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 |
---|---|---|---|---|---|---|
Returns a new object of class 'Message Query'. | MessageQuery createMessageQuery(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Builder clearQueryMessage() {\n bitField0_ = (bitField0_ & ~0x00000200);\n queryMessage_ = getDefaultInstance().getQueryMessage();\n onChanged();\n return this;\n }",
"public Builder setQueryMessage(com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000200;\n queryMessage_ = value;\n onChanged();\n return this;\n }",
"public static QueryInterface createQuery() {\n return new XmlQuery();\n }",
"public Query() {\r\n }",
"com.google.protobuf.ByteString getQueryMessage();",
"public Query(){\n this(new MongoQueryFilter.MongoQueryFilterBuilder());\n }",
"@Override\n protected QueryStatusMessage createInstance() {\n return new QueryStatusMessage();\n }",
"Query createQuery(final String query);",
"public com.google.protobuf.ByteString getQueryMessage() {\n return queryMessage_;\n }",
"public Query query(String query) throws Exceptions.OsoException {\n return new Query(ffiPolar.newQueryFromStr(query), host.clone());\n }",
"protected JPAQuery<T> createQuery() {\n\t\tJPAQuery<T> query = new JPAQuery<>(entityManager);\n\t\tquery.from(getDslRoot());\n\t\treturn query;\n\t}",
"public com.google.protobuf.ByteString getQueryMessage() {\n return queryMessage_;\n }",
"<Q, R> CompletableFuture<QueryResponseMessage<R>> query( QueryMessage<Q, R> query );",
"public QueryCore(String query)\n {\n this.query = query;\n }",
"private Query(String command) {\n\t\tthis.command = command;\n\t}",
"private List<Message> returnMessages(Query query, String recipient) {\n List<Message> messages = new ArrayList<>();\n PreparedQuery results = datastore.prepare(query);\n\n for (Entity entity : results.asIterable()) {\n try {\n String idString = entity.getKey().getName();\n UUID id = UUID.fromString(idString);\n String text = (String) entity.getProperty(\"text\");\n long timestamp = (long) entity.getProperty(\"timestamp\");\n String user = (String) entity.getProperty(\"user\");\n recipient = recipient != null ? recipient : (String) entity.getProperty(\"recipient\");\n\n Message message = new Message(id, user, text, timestamp, recipient);\n messages.add(message);\n // An exception can occur here for multiple reasons (Type casting error, any\n // property not existing, key error, etc...)\n } catch (Exception e) {\n System.err.println(\"Error reading message.\");\n System.err.println(entity.toString());\n e.printStackTrace();\n }\n }\n\n return messages;\n }",
"public MessageExample() {\n oredCriteria = new ArrayList<Criteria>();\n }",
"private Queries() {\n // prevent instantiation\n }",
"protected ParseObject createMessage() {\n //format single variables appropriatly. most cases the field is an array\n ArrayList<ParseUser> nextDrinker = new ArrayList<ParseUser>();\n nextDrinker.add(mNextDrinker);\n ArrayList<String> groupName = new ArrayList<String>();\n groupName.add(mGroupName);\n\n ParseObject message = new ParseObject(ParseConstants.CLASS_MESSAGES);\n message.put(ParseConstants.KEY_SENDER_ID, ParseUser.getCurrentUser().getObjectId());\n message.put(ParseConstants.KEY_SENDER, ParseUser.getCurrentUser());\n message.put(ParseConstants.KEY_GROUP_ID, mGroupId);\n message.put(ParseConstants.KEY_GROUP_NAME, groupName);\n message.put(ParseConstants.KEY_SENDER_NAME, ParseUser.getCurrentUser().getUsername());\n message.put(ParseConstants.KEY_RECIPIENT_IDS, nextDrinker);\n message.put(ParseConstants.KEY_MESSAGE_TYPE, ParseConstants.TYPE_DRINK_REQUEST);\n\n return message;\n }",
"@Override\n\tpublic Query objectQuery(String query) throws Exception {\n\t\treturn null;\n\t}",
"public static QueryResult build() {\n return new QueryResult(ImmutableList.of());\n }",
"public static Query empty() {\n return new Query();\n }",
"Query query();",
"public Message() {}",
"public Message() {}",
"public Query getQuery()\n {\n return query;\n }",
"private QueryImpl(com.google.protobuf.GeneratedMessageLite.Builder builder) {\n super(builder);\n\n }",
"protected void queryMsg() {\n\t\tif (currentPosition == 0) {//LIVE\n\t\t\tobtainLiveData(true, currentPosition, liveMaxChatId);\n\t\t} else {//CHAT\n\t\t\tobtainChatData(true, currentPosition, chatModels.get(0).getChatId());\n\t\t}\n\t}",
"public abstract String createQuery();",
"public Message(){}",
"@Override\n public QueryStatusMessage clone() {\n QueryStatusMessage t = createInstance();\n t.copyFrom(this);\n return t;\n }",
"QueryType createQueryType();",
"public Message newMessage(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5) {\n/* 109 */ return new SimpleMessage(message);\n/* */ }",
"com.exacttarget.wsdl.partnerapi.QueryRequestMsgDocument.QueryRequestMsg addNewQueryRequestMsg();",
"public QueryException(String message) {\n super(message);\n }",
"public Message() {\n }",
"public Message() {\n }",
"public static @NotNull Breadcrumb query(final @NotNull String message) {\n final Breadcrumb breadcrumb = new Breadcrumb();\n breadcrumb.setType(\"query\");\n breadcrumb.setMessage(message);\n return breadcrumb;\n }",
"public static Query of(String rawQuery) {\n return new Query(rawQuery);\n }",
"public static RsQueryObject get(ClassDescriptor cld, Query query)\r\n {\r\n return new RsQueryObject(cld, query);\r\n }",
"public Message newMessage(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6) {\n/* 118 */ return new SimpleMessage(message);\n/* */ }",
"public Message newMessage(String message, Object p0, Object p1, Object p2, Object p3) {\n/* 93 */ return new SimpleMessage(message);\n/* */ }",
"com.exacttarget.wsdl.partnerapi.QueryRequestMsgDocument.QueryRequestMsg getQueryRequestMsg();",
"public Message newMessage(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7) {\n/* 127 */ return new SimpleMessage(message);\n/* */ }",
"private QueryPassageRecord(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }",
"public MessageRequest() {\n\t}",
"public Message newMessage(String message, Object p0) {\n/* 69 */ return new SimpleMessage(message);\n/* */ }",
"public Message() {\n }",
"IQuery getQuery();",
"public static MessageList newInstance() {\n MessageList fragment = new MessageList();\n return fragment;\n }",
"public Query getQuery ()\n {\n\n\treturn this.q;\n\n }",
"MessageDto peekMessage(MessageQueryInfoDto messageQueryInfo) throws IOException, MlmqException;",
"SelectQuery createSelectQuery();",
"public Message newMessage(String message, Object p0, Object p1) {\n/* 77 */ return new SimpleMessage(message);\n/* */ }",
"protected SelectQuery getQuery(final String query) {\n\t\treturn queryFactory.parseQuery(query);\n\t}",
"public Message newMessage(String message, Object p0, Object p1, Object p2, Object p3, Object p4) {\n/* 101 */ return new SimpleMessage(message);\n/* */ }",
"public QueryException(String message){\n\t\tsuper(message);\n\t}",
"private DbQuery() {}",
"public RequestMessage() {\r\n\t\tsuper();\r\n\t\tthis.criteria = new PersonSearchCriteria();\r\n\t\tthis.setSourceSystemID(SOURCE_SYSTEM_ID);\r\n\t\tthis.setSourceUserID(SOURCE_USER_ID);\r\n\t}",
"public PromoMessages() {\n }",
"public Message newMessage(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7, Object p8, Object p9) {\n/* 145 */ return new SimpleMessage(message);\n/* */ }",
"public ResultSet construct(String szQuery) {\n\t\treturn null;\n\t}",
"public QueryModel getQueryModel()\n {\n return _queryModel;\n }",
"private Message(){\n // default constructor\n }",
"public Message newMessage(String message, Object p0, Object p1, Object p2) {\n/* 85 */ return new SimpleMessage(message);\n/* */ }",
"public Message newMessage(String message, Object... params) {\n/* 61 */ return new SimpleMessage(message);\n/* */ }",
"public Message newMessage(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7, Object p8) {\n/* 136 */ return new SimpleMessage(message);\n/* */ }",
"public Query() {\n\n// oriToRwt = new HashMap();\n// oriToRwt.put(); // TODO\n }",
"public Builder query(final String query) {\n this.query = query;\n return this;\n }",
"boolean hasQueryMessage();",
"public MessageAbstract createMessageAbstract() {\n\t\tMessageAbstract messageAbstract = new MessageAbstract();\n\t\tmessageAbstract.setId(this.id);\n\t\tmessageAbstract.setMessage(this.message);\n\t\tmessageAbstract.setSentTimestamp(this.sentTimestamp);\n\n\t\t// Add sender's user ID if available\n\t\tif (this.origin != null) {\n\t\t\tmessageAbstract.setSenderUserId(this.origin.getId());\n\t\t\tmessageAbstract.setSenderScreenName(this.origin.getScreenName());\n\t\t}\n\t\treturn messageAbstract;\n\t}",
"public Builder clearQuery() {\n bitField0_ = (bitField0_ & ~0x00000010);\n query_ = getDefaultInstance().getQuery();\n\n return this;\n }",
"public Query createQuery() {\n\n String queryString = getQueryString();\n\n if (debug == true) {\n logger.info( \"Query String: {0}\", queryString);\n logger.info( \"Parameters: Max Results: {0}, First result: {1}, Order By: {2}, Restrictions: {3}, Joins: {4}\", new Object[]{maxResults, firstResult, orderBy, normalizedRestrictions, joins});\n }\n\n Query query = entityManager.createQuery(queryString);\n\n List<QueryParameter> parameters = getQueryParameters();\n for (QueryParameter parameter : parameters) {\n //dates (Date and Calendar)\n if (parameter.getTemporalType() != null && (parameter.getValue() instanceof Date || parameter.getValue() instanceof Calendar)) {\n if (parameter.getValue() instanceof Date) {\n if (parameter.getPosition() != null) {\n query.setParameter(parameter.getPosition(), (Date) parameter.getValue(), parameter.getTemporalType());\n } else {\n if (parameter.getProperty() != null) {\n query.setParameter(parameter.getProperty(), (Date) parameter.getValue(), parameter.getTemporalType());\n }\n }\n } else if (parameter.getValue() instanceof Calendar) {\n if (parameter.getPosition() != null) {\n query.setParameter(parameter.getPosition(), (Calendar) parameter.getValue(), parameter.getTemporalType());\n } else {\n if (parameter.getProperty() != null) {\n query.setParameter(parameter.getProperty(), (Calendar) parameter.getValue(), parameter.getTemporalType());\n }\n }\n }\n } else {\n if (parameter.getPosition() != null) {\n query.setParameter(parameter.getPosition(), parameter.getValue());\n } else {\n if (parameter.getProperty() != null) {\n query.setParameter(parameter.getProperty(), parameter.getValue());\n }\n }\n }\n }\n\n if (maxResults != null) {\n query.setMaxResults(maxResults);\n }\n if (firstResult != null) {\n query.setFirstResult(firstResult);\n }\n return query;\n }",
"public abstract List createQuery(String query);",
"public void constructQuery(String query) {\n\t\tQuery q = QueryFactory.create(query);\n\t\tQueryExecution qe = QueryExecutionFactory.create(q, model);\n\t\tModel result = qe.execConstruct();\n\t\tprintModel(result);\n\t\tmodel.add(result);\n\t\tqe.close();\n\t}",
"public com.google.protobuf.ByteString getQueryBytes() {\n java.lang.Object ref = query_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);\n query_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public QueryBO() {\r\n }",
"public QueryResponse query(PqlQuery query) {\n return query(query, QueryOptions.defaultOptions());\n }",
"TSearchQuery createSearchQuery(SearchQueryDefinitionAPI searchQueryDefinition);",
"protected MultiPhraseQuery.Builder newMultiPhraseQueryBuilder() {\n return new MultiPhraseQuery.Builder();\n }",
"public java.lang.String getQuery() {\n java.lang.Object ref = query_;\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 if (bs.isValidUtf8()) {\n query_ = s;\n }\n return s;\n }\n }",
"public query convertNewQueryComposition() {\n int index = listDocumentRetrievedForThisQuery.getQuery().getIndex();\n StringBuffer queryContent = new StringBuffer();\n for (Map.Entry m : newQueryComposition.entrySet()) {\n String keyTerm = (String) m.getKey();\n queryContent.append(keyTerm + \" \");\n }\n query Query = new query(index,queryContent.toString());\n return Query;\n }",
"public final InternalMessageModel newMessageModel() {\n return (InternalMessageModel) newProxy(InternalMessageModel.class,\n MessageModelImpl.class);\n }",
"public java.lang.String getQuery() {\r\n return query;\r\n }",
"public PseudoQuery() {\r\n\t}",
"public com.google.protobuf.ByteString getQueryBytes() {\n java.lang.Object ref = query_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);\n query_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public java.lang.String getQuery() {\n java.lang.Object ref = query_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref).toStringUtf8();\n query_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"DynamicMessage createDynamicMessage();",
"@Override\n\tpublic <T> TypedQuery<T> createQuery(String qlString, Class<T> resultClass) {\n\t\treturn null;\n\t}",
"public String getQuery(){\n return this.query;\n }",
"SQLQuery createSQLQuery(final String query);",
"public MessageRecordExample() {\n oredCriteria = new ArrayList<Criteria>();\n }",
"public java.lang.CharSequence getQuery() {\n return query;\n }",
"private String getCreateQuery() {\n String query = null;\n try {\n query = crudQueryComposer.composeCreateQuery();\n } catch (MissingPropertyException e) {\n logger.error(e);\n }\n return query;\n }",
"public java.lang.String getQuery()\n {\n return this.query;\n }",
"public java.lang.CharSequence getQuery() {\n return query;\n }",
"public QueryRegistry() {\r\n }",
"public static MessageBuilder newMessage(Session session) {\n\n return new MessageBuilder(session);\n }",
"@Override\n\tpublic MessageDao getMessage() {\n\t\treturn new BuyMessageImpl();\n\t}",
"public Query() {\n initComponents();\n }"
]
| [
"0.6859667",
"0.6804052",
"0.65444297",
"0.65414816",
"0.65140873",
"0.6370799",
"0.63442767",
"0.6282908",
"0.6265923",
"0.6246866",
"0.6220833",
"0.6196633",
"0.6142009",
"0.6126674",
"0.60600305",
"0.6030502",
"0.6020208",
"0.5964978",
"0.59390277",
"0.59299767",
"0.59273005",
"0.59104997",
"0.5902014",
"0.5899432",
"0.5899432",
"0.5899195",
"0.5898394",
"0.58947784",
"0.5884147",
"0.58750457",
"0.5869772",
"0.5855833",
"0.5829085",
"0.5816501",
"0.58009523",
"0.57954526",
"0.57954526",
"0.5793288",
"0.57717925",
"0.57608294",
"0.57519007",
"0.5749713",
"0.57367206",
"0.57321256",
"0.57317555",
"0.5723977",
"0.5722411",
"0.5714736",
"0.57118094",
"0.5708335",
"0.57051635",
"0.57024205",
"0.5686955",
"0.56825006",
"0.56635654",
"0.56557816",
"0.56547403",
"0.5651385",
"0.56422126",
"0.5635124",
"0.56240803",
"0.5618887",
"0.56181973",
"0.5617895",
"0.5608828",
"0.5606827",
"0.5605442",
"0.5577929",
"0.5572502",
"0.5566571",
"0.55660444",
"0.5558885",
"0.5553668",
"0.5551555",
"0.5542674",
"0.5541983",
"0.553397",
"0.5527765",
"0.55217487",
"0.5520109",
"0.5515894",
"0.5510845",
"0.5503533",
"0.55013275",
"0.54941213",
"0.54862344",
"0.54802346",
"0.5478681",
"0.5468606",
"0.5464322",
"0.5445203",
"0.54394066",
"0.5432241",
"0.54300797",
"0.5426419",
"0.5423898",
"0.5423649",
"0.5421125",
"0.5416499",
"0.5411064"
]
| 0.86067575 | 0 |
Returns a new object of class 'Obstacle Query'. | ObstacleQuery createObstacleQuery(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static QueryInterface createQuery() {\n return new XmlQuery();\n }",
"public Query() {\n\n// oriToRwt = new HashMap();\n// oriToRwt.put(); // TODO\n }",
"public Obstacle getConstructingObstacle();",
"public Query() {\r\n }",
"public static Query empty() {\n return new Query();\n }",
"Query query();",
"public Query(){\n this(new MongoQueryFilter.MongoQueryFilterBuilder());\n }",
"protected JPAQuery<T> createQuery() {\n\t\tJPAQuery<T> query = new JPAQuery<>(entityManager);\n\t\tquery.from(getDslRoot());\n\t\treturn query;\n\t}",
"IQuery getQuery();",
"public PseudoQuery() {\r\n\t}",
"private DbQuery() {}",
"public Query<T, R> build() {\n // if criteria.size == 0, rootCriterion = null\n Criterion rootCriterion = null;\n if (criteria.size() == 1) {\n rootCriterion = criteria.get(0);\n } else if (criteria.size() > 1) {\n rootCriterion = Restrictions.and(criteria\n .toArray(new Criterion[criteria.size()]));\n }\n return new QueryImpl<T, R>(entityClass, returnType, rootCriterion,\n orderings, maxResults, returnFields);\n }",
"private Queries() {\n // prevent instantiation\n }",
"public QueryBO() {\r\n }",
"@Override\n\tpublic Query objectQuery(String query) throws Exception {\n\t\treturn null;\n\t}",
"private void montaQuery(Publicacao object, Query q) {\t\t\n\t}",
"public Obstacle(Location location) {\n super(location);\n }",
"public Query query(String query) throws Exceptions.OsoException {\n return new Query(ffiPolar.newQueryFromStr(query), host.clone());\n }",
"public static QueryResult build() {\n return new QueryResult(ImmutableList.of());\n }",
"public QueryBuilder()\n {\n\tlabel = null;\n\tqueryCondition = null;\n\tselectionLimiter = null;\n\tselectionSorter = null;\n\n\tvariablesMap = new HashMap<String, Expression>();\n\tselectionLabelsReferencedByStats = new HashSet<String>();\n }",
"public static RsQueryObject get(ClassDescriptor cld, Query query)\r\n {\r\n return new RsQueryObject(cld, query);\r\n }",
"private ASTQuery() {\r\n dataset = Dataset.create();\r\n }",
"public Query createQuery() {\n\n String queryString = getQueryString();\n\n if (debug == true) {\n logger.info( \"Query String: {0}\", queryString);\n logger.info( \"Parameters: Max Results: {0}, First result: {1}, Order By: {2}, Restrictions: {3}, Joins: {4}\", new Object[]{maxResults, firstResult, orderBy, normalizedRestrictions, joins});\n }\n\n Query query = entityManager.createQuery(queryString);\n\n List<QueryParameter> parameters = getQueryParameters();\n for (QueryParameter parameter : parameters) {\n //dates (Date and Calendar)\n if (parameter.getTemporalType() != null && (parameter.getValue() instanceof Date || parameter.getValue() instanceof Calendar)) {\n if (parameter.getValue() instanceof Date) {\n if (parameter.getPosition() != null) {\n query.setParameter(parameter.getPosition(), (Date) parameter.getValue(), parameter.getTemporalType());\n } else {\n if (parameter.getProperty() != null) {\n query.setParameter(parameter.getProperty(), (Date) parameter.getValue(), parameter.getTemporalType());\n }\n }\n } else if (parameter.getValue() instanceof Calendar) {\n if (parameter.getPosition() != null) {\n query.setParameter(parameter.getPosition(), (Calendar) parameter.getValue(), parameter.getTemporalType());\n } else {\n if (parameter.getProperty() != null) {\n query.setParameter(parameter.getProperty(), (Calendar) parameter.getValue(), parameter.getTemporalType());\n }\n }\n }\n } else {\n if (parameter.getPosition() != null) {\n query.setParameter(parameter.getPosition(), parameter.getValue());\n } else {\n if (parameter.getProperty() != null) {\n query.setParameter(parameter.getProperty(), parameter.getValue());\n }\n }\n }\n }\n\n if (maxResults != null) {\n query.setMaxResults(maxResults);\n }\n if (firstResult != null) {\n query.setFirstResult(firstResult);\n }\n return query;\n }",
"@Test\n public void testWithObstacle() {\n Grid g = new Grid(3, 3, 0, 0, 0, 0);\n Obstacle o = new Obstacle(1, 1);\n g.setObject(o, 1, 1);\n g.setObject(o, 1, 2);\n AStarStrategy strategy = new AStarStrategy();\n\n Location from = new Location(0, 0);\n Location to = new Location(2, 2);\n Path path = strategy.generatePath(g, from, to);\n assertNotNull(path);\n assertEquals(4, path.getMoves().size());\n assertEquals(Move.DOWN, path.getMoves().get(0).direction);\n assertEquals(Move.DOWN, path.getMoves().get(1).direction);\n assertEquals(Move.RIGHT, path.getMoves().get(2).direction);\n assertEquals(Move.RIGHT, path.getMoves().get(3).direction);\n }",
"public QueryLocator() {\n this(new Random().nextInt(1024));\n }",
"public Query() {\n initComponents();\n }",
"public Query advancedQuery() \n {\n return null;\n }",
"public SearchQuery build() {\n this._Web_search.set_maxDepth(_maxDepth);\n this._Web_search.set_maxResults(_maxResults);\n this._Web_search.set_threshold(_threshold);\n this._Web_search.set_beamWidth(_beamWidth);\n if (heuristicSearchType == null) {\n this._Web_search.setHeuristicSearchType(Enums.HeuristicSearchType.BEST_FIRST);\n } else {\n this._Web_search.setHeuristicSearchType(heuristicSearchType);\n }\n\n return new SearchQuery(this._query, this._Web_search);\n }",
"public Obstacle(int x, int y) {\n super(x, y);\n }",
"List<OwnerOperatorDTO> search(String query);",
"QueryType createQueryType();",
"public abstract String createQuery();",
"CampusSearchQuery generateQuery();",
"public Query query(Predicate query) throws Exceptions.OsoException {\n Host new_host = host.clone();\n String pred = new_host.toPolarTerm(query).toString();\n return new Query(ffiPolar.newQueryFromTerm(pred), new_host);\n }",
"@Test\n public void testWithObstacle2() {\n Grid g = new Grid(3, 3, 0, 0, 0, 0);\n Obstacle o = new Obstacle(1, 1);\n g.setObject(o, 1, 0);\n g.setObject(o, 1, 1);\n AStarStrategy strategy = new AStarStrategy();\n\n Location from = new Location(0, 0);\n Location to = new Location(2, 2);\n Path path = strategy.generatePath(g, from, to);\n assertNotNull(path);\n assertEquals(4, path.getMoves().size());\n assertEquals(Move.RIGHT, path.getMoves().get(0).direction);\n assertEquals(Move.RIGHT, path.getMoves().get(1).direction);\n assertEquals(Move.DOWN, path.getMoves().get(2).direction);\n assertEquals(Move.DOWN, path.getMoves().get(3).direction);\n }",
"public ObstacleSelector(World world) {\n\t\tthis(world,DEFAULT_MSIZE,DEFAULT_MSIZE);\t\n }",
"Query createQuery(final String query);",
"protected BooleanQuery.Builder newBooleanQuery() {\n return new BooleanQuery.Builder();\n }",
"public FindNeighbors() {\r\n }",
"public Obstacle(String action, String name, int[] bounds, Area startArea, int id) {\n this.action = action;\n this.name = name;\n this.bounds = bounds;\n this.startArea = startArea;\n this.id = id;\n }",
"public void Query() {\n }",
"public IsochroneQuery(Config config) {\n this.config = config;\n this.connection = config!= null ? config.getConnection() : null;\n // initConstants();\n }",
"public QueryOptions build() {\n return new QueryOptions(this.columns, this.excludeColumns, this.excludeAttributes, this.shards);\n }",
"public interface Queryable<Ttuple extends Tuple>\n{\n URI QUERYABLE_URI = URIPool.create(\"class:/spiralcraft/data/query/Queryable\");\n \n /**\n * @return An array of all the Types supported by this Queryable\n */\n Type<?>[] getTypes();\n \n /**\n * @return Whether the store contains the specified Type.\n */\n boolean containsType(Type<?> type);\n \n /**\n * Returns all data instances of a specific Type for further manipulation by\n * BoundQueries. This method is used when a Queryable cannot provide\n * an optimized implementation for the simplest of Queries, or if no \n * optimization is needed. \n * \n * @return A boundQuery which provides the set of all instances for a given\n * type. \n */\n BoundQuery<?,Ttuple> getAll(Type<?> type) \n throws DataException;\n \n\n /**\n * Bind the specified Query and parameter context to this Queryable.\n * \n *@return a BoundQuery that implements the data flow path and provides the\n * data requested by the Query\n */\n BoundQuery<?,Ttuple> query(Query q,Focus<?> context)\n throws DataException;\n\n /**\n * Provide a custom binding solution for the root node of the provided Query\n * structure, or return null if this Queryable does not provide a custom\n * binding solution for the provided Query node.\n *\n * @param q\n * @param context\n * @return\n * @throws DataException\n */\n BoundQuery<?,Ttuple> solve(Query q,Focus<?> context)\n throws DataException;\n}",
"public GameObject getObstacle() {\n \tif (selection != null) {\n \tjava.lang.Object data = selection.getBody().getUserData();\n \ttry {\n \t\treturn (GameObject)data;\n \t} catch (Exception e) {\n \t}\n }\n return null;\n }",
"public Api getQueryResult(String query) throws Exception {\n\t\tApi api = getQueryResult(getWiki(),query);\n\t\treturn api;\n\t}",
"public Query getQuery()\n {\n return query;\n }",
"SelectQuery createSelectQuery();",
"HumidityQuery createHumidityQuery();",
"public PreparedQuery getQuery() {\n Query query = new Query(\"TrackedLocation\").addSort(\"cityName\", SortDirection.ASCENDING);\n return datastore.prepare(query);\n }",
"public interface Query {\n\n\t/**\n\t * @return ID of the given query\n\t */\n\tint queryID();\n\t\n\t/**\n\t * @return given query\n\t */\n\tString query();\n\t\n\t/**\n\t * @return list of relevant documents to the corresponding query\n\t */\n\tList<RelevanceInfo> listOfRelevantDocuments();\n\t\n\t/**\n\t * @return list of results to the corresponding query after running one of the retrieval models\n\t */\n\tList<Result> resultList();\n\t\n\t/**\n\t * @param resultList\n\t * @Effects adds results to the result list of the corresponding query\n\t */\n\tvoid putResultList(List<Result> resultList);\n}",
"public GraphQuery clone(Rete engine) {\n\t\tGraphQuery clone = new GraphQuery(this.name);\n\t\tclone.setQueryParameters(this.queryParameterNodeMap);\n\t\tclone.bindings = this.bindings;\n\t\tclone.comment = this.comment;\n\t\tclone.conditions = this.conditions;\n\t\tclone.name = this.name;\n\t\tclone.watch = this.watch;\n\t\tclone.queryRoot = this.queryRoot.clone(engine, clone);\n\t\tQueryBaseJoin last = (QueryBaseJoin)clone.getLastNode();\n\t\tclone.resultNode = (QueryResultNode)last.getSuccessorNodes()[0];\n\t\treturn clone;\n\t}",
"private DirectDbQuery() {\n this.query = null;\n this.database = null;\n this.queryLanguage = null;\n this.paramMap = null;\n }",
"public ObstacleSelector(World world, float width, float height) {\n\t this.world = world;\n \n\t pointer = new Rectangle();\n \tpointer.width = width;\n \tpointer.height = height;\n \n \tmouseJointDef = new MouseJointDef();\n \t\n \tmouseJointDef.frequencyHz = DEFAULT_FREQUENCY;\n \tmouseJointDef.dampingRatio = DEFAULT_DAMPING;\n \tforce = DEFAULT_FORCE;\n \n \tBodyDef groundDef = new BodyDef();\n\t\tgroundDef.type = BodyDef.BodyType.StaticBody;\n\t\tCircleShape groundShape = new CircleShape();\n\t\tgroundShape.setRadius(pointer.width);\n\t\tground = world.createBody(groundDef);\n\t\tground.createFixture(groundShape,0);\n\n\t if (ground != null) {\n\t FixtureDef groundFixture = new FixtureDef();\n \tgroundFixture.shape = groundShape;\n \tground.createFixture(groundFixture);\n \t}\n\t \n\t drawScale = new Vector2(1,1);\n }",
"@Test\n public void testWithObstacle3() {\n Grid g = new Grid(4, 4, 0, 0, 0, 0);\n Obstacle o = new Obstacle(1, 1);\n g.setObject(o, 0, 3);\n g.setObject(o, 1, 1);\n g.setObject(o, 1, 2);\n g.setObject(o, 3, 0);\n g.setObject(o, 3, 1);\n AStarStrategy strategy = new AStarStrategy();\n\n Location from = new Location(0, 0);\n Location to = new Location(3, 3);\n Path path = strategy.generatePath(g, from, to);\n assertNotNull(path);\n assertEquals(6, path.getMoves().size());\n assertEquals(Move.DOWN, path.getMoves().get(0).direction);\n assertEquals(Move.DOWN, path.getMoves().get(1).direction);\n assertEquals(Move.RIGHT, path.getMoves().get(2).direction);\n assertEquals(Move.RIGHT, path.getMoves().get(3).direction);\n assertEquals(Move.RIGHT, path.getMoves().get(4).direction);\n assertEquals(Move.DOWN, path.getMoves().get(5).direction);\n }",
"QueryRequest<Review> query();",
"Query queryOn(Connection connection);",
"public QueryCore(String query)\n {\n this.query = query;\n }",
"private MetaSparqlRequest createQueryMT2() {\n\t\treturn createQueryMT1();\n\t}",
"public PhysicalOperator getOperator(RAQuery query, SimpleSGBD sgbd) {\n\t\tif(query instanceof ProjectionQuery){\n\t\t\tProjectionQuery queryP = (ProjectionQuery) query;\n\t\t\tRAQuery subQuery = queryP.getSubQuery();\n\t\t\tString[] attributes = queryP.getProjectedAttributesNames();\n\t\t\tif (subQuery instanceof RelationNameQuery){\n\t\t\t\tRelationNameQuery rNameQuery = (RelationNameQuery) subQuery;\n\t\t\t\tSequentialAccessOnARelationOperator saonaro = new SequentialAccessOnARelationOperator(sgbd, rNameQuery.getRelationName());\n\t\t\t\tProjectionOperator opP = new ProjectionOperator(saonaro, attributes);\n\t\t\t\treturn opP;\n\t\t\t}\n\t\t} \n\t\t\n\t\tif(query instanceof SelectionQuery){\n\t\t\tSelectionQuery queryP = (SelectionQuery) query;\n\t\t\tRAQuery subQuery = queryP.getSubQuery();\n\t\t\tString attributeName = queryP.getAttributeName();\n\t\t\tString value = queryP.getConstantValue();\n\t\t\tif (subQuery instanceof RelationNameQuery){\n\t\t\t\tRelationNameQuery rNameQuery = (RelationNameQuery) subQuery;\n\t\t\t\tSequentialAccessOnARelationOperator saonaro = new SequentialAccessOnARelationOperator(sgbd, rNameQuery.getRelationName());\n\t\t\t\tSelectionOperator sOp = new SelectionOperator(saonaro, attributeName, value);\n\t\t\t\treturn sOp;\n\t\t\t}\n\t\t} \n\t\t\n\t\tif(query instanceof JoinQuery){\n\t\t\tJoinQuery joinQuery = (JoinQuery) query;\n\t\t\tRAQuery subQuery1 = joinQuery.getLeftSubQuery();\n\t\t\tRAQuery subQuery2 = joinQuery.getRightSubQuery();\n\t\t\t\n\t\t\tif(subQuery1 instanceof RelationNameQuery && subQuery2 instanceof RelationNameQuery){\n\t\t\t\tRelationNameQuery rNameQuery1 = (RelationNameQuery) subQuery1;\n\t\t\t\tSequentialAccessOnARelationOperator saonaro1 = new SequentialAccessOnARelationOperator(sgbd, rNameQuery1.getRelationName());\n\t\t\t\tRelationNameQuery rNameQuery2 = (RelationNameQuery) subQuery2;\n\t\t\t\tSequentialAccessOnARelationOperator saonaro2 = new SequentialAccessOnARelationOperator(sgbd, rNameQuery2.getRelationName());\n\t\t\t\tJoinOperator jOp = new JoinOperator(saonaro1, saonaro2);\n\t\t\t\treturn jOp;\n\t\t\t}\n\t\t}\n\t\t\tthrow new UnsupportedOperationException(\"not yet implemented\");\n\t\t\n\t}",
"protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria(this);\n return criteria;\n }",
"protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria(this);\n return criteria;\n }",
"protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria(this);\n return criteria;\n }",
"protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria(this);\n return criteria;\n }",
"protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria(this);\n return criteria;\n }",
"public ASTQuery subCreate(){\r\n\t\tASTQuery ast = create();\r\n\t\tast.setGlobalAST(this);\r\n\t\tast.setNSM(getNSM());\r\n\t\treturn ast;\r\n\t}",
"public Object clone() {\n SetQuery copy = new SetQuery(this.operation);\n\n this.copyMetadataState(copy);\n\n copy.leftQuery = (QueryCommand)this.leftQuery.clone();\n copy.rightQuery = (QueryCommand)this.rightQuery.clone();\n\n copy.setAll(this.all);\n\n if(this.getOrderBy() != null) {\n copy.setOrderBy(this.getOrderBy().clone());\n }\n\n if(this.getLimit() != null) {\n copy.setLimit( this.getLimit().clone() );\n }\n\n copy.setWith(LanguageObject.Util.deepClone(this.getWith(), WithQueryCommand.class));\n\n if (this.projectedTypes != null) {\n copy.setProjectedTypes(new ArrayList<Class<?>>(projectedTypes), this.metadata);\n }\n\n return copy;\n }",
"Oracion createOracion();",
"@Override\n\tpublic <T> TypedQuery<T> createQuery(CriteriaQuery<T> criteriaQuery) {\n\t\treturn null;\n\t}",
"@Override\n\tpublic <T> TypedQuery<T> createQuery(String qlString, Class<T> resultClass) {\n\t\treturn null;\n\t}",
"public Query getQuery ()\n {\n\n\treturn this.q;\n\n }",
"public QueryInfoSearch getQueryInfoSearch() {\n if (queryInfoSearch != null) return queryInfoSearch;\n queryInfoSearch = new QueryInfoSearch();\n return queryInfoSearch;\n }",
"public void addObstacle(Coord obstacleCoord);",
"public List<T> query(QueryObject qo) {\n\t\treturn null;\n\t}",
"public void constructQuery(String query) {\n\t\tQuery q = QueryFactory.create(query);\n\t\tQueryExecution qe = QueryExecutionFactory.create(q, model);\n\t\tModel result = qe.execConstruct();\n\t\tprintModel(result);\n\t\tmodel.add(result);\n\t\tqe.close();\n\t}",
"protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }",
"protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }",
"protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }",
"protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }",
"protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }",
"protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }",
"protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }",
"protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }",
"protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }",
"protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }",
"protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }",
"protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }",
"protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }",
"protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }",
"protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }",
"protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }",
"protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }",
"protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }",
"protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }",
"protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }",
"protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }",
"protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }",
"protected Criteria createCriteriaInternal() {\r\n Criteria criteria = new Criteria();\r\n return criteria;\r\n }",
"protected Query globalizedQuery(Constraint localConstraint, URIReferenceImpl model) throws QueryException {\n // convert the constraint to network compatible form\n Constraint globalConstraint = new ConstraintImpl(\n globalizeConstraintElement(localConstraint.getElement(0)),\n globalizeConstraintElement(localConstraint.getElement(1)),\n globalizeConstraintElement(localConstraint.getElement(2)),\n model\n );\n \n // convert the variable set to a variable list\n List<Variable> variables = new ArrayList<Variable>((Set<Variable>)globalConstraint.getVariables());\n // build the new query\n return new Query(variables, new ModelResource(model.getURI()), globalConstraint, null, Collections.EMPTY_LIST, null, 0, new UnconstrainedAnswer());\n }",
"protected Criteria createCriteriaInternal() {\n Criteria criteria = new Criteria();\n return criteria;\n }"
]
| [
"0.6217844",
"0.619776",
"0.60424334",
"0.59959143",
"0.5794583",
"0.5768103",
"0.5701629",
"0.56836593",
"0.5648728",
"0.5624188",
"0.5604863",
"0.5603981",
"0.5577536",
"0.55734044",
"0.5551139",
"0.5494803",
"0.549194",
"0.5490395",
"0.5481119",
"0.5468066",
"0.54618573",
"0.5425227",
"0.54177505",
"0.53708184",
"0.5362269",
"0.53597003",
"0.5331134",
"0.52984476",
"0.5288795",
"0.52884334",
"0.528578",
"0.52851474",
"0.5257908",
"0.5253943",
"0.52034163",
"0.51970327",
"0.51907337",
"0.51636845",
"0.5163039",
"0.5144256",
"0.51425046",
"0.51421654",
"0.5133294",
"0.51257724",
"0.5117384",
"0.5098495",
"0.5075396",
"0.5058029",
"0.50229686",
"0.5017002",
"0.50119704",
"0.49973392",
"0.49820527",
"0.4977641",
"0.49760804",
"0.49718076",
"0.4970665",
"0.4967495",
"0.49659604",
"0.49559528",
"0.4955303",
"0.4955303",
"0.4955303",
"0.4955303",
"0.4955303",
"0.4954065",
"0.49537528",
"0.49503455",
"0.4944871",
"0.4939888",
"0.49258605",
"0.49256083",
"0.49245098",
"0.4922416",
"0.4920801",
"0.4919935",
"0.49175546",
"0.49175546",
"0.49175546",
"0.49175546",
"0.49175546",
"0.49175546",
"0.49175546",
"0.49175546",
"0.49175546",
"0.49175546",
"0.49175546",
"0.49175546",
"0.49175546",
"0.49175546",
"0.49175546",
"0.49175546",
"0.49175546",
"0.49175546",
"0.49175546",
"0.49175546",
"0.49175546",
"0.49175546",
"0.4910585",
"0.49101388"
]
| 0.8645811 | 0 |
Returns a new object of class 'Numeric Expression'. | NumericExpression createNumericExpression(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Expression createExpression();",
"Expression() { }",
"public NumericMethodException() {\n super();\n }",
"NumberValue createNumberValue();",
"public NumericField() {\n\t\tsuper();\n\t}",
"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 }",
"Expression getExp();",
"public Expression() {\r\n }",
"public Expression asExpression() {\n switch (TYPE) {\n case EXPRESSION:\n return EXPRESSION;\n case IDENTIFIER:\n return new Variable(VALUE);\n case LITERAL:\n if (VALUE.matches(\"\\\\d+\")) {\n return new LInteger(Integer.parseInt(VALUE));\n } else if (VALUE.equals(\"true\") || VALUE.equals(\"false\")) {\n return LBoolean.resolve(VALUE.equals(\"true\"));\n } else if (VALUE.equals(\"null\")) {\n return LNull.NULL;\n } else {\n return new LString(VALUE);\n }\n default:\n throw ErrorLog.get(\"Unexpected symbol '%s'\", VALUE);\n }\n }",
"public MathEval() {\r\n super();\r\n\r\n constants=new TreeMap<String,Double>(String.CASE_INSENSITIVE_ORDER);\r\n setConstant(\"E\" ,Math.E);\r\n setConstant(\"Euler\" ,0.577215664901533D);\r\n setConstant(\"LN2\" ,0.693147180559945D);\r\n setConstant(\"LN10\" ,2.302585092994046D);\r\n setConstant(\"LOG2E\" ,1.442695040888963D);\r\n setConstant(\"LOG10E\",0.434294481903252D);\r\n setConstant(\"PHI\" ,1.618033988749895D);\r\n setConstant(\"PI\" ,Math.PI);\r\n\r\n variables=new TreeMap<String,Double>(String.CASE_INSENSITIVE_ORDER);\r\n\r\n functions=new TreeMap<String,FunctionHandler>(String.CASE_INSENSITIVE_ORDER);\r\n\r\n offset=0;\r\n isConstant=false;\r\n }",
"Expr createExpr();",
"protected RealExpression() {\r\n super();\r\n }",
"ExpOperand createExpOperand();",
"public NumberExpression(String value) {\n this(new BigDecimal(value));\n }",
"private AvgExpression() {\n }",
"public static NumberAmount create(){\n NumberAmount NA = new NumberAmount(new AdvancedOperations(Digit.Zero()));\n return NA;\n }",
"JavaExpression createJavaExpression();",
"void visit(NumericalValue expression);",
"Expression getExpression();",
"Expression getExpression();",
"Expression getExpression();",
"Expression getExpression();",
"DExpression getExpression();",
"private Equation createEquation() throws MainApplicationException {\r\n\t\tEquation equation = new Equation(false,\r\n\t\t\t\t\"a+b=c\", \r\n\t\t\t\tfalse, \r\n\t\t\t\tnew Parametre(), \r\n\t\t\t\t\"Insérer Propriété\",\r\n\t\t\t\t\"Insérer commentaire\");\r\n\t\tequation.setIsModifiable(true);\r\n\t\treturn equation;\r\n\t}",
"Multiply createMultiply();",
"public Object getExpression();",
"public Equation()\r\n\t{\r\n\t\texpression = \"\";\r\n\t}",
"public NumericValue(final double value) {\n this.value = value;\n }",
"public Expression() {\r\n\t\ttext = new StringBuffer();\r\n\t\txttext = new StringBuffer();\r\n\t}",
"public Polynomial visit(NumberExpression expression) {\n PolynomialTerm x = new PolynomialTerm(expression.getValue());\n return new Polynomial(x);\n }",
"final public ASTExpression Expression() throws ParseException {\r\n /*@bgen(jjtree) Expression */\r\n ASTExpression jjtn000 = new ASTExpression(JJTEXPRESSION);\r\n boolean jjtc000 = true;\r\n jjtree.openNodeScope(jjtn000);\r\n try {\r\n switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r\n case QUOTE:\r\n StringLiteral();\r\n jj_consume_token(61);\r\n jjtree.closeNodeScope(jjtn000, true);\r\n jjtc000 = false;\r\n {if (true) return jjtn000;}\r\n break;\r\n case IDENTIFIER:\r\n case INTEGER:\r\n case NOT:\r\n case SUB:\r\n case FLOATING_POINT_LITERAL:\r\n case 59:\r\n LogicalORExpression();\r\n jjtree.closeNodeScope(jjtn000, true);\r\n jjtc000 = false;\r\n {if (true) return jjtn000;}\r\n break;\r\n default:\r\n jj_la1[45] = jj_gen;\r\n jj_consume_token(-1);\r\n throw new ParseException();\r\n }\r\n } catch (Throwable jjte000) {\r\n if (jjtc000) {\r\n jjtree.clearNodeScope(jjtn000);\r\n jjtc000 = false;\r\n } else {\r\n jjtree.popNode();\r\n }\r\n if (jjte000 instanceof RuntimeException) {\r\n {if (true) throw (RuntimeException)jjte000;}\r\n }\r\n if (jjte000 instanceof ParseException) {\r\n {if (true) throw (ParseException)jjte000;}\r\n }\r\n {if (true) throw (Error)jjte000;}\r\n } finally {\r\n if (jjtc000) {\r\n jjtree.closeNodeScope(jjtn000, true);\r\n }\r\n }\r\n throw new Error(\"Missing return statement in function\");\r\n }",
"public Cos(Expression exp) {\n super(exp);\n }",
"@Override\n\tAlgebraicExpression clone();",
"public NumericConstantExpression(String numericConstant) {\r\n this.numconst = numericConstant;\r\n }",
"public Expression(String expr) {\n this.expr = expr;\n scalars = null;\n arrays = null;\n openingBracketIndex = null;\n closingBracketIndex = null;\n }",
"public MathEquation() {\n }",
"public interface Expression {\n\t\n\t/**\n\t * Evaluates an arithmetic expression.\n\t * \n\t * @return the value to which this expression evaluates\n\t */\n\tdouble eval();\n\t\n\t/**\n\t * Creates a String representation of an arithmetic expression.\n\t * \n\t * @return this expression in standard form, suitable for inclusion\n\t * in a program or text document (e.g., \"(2 - 4 * (7 + 2))\"). Note\n\t * that the string can have \"unnecessary\" parentheses as this (toy)\n\t * system does not know about operator precedence. \n\t */\n\tString toString();\n\n}",
"private IExpressionElement createExpression() throws RodinDBException {\n\t\tfinal IMachineRoot mch = createMachine(\"mch\");\n\t\treturn mch.createChild(IVariant.ELEMENT_TYPE, null, null);\n\t}",
"XExpr createXExpr();",
"Expr expr();",
"VariableExp createVariableExp();",
"private Expr expression() {\n return assignment();\n }",
"public UnaryExpNode() {\n }",
"public T exp(T value);",
"XExpression getExpression();",
"private XMath()\n {\n \n }",
"public Calculator() {\r\n\t\tthis.operator = new Addition();\r\n\t}",
"public ParseExpression(){\n expression = null;\n }",
"private IMathExpr parseMathElement(String expr)\r\n throws InvalidMathExprException {\r\n try {\r\n double val = Double.parseDouble(expr);\r\n \r\n return new MathExprConst(val);\r\n } catch (NumberFormatException ex) {\r\n throw new InvalidMathExprException(\"Invalid syntax, \"\r\n + \"unknown character: \" + expr);\r\n }\r\n }",
"public int getNumeric() {\r\n\t\treturn numeric;\r\n\t}",
"public Model() {\n operation = new DecimalOperation();\n base = 10;\n newnum = true;\n memory = new Stack<>();\n }",
"ExpressionCalculPrimary getExpr();",
"public Math2()\r\n {\r\n \r\n }",
"public ConvCalculator(Expression exp){\r\n this();\r\n this.expression = exp;\r\n }",
"protected UnaryExpNode(ExpNode expr) {\n this.expr = expr;\n }",
"Operand createOperand();",
"public MathEval(MathEval oth) {\r\n super();\r\n\r\n constants=new TreeMap<String,Double>(String.CASE_INSENSITIVE_ORDER);\r\n constants.putAll(oth.constants);\r\n\r\n variables=new TreeMap<String,Double>(String.CASE_INSENSITIVE_ORDER);\r\n variables.putAll(oth.variables);\r\n\r\n functions=new TreeMap<String,FunctionHandler>(String.CASE_INSENSITIVE_ORDER);\r\n functions.putAll(oth.functions);\r\n\r\n relaxed=oth.relaxed;\r\n\r\n offset=0;\r\n isConstant=false;\r\n }",
"FullExpression createFullExpression();",
"Expression multExpression() throws SyntaxException {\r\n\t\tToken first = t;\r\n\t\tExpression e0 = powerExpression();\r\n\t\twhile(isKind(OP_TIMES, OP_DIV, OP_MOD)) {\r\n\t\t\tToken op = consume();\r\n\t\t\tExpression e1 = powerExpression();\r\n\t\t\te0 = new ExpressionBinary(first,e0,op,e1);\r\n\t\t}\r\n\t\treturn e0;\r\n\t}",
"<C, PM> VariableExp<C, PM> createVariableExp();",
"public static void main(String[] args) throws Exception {\r\n Expression e = new Plus(new Mult(2, \"x\"), new Plus(new Sin(new Mult(4, \"y\")), new Pow(\"e\", \"x\")));\r\n System.out.println(e);\r\n Map<String, Double> assignment = new TreeMap<String, Double>();\r\n assignment.put(\"x\", 2.0);\r\n assignment.put(\"y\", 0.25);\r\n assignment.put(\"e\", 2.71);\r\n System.out.println(e.evaluate(assignment));\r\n e = e.differentiate(\"x\");\r\n System.out.println(e);\r\n System.out.println(e.evaluate(assignment));\r\n System.out.println(e.simplify());\r\n System.out.println(e);\r\n }",
"public abstract Expression generateExpression(GenerationContext context);",
"public Node expression()\r\n\t{\r\n\t\tNode lhs = term();\r\n\t\tif(lhs!=null)\r\n\t\t{\r\n\t\t\tint index = lexer.getPosition();\r\n\t\t\tLexer.Token token = lexer.getToken();\r\n\t\t\twhile(token == Lexer.Token.PLUS\r\n\t\t\t\t||token == Lexer.Token.MINUS)\r\n\t\t\t{\r\n\t\t\t\tNode rhs = term(); \r\n\t\t\t\tif(rhs!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tif(token == Lexer.Token.PLUS)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tlhs = new Add(lhs,rhs);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(token == Lexer.Token.MINUS)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tlhs = new Sub(lhs,rhs);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tindex = lexer.getPosition();\r\n\t\t\t\t\ttoken = lexer.getToken();\r\n\t\t\t\t}\r\n\t\t\t\telse break;\r\n\t\t\t}\r\n\t\t\tlexer.setPosition(index);\r\n\t\t}\r\n\t\treturn lhs;\r\n\t}",
"public NumericMethodException(String msg) {\n super(msg);\n }",
"@Override\n\tpublic int evalTree() {\n\t\tint num;\n\t\tExpressionTree left, right;\n\t\t\n\t\ttry {\n\t\t\tnum = Integer.parseInt(EMPTY + this.getValue());\n\n\t\t\treturn num;\n\t\t}\n\n\t\tcatch (NumberFormatException n) {\n\t\t\tleft = new ExpressionTree(getLeft());\n\t\t\tright = new ExpressionTree(getRight());\n\t\t\tif(TIMES_SIGN.equals(this.getValue()))\n\t\t\t\treturn left.evalTree() * right.evalTree();\n\t\t\telse\n\t\t\t\treturn left.evalTree() + right.evalTree();\n\t\t}\n\t}",
"public static NewExpression new_(Class type) { throw Extensions.todo(); }",
"private double parseNumber() throws InvalidExpressionException {\n\t\tdouble value;\r\n\t\tboolean negative = false;\r\n\t\tignorWhiteSpace();\r\n\t\tif (singleChar == '+' || singleChar == '-') {\r\n\t\t\t// check if the value is negative\r\n\t\t\tnegative = singleChar == '-';\r\n\t\t\tnextChar();\r\n\t\t\tignorWhiteSpace();\r\n\t\t}\r\n\t\tif (singleChar == '(') { // in case of open parentheses do recursion (include nested parentheses)!\r\n\t\t\tnextChar();\r\n\t\t\tvalue = parseExpression();\r\n\t\t\tif (singleChar == ')')\r\n\t\t\t\tnextChar();\r\n\t\t} else { // construct full length number\r\n\t\t\tStringBuilder sb = new StringBuilder();\r\n\t\t\twhile ((singleChar >= '0' && singleChar <= '9') || singleChar == '.') { // added support for double numbers\r\n\t\t\t\tsb.append((char) singleChar);\r\n\t\t\t\tnextChar();\r\n\t\t\t}\r\n\t\t\tif (sb.length() == 0) // If invalid char exist in the expression, throw an exception.\r\n\t\t\t\tthrow new InvalidExpressionException(\"Invalid character : \" + (char) singleChar);\r\n\t\t\tvalue = Double.parseDouble(sb.toString());\r\n\t\t}\r\n\t\tignorWhiteSpace();\r\n\t\tif (singleChar == '^') { // in power \r\n\t\t\tnextChar();\r\n\t\t\tvalue = Math.pow(value, parseNumber());\r\n\t\t}\r\n\t\tif (negative)\r\n\t\t\tvalue = -value; // append minus to number if negative\r\n\t\treturn value;\r\n\t}",
"private ExpressionTools(){\n\t\t\n\t}",
"private PropertyEvaluator createEvaluator() {\n return helper.getStandardPropertyEvaluator();\n }",
"public Number getNumberValue();",
"public Expr getExpression()\n {\n Parser.validateExpr(expression, analysis);\n return expression;\n }",
"public Cos(String exp) {\n super(exp);\n }",
"@Override\r\n\tpublic RandomGenerator_Exponential clone() {\r\n\t\tRandomGenerator_Exponential rg = new RandomGenerator_Exponential();\r\n\t\trg.lambda=lambda;\r\n\t\treturn rg;\r\n\t}",
"public Expression differentiate(String var) {\r\n // var might be a differentiate of other variable\r\n if (!this.toString().equalsIgnoreCase(var)) {\r\n return (Expression) new Num(0);\r\n }\r\n return (Expression) new Num(1);\r\n\r\n }",
"public Object eval (Object expression);",
"public int getNumericValue() {\n return value;\n }",
"@Test\n\t\tpublic void testExpression() throws LexicalException, SyntaxException {\n\t\t\tString input = \"x + 2\";\n\t\t\tPLPParser parser = makeParser(input);\n\t\t\tExpression e = parser.expression(); //call expression here instead of parse\n\t\t\tshow(e);\t\n\t\t\tassertEquals(ExpressionBinary.class, e.getClass());\n\t\t\tExpressionBinary b = (ExpressionBinary)e;\n\t\t\tassertEquals(ExpressionIdentifier.class, b.leftExpression.getClass());//\n\t\t\tExpressionIdentifier left = (ExpressionIdentifier)b.leftExpression;\n\t\t\tassertEquals(\"x\", left.name);\n\t\t\tassertEquals(ExpressionIntegerLiteral.class, b.rightExpression.getClass());\n\t\t\tExpressionIntegerLiteral right = (ExpressionIntegerLiteral)b.rightExpression;\n\t\t\tassertEquals(2, right.value);\n\t\t\tassertEquals(OP_PLUS, b.op);\n\t\t}",
"protected NumericalAttribute(String name) {\n\t\tthis(name, Ontology.NUMERICAL);\n\t}",
"@Override\n public String toString() {\n return \"Expression\";\n }",
"Expr getExpr();",
"public BaseExpression(Expression e) {\r\n this.e1 = e;\r\n }",
"public Mult(double left, Expression right) {\n super(left, right);\n }",
"NumericalAttribute(String name, int valueType) {\n\t\tsuper(name, valueType);\n\t\tregisterStatistics(new NumericalStatistics());\n\t\tregisterStatistics(new WeightedNumericalStatistics());\n\t\tregisterStatistics(new MinMaxStatistics());\n\t\tregisterStatistics(new UnknownStatistics());\n\t}",
"public Expression(IExpressionPart expressionPart)\r\n\t{\r\n\t\tthis.expressionPart = expressionPart;\r\n\t}",
"public Cos(Expression expression) {\n super(\"cos(%s)\", expression);\n }",
"Quantity createQuantity();",
"private XMLTreeNNExpressionEvaluator() {\n }",
"public Stmt createEval(Expr expr) {\n return xnf.Eval(expr.position(), expr);\n }",
"public Cos(double exp) {\n super(exp);\n }",
"Expression addExpression() throws SyntaxException {\r\n\t\tToken first = t;\r\n\t\tExpression e0 = multExpression();\r\n\t\twhile(isKind(OP_PLUS, OP_MINUS)) {\r\n\t\t\tToken op = consume();\r\n\t\t\tExpression e1 = multExpression();\r\n\t\t\te0 = new ExpressionBinary(first,e0,op,e1);\r\n\t\t}\r\n\t\treturn e0;\r\n\t}",
"private XMLTreeIntExpressionEvaluator() {\n }",
"private MyMath() {\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}",
"long getNumericField();",
"public Math() {\n initComponents();\n }",
"double parseExpression() {\n double x = parseTerm();\n for (;;) {\n if (eat('+')) x += parseTerm(); // addition\n else if (eat('-')) x -= parseTerm(); // subtraction\n else return x;\n }\n }",
"double parseExpression() {\n double x = parseTerm();\n for (;;) {\n if (eat('+')) x += parseTerm(); // addition\n else if (eat('-')) x -= parseTerm(); // subtraction\n else return x;\n }\n }",
"public Mult(Expression left, double right) {\n super(left, right);\n }",
"public Object clone() throws CloneNotSupportedException {\r\n\t\t// Shallow clone\r\n\t\tExpression v = (Expression) super.clone();\r\n\t\tv.eval_stack = null;\r\n\t\t// v.text = new StringBuffer(new String(text));\r\n\t\tint size = elements.size();\r\n\t\tArrayList cloned_elements = new ArrayList(size);\r\n\t\tv.elements = cloned_elements;\r\n\r\n\t\treturn v;\r\n\t}",
"protected IExpressionValue expression() throws TableFunctionMalformedException,\r\n\t\t\t\t\t\t\t\t\t\t\t\t InvalidProbabilityRangeException,\r\n\t\t\t\t\t\t\t\t\t\t\t\t SomeStateUndeclaredException{\r\n\t\t\r\n\t\t// temp table already created by upper caller\r\n\t\t\r\n\t\tIExpressionValue temp1 = term();\r\n\t\tIExpressionValue temp2 = null;\r\n\t\t\r\n\t\tFloat temp1Value = null;\r\n\t\tFloat temp2Value = null;\r\n\t\t// LOOK FOR +/- (OPTIONAL)\r\n\t\tswitch (look) {\r\n\t\tcase '+':\r\n\t\t\tmatch('+');\r\n\t\t\ttemp2 = term();\r\n\t\t\ttry {\r\n\t\t\t\ttemp1Value = Float.parseFloat(temp1.getValue());\r\n\t\t\t} catch (NumberFormatException e) {\r\n\t\t\t\ttemp1Value = Float.NaN;\r\n\t\t\t}\r\n\t\t\ttry {\r\n\t\t\t\ttemp2Value = Float.parseFloat(temp2.getValue());\r\n\t\t\t} catch (NumberFormatException e) {\r\n\t\t\t\ttemp2Value = Float.NaN;\r\n\t\t\t}\r\n\t\t\tif (!Float.isNaN(temp1Value) && !Float.isNaN(temp2Value)) {\r\n\t\t\t\t// TODO cut the subtree if it is a known value...\r\n\t\t\t\ttemp1 = new AddOperationProbabilityValue(\r\n\t\t\t\t\t\ttemp1.isFixedValue()?(new SimpleProbabilityValue(temp1Value)):temp1 ,\r\n\t\t\t\t\t\t\t\ttemp2.isFixedValue()?(new SimpleProbabilityValue(temp2Value)):temp2);\r\n\t\t\t}\t\t\r\n\t\t\tbreak;\r\n\t\tcase '-':\r\n\t\t\tmatch('-');\r\n\t\t\ttemp2 = term();\r\n\t\t\ttry {\r\n\t\t\t\ttemp1Value = Float.parseFloat(temp1.getValue());\r\n\t\t\t} catch (NumberFormatException e) {\r\n\t\t\t\ttemp1Value = Float.NaN;\r\n\t\t\t}\r\n\t\t\ttry {\r\n\t\t\t\ttemp2Value = Float.parseFloat(temp2.getValue());\r\n\t\t\t} catch (NumberFormatException e) {\r\n\t\t\t\ttemp2Value = Float.NaN;\r\n\t\t\t}\r\n\t\t\tif (!Float.isNaN(temp1Value) && !Float.isNaN(temp2Value)){\r\n\t\t\t\t// TODO cut the subtree if it is known value...\r\n\t\t\t\ttemp1 = new SubtractOperationProbabilityValue(\r\n\t\t\t\t\t\ttemp1.isFixedValue()?(new SimpleProbabilityValue(temp1Value)):temp1 ,\r\n\t\t\t\t\t\t\t\ttemp2.isFixedValue()?(new SimpleProbabilityValue(temp2Value)):temp2);\r\n\t\t\t}\t\t\t\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\t// Debug.println(\"Expression returned \" + temp1.getProbability());\r\n\t\treturn temp1;\r\n\t}"
]
| [
"0.6917567",
"0.6447215",
"0.62684196",
"0.62585366",
"0.6159584",
"0.61454695",
"0.61454004",
"0.61412364",
"0.6107675",
"0.60723525",
"0.60659176",
"0.60618764",
"0.60598946",
"0.60158324",
"0.5908684",
"0.5885121",
"0.5874272",
"0.58528894",
"0.5836912",
"0.5836912",
"0.5836912",
"0.5836912",
"0.58344704",
"0.5746564",
"0.574291",
"0.57419896",
"0.5713812",
"0.56994194",
"0.5686148",
"0.5678817",
"0.56649804",
"0.56606036",
"0.5638955",
"0.563861",
"0.563009",
"0.5626713",
"0.56152344",
"0.55541116",
"0.552783",
"0.54933596",
"0.5491815",
"0.5484491",
"0.54810107",
"0.54727626",
"0.54696864",
"0.5452744",
"0.5432651",
"0.5416999",
"0.541139",
"0.5409187",
"0.5394432",
"0.53904593",
"0.5388511",
"0.53806037",
"0.53695947",
"0.53641516",
"0.53602004",
"0.5338148",
"0.53338647",
"0.5328234",
"0.53213745",
"0.5318307",
"0.53050435",
"0.5301961",
"0.529907",
"0.5294982",
"0.5288192",
"0.5286009",
"0.5282353",
"0.52742136",
"0.5273445",
"0.52664584",
"0.52649266",
"0.5250347",
"0.5249178",
"0.5247943",
"0.52439654",
"0.5241821",
"0.5235468",
"0.522866",
"0.522752",
"0.5222853",
"0.5219758",
"0.5214293",
"0.5213351",
"0.51910186",
"0.5188987",
"0.5183819",
"0.51811457",
"0.5168557",
"0.5167836",
"0.5162509",
"0.516196",
"0.5158215",
"0.51579154",
"0.51574296",
"0.51574296",
"0.5156323",
"0.5155106",
"0.515501"
]
| 0.8852934 | 0 |
Returns a new object of class 'String Expression'. | StringExpression createStringExpression(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"StringLiteralExp createStringLiteralExp();",
"<C> StringLiteralExp<C> createStringLiteralExp();",
"public LiteralExpression (String str){\n _value = str;\n }",
"Expression createExpression();",
"StringOperation createStringOperation();",
"public static Expression compile(@NonNull final String s) {\n return new Expression(PARSER.parse(s));\n }",
"public Expression(String expr) {\n this.expr = expr;\n scalars = null;\n arrays = null;\n openingBracketIndex = null;\n closingBracketIndex = null;\n }",
"public Expression() {\r\n\t\ttext = new StringBuffer();\r\n\t\txttext = new StringBuffer();\r\n\t}",
"public String getExpressionString ()\n {\n return toStringToken ((String) getValue ());\n }",
"Expression() { }",
"String getExpression();",
"String getExpression();",
"public static JRDesignExpression createExpression(String text) {\n\t\treturn createExpression(text, (String) null);\n\t}",
"public StringExpr(Token token, String value) {\n super(token);\n this.value = value;\n }",
"public String toString() {\n return m_expression;\n }",
"@Override\n public String toString() {\n return \"Expression\";\n }",
"public Expression(String pExpStr) {\n Queue<Token> tokenQueue = new Queue<>();\n setTokenQueue(tokenQueue);\n Tokenizer tokenizer = new Tokenizer(pExpStr);\n Token prevToken = null;\n Token token = tokenizer.nextToken();\n while (token != null) {\n if (token instanceof SubOperator) {\n token = negationCheck(token, prevToken);\n }\n getTokenQueue().enqueue(token);\n prevToken = token;\n token = tokenizer.nextToken();\n }\n }",
"public Expression(Expression exp) {\r\n\t\tconcat(exp);\r\n\t\ttext = new StringBuffer(new String(exp.text));\r\n\t}",
"public Expression makeExpression(String input) {\n\t\tmyInput = input;\n\t\tmyCurrentPosition = 0; // NEW LINE\n\t\tExpression result = parseExpression(new HashMap<String, Expression>());\n\t\tskipWhiteSpace();\n\t\tif (notAtEndOfString()) {\n\t\t\tthrow new ParserException(\n\t\t\t\t\t\"Unexpected characters at end of the string: \"\n\t\t\t\t\t\t\t+ myInput.substring(myCurrentPosition),\n\t\t\t\t\tParserException.Type.EXTRA_CHARACTERS);\n\t\t}\n\t\treturn result;\n\t}",
"public abstract String construct();",
"JavaExpression createJavaExpression();",
"private void jetExprStr(){\n\t\texprType = Z3MiscFunctions.v().getExprType(rExpr);\n\t\tswitch(exprType){\n\t\t\tcase BINOP:\n\t\t\t\tjetBinopExprStr();\n\t\t\t\tbreak;\n\t\t\tcase CAST:\n\t\t\t\tjetCastExprStr();\n\t\t\t\tbreak;\n\t\t\tcase INVOKE:\n\t\t\t\tjetInvokeExpr();\n\t\t\t\tbreak;\n\t\t\tcase NEWARRAY:\n\t\t\t\tjetNewArrayExpr();\n\t\t\t\tbreak;\n\t\t\tcase NEWEXPR:\n\t\t\t\tjetNewExpr();\n\t\t\t\tbreak;\n\t\t\tcase UNOP:\n\t\t\t\tjetUnopExpr();\n\t\t\t\tbreak;\n\t\t\tcase INSTANCEOF:\n\t\t\t\t//TODO\n\t\t\t\tassert(false);\n\t\t\t\tbreak;\n\t\t\tcase NEWMULIARRAY:\n\t\t\t\t//TODO\n\t\t\t\tassert(false);\n\t\t\t\tbreak;\n\t\t}\n\t}",
"Expr createExpr();",
"public Equation(String strEquation) {\n\t\tthis.strEquation = strEquation;\n\t}",
"public Equation()\r\n\t{\r\n\t\texpression = \"\";\r\n\t}",
"public Expression() {\r\n }",
"public Expression asExpression() {\n switch (TYPE) {\n case EXPRESSION:\n return EXPRESSION;\n case IDENTIFIER:\n return new Variable(VALUE);\n case LITERAL:\n if (VALUE.matches(\"\\\\d+\")) {\n return new LInteger(Integer.parseInt(VALUE));\n } else if (VALUE.equals(\"true\") || VALUE.equals(\"false\")) {\n return LBoolean.resolve(VALUE.equals(\"true\"));\n } else if (VALUE.equals(\"null\")) {\n return LNull.NULL;\n } else {\n return new LString(VALUE);\n }\n default:\n throw ErrorLog.get(\"Unexpected symbol '%s'\", VALUE);\n }\n }",
"public WebutilsExpression parse(String expressionStr)\r\n\t{\r\n\t\tExpression expression = expressionEvaluator.parse(expressionStr);\r\n\t\treturn new WebutilsExpression(expression, expressionRegistry);\r\n\t}",
"public TextExpression(String text) {\n this.text = text;\n }",
"FullExpression createFullExpression();",
"Expression getExpression();",
"Expression getExpression();",
"Expression getExpression();",
"Expression getExpression();",
"private Expression(String id, String message, String expression) {\n this.id = id;\n this.message = message;\n this.expression = expression;\n }",
"@Override\n public Object construct(Object... args) {\n CharSequence stringData = (args.length > 0 ? ToString(realm(), args[0]) : \"\");\n ExoticString obj = new ExoticString(realm(), stringData);\n obj.setPrototype(realm().getIntrinsic(Intrinsics.StringPrototype));\n return obj;\n }",
"public Query(String expression) {\r\n\t\t_product = Product.class;\r\n\t\t_variable = \"p\";\r\n\t\t_expression = expression;\r\n\r\n\t}",
"StringValue createStringValue();",
"StringValue createStringValue();",
"StringValue createStringValue();",
"StringValue createStringValue();",
"Expression(String expressionString) throws IllegalArgumentException {\r\n tokenList = new ArrayList<String>();\r\n StringBuilder token = new StringBuilder();\r\n\r\n // ADD YOUR CODE BELOW HERE\r\n // ..\r\n for (int i = 0; i < expressionString.length(); i++) {\r\n Character first = expressionString.charAt(i);\r\n if (first == ' ') {\r\n continue;\r\n }\r\n if (first == '(' || first == ')' || first == '[' || first == ']') {\r\n tokenList.add(expressionString.substring(i, i + 1));\r\n }\r\n if (first == '+' || first == '-' || first == '*' || first == '/') {\r\n if (expressionString.charAt(i + 1) == '+' || expressionString.charAt(i + 1) == '-') {\r\n tokenList.add(expressionString.substring(i, i + 2));\r\n i++;\r\n continue;\r\n }\r\n tokenList.add(expressionString.substring(i, i + 1));\r\n }\r\n if (Character.isDigit(first)) {\r\n int k = i + 1;\r\n while (Character.isDigit(expressionString.charAt(k))) {\r\n k++;\r\n }\r\n tokenList.add(expressionString.substring(i, k));\r\n i = k - 1;\r\n\r\n }\r\n }\r\n }",
"public static Symbol string()\r\n\t{\r\n\t\tString str_text = buffer.toString();\r\n\t\tToken token = new Token(fname, str_text, str_linepos, str_charpos,\r\n\t\t\t\tstr_colpos);\r\n\t\treturn new Symbol(sym.STRING, str_linepos, str_colpos, token);\r\n\t}",
"public static JRDesignExpression createExpression(String text, Class valueClass) {\n\t\tString valueClassName = null;\n\t\tif (valueClass != null) {\n\t\t\tvalueClassName = valueClass.getName();\n\t\t\tif (valueClass.isArray())\n\t\t\t\tvalueClassName = null;\n\t\t\telse if (valueClass.isArray())\n\t\t\t\tvalueClassName = null;\n\t\t\telse if (valueClass.isPrimitive())\n\t\t\t\tvalueClassName = null;\n\t\t}\n\t\treturn createExpression(text, valueClassName);\n\t}",
"public Object getExpression();",
"public SpyExpressionHandler(final String string) throws ExpressionException {\n\t\t\tsuper(string);\n\t\t}",
"StringConstant createStringConstant();",
"@org.junit.Test\n public void constrCompelemString1() {\n final XQuery query = new XQuery(\n \"fn:string(element elem {'a', element a {}, 'b'})\",\n ctx);\n try {\n result = new QT3Result(query.value());\n } catch(final Throwable trw) {\n result = new QT3Result(trw);\n } finally {\n query.close();\n }\n test(\n assertStringValue(false, \"ab\")\n );\n }",
"@SuppressWarnings(\"deprecation\")\n\tpublic static JRDesignExpression createExpression(String text, String valueClassName) {\n\t\tJRDesignExpression exp = new JRDesignExpression();\n\n\t\tif (text != null) {\n\t\t\texp.setText(text);\n\t\t}\n\n\t\tif (valueClassName != null) {\n\t\t\texp.setValueClassName(valueClassName);\n\t\t}\n\n\t\treturn exp;\n\n\t}",
"@Override\r\n\tpublic String toString() {\r\n\t\tString string = \"\";\r\n\t\tif (expressionTree.getNumberOfChildren()==0)\r\n\t\t\treturn expressionTree.getValue();\r\n\t\telse{\r\n\t\t\tstring += \"(\";\r\n\t\t\tfor (int i = 0; i < expressionTree.getNumberOfChildren(); i++){\r\n\t\t\t\tTree<String> subtree = expressionTree.getChild(i);\r\n\t\t\t\tif (subtree.getNumberOfChildren()==0)\r\n\t\t\t\t\tstring += subtree.getValue();\r\n\t\t\t\telse\r\n\t\t\t\t\tstring += (new Expression(subtree.toString())).toString()+\" \";\r\n\t\t\t\tif (i < expressionTree.getNumberOfChildren()-1)\r\n\t\t\t\t\tstring += \" \" + expressionTree.getValue()+\" \";\r\n\t\t\t}\r\n\t\t\tstring += \")\";\r\n\t\t}\r\n\t\treturn string;\r\n\t}",
"public ParseExpression(){\n expression = null;\n }",
"Expression getExp();",
"RealLiteralExp createRealLiteralExp();",
"public T caseExpression_String(Expression_String object)\r\n {\r\n return null;\r\n }",
"public StringTemplateElement()\n {\n super(String.class);\n }",
"public Expression determine(String s);",
"public String toString() {\n return fullExpression;\n }",
"private Expr expression() {\n return assignment();\n }",
"public Expression getExpression() {\n if (this.expression == null) {\n // lazy init must be thread-safe for readers\n synchronized (this) {\n if (this.expression == null) {\n preLazyInit();\n this.expression = new SimpleName(this.ast);\n postLazyInit(this.expression, EXPRESSION_PROPERTY);\n }\n }\n }\n return this.expression;\n }",
"SimpleLiteral createSimpleLiteral();",
"public String getExpression() {\n return _expression;\n }",
"public String getExpression() {\n return expression;\n }",
"public String getExpression() {\n return expression;\n }",
"public String getExpression() {\n return expression;\n }",
"private void jetStringOperation(InvokeExpr invokeExpr){\n\t\tthis.exprStr = StringModeling.modelMethod(invokeExpr, fileGenerator, stmtIdx);\n\t}",
"ExpOperand createExpOperand();",
"private Element encapsulateString(String sentence){\n return new MyElement(sentence);\n }",
"StringTemplate createStringTemplate();",
"final public ASTExpression Expression() throws ParseException {\r\n /*@bgen(jjtree) Expression */\r\n ASTExpression jjtn000 = new ASTExpression(JJTEXPRESSION);\r\n boolean jjtc000 = true;\r\n jjtree.openNodeScope(jjtn000);\r\n try {\r\n switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {\r\n case QUOTE:\r\n StringLiteral();\r\n jj_consume_token(61);\r\n jjtree.closeNodeScope(jjtn000, true);\r\n jjtc000 = false;\r\n {if (true) return jjtn000;}\r\n break;\r\n case IDENTIFIER:\r\n case INTEGER:\r\n case NOT:\r\n case SUB:\r\n case FLOATING_POINT_LITERAL:\r\n case 59:\r\n LogicalORExpression();\r\n jjtree.closeNodeScope(jjtn000, true);\r\n jjtc000 = false;\r\n {if (true) return jjtn000;}\r\n break;\r\n default:\r\n jj_la1[45] = jj_gen;\r\n jj_consume_token(-1);\r\n throw new ParseException();\r\n }\r\n } catch (Throwable jjte000) {\r\n if (jjtc000) {\r\n jjtree.clearNodeScope(jjtn000);\r\n jjtc000 = false;\r\n } else {\r\n jjtree.popNode();\r\n }\r\n if (jjte000 instanceof RuntimeException) {\r\n {if (true) throw (RuntimeException)jjte000;}\r\n }\r\n if (jjte000 instanceof ParseException) {\r\n {if (true) throw (ParseException)jjte000;}\r\n }\r\n {if (true) throw (Error)jjte000;}\r\n } finally {\r\n if (jjtc000) {\r\n jjtree.closeNodeScope(jjtn000, true);\r\n }\r\n }\r\n throw new Error(\"Missing return statement in function\");\r\n }",
"@Override\n public String toString() {\n return \"(\" + getExpression1() + \" - \" + getExpression2() + \")\";\n }",
"public String toString()\r\n\t{\r\n\t\tcheckInitialization();\r\n\t\treturn equationString + \" = \" + getResult();\r\n\t}",
"private void createStringConcat( AOpExpr node){\n\t\til.append(fi.createNew(\"java.lang.StringBuilder\"));\n \til.append(InstructionConstants.DUP);\n \tnode.getLeft().apply(this); //Load the left string.\n \til.append(fi.createInvoke(\"java.lang.StringBuilder\", \"<init>\", org.apache.bcel.generic.Type.VOID, new org.apache.bcel.generic.Type[] { org.apache.bcel.generic.Type.STRING }, Constants.INVOKESPECIAL));\n \tnode.getRight().apply(this); \n \til.append(fi.createInvoke(\"java.lang.StringBuilder\", \"append\", new org.apache.bcel.generic.ObjectType(\"java.lang.StringBuilder\"), new org.apache.bcel.generic.Type[] { org.apache.bcel.generic.Type.STRING }, Constants.INVOKEVIRTUAL));\n \til.append(fi.createInvoke(\"java.lang.StringBuilder\", \"toString\", org.apache.bcel.generic.Type.STRING, org.apache.bcel.generic.Type.NO_ARGS, Constants.INVOKEVIRTUAL));\n\t}",
"@Override\r\n\tpublic Object visitStringLiteralExpression(\r\n\t\t\tStringLiteralExpression stringLiteralExpression, Object arg)\r\n\t\t\tthrows Exception {\n\t mv.visitLdcInsn(stringLiteralExpression.stringLiteral.getText());\r\n\t\treturn \"Ljava/lang/String;\";\r\n\t}",
"private static void testToString() {\r\n\t\tSystem.out.println(\"\\n----------\\nTesting toString();\");\r\n\t\tString equation = \"(5*5*2*2)-(2*5)-(5*2*(2+3+4))\";\r\n\t\tCalculator calc = new Calculator(equation);\r\n\t\tString result = calc.toString();\r\n\t\tString expected = \"(5*5*2*2)-(2*5)-(5*2*(2+3+4)) = 0\";\r\n\t\tprintTest(true, \"testing toString() with valid equation \" + equation, result, expected);\r\n\t\t\r\n\t\tequation = \"0 + 12345\";\r\n\t\tcalc.setEquationString(equation);\r\n\t\texpected = \"0 + 12345 = 12345\";\r\n\t\tresult= calc.toString();\r\n\t\tprintTest(true, \"Testing getResult() with equation \" + equation, result, expected);\r\n\t\t\r\n\t\tequation = \"1/0\";\r\n\t\tcalc.setEquationString(equation);\r\n\t\texpected = \"1/0 = Java.lang.ArithmeticException: / by zero\";\r\n\t\tresult= calc.toString();\r\n\t\tprintTest(true, \"Testing getResult() with equation \" + equation, result, expected);\r\n\t\t\r\n\t\tequation = \"5++5\";\r\n\t\tcalc.setEquationString(equation);\r\n\t\texpected = \"5++5 = Error: cannot have two adjacent signs\";\r\n\t\tresult= calc.toString();\r\n\t\tprintTest(true, \"Testing getResult() with equation \" + equation, result, expected);\r\n\t\t\r\n\t\tequation = \"5+7)\";\r\n\t\tcalc.setEquationString(equation);\r\n\t\texpected = \"5+7) = java.util.EmptyStackException Make sure all parenthesis have a matching pair\";\r\n\t\tresult= calc.toString();\r\n\t\tprintTest(true, \"Testing getResult() with equation \" + equation, result, expected);\r\n\t\t\r\n\t\tequation = \"(5+7\";\r\n\t\tcalc.setEquationString(equation);\r\n\t\texpected = \"(5+7 = java.util.EmptyStackException Make sure all parenthesis have a matching pair\";\r\n\t\tresult= calc.toString();\r\n\t\tprintTest(true, \"Testing getResult() with equation \" + equation, result, expected);\r\n\t\t\r\n\t\tequation = \"x\";\r\n\t\tcalc.setEquationString(equation);\r\n\t\texpected = \"x = Error: Invalid character entered\";\r\n\t\tresult= calc.toString();\r\n\t\tprintTest(true, \"Testing getResult() with equation \" + equation, result, expected);\r\n\t}",
"public interface Expression {\n\t\n\t/**\n\t * Evaluates an arithmetic expression.\n\t * \n\t * @return the value to which this expression evaluates\n\t */\n\tdouble eval();\n\t\n\t/**\n\t * Creates a String representation of an arithmetic expression.\n\t * \n\t * @return this expression in standard form, suitable for inclusion\n\t * in a program or text document (e.g., \"(2 - 4 * (7 + 2))\"). Note\n\t * that the string can have \"unnecessary\" parentheses as this (toy)\n\t * system does not know about operator precedence. \n\t */\n\tString toString();\n\n}",
"private static Expression retrieveParseExpression(String expression) {\n return StaticJavaParser.parseExpression(expression);\n }",
"Literal createLiteral();",
"Literal createLiteral();",
"public String toString() {\r\n\t\tStringBuffer buf = new StringBuffer();\r\n\t\tbuf.append(\"[ Expression \");\r\n\t\tif (text() != null) {\r\n\t\t\tbuf.append(\"[\");\r\n\t\t\tbuf.append(text().toString());\r\n\t\t\tbuf.append(\"]\");\r\n\t\t}\r\n\t\tbuf.append(\": \");\r\n\t\tfor (int n = 0; n < elements.size(); ++n) {\r\n\t\t\tbuf.append(elements.get(n));\r\n\t\t\tif (n < elements.size() - 1) {\r\n\t\t\t\tbuf.append(\",\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tbuf.append(\" ]\");\r\n\t\treturn new String(buf);\r\n\t}",
"public String toString() {\n if (mExpression.size() == 1 && mExpression.get(0).startsWith(\"-\")) {\n return mExpression.get(0);\n }\n\n StringBuilder output = new StringBuilder();\n boolean first = true;\n int size = mExpression.size();\n\n for (int i = 0; i < size; i++) {\n String element = mExpression.get(i);\n\n if (first) {\n first = false;\n } else {\n output.append(\"\");\n }\n\n\n if (isOperand(element) && element.startsWith(\"-\")) {\n output.append(\"(\")\n .append(element)\n .append(\")\");\n } else {\n output.append(element);\n }\n }\n\n return output.toString();\n }",
"@Override\n\tpublic void outAStringExpr(AStringExpr node) {\n\t\tString s = node.getString().getText(); \n\t\ts = s.substring(1, s.length()-1);\n\t\til.append(new PUSH(cp, s)); \n\t}",
"public MatchesStringExpression(Expression expressionA, Expression expressionB, Expression errorRecoveryExpression)\n {\n\tsuper(expressionA, expressionB, errorRecoveryExpression);\n }",
"public Object eval(String expression) throws Exception;",
"public static Expression parse(String exp) {\n\t\texp = exp.replace(\" \", \"\");\r\n\t\tchar[] cs = exp.toCharArray();\r\n\t\tint i = 0;\r\n\t\twhile (i < cs.length && !Operator.validOp(cs[i])) {\r\n\t\t\t++i;\r\n\t\t}\r\n\t\tif (i == cs.length)\r\n\t\t\treturn new Expression(Token.parse(exp));\r\n\t\telse {\r\n\t\t\t//to preserve order of operations here, flip order accordingly\r\n\t\t\t//if the operator is * or /\r\n\t\t\treturn new Expression(\r\n\t\t\t\t\tExpression.parse(exp.substring(0,i)),\r\n\t\t\t\t\t(Operator)Token.parse(cs[i]),\r\n\t\t\t\t\tExpression.parse(exp.substring(i+1, exp.length()))\r\n\t\t\t);\r\n\t\t}\r\n\t}",
"private Equation createEquation() throws MainApplicationException {\r\n\t\tEquation equation = new Equation(false,\r\n\t\t\t\t\"a+b=c\", \r\n\t\t\t\tfalse, \r\n\t\t\t\tnew Parametre(), \r\n\t\t\t\t\"Insérer Propriété\",\r\n\t\t\t\t\"Insérer commentaire\");\r\n\t\tequation.setIsModifiable(true);\r\n\t\treturn equation;\r\n\t}",
"DExpression getExpression();",
"public final expressionParser.stringExpression_return stringExpression() throws RecognitionException {\n expressionParser.stringExpression_return retval = new expressionParser.stringExpression_return();\n retval.start = input.LT(1);\n\n CommonTree root_0 = null;\n\n Token STRING6=null;\n Token STRING8=null;\n expressionParser.nameExpression_return nameExpression7 = null;\n\n\n CommonTree STRING6_tree=null;\n CommonTree STRING8_tree=null;\n\n try {\n // C:\\\\work\\\\art\\\\latest-code\\\\vclang-code-dd0a89f0d579f02ec8c3d8cd398ea8f7cbb445aa\\\\src\\\\art\\\\grammar\\\\expression.g:40:3: ( ( ( STRING )* ( nameExpression )+ ( STRING )* )+ )\n // C:\\\\work\\\\art\\\\latest-code\\\\vclang-code-dd0a89f0d579f02ec8c3d8cd398ea8f7cbb445aa\\\\src\\\\art\\\\grammar\\\\expression.g:40:5: ( ( STRING )* ( nameExpression )+ ( STRING )* )+\n {\n root_0 = (CommonTree)adaptor.nil();\n\n // C:\\\\work\\\\art\\\\latest-code\\\\vclang-code-dd0a89f0d579f02ec8c3d8cd398ea8f7cbb445aa\\\\src\\\\art\\\\grammar\\\\expression.g:40:5: ( ( STRING )* ( nameExpression )+ ( STRING )* )+\n int cnt6=0;\n loop6:\n do {\n int alt6=2;\n int LA6_0 = input.LA(1);\n\n if ( (LA6_0==STRING) ) {\n int LA6_2 = input.LA(2);\n\n if ( (synpred8_expression()) ) {\n alt6=1;\n }\n\n\n }\n else if ( (LA6_0==EPRESSIONCHAR) ) {\n int LA6_3 = input.LA(2);\n\n if ( (synpred8_expression()) ) {\n alt6=1;\n }\n\n\n }\n\n\n switch (alt6) {\n \tcase 1 :\n \t // C:\\\\work\\\\art\\\\latest-code\\\\vclang-code-dd0a89f0d579f02ec8c3d8cd398ea8f7cbb445aa\\\\src\\\\art\\\\grammar\\\\expression.g:40:6: ( STRING )* ( nameExpression )+ ( STRING )*\n \t {\n \t // C:\\\\work\\\\art\\\\latest-code\\\\vclang-code-dd0a89f0d579f02ec8c3d8cd398ea8f7cbb445aa\\\\src\\\\art\\\\grammar\\\\expression.g:40:6: ( STRING )*\n \t loop3:\n \t do {\n \t int alt3=2;\n \t int LA3_0 = input.LA(1);\n\n \t if ( (LA3_0==STRING) ) {\n \t alt3=1;\n \t }\n\n\n \t switch (alt3) {\n \t \tcase 1 :\n \t \t // C:\\\\work\\\\art\\\\latest-code\\\\vclang-code-dd0a89f0d579f02ec8c3d8cd398ea8f7cbb445aa\\\\src\\\\art\\\\grammar\\\\expression.g:0:0: STRING\n \t \t {\n \t \t STRING6=(Token)match(input,STRING,FOLLOW_STRING_in_stringExpression157); if (state.failed) return retval;\n \t \t if ( state.backtracking==0 ) {\n \t \t STRING6_tree = (CommonTree)adaptor.create(STRING6);\n \t \t adaptor.addChild(root_0, STRING6_tree);\n \t \t }\n\n \t \t }\n \t \t break;\n\n \t \tdefault :\n \t \t break loop3;\n \t }\n \t } while (true);\n\n \t // C:\\\\work\\\\art\\\\latest-code\\\\vclang-code-dd0a89f0d579f02ec8c3d8cd398ea8f7cbb445aa\\\\src\\\\art\\\\grammar\\\\expression.g:40:14: ( nameExpression )+\n \t int cnt4=0;\n \t loop4:\n \t do {\n \t int alt4=2;\n \t int LA4_0 = input.LA(1);\n\n \t if ( (LA4_0==EPRESSIONCHAR) ) {\n \t int LA4_2 = input.LA(2);\n\n \t if ( (synpred6_expression()) ) {\n \t alt4=1;\n \t }\n\n\n \t }\n\n\n \t switch (alt4) {\n \t \tcase 1 :\n \t \t // C:\\\\work\\\\art\\\\latest-code\\\\vclang-code-dd0a89f0d579f02ec8c3d8cd398ea8f7cbb445aa\\\\src\\\\art\\\\grammar\\\\expression.g:0:0: nameExpression\n \t \t {\n \t \t pushFollow(FOLLOW_nameExpression_in_stringExpression160);\n \t \t nameExpression7=nameExpression();\n\n \t \t state._fsp--;\n \t \t if (state.failed) return retval;\n \t \t if ( state.backtracking==0 ) adaptor.addChild(root_0, nameExpression7.getTree());\n\n \t \t }\n \t \t break;\n\n \t \tdefault :\n \t \t if ( cnt4 >= 1 ) break loop4;\n \t \t if (state.backtracking>0) {state.failed=true; return retval;}\n \t EarlyExitException eee =\n \t new EarlyExitException(4, input);\n \t throw eee;\n \t }\n \t cnt4++;\n \t } while (true);\n\n \t // C:\\\\work\\\\art\\\\latest-code\\\\vclang-code-dd0a89f0d579f02ec8c3d8cd398ea8f7cbb445aa\\\\src\\\\art\\\\grammar\\\\expression.g:40:30: ( STRING )*\n \t loop5:\n \t do {\n \t int alt5=2;\n \t int LA5_0 = input.LA(1);\n\n \t if ( (LA5_0==STRING) ) {\n \t int LA5_2 = input.LA(2);\n\n \t if ( (synpred7_expression()) ) {\n \t alt5=1;\n \t }\n\n\n \t }\n\n\n \t switch (alt5) {\n \t \tcase 1 :\n \t \t // C:\\\\work\\\\art\\\\latest-code\\\\vclang-code-dd0a89f0d579f02ec8c3d8cd398ea8f7cbb445aa\\\\src\\\\art\\\\grammar\\\\expression.g:0:0: STRING\n \t \t {\n \t \t STRING8=(Token)match(input,STRING,FOLLOW_STRING_in_stringExpression163); if (state.failed) return retval;\n \t \t if ( state.backtracking==0 ) {\n \t \t STRING8_tree = (CommonTree)adaptor.create(STRING8);\n \t \t adaptor.addChild(root_0, STRING8_tree);\n \t \t }\n\n \t \t }\n \t \t break;\n\n \t \tdefault :\n \t \t break loop5;\n \t }\n \t } while (true);\n\n\n \t }\n \t break;\n\n \tdefault :\n \t if ( cnt6 >= 1 ) break loop6;\n \t if (state.backtracking>0) {state.failed=true; return retval;}\n EarlyExitException eee =\n new EarlyExitException(6, input);\n throw eee;\n }\n cnt6++;\n } while (true);\n\n\n }\n\n retval.stop = input.LT(-1);\n\n if ( state.backtracking==0 ) {\n\n retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);\n adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);\n }\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n \tretval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);\n\n }\n finally {\n }\n return retval;\n }",
"public StringConversionNode(Tree tree, Node operand, TypeMirror type) {\n super(type);\n this.tree = tree;\n this.operand = operand;\n }",
"String getSourceExpression();",
"@JsonCreator\n public static QueryStringOperator fromString(String name) {\n return fromString(name, QueryStringOperator.class);\n }",
"StringContent createStringContent();",
"VariableExp createVariableExp();",
"public ExpressionGuard(final String expression)\n throws InvalidExpressionException, IllegalArgumentException {\n if (expression == null) {\n throw new IllegalArgumentException(\"`expression' must not be null.\");\n }\n try {\n this.compiledExpression = MVEL.compileExpression(expression);\n this.expression = expression;\n } catch (final CompileException exc) {\n throw new InvalidExpressionException(exc);\n }\n }",
"public String getEquationString()\r\n\t{\r\n\t\tcheckInitialization();\r\n\t\treturn equationString;\r\n\t}",
"@Test\r\n public void testToString() {\r\n System.out.println(\"toString\");\r\n Assignment instance = new Assignment();\r\n String expResult = \":=\";\r\n String result = instance.toString();\r\n assertEquals(expResult, result);\r\n }",
"public T caseExprString(ExprString object)\n {\n return null;\n }",
"public Expr getExpression()\n {\n Parser.validateExpr(expression, analysis);\n return expression;\n }",
"@JsonCreator\n public Filter(String filterStr) {\n Matcher matcher = FILTER_PATTERN.matcher(filterStr);\n if (matcher.find()) {\n _expression = filterStr;\n _leftOperand = getOperand(matcher.group(1));\n _operator = Operator.fromString(matcher.group(2).replaceAll(\"\\\\s+\", \"\"));\n _rightOperand = getOperand(matcher.group(4));\n } else {\n throw new IllegalArgumentException(\"Illegal filter string pattern: '\" + filterStr + \"'\");\n }\n }",
"public static void main(String args[]) {\n String str1 = new String(\"Java strings are objects.\");\n String str2 = \"They are constructed various ways.\";\n String str3 = new String(str2);\n\n String test = \"this is a string\";\n test = \"this is a new string\";\n\n String b = \" This\" + \" is \" + \"a \" + \"String\";\n\n\n System.out.println(str1);\n System.out.println(str2);\n System.out.println(str3);\n System.out.println(test);\n System.out.println(b);\n }",
"public ExpressionTree(String initValue) {\n\t\tsuper(initValue);\n\t}"
]
| [
"0.7377427",
"0.704686",
"0.70112157",
"0.6882274",
"0.6789951",
"0.665015",
"0.6620442",
"0.6448834",
"0.64384943",
"0.6429967",
"0.63961476",
"0.63961476",
"0.63713145",
"0.6340662",
"0.6334656",
"0.631123",
"0.62969875",
"0.6295564",
"0.62040377",
"0.62001693",
"0.6139867",
"0.61167693",
"0.6103864",
"0.60504216",
"0.60416734",
"0.6037934",
"0.600357",
"0.5999637",
"0.59363604",
"0.588915",
"0.5882675",
"0.5882675",
"0.5882675",
"0.5882675",
"0.5859368",
"0.5837794",
"0.58209413",
"0.58126485",
"0.58126485",
"0.58126485",
"0.58126485",
"0.5808338",
"0.577882",
"0.5777144",
"0.57637197",
"0.5753663",
"0.57176083",
"0.5713774",
"0.5685381",
"0.56766367",
"0.5660532",
"0.56591964",
"0.56575745",
"0.5637793",
"0.56332994",
"0.5623437",
"0.5621084",
"0.55963534",
"0.55616987",
"0.5554149",
"0.5554",
"0.5532626",
"0.5532626",
"0.5532626",
"0.5523352",
"0.55057406",
"0.55",
"0.5487247",
"0.54779893",
"0.5468021",
"0.546728",
"0.54573816",
"0.5455074",
"0.5452894",
"0.5448801",
"0.54451203",
"0.54398257",
"0.54398257",
"0.5437605",
"0.54359245",
"0.5431058",
"0.5403412",
"0.5397764",
"0.53894085",
"0.5385521",
"0.5382946",
"0.5379323",
"0.5368084",
"0.53677934",
"0.5367021",
"0.53647345",
"0.53536785",
"0.53512406",
"0.5342613",
"0.5318992",
"0.53115505",
"0.5308265",
"0.5308262",
"0.5304869",
"0.5302666"
]
| 0.88248414 | 0 |
Returns a new object of class 'Boolean Expression'. | BooleanExpression createBooleanExpression(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"BooleanLiteralExp createBooleanLiteralExp();",
"<C> BooleanLiteralExp<C> createBooleanLiteralExp();",
"BooleanValue createBooleanValue();",
"BooleanValue createBooleanValue();",
"BooleanValue createBooleanValue();",
"BooleanValue createBooleanValue();",
"String getBooleanTrueExpression();",
"BoolOperation createBoolOperation();",
"public interface BooleanExpression extends Expression {\n /**\n * Evaluate the expression\n * \n * @return the result of the evaluation (true or false)\n */\n boolean evaluate();\n}",
"public static Predicate<Boolean> identity() {\n return new Predicate<Boolean>() {\n\n @Override\n public boolean test(Boolean b) {\n return b;\n }\n\n };\n }",
"public Boolean asBoolean();",
"public TruthExpression() {\r\n\t\tsuper(new Expression[]{});\r\n\t\tthis.truthValue = TruthValue.FALSE;\r\n\t}",
"ConditionalExpression createConditionalExpression();",
"boolean booleanOf();",
"public BooleanLit createTrue(Position pos) {\n return (BooleanLit) xnf.BooleanLit(pos, true).type(xts.Boolean());\n }",
"String getBooleanFalseExpression();",
"public BooleanExpTest(String name) {\n\t\tsuper(name);\n\t}",
"protected BooleanQuery.Builder newBooleanQuery() {\n return new BooleanQuery.Builder();\n }",
"Expression createExpression();",
"BoolConstant createBoolConstant();",
"String getBooleanExpression(boolean flag);",
"public static Value makeBool(boolean b) {\n if (b)\n return theBoolTrue;\n else\n return theBoolFalse;\n }",
"public Boolean() {\n\t\tsuper(false);\n\t}",
"abstract public boolean getAsBoolean();",
"public static final BooleanConstantTrue getTrue()\n {\n return new BooleanConstant.BooleanConstantTrue();\n }",
"public final AliaChecker.boolean_expr_return boolean_expr() throws RecognitionException {\n\t\tAliaChecker.boolean_expr_return retval = new AliaChecker.boolean_expr_return();\n\t\tretval.start = input.LT(1);\n\n\t\tCommonTree root_0 = null;\n\n\t\tCommonTree _first_0 = null;\n\t\tCommonTree _last = null;\n\n\n\t\tCommonTree set26=null;\n\n\t\tCommonTree set26_tree=null;\n\n\t\ttry {\n\t\t\t// src\\\\alia\\\\AliaChecker.g:295:14: ( TRUE | FALSE )\n\t\t\t// src\\\\alia\\\\AliaChecker.g:\n\t\t\t{\n\t\t\troot_0 = (CommonTree)adaptor.nil();\n\n\n\t\t\t_last = (CommonTree)input.LT(1);\n\t\t\tset26=(CommonTree)input.LT(1);\n\t\t\tif ( input.LA(1)==FALSE||input.LA(1)==TRUE ) {\n\t\t\t\tinput.consume();\n\t\t\t\tset26_tree = (CommonTree)adaptor.dupNode(set26);\n\n\n\t\t\t\tadaptor.addChild(root_0, set26_tree);\n\n\t\t\t\tstate.errorRecovery=false;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tMismatchedSetException mse = new MismatchedSetException(null,input);\n\t\t\t\tthrow mse;\n\t\t\t}\n\n\t\t\t \n\n\t\t\t}\n\n\t\t\tretval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);\n\n\t\t}\n\t\t \n\t\t catch (RecognitionException e) { \n\t\t \tif(!e.getMessage().equals(\"\")) {\n\t\t\t\t\tSystem.err.println(\"Exception!:\"+e.getMessage());\n\t\t\t\t}\n\t\t\t\tthrow (new AliaException(\"\"));\n\t\t } \n\n\t\tfinally {\n\t\t\t// do for sure before leaving\n\t\t}\n\t\treturn retval;\n\t}",
"public Expression convertToMutableBooleanExpression(ImmutableExpression booleanExpression) {\n OperationPredicate pred = booleanExpression.getFunctionSymbol();\n return termFactory.getExpression(pred, convertToMutableTerms(booleanExpression.getTerms()));\n }",
"@JsSupport( {JsVersion.MOZILLA_ONE_DOT_ONE, \r\n\t\tJsVersion.JSCRIPT_TWO_DOT_ZERO})\r\npublic interface Boolean extends Object {\r\n\t\r\n\t@Constructor void Boolean();\r\n\t\r\n\t@Constructor void Boolean(boolean value);\r\n\t\r\n\t@Constructor void Boolean(Number value);\r\n\t\r\n\t@Constructor void Boolean(String value);\r\n\t\r\n\t@Function boolean valueOf();\r\n\t\r\n}",
"public RubyBoolean getTrue() {\n return trueObject;\n }",
"@Override\n public Expression translateSyntacticSugar() {\n return new Condition(this.e1, BooleanConstant.TRUE, this.e2);\n }",
"public T caseExpression_Boolean(Expression_Boolean object)\r\n {\r\n return null;\r\n }",
"@Override\n\tpublic String visitBoolExpr(BoolExprContext ctx) {\n\t\tint childrenNo=ctx.children.size();\n\t\tif (childrenNo == 3 )\n\t\t{\n\t\t\tParseTree n=ctx.getChild(1);\t\t\t\n\t\t\tif (!(n instanceof TerminalNode)) return visit(n); //( boolExpr ) \n\t\t\telse if(n.equals(ctx.COMP())) {\n\t\t\t\tString firstOpType=visit(ctx.getChild(0)); //|arExpr COMP arExpr\n\t\t\t\tString secondOpType=visit(ctx.getChild(2)); \n\t\t\t\tif(!((firstOpType.equals(\"int\"))&&(secondOpType.equals(\"int\")))) throw new RuntimeException(\"you can only compare integer types\");\n\t\t\t\treturn \"boolean\";\n\t\t\t}else if(n==ctx.EQ()){\t\t\t\t\t\t\t\t\t\t\t//|arExpr EQ arExpr\n\t\t\t\tString firstOpType=visit(ctx.getChild(0)); \n\t\t\t\tString secondOpType=visit(ctx.getChild(2)); \t\t\t\t\n\t\t\t\tif(!(((firstOpType.equals(\"int\"))&&(secondOpType.equals(\"int\")))||((firstOpType.equals(\"char\"))&&(secondOpType.equals(\"char\"))))) throw new RuntimeException(\"you can only use\"\n\t\t\t\t\t\t+ \"\\\"==\\\" operator on integer or character types\");\n\t\t\t\treturn \"boolean\";\n\t\t\t}else if(n==ctx.AND()||n==ctx.OR()){ //|boolExpr (AND|OR)boolExpr\n\t\t\t\tString firstOpType=visit(ctx.getChild(0));\n\t\t\t\tString secondOpType=visit(ctx.getChild(2));\n\t\t\t\tif(!(firstOpType.equals(\"boolean\"))&&(secondOpType.equals(\"boolean\"))) throw new RuntimeException(\"you can only use boolean operators on boolean expressions\");\n\t\t\t\treturn \"boolean\";\n\t\t\t}\n\t\t} else if (childrenNo == 2 ) { //|NOT boolExpr\n\t\t\tString exprType=visit(ctx.getChild(1));\n\t\t\tif (!exprType.equals(\"boolean\")) throw new RuntimeException(\"NOT operator works only with boolean expresssions\");\n\t\t\t\treturn \"boolean\";\n\t\t}else {\t\t\t\t\t\t\t\t//|(ID|property|BOOLEANLIT|arrIdExpr|methodCall)\n\t\t\tParseTree n=ctx.getChild(0);\n\t\t\tif (n instanceof TerminalNode) {\t\t\t\t\n\t\t\t\tif (n==ctx.BOOLEANLIT()) return \"boolean\";\n\t\t\t\telse if(n==ctx.ID()){\n\t\t\t\t\tString key=visitTerminal((TerminalNode)n);\n\t\t\t\t\tRecord id= table.lookup(key);\n\t\t\t\t\tif (id==null) throw new RuntimeException(\"Identifier \"+key+\" is not declared\");\t\t\t\t\t\n\t\t\t\t\treturn id.getReturnType();\n\t\t\t\t\t\n\t\t\t\t}\t\t\t \n\t\t\t}else {\n\t\t\t\tString type=visit(ctx.getChild(0));\n\t\t\t\treturn type;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn null; //for debug\n\t}",
"static Nda<Boolean> of( boolean... value ) { return Tensor.of( Boolean.class, Shape.of( value.length ), value ); }",
"public FluentExp<Boolean> and (SQLExpression<Boolean> expr)\n {\n return Ops.and(this, expr);\n }",
"@Test\n public void testBooleanLiteralTrue2() throws Exception {\n Boolean expected = Boolean.TRUE;\n String sql = \"SELECT TRUE\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n Node constantNode = verifyExpressionSymbol(selectNode, Select.SYMBOLS_REF_NAME, Constant.ID);\n verifyProperty(constantNode, Constant.VALUE_PROP_NAME, expected);\n verifyProperty(constantNode, Expression.TYPE_CLASS_PROP_NAME, DataTypeName.BOOLEAN.name());\n \n verifySql(\"SELECT TRUE\", fileNode);\n }",
"public Cond newCond() {\n return new Cond();\n }",
"JavaExpression createJavaExpression();",
"public BooleanValue(boolean bool) {\r\n this.val = bool;\r\n }",
"public boolean isExpression (Object value);",
"public TrueValue (){\n }",
"@Test\n public void testBooleanLiteralFalse2() throws Exception {\n Boolean expected = Boolean.FALSE;\n String sql = \"SELECT {b'false'}\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n Node constantNode = verifyExpressionSymbol(selectNode, Select.SYMBOLS_REF_NAME, Constant.ID);\n verifyProperty(constantNode, Constant.VALUE_PROP_NAME, expected);\n verifyProperty(constantNode, Expression.TYPE_CLASS_PROP_NAME, DataTypeName.BOOLEAN.name());\n\n verifySql(\"SELECT FALSE\", fileNode);\n }",
"public static VariableValue createValueObject(boolean value) {\n\t\treturn new BooleanValue(value);\n\t}",
"public boolean evaluatesToTrue(final String jsExpression);",
"private boolean evaluateBooleanExpression(String expression)\n {\n CoreInstance value = (CoreInstance) evaluateExpression(expression, M3Paths.Boolean, true);\n if (value instanceof BooleanCoreInstance)\n {\n return ((BooleanCoreInstance) value).getValue();\n }\n\n String valueName = value.getName();\n if (ModelRepository.BOOLEAN_TRUE.equals(valueName))\n {\n return true;\n }\n if (ModelRepository.BOOLEAN_FALSE.equals(valueName))\n {\n return false;\n }\n\n throw new RuntimeException(\"Expected boolean value, got: \" + valueName);\n }",
"public boolean getBoolean();",
"public static TreeNode makeLiteral(Boolean booleanConstant) {\n return new BooleanNode(booleanConstant);\n }",
"public static UnaryExpression isFalse(Expression expression) { throw Extensions.todo(); }",
"public interface BoolExprVisitor\n{\n void visit(AndExpr e);\n\n void visit(EqExpr e);\n\n void visit(ExistentialQuantifier e);\n\n void visit(GreaterEqExpr e);\n\n void visit(GreaterExpr e);\n\n void visit(ImplExpr e);\n\n void visit(LessEqExpr e);\n\n void visit(LessExpr e);\n\n void visit(NegExpr e);\n\n void visit(OrExpr e);\n\n void visit(UniversalQuantifier e);\n}",
"boolean getBoolean();",
"boolean getBoolean();",
"public static UnaryExpression isTrue(Expression expression) { throw Extensions.todo(); }",
"BooleanExpression gteq(T t);",
"boolean getBoolValue();",
"boolean getBoolValue();",
"@Override\n\t\tpublic BooleanType toBooleanType() {\n\t\t\treturn new BooleanType(false);\n\t\t}",
"@Override\n\t\tpublic BooleanType toBooleanType() {\n\t\t\treturn new BooleanType(false);\n\t\t}",
"private BooleanFunctions()\n {\n }",
"default boolean asBool() {\n\t\tthrow new EvaluatorException(\"Expecting a bool value\");\n\t}",
"public T caseExprBool(ExprBool object)\n {\n return null;\n }",
"Expression() { }",
"@Override\r\n\tpublic Object visitBooleanLiteralExpression(\r\n\t\t\tBooleanLiteralExpression booleanLiteralExpression, Object arg)\r\n\t\t\tthrows Exception {\n\t if(booleanLiteralExpression.booleanLiteral.getText().equals(\"false\"))\r\n\t {\r\n\t mv.visitLdcInsn(new Boolean(false));\r\n\t }\r\n\t else\r\n\t {\r\n\t mv.visitLdcInsn(new Boolean(true));\r\n\t }\r\n if(arg != null)\r\n {\r\n// mv.visitMethodInsn(INVOKESTATIC, \"java/lang/Boolean\", \"valueOf\", \"(Z)Ljava/lang/Boolean;\");\r\n }\r\n\t return \"Z\";\r\n\t}",
"public StatementNode getStatementNodeOnTrue();",
"boolean isEBoolean();",
"public BooleanValue(boolean value) {\r\n\t\tthis.value = value;\r\n\t}",
"public BooleanValue(boolean value) {\r\n\t\tthis.value = value;\r\n\t}",
"public T caseBooleanExpression(BooleanExpression object) {\n\t\treturn null;\n\t}",
"public BooleanLit createFalse(Position pos) {\n return (BooleanLit) xnf.BooleanLit(pos, false).type(xts.Boolean());\n }",
"public LogicalOperator() {\n this.logical = Logical.And;\n }",
"public DBBoolean() {\n\t}",
"public boolean isBoolean();",
"public Literal getLiteralBoolean(Boolean literalData);",
"public DBBoolean(Boolean bool) {\n\t\tsuper(bool);\n\t}",
"public static UnaryExpression isTrue(Expression expression, Method method) { throw Extensions.todo(); }",
"static Nda<Boolean> of( Shape shape, boolean... values ) { return Tensor.ofAny( Boolean.class, shape, values ); }",
"IfExp createIfExp();",
"public void build(List<Node> booleanExpressionToAdd) throws TreeParsingException { \r\n this.tokenType = JdbcGrammarParser.WHEREEXPRESSION;\r\n this.tokenName = JdbcGrammarParser.tokenNames[this.tokenType];\r\n this.logger.debug(\"BUILDING \" + this.tokenName + \"from booleanExpressions\");\r\n \r\n if(booleanExpressionToAdd.size() == 1 && \r\n booleanExpressionToAdd.get(0).getTokenType() == JdbcGrammarParser.BOOLEANEXPRESSIONITEM){\r\n this.expression = booleanExpressionToAdd.get(0);\r\n \r\n //Resolve new pointed Columns\r\n WhereExpressionJoinResolver.columnResolver(\r\n (BooleanExpressionItem)this.expression, this.selectStatement);\r\n }\r\n else {\r\n this.expression = new Conjunction(booleanExpressionToAdd, selectStatement);\r\n }\r\n }",
"public Boolean booleanValue() {\n\t\tif (this.getLiteralValue() instanceof Boolean) {\n\t\t\treturn (Boolean) this.getLiteralValue();\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}",
"public static UnaryExpression isFalse(Expression expression, Method method) { throw Extensions.todo(); }",
"public PropertyBoolean(String name) {\n super(name);\n }",
"Equality createEquality();",
"public static BooleanConstantFalse getFalse()\n {\n return new BooleanConstant.BooleanConstantFalse();\n }",
"public Boolean getBooleanAttribute();",
"public interface UnaryBooleanExpressionProperty extends BooleanExpressionProperty<BooleanExpression>, UnaryProperty<BooleanExpressionProperty<BooleanExpression>, BooleanExpression> {\n}",
"public ExpressionSearch exp(boolean and)\n\t\t{\n\t\t\treturn new ExpressionSearch(and);\n\t\t}",
"BooleanExpression lteq(T t);",
"public final EObject ruleExpression_1() throws RecognitionException {\n EObject current = null;\n int ruleExpression_1_StartIndex = input.index();\n EObject this_Expression_2_0 = null;\n\n Enumerator lv_op_2_0 = null;\n\n EObject lv_rhs_3_0 = null;\n\n\n enterRule(); \n \n try {\n if ( state.backtracking>0 && alreadyParsedRule(input, 86) ) { return current; }\n // ../de.jevopi.mitra2/src-gen/de/jevopi/mitra2/parser/antlr/internal/InternalMitraParser.g:3786:28: ( (this_Expression_2_0= ruleExpression_2 ( () ( (lv_op_2_0= ruleBooleanOperator ) ) ( (lv_rhs_3_0= ruleExpression_2 ) ) )* ) )\n // ../de.jevopi.mitra2/src-gen/de/jevopi/mitra2/parser/antlr/internal/InternalMitraParser.g:3787:1: (this_Expression_2_0= ruleExpression_2 ( () ( (lv_op_2_0= ruleBooleanOperator ) ) ( (lv_rhs_3_0= ruleExpression_2 ) ) )* )\n {\n // ../de.jevopi.mitra2/src-gen/de/jevopi/mitra2/parser/antlr/internal/InternalMitraParser.g:3787:1: (this_Expression_2_0= ruleExpression_2 ( () ( (lv_op_2_0= ruleBooleanOperator ) ) ( (lv_rhs_3_0= ruleExpression_2 ) ) )* )\n // ../de.jevopi.mitra2/src-gen/de/jevopi/mitra2/parser/antlr/internal/InternalMitraParser.g:3788:2: this_Expression_2_0= ruleExpression_2 ( () ( (lv_op_2_0= ruleBooleanOperator ) ) ( (lv_rhs_3_0= ruleExpression_2 ) ) )*\n {\n if ( state.backtracking==0 ) {\n \n \t /* */ \n \t\n }\n if ( state.backtracking==0 ) {\n \n newCompositeNode(grammarAccess.getExpression_1Access().getExpression_2ParserRuleCall_0()); \n \n }\n pushFollow(FOLLOW_ruleExpression_2_in_ruleExpression_17599);\n this_Expression_2_0=ruleExpression_2();\n\n state._fsp--;\n if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n current = this_Expression_2_0;\n afterParserOrEnumRuleCall();\n \n }\n // ../de.jevopi.mitra2/src-gen/de/jevopi/mitra2/parser/antlr/internal/InternalMitraParser.g:3799:1: ( () ( (lv_op_2_0= ruleBooleanOperator ) ) ( (lv_rhs_3_0= ruleExpression_2 ) ) )*\n loop66:\n do {\n int alt66=2;\n alt66 = dfa66.predict(input);\n switch (alt66) {\n \tcase 1 :\n \t // ../de.jevopi.mitra2/src-gen/de/jevopi/mitra2/parser/antlr/internal/InternalMitraParser.g:3799:2: () ( (lv_op_2_0= ruleBooleanOperator ) ) ( (lv_rhs_3_0= ruleExpression_2 ) )\n \t {\n \t // ../de.jevopi.mitra2/src-gen/de/jevopi/mitra2/parser/antlr/internal/InternalMitraParser.g:3799:2: ()\n \t // ../de.jevopi.mitra2/src-gen/de/jevopi/mitra2/parser/antlr/internal/InternalMitraParser.g:3800:2: \n \t {\n \t if ( state.backtracking==0 ) {\n \t \n \t \t /* */ \n \t \t\n \t }\n \t if ( state.backtracking==0 ) {\n\n \t current = forceCreateModelElementAndSet(\n \t grammarAccess.getExpression_1Access().getBooleanExpressionLhsAction_1_0(),\n \t current);\n \t \n \t }\n\n \t }\n\n \t // ../de.jevopi.mitra2/src-gen/de/jevopi/mitra2/parser/antlr/internal/InternalMitraParser.g:3808:2: ( (lv_op_2_0= ruleBooleanOperator ) )\n \t // ../de.jevopi.mitra2/src-gen/de/jevopi/mitra2/parser/antlr/internal/InternalMitraParser.g:3809:1: (lv_op_2_0= ruleBooleanOperator )\n \t {\n \t // ../de.jevopi.mitra2/src-gen/de/jevopi/mitra2/parser/antlr/internal/InternalMitraParser.g:3809:1: (lv_op_2_0= ruleBooleanOperator )\n \t // ../de.jevopi.mitra2/src-gen/de/jevopi/mitra2/parser/antlr/internal/InternalMitraParser.g:3810:3: lv_op_2_0= ruleBooleanOperator\n \t {\n \t if ( state.backtracking==0 ) {\n \t \n \t \t newCompositeNode(grammarAccess.getExpression_1Access().getOpBooleanOperatorEnumRuleCall_1_1_0()); \n \t \t \n \t }\n \t pushFollow(FOLLOW_ruleBooleanOperator_in_ruleExpression_17632);\n \t lv_op_2_0=ruleBooleanOperator();\n\n \t state._fsp--;\n \t if (state.failed) return current;\n \t if ( state.backtracking==0 ) {\n\n \t \t if (current==null) {\n \t \t current = createModelElementForParent(grammarAccess.getExpression_1Rule());\n \t \t }\n \t \t\tset(\n \t \t\t\tcurrent, \n \t \t\t\t\"op\",\n \t \t\tlv_op_2_0, \n \t \t\t\"BooleanOperator\");\n \t \t afterParserOrEnumRuleCall();\n \t \t \n \t }\n\n \t }\n\n\n \t }\n\n \t // ../de.jevopi.mitra2/src-gen/de/jevopi/mitra2/parser/antlr/internal/InternalMitraParser.g:3826:2: ( (lv_rhs_3_0= ruleExpression_2 ) )\n \t // ../de.jevopi.mitra2/src-gen/de/jevopi/mitra2/parser/antlr/internal/InternalMitraParser.g:3827:1: (lv_rhs_3_0= ruleExpression_2 )\n \t {\n \t // ../de.jevopi.mitra2/src-gen/de/jevopi/mitra2/parser/antlr/internal/InternalMitraParser.g:3827:1: (lv_rhs_3_0= ruleExpression_2 )\n \t // ../de.jevopi.mitra2/src-gen/de/jevopi/mitra2/parser/antlr/internal/InternalMitraParser.g:3828:3: lv_rhs_3_0= ruleExpression_2\n \t {\n \t if ( state.backtracking==0 ) {\n \t \n \t \t newCompositeNode(grammarAccess.getExpression_1Access().getRhsExpression_2ParserRuleCall_1_2_0()); \n \t \t \n \t }\n \t pushFollow(FOLLOW_ruleExpression_2_in_ruleExpression_17653);\n \t lv_rhs_3_0=ruleExpression_2();\n\n \t state._fsp--;\n \t if (state.failed) return current;\n \t if ( state.backtracking==0 ) {\n\n \t \t if (current==null) {\n \t \t current = createModelElementForParent(grammarAccess.getExpression_1Rule());\n \t \t }\n \t \t\tset(\n \t \t\t\tcurrent, \n \t \t\t\t\"rhs\",\n \t \t\tlv_rhs_3_0, \n \t \t\t\"Expression_2\");\n \t \t afterParserOrEnumRuleCall();\n \t \t \n \t }\n\n \t }\n\n\n \t }\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break loop66;\n }\n } while (true);\n\n\n }\n\n\n }\n\n if ( state.backtracking==0 ) {\n leaveRule(); \n }\n }\n \n \tcatch (RecognitionException re) { \n \t recover(input,re); \n \t appendSkippedTokens();\n \t}\n finally {\n if ( state.backtracking>0 ) { memoize(input, 86, ruleExpression_1_StartIndex); }\n }\n return current;\n }",
"public SPARQLBooleanXMLParser() {\n\t\tsuper();\n\t}",
"public T caseBooleanBinaryExpression(BooleanBinaryExpression object) {\n\t\treturn null;\n\t}",
"public final short getExprType()\n {\n return XPathExpression.BOOLEAN;\n }",
"public Expression asExpression() {\n switch (TYPE) {\n case EXPRESSION:\n return EXPRESSION;\n case IDENTIFIER:\n return new Variable(VALUE);\n case LITERAL:\n if (VALUE.matches(\"\\\\d+\")) {\n return new LInteger(Integer.parseInt(VALUE));\n } else if (VALUE.equals(\"true\") || VALUE.equals(\"false\")) {\n return LBoolean.resolve(VALUE.equals(\"true\"));\n } else if (VALUE.equals(\"null\")) {\n return LNull.NULL;\n } else {\n return new LString(VALUE);\n }\n default:\n throw ErrorLog.get(\"Unexpected symbol '%s'\", VALUE);\n }\n }",
"public T caseOpBool(OpBool object)\n {\n return null;\n }",
"@Override\n public void codeGenBoolExpr(DecacCompiler compiler, boolean condToranch, Label label) {\n }",
"public AttributeBooleanType buildUnchecked() {\n return new AttributeBooleanTypeImpl();\n }",
"public static Value makeAnyBool() {\n return theBoolAny;\n }",
"public static Value makeBool(Bool b) {\n if (b.isMaybeAnyBool())\n return theBoolAny;\n else if (b.isMaybeTrueButNotFalse())\n return theBoolTrue;\n else if (b.isMaybeFalseButNotTrue())\n return theBoolFalse;\n else\n return theNone;\n }",
"public final EObject ruleBooleanLiteral() throws RecognitionException {\n EObject current = null;\n\n Token otherlv_1=null;\n Token lv_isTrue_2_0=null;\n\n enterRule(); \n \n try {\n // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:1918:28: ( ( () (otherlv_1= 'false' | ( (lv_isTrue_2_0= 'true' ) ) ) ) )\n // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:1919:1: ( () (otherlv_1= 'false' | ( (lv_isTrue_2_0= 'true' ) ) ) )\n {\n // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:1919:1: ( () (otherlv_1= 'false' | ( (lv_isTrue_2_0= 'true' ) ) ) )\n // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:1919:2: () (otherlv_1= 'false' | ( (lv_isTrue_2_0= 'true' ) ) )\n {\n // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:1919:2: ()\n // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:1920:5: \n {\n if ( state.backtracking==0 ) {\n\n current = forceCreateModelElement(\n grammarAccess.getBooleanLiteralAccess().getBooleanLiteralAction_0(),\n current);\n \n }\n\n }\n\n // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:1925:2: (otherlv_1= 'false' | ( (lv_isTrue_2_0= 'true' ) ) )\n int alt25=2;\n int LA25_0 = input.LA(1);\n\n if ( (LA25_0==48) ) {\n alt25=1;\n }\n else if ( (LA25_0==49) ) {\n alt25=2;\n }\n else {\n if (state.backtracking>0) {state.failed=true; return current;}\n NoViableAltException nvae =\n new NoViableAltException(\"\", 25, 0, input);\n\n throw nvae;\n }\n switch (alt25) {\n case 1 :\n // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:1925:4: otherlv_1= 'false'\n {\n otherlv_1=(Token)match(input,48,FOLLOW_48_in_ruleBooleanLiteral4564); if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n \tnewLeafNode(otherlv_1, grammarAccess.getBooleanLiteralAccess().getFalseKeyword_1_0());\n \n }\n\n }\n break;\n case 2 :\n // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:1930:6: ( (lv_isTrue_2_0= 'true' ) )\n {\n // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:1930:6: ( (lv_isTrue_2_0= 'true' ) )\n // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:1931:1: (lv_isTrue_2_0= 'true' )\n {\n // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:1931:1: (lv_isTrue_2_0= 'true' )\n // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:1932:3: lv_isTrue_2_0= 'true'\n {\n lv_isTrue_2_0=(Token)match(input,49,FOLLOW_49_in_ruleBooleanLiteral4588); if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n newLeafNode(lv_isTrue_2_0, grammarAccess.getBooleanLiteralAccess().getIsTrueTrueKeyword_1_1_0());\n \n }\n if ( state.backtracking==0 ) {\n\n \t if (current==null) {\n \t current = createModelElement(grammarAccess.getBooleanLiteralRule());\n \t }\n \t\tsetWithLastConsumed(current, \"isTrue\", true, \"true\");\n \t \n }\n\n }\n\n\n }\n\n\n }\n break;\n\n }\n\n\n }\n\n\n }\n\n if ( state.backtracking==0 ) {\n leaveRule(); \n }\n }\n \n catch (RecognitionException re) { \n recover(input,re); \n appendSkippedTokens();\n } \n finally {\n }\n return current;\n }",
"@Override\n public Expression toExpression()\n {\n return new ComparisonExpression(getType(this.compareType), lvalue.toExpression(), rvalue.toExpression());\n }",
"public T caseBooleanUnaryExpression(BooleanUnaryExpression object) {\n\t\treturn null;\n\t}",
"protected ICompilerBooleanValue bExpression() throws InvalidConditionantException,\r\n\t\t\t\t\t\t\t\t\t TableFunctionMalformedException{\r\n\t\t\r\n\t\tICompilerBooleanValue val1 = bTerm();\r\n\t\t\r\n\t\t// LOOK FOR OR (OPTIONAL)\r\n\t\t// scan();\r\n\t\tif (look == '|') {\r\n\t\t\tmatch('|');\r\n\t\t\tICompilerBooleanValue val2 = bTerm();\r\n\t\t\t// Debug.println(\"EXITING BEXPRESSION AS OR\");\r\n\t\t\tif (look == '|') {\r\n\t\t\t\tmatch('|');\r\n\t\t\t\treturn new CompilerOrValue(val1, new CompilerOrValue(val2,bExpression()));\r\n\t\t\t} else {\r\n\t\t\t\treturn new CompilerOrValue(val1, val2);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t// Debug.println(\"EXITING BEXPRESSION AS SINGLE TERM\");\t\t\t\r\n\t\t\treturn val1;\r\n\t\t}\r\n\t\t\r\n\t}"
]
| [
"0.79013765",
"0.75354683",
"0.72424734",
"0.72424734",
"0.72424734",
"0.72424734",
"0.7068344",
"0.7025785",
"0.7023201",
"0.6860355",
"0.6772086",
"0.6769698",
"0.66121",
"0.6548617",
"0.65322894",
"0.65138686",
"0.6497015",
"0.6490278",
"0.63960195",
"0.63588744",
"0.6353528",
"0.6319711",
"0.6293218",
"0.6277515",
"0.62543994",
"0.6227589",
"0.62182444",
"0.6161342",
"0.61423784",
"0.6133303",
"0.61055636",
"0.60933006",
"0.6075746",
"0.6060533",
"0.6060335",
"0.60393333",
"0.60276234",
"0.6025645",
"0.6021568",
"0.6014605",
"0.6013239",
"0.59994566",
"0.59884036",
"0.5986495",
"0.59750116",
"0.5971686",
"0.5968604",
"0.5943338",
"0.59365016",
"0.59365016",
"0.5931738",
"0.59251946",
"0.5919612",
"0.5919612",
"0.5915827",
"0.5915827",
"0.5873777",
"0.5833611",
"0.5831107",
"0.5831035",
"0.580967",
"0.57964617",
"0.57945323",
"0.5775972",
"0.5775972",
"0.57752806",
"0.5774051",
"0.57687896",
"0.5753349",
"0.5750433",
"0.57458746",
"0.57399154",
"0.5723475",
"0.5720377",
"0.5706758",
"0.57057554",
"0.5697237",
"0.56953984",
"0.56902325",
"0.5688327",
"0.5684881",
"0.56846064",
"0.56830215",
"0.56822884",
"0.56800735",
"0.56775874",
"0.56747997",
"0.5673397",
"0.5660248",
"0.56484294",
"0.5644943",
"0.5641457",
"0.5625984",
"0.5620755",
"0.55997646",
"0.55979306",
"0.55955195",
"0.55924755",
"0.556919"
]
| 0.89447755 | 1 |
Returns a new object of class 'Rover Value'. | RoverValue createRoverValue(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Point getRoverPos()\n {\n return new Point(roverX, roverY);\n }",
"@Test\n public void Constructor_ObjectValues_InstanceCreated() {\n\t\ttry {\n Position position = make_PositionWithIntegerPoints(xCoordinate, yCoordinate, direction);\n Surface surface = make_SurfaceWithGivenDimensions(xDimension, yDimension);\n\t\t\tRover rover = make_RoverWithObjectValues(position, surface);\n\t\t}\n\t\tcatch (AssertionError assErr) {\n\t\t\t// Test passed.\n\t\t\treturn;\n\t\t}\n }",
"Rover(){\n\t\tthis.id = 0;\n\t\tthis.x = 0;\n\t\tthis.y = 0;\n\t\tthis.orientation = Directions.NORTH;\n\t\tthis.mapW=this.defaultMapW;\n\t\tthis.mapH=this.defaultMapH;\n\t}",
"@Override\n\tpublic IProperty getClone() {\n\t\treturn new Strength(myStrength);\n\t}",
"public Mover(){\n \t\n }",
"public CarValue(double value) {\n this.value = value;\n }",
"public Obj surrToValue(int surr) {\n for (int i=0 ; i < count ; i++)\n if (surrogates[i] == surr)\n return IntObj.get(values[i]);\n return IntObj.get(store.surrToValue(surr));\n }",
"private static Tensor oval() {\n Tensor poly = Tensors.of( //\n Tensors.vector(35.200, 44.933), //\n Tensors.vector(49.867, 59.200), //\n Tensors.vector(57.200, 54.800), //\n Tensors.vector(49.200, 45.067), //\n Tensors.vector(40.800, 37.333));\n poly = poly.map(scalar -> Quantity.of(scalar, SI.METER));\n return Nest.of(SUBDIVISION_RN, poly, 6).unmodifiable();\n }",
"public double getRwsValue() {\n return this.rwsValue;\n }",
"@Override \n public Score clone()\n {\n try\n { \n return (Score)super.clone();\n }\n catch(CloneNotSupportedException e)\n {\n throw new InternalError();\n }\n }",
"public ViewObjectImpl getStockPricesROVO() {\n return (ViewObjectImpl)findViewObject(\"StockPricesROVO\");\n }",
"public ShrExpr(Expression value1, Expression value2) {\n super(value1, value2);\n }",
"public abstract R getValue();",
"public void setCrossoverRate(double rate) { this.exec = this.exec.withProperty(\"ux.rate\", rate); }",
"public BackgroundRippleObject revive(){\n return this.revive(\n randomPosInObjBounds(),\n makeRandomColor()\n );\n }",
"public Clorus replicate() {\n Clorus p2 = new Clorus(energy/2.0);\n energy /= 2;\n return p2;\n }",
"@Override\n\tpublic Object clone() {\n\t\treturn new MeanVar(n, mean, s);\n\t}",
"public BaseWindowedBolt<T> withRetractor(Retractor retractor) {\n this.retractor = retractor;\n return this;\n }",
"public void setR(Double r);",
"public Troop() //make a overloaded constructor \n\t{\n\t\ttroopType = \"light\"; \n\t\tname = \"Default\";\n\t\thp = 50;\n\t\tatt = 20;\n\t}",
"public BackgroundRippleObject revive(Vector2D p, Color c){\n super.revive(p, new Vector2D());\n\n timeToLive = 255;\n radius = OBJ_RADIUS;\n rValue = c.getRed();\n gValue = c.getGreen();\n bValue = c.getBlue();\n setColor();\n return this;\n }",
"public Rogue() {\r\n\t\tsuper();\r\n\t\tthis.name =\"Rogue\";\r\n\t\tthis.attackPower = 50;\r\n\t\tthis.maxHP = 35;\r\n\t\tthis.hp = this.maxHP;\r\n\t}",
"public Property(int boardPosition, String name, int value, int rentPrice, int mortgagePrice, int redeemPrice) {\n this.boardPosition = boardPosition;\n this.name = name;\n this.value = value;\n this.rentPrice = rentPrice;\n this.mortgagePrice = mortgagePrice;\n this.isMortgaged = false;\n this.redeemPrice = redeemPrice;\n this.owner = null;\n }",
"@Override\n public Roshambo generateRoshambo() {\n playerResult = Roshambo.ROCK;\n return playerResult;\n }",
"public VectorN getR()\n\t{\n\t\tVectorN out = new VectorN(3);\n\t\tout.x[0] = this.rv.x[0];\n\t\tout.x[1] = this.rv.x[1];\n\t\tout.x[2] = this.rv.x[2];\n\t\treturn out;\n\t}",
"public double getRise(\n )\n {return rise;}",
"@Override\n public Move getMove() {\n\n return Move.ROCK;\n }",
"public StockDetailsROVOImpl getStockDetailsROVO() {\n return (StockDetailsROVOImpl)findViewObject(\"StockDetailsROVO\");\n }",
"public GeneratorLover(String name) {\n super(name);\n }",
"Expression getRValue();",
"public Resistor() {\n\t\tcomponent = \"Resistor\";\n\t\tprice = 1.99;\n\t\tsize = DEFAULT_SIZE;\n\t\tx = 0;\n\t\ty = 0;\n\t\tcolor = new Color(255, 100, 50);\n\t\torientation = \"horizontal\";\n\t}",
"public Rogue(String name) {\r\n\t\tsuper(name);\r\n\t\tthis.name +=\" the Rogue\";\r\n\t\tthis.attackPower = 50;\r\n\t\tthis.maxHP = 35;\r\n\t\tthis.hp = this.maxHP;\r\n\t}",
"private Valuable makeValuable(double value) {\n if (currency.equals(\"Baht\")) {\n if (value == 1 || value == 2 || value == 5 || value == 10)\n return new Coin(value, currency);\n else if (value == 20 || value == 50 || value == 100 || value == 500 || value == 1000) {\n return new BankNote(value, currency);\n }\n } else if (currency.equals(\"Ringgit\")) {\n if (value == 0.05 || value == 0.1 || value == 0.2 || value == 0.5)\n return new Coin(value, currency);\n else if (value == 1 || value == 2 || value == 5 || value == 10 || value == 20 || value == 50 || value == 100)\n return new BankNote(value, currency);\n }\n throw new IllegalArgumentException(\"Cannot create \" + value + \" \" + currency);\n }",
"public abstract V getValue();",
"public double getRisultato() {\r\n return risultato;\r\n }",
"public Vector2d getRre() {\n return rre;\n }",
"public Value(){}",
"ObjectValue createObjectValue();",
"public MovableObject lightClone()\n\t\t{\n\t\t\tfinal MovableObject clone = new MovableObject();\n\t\t\tclone.assCount = this.assCount;\n\t\t\tclone.associatable = this.associatable;\n\t\t\tclone.bound = this.bound;\n\t\t\tclone.coords = new int[this.coords.length];\n\t\t\tfor(int i=0; i < this.coords.length; i++)\n\t\t\t\tclone.coords[i] = this.coords[i];\n\t\t\tclone.highlighted = this.highlighted;\n\t\t\tclone.hotSpotLabel = this.hotSpotLabel;\n\t\t\tclone.keyCode = this.keyCode;\n\t\t\tclone.label = this.label;\n\t\t\tclone.maxAssociations = this.maxAssociations;\n\t\t\tif(shape.equals(\"rect\"))\n\t\t\t{\n\t\t\t\tclone.obj = new Rectangle(coords[0]-3,coords[1]-3,coords[2]+6,coords[3]+6);\n\t\t\t}\n\t\t\tif(shape.equals(\"circle\"))\n\t\t\t{\n\t\t\t\tclone.obj = new Ellipse2D.Double((coords[0]-coords[2])-4,(coords[1]-coords[2])-4,(coords[2]+2)*2,(coords[2]+2)*2);\n\t\t\t}\n\t\t\tif(shape.equals(\"ellipse\"))\n\t\t\t{\n\t\t\t\tclone.obj = new Ellipse2D.Double((coords[0]-coords[2])-4,(coords[1]-coords[2])-4,(coords[2]+2)*2,(coords[3]+2)*2);\n\t\t\t}\n\t\t\tif(shape.equals(\"poly\"))\n\t\t\t{\n\t\t\t\tfinal int xArr[] = new int[coords.length/2];\n\t\t\t\tfinal int yArr[] = new int[coords.length/2];\n\t\t\t\tint xCount = 0;\n\t\t\t\tint yCount = 0;\n\t\t\t\tfor(int i=0; i < coords.length; i++)\n\t\t\t\t{\n\t\t\t\t\tif((i%2) == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\txArr[xCount] = coords[i];\n\t\t\t\t\t\txCount++;\n\t\t\t\t\t}else\n\t\t\t\t\t{\n\t\t\t\t\t\tyArr[yCount] = coords[i];\n\t\t\t\t\t\tyCount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//TODO calculate the centre of mass\n\n\t\t\t\tclone.obj = new Polygon(xArr,yArr,xArr.length);\n\t\t\t}\n\t\t\tclone.pos = new Point(this.pos.x,this.pos.y);\n\t\t\tclone.shape = this.shape;\n\t\t\tclone.startPos = this.startPos;\n\t\t\tclone.value = this.value;\n\n\t\t\treturn clone;\n\t\t}",
"RangeValue createRangeValue();",
"public Rate rate() {\n _initialize();\n return rate;\n }",
"public abstract O value();",
"public CurrValue(Date date, Double value) {\n\t\td = date;\n\t\tval = value;\n\t}",
"@Override\r\n\tpublic RandomGenerator_Exponential clone() {\r\n\t\tRandomGenerator_Exponential rg = new RandomGenerator_Exponential();\r\n\t\trg.lambda=lambda;\r\n\t\treturn rg;\r\n\t}",
"public RXR getRXR(int rep) { \r\n return getTyped(\"RXR\", rep, RXR.class);\r\n }",
"public int R(){\r\n return R;\r\n }",
"ProxyValue createProxyValue();",
"public VoltageSource(double value, Node node1, Node node2) {\n super(node1, node2);\n this.VS_ID=++No_of_VS;\n setValue(value);\n }",
"RentalObject createRentalObject();",
"public Building getRoof();",
"Object getROIs();",
"@Override\n public Shape getCelkoveHranice() {\n return new Rectangle2D.Double(super.getX() + 22, super.getY() + 45, 45, 45);\n }",
"public Builder<V, E> setR(double r) {\n this.r = r;\n return this;\n }",
"@Override\n public T getObjRaiz() {\n return (super.getObjRaiz());\n }",
"public float getRho();",
"public Object clone() {\n\t\treturn new RelExpr((Term)getTerm(0).clone(), op, (Term)getTerm(1).clone());\n\t}",
"public interface Valuable<R> {\n\n\t/**\n\t * @return the value of this object.\n\t */\n\tR getValue();\n\n\t/**\n\t * Sets the value of this object.\n\t * \n\t * @param value - the value to set.\n\t */\n\tvoid setValue(R value);\n\n}",
"@FameProperty(name = \"duplicationRate\", derived = true)\n public Number getDuplicationRate() {\n throw new UnsupportedOperationException(\"Not yet implemented!\"); \n }",
"public PaxosRound createRound()\n {\n return createRound(0);\n }",
"public Rarity getRarity()\r\n {\r\n\treturn rare;\r\n }",
"public Value() {}",
"public int get () { return rating; }",
"public Shoe makeShoe() {\n\treturn new Shoe();\r\n}",
"@LogValue\n @Override\n public Object toLogValue() {\n return LogValueMapFactory.of(\n \"super\", super.toLogValue(),\n \"Path\", _path,\n \"RrdTool\", _rrdTool);\n }",
"public MaxAggregator replicate()\r\n {\r\n return new MaxAggregator(getProperty());\r\n }",
"IGLProperty clone();",
"public Value makeGetter() {\n Value r = new Value(this);\n r.getters = object_labels;\n r.object_labels = null;\n return canonicalize(r);\n }",
"public static RatingModel create(int value, BeerModel beerModel, UserModel userModel) {\n \t\treturn new RatingModel(value, beerModel, userModel);\n \t}",
"double getRating();",
"public Value makePolymorphic(ObjectProperty prop) {\n Value r = new Value();\n r.var = prop;\n r.flags |= flags & (ATTR | ABSENT | PRESENT_DATA | PRESENT_ACCESSOR | EXTENDEDSCOPE);\n if (isMaybePresentData())\n r.flags |= PRESENT_DATA;\n if (isMaybePresentAccessor())\n r.flags |= PRESENT_ACCESSOR;\n return canonicalize(r);\n }",
"@Override\n public ValueKind getValueKind() {\n return ValueKind.R_VALUE;\n }",
"public static void main(String args[]) \n {\n Rectangle r1 = new Rectangle(); \n // r2 is variabel reference lainnya \n // r2 is di inisialisasi menggunakan r1: \n // r1 dan r2 sama2 mengreferensi objek yang sama \n // maka tidak mengduplikasi objek yang sama \n // dan tidak menggunakan memori alokasi tambahan\n Rectangle r2 = r1; \n r1.length = 10; \n r2.length = 20; \n System.out.println(\"Value of R1's Length : \" + r1.length); \n System.out.println(\"Value of R2's Length : \" + r2.length); \n }",
"public GeneralSinglePointCrossoverForRes(HashMap<String, Object> parameters) {\n\t\tsuper(parameters);\n\t\tsinglePointCrossoverFavorMaximizationOfRes = new SinglePointCrossoverFavorMaximizationOfRes(\n\t\t\t\tparameters);\n\t\tsinglePointCrossoverFavorMaximizationOfPP = new SinglePointCrossoverFavorMaximizationOfPP(\n\t\t\t\tparameters);\n\t\tsinglePointCrossoverForRes = new SinglePointCrossoverForRes(parameters);\n\n\t\tif (parameters.get(\"singlePointCrossoverProbability\") != null)\n\t\t\tsinglePointCrossoverProbability_ = (Double) parameters.get(\"singlePointCrossoverProbability\");\n\t}",
"RoachPopulation(int initial)\n {\n roaches = initial;\n }",
"public int getR();",
"public Rover addRover(int x, int y, Direction direction) throws OffPlateauException, SpaceAlreadyOccupiedException {\n if (!isOnPlateau(x, y)) {\n throw new OffPlateauException(String.format(OFF_PLATEAU_ERROR_MESSAGE_TEMPLATE, x, y, xTopRight, yTopRight));\n }\n\n Coordinate position = new Coordinate(x, y);\n if (isSpaceOccupied(position)) {\n throw new SpaceAlreadyOccupiedException(String.format(OCCUPIED_ADD_ERROR_MESSAGE_TEMPLATE, x, y));\n }\n\n Rover rover = new Rover(position, direction, this);\n rovers.add(rover);\n return rover;\n }",
"ValuationMethod getValuationMethod();",
"VariationPoint createVariationPoint();",
"public double getGrossSales() {\n return grossSales;\n}",
"public O copy() {\n return value();\n }",
"@Override\n public InterpreterValue sub(InterpreterValue v) {\n\n // If the given value is a IntegerValue create a new DoubleValue from\n // the subtraction-result\n if(v instanceof IntegerValue) return new DoubleValue(getValue() - ((IntegerValue) v).getValue());\n\n // If the given value is a DoubleValue create a new DoubleValue from\n // the subtraction-result\n if(v instanceof DoubleValue) return new DoubleValue(getValue() - ((DoubleValue) v).getValue());\n\n // In other case just throw an error\n throw new Error(\"Operator '-' is not defined for type double and \" + v.getName());\n\n }",
"public static MetricTransformation2DRobustEstimator create() {\n return create(DEFAULT_ROBUST_METHOD);\n }",
"@Override\n public AbstractRelic makeCopy() {\n return new SpiritualRecovery();\n }",
"public void setRisultato(double risultato) {\r\n this.risultato = risultato;\r\n }",
"public Rol() {}",
"public Rates() {\n }",
"@Deprecated\r\n\tpublic QualityValue(){\r\n\t\tsuper();\r\n\t}",
"protected InterestRate() {\n\t}",
"public double getR() {\r\n\t\tif(!polar)\r\n\t\t\tupdatePolar();\r\n\t\treturn r;\r\n\t}",
"public Intervals() {\n }",
"public Rook(Color color, Coordinate coordinate) {\n super(color, 'R', 5, coordinate);\n }",
"@Override\n public Double value(TypeOfValue value);",
"public abstract Value getValue();",
"@External(readonly = true)\n\tpublic Address get_roulette_score() {\n\t\treturn this.roulette_score.get();\n\t}",
"public Value() {\n }",
"public OreVein(OreType oreType) {\n type = oreType.getType();\n data = oreType.getData();\n amount = oreType.getAmount();\n targetType = oreType.getTargetType();\n }",
"protected Value(Value v) {\n flags = v.flags;\n num = v.num;\n str = v.str;\n object_labels = v.object_labels;\n getters = v.getters;\n setters = v.setters;\n excluded_strings = v.excluded_strings;\n included_strings = v.included_strings;\n functionPartitions = v.functionPartitions;\n functionTypeSignatures = v.functionTypeSignatures;\n var = v.var;\n hashcode = v.hashcode;\n }",
"public RateType_VO(Integer type) {\n ratetype = type;\n}",
"private PropertyEvaluator createEvaluator() {\n return helper.getStandardPropertyEvaluator();\n }",
"public FieldsValueObject opbToValueObject() {\r\n final String methodName = \"opbToValueObject()\";\r\n\r\n logger.entering(CLASS_NAME, methodName);\r\n\r\n final FieldsValueObject valueObject = new FieldsValueObject();\r\n\r\n valueObject.a = a;\r\n valueObject.aDataSourceValue = aDataSourceValue;\r\n\r\n valueObject.aVarchar = aVarchar;\r\n valueObject.aVarcharDataSourceValue = aVarcharDataSourceValue;\r\n\r\n valueObject.aNumber = aNumber;\r\n valueObject.aNumberDataSourceValue = aNumberDataSourceValue;\r\n\r\n valueObject.aInteger = aInteger;\r\n valueObject.aIntegerDataSourceValue = aIntegerDataSourceValue;\r\n\r\n valueObject.aDate = aDate;\r\n valueObject.aDateDataSourceValue = aDateDataSourceValue;\r\n\r\n valueObject.aRo = aRo;\r\n\r\n\r\n return valueObject;\r\n\r\n }"
]
| [
"0.5857931",
"0.55383486",
"0.5243104",
"0.51229185",
"0.4964379",
"0.4924551",
"0.4914862",
"0.48951435",
"0.48927945",
"0.4874011",
"0.48705775",
"0.48693192",
"0.48481193",
"0.48386398",
"0.48256755",
"0.4808762",
"0.48068932",
"0.48012072",
"0.47964716",
"0.478676",
"0.47829136",
"0.47795558",
"0.4769955",
"0.47666457",
"0.4750364",
"0.47404188",
"0.47366914",
"0.47191724",
"0.47107607",
"0.4705246",
"0.46925035",
"0.4687822",
"0.4658714",
"0.46318963",
"0.46100196",
"0.45927867",
"0.45923835",
"0.4588454",
"0.45871857",
"0.45825174",
"0.45489565",
"0.4547436",
"0.4547052",
"0.45358476",
"0.4524101",
"0.451638",
"0.44972122",
"0.44941607",
"0.4493538",
"0.44918925",
"0.44863158",
"0.4479016",
"0.44752136",
"0.44689393",
"0.44587702",
"0.44576687",
"0.44563878",
"0.44521436",
"0.44514197",
"0.44483477",
"0.44378325",
"0.44350955",
"0.44329587",
"0.44321495",
"0.4431798",
"0.44287407",
"0.44232976",
"0.442154",
"0.44215363",
"0.44183338",
"0.44174373",
"0.44169992",
"0.4414045",
"0.44056785",
"0.44007075",
"0.4393742",
"0.4392528",
"0.43868878",
"0.43813738",
"0.4379596",
"0.43780524",
"0.43775463",
"0.43769282",
"0.4373985",
"0.4371543",
"0.43708873",
"0.4362056",
"0.43597984",
"0.43550882",
"0.43518382",
"0.4351536",
"0.4344938",
"0.43446293",
"0.4344386",
"0.4342146",
"0.43371826",
"0.43332273",
"0.43233517",
"0.43206945",
"0.4319976"
]
| 0.8644396 | 0 |
Returns a new object of class 'Number Value'. | NumberValue createNumberValue(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Number getNumberValue();",
"public Number(final T theVal)\n {\n if (theVal instanceof Integer) {\n myInt = (Integer) theVal;\n isInt = true;\n } else if (theVal instanceof Double) {\n myDouble = (Double) theVal;\n isDouble = true;\n } else if (theVal instanceof Float) {\n myFloat = (Float) theVal;\n isFloat = true;\n } else if (theVal instanceof Long) {\n myLong = (Long) theVal;\n isLong = true;\n }\n }",
"public NumberValue(Token token, Number value, Trackable trackable) {\n super(token, value, trackable);\n }",
"public Number(int v)\n {\n val = v;\n }",
"Number(String face, int numValue) {\n this.face = face;\n this.numValue = numValue;\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}",
"private\tNum(int num) { value = num; }",
"public static NumberAmount create(){\n NumberAmount NA = new NumberAmount(new AdvancedOperations(Digit.Zero()));\n return NA;\n }",
"public int getNumberValue() {\r\n return number;\r\n }",
"public NumberP(ErrorTypesNumber error) { Error = error; }",
"public Numbers(int number) {\r\n\t\tthis.number = number;\r\n\t}",
"public NumberP(Number number)\n\t{\n\t\tNumber tempVar = Constructors.ExtractDynamicToNumber(number);\n\n\t\tif (!tempVar.getError().equals(ErrorTypesNumber.None))\n\t\t{\n\t\t\tError = tempVar.getError();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tBaseTenExponent = number.getBaseTenExponent();\n\t\t\tValue = number.getValue();\n\t\t\tConfig = new ParseConfig(NumericTypes.Double);\n\t\t}\n\t}",
"public NumericValue(final double value) {\n this.value = value;\n }",
"public SeriesInstance setNumber(IntegerDt theValue) {\n\t\tmyNumber = theValue;\n\t\treturn this;\n\t}",
"@Override\n public abstract JsonParser.NumberType numberType();",
"public Number(int n) \n {\n nn = n; // initailize with the inputed value\n }",
"public static Number asNumber(Object value) {\n Number num = null;\n if (value == null) {\n num = null;\n } else if (value instanceof Number) {\n num = (Number) value;\n } else if (value instanceof Boolean) {\n num = ((Boolean) value) ? 1 : 0;\n }\n return num;\n }",
"public Number number() {\n return number;\n }",
"public Integer getNumberValue()\n\t{\n\t\treturn (number == null) ? null : number.value;\n\t}",
"public Series setNumber(IntegerDt theValue) {\n\t\tmyNumber = theValue;\n\t\treturn this;\n\t}",
"public NumberP(NumberO numberO)\n\t{\n\t\tNumber tempVar = Constructors.ExtractDynamicToNumber(numberO);\n\n\t\tif (!tempVar.getError().equals(ErrorTypesNumber.None))\n\t\t{\n\t\t\tError = tempVar.getError();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tBaseTenExponent = numberO.getBaseTenExponent();\n\t\t\tValue = numberO.getValue();\n\t\t\tConfig = new ParseConfig(NumericTypes.Double);\n\t\t}\n\t}",
"public IntegerDt getNumberElement() { \n\t\tif (myNumber == null) {\n\t\t\tmyNumber = new IntegerDt();\n\t\t}\n\t\treturn myNumber;\n\t}",
"public IntegerDt getNumberElement() { \n\t\tif (myNumber == null) {\n\t\t\tmyNumber = new IntegerDt();\n\t\t}\n\t\treturn myNumber;\n\t}",
"public int getNumericValue() {\n return value;\n }",
"protected JSONNumber(String str) {\n\t\ttype = JSONConstants.VT_NUMBER;\n\t\tthis.numberStr = str;\n\t\tthis.numberBytes = str.getBytes();\n\t}",
"public void testNumberConversion() throws Exception {\n NumberMetadataDefinition def = new NumberMetadataDefinition(\"number\", NUMBER);\n List<AbstractMetadataDefinition> list = new LinkedList<AbstractMetadataDefinition>();\n list.add(def);\n PluginImpl.getInstance().setDefinitions(list);\n FreeStyleProject freeStyleProject = createFreeStyleProject();\n configRoundtrip(freeStyleProject);\n MetadataJobProperty property = freeStyleProject.getProperty(MetadataJobProperty.class);\n assertNotNull(\"No MetadataJobProperty\", property);\n NumberMetadataValue number = (NumberMetadataValue)TreeStructureUtil.getLeaf(property, \"number\");\n assertNotNull(number);\n assertEquals(new Long(NUMBER), number.getValue());\n }",
"@Override\n public JsonParser.NumberType numberType() {\n // most types non-numeric, so:\n return null;\n }",
"public IntegerDt getNumber() { \n\t\tif (myNumber == null) {\n\t\t\tmyNumber = new IntegerDt();\n\t\t}\n\t\treturn myNumber;\n\t}",
"public IntegerDt getNumber() { \n\t\tif (myNumber == null) {\n\t\t\tmyNumber = new IntegerDt();\n\t\t}\n\t\treturn myNumber;\n\t}",
"IntegerValue createIntegerValue();",
"IntegerValue createIntegerValue();",
"public DoubleValue(double num) {\n this.num = num;\n }",
"public T caseNumber(org.uis.lenguajegrafico.lenguajegrafico.Number object)\n {\n return null;\n }",
"public void testSetNumber() {\n ValueString vs = new ValueString();\n\n vs.setNumber(0);\n assertEquals(\"0.0\", vs.getString());\n vs.setNumber(1);\n assertEquals(\"1.0\", vs.getString());\n vs.setNumber(-1);\n assertEquals(\"-1.0\", vs.getString());\n vs.setNumber(2.5);\n assertEquals(\"2.5\", vs.getString());\n vs.setNumber(2.8);\n assertEquals(\"2.8\", vs.getString());\n }",
"public int getNumericValue() {\n return value;\n }",
"public Integer getNumber() {\r\n return number;\r\n }",
"public int getValue(){\n return number;\n }",
"public NumberExpression(String value) {\n this(new BigDecimal(value));\n }",
"public NumberToNumber(Class<T> targetType)\r\n/* 21: */ {\r\n/* 22:52 */ this.targetType = targetType;\r\n/* 23: */ }",
"IntegerValue getValueObject();",
"public Integer getNumber() {\n return number;\n }",
"default T handleNumber(double val) {\n throw new UnsupportedOperationException();\n }",
"public int getNumber() {\r\n return Number;\r\n }",
"private Numbers() {\n\t}",
"public static Value makeNumNaN() {\n return theNumNaN;\n }",
"public void setValue(Number value) {\n this.value = value;\n }",
"public static Value makeNum(double d) {\n if (Double.isNaN(d))\n return theNumNaN;\n if (Double.isInfinite(d))\n return theNumInf;\n Value r = new Value();\n r.num = d;\n return canonicalize(r);\n }",
"FloatValue createFloatValue();",
"FloatValue createFloatValue();",
"static public double asNumber(Object a) throws Exception {\r\n\t\tif (a instanceof JSObject)\r\n\t\t\ta = ((JSObject) a).valueOf();\r\n\t\t\r\n\t\t// js types\r\n\t\tif (a instanceof Double)\r\n\t\t\treturn (Double) a;\r\n\t\tif (a instanceof Boolean)\r\n\t\t\treturn (Boolean) a ? 1 : 0;\r\n\t\tif (a instanceof String)\r\n\t\t\ttry {\r\n\t\t\t\treturn Double.parseDouble((String) a);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\treturn Double.NaN;\r\n\t\t\t}\r\n\t\t\r\n\t\t// java types\r\n\t\tif (a instanceof Number)\r\n\t\t\treturn ((Number) a).doubleValue();\r\n\r\n\t\treturn Double.NaN;\r\n\t}",
"@Override\r\n public Element toNumber(int numberType, Ring ring) {\r\n if (numberType == numbElementType()) { return this;}\r\n if (numberType >= Ring.Complex) { \r\n numberType = numberType ^ Ring.Complex;}\r\n return new Complex(re.toNumber(numberType, ring), im.toNumber(numberType, ring));\r\n }",
"public static MessageNumber toNumber(MessageValue<?> value) {\n\t\tif (value != null) {\n\t\t\tif (value instanceof MessageNumber) {\n\t\t\t\treturn (MessageNumber) value;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn new MessageNumberImpl(value.asString());\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public static Value makeAnyNum() {\n return theNumAny;\n }",
"@Override\n public double numValue(int numId) {\n return 0;\n }",
"public Integer getNumber() {\n\t\treturn number;\n\t}",
"public SeriesInstance setNumber( int theInteger) {\n\t\tmyNumber = new IntegerDt(theInteger); \n\t\treturn this; \n\t}",
"private static Number transform(Object value) {\n\t\tif (value == null) {\n\t\t\treturn Integer.valueOf(0);\n\t\t}\n\t\tif (value instanceof String) {\n\t\t\ttry {\n\t\t\t\treturn Integer.parseInt((String)value);\n\t\t\t} catch(NumberFormatException ex) {\n\t\t\t\ttry {\n\t\t\t\t\treturn Double.parseDouble((String)value);\n\t\t\t\t} catch (NumberFormatException ex2) {\n\t\t\t\t\tthrow new RuntimeException(\n\t\t\t\t\t\t\t\"String \" + value + \" cannot be interpreted as a number\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (!(value instanceof Double || value instanceof Integer)) {\n\t\t\tthrow new RuntimeException(value.toString() + \" cannot be interpreted as a number.\");\n\t\t}\n\t\treturn (Number)value;\n\t}",
"public static <Q extends Quantity<Q>> BaseAmount<Q> valueOf(Number value,\r\n \t\t\tUnit<Q> unit) {\r\n \t\tBaseAmount<Q> amount = new BaseAmount<Q>(value, unit);\r\n \t\treturn amount;\r\n \t}",
"public static Value createValue(Object val) {\n if (val instanceof String) {\n return new NominalValue((String) val);\n } else if (val instanceof Double) {\n return new NumericValue((Double) val);\n }\n return UnknownValue.getInstance();\n }",
"public Value(){}",
"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}",
"@Override\n\tpublic Type visit(TLANumber tlaNumber) throws RuntimeException {\n\t\tif (tlaNumber.getVal().contains(\".\")) {\n\t\t\treturn new RealType(Collections.singletonList(tlaNumber));\n\t\t}\n\t\treturn TLABuiltins.getPolymorphicNumberType(tlaNumber, solver, generator);\n\t}",
"public abstract Quantity<Q> create(Number value, Unit<Q> unit);",
"public void setNumber(String newValue);",
"public NumericField() {\n\t\tsuper();\n\t}",
"public String getNumber(){\r\n return number;\r\n }",
"java.lang.String getNumber();",
"java.lang.String getNumber();",
"java.lang.String getNumber();",
"public SeleniumQueryObject val(Number value) {\n\t\tLOGGER.debug(\"Setting value of \"+this+\" to: \"+value+\".\");\n\t\treturn ValFunction.val(this, this.elements, value);\n\t}",
"public static VariableValue createValueObject(int value) {\n\t\treturn new IntegerValue(value);\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}",
"public NumberSequence(HsqlName name, long value, long increment,\n Type type) {\n\n this(name, type);\n\n setStartValue(value);\n setIncrement(increment);\n }",
"public final EObject ruleNumberLiteral() throws RecognitionException {\r\n EObject current = null;\r\n\r\n AntlrDatatypeRuleToken lv_value_0_0 = null;\r\n\r\n\r\n enterRule(); \r\n \r\n try {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4243:28: ( ( (lv_value_0_0= ruleNumber ) ) )\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4244:1: ( (lv_value_0_0= ruleNumber ) )\r\n {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4244:1: ( (lv_value_0_0= ruleNumber ) )\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4245:1: (lv_value_0_0= ruleNumber )\r\n {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4245:1: (lv_value_0_0= ruleNumber )\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4246:3: lv_value_0_0= ruleNumber\r\n {\r\n if ( state.backtracking==0 ) {\r\n \r\n \t newCompositeNode(grammarAccess.getNumberLiteralAccess().getValueNumberParserRuleCall_0()); \r\n \t \r\n }\r\n pushFollow(FOLLOW_ruleNumber_in_ruleNumberLiteral9152);\r\n lv_value_0_0=ruleNumber();\r\n\r\n state._fsp--;\r\n if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n\r\n \t if (current==null) {\r\n \t current = createModelElementForParent(grammarAccess.getNumberLiteralRule());\r\n \t }\r\n \t\tset(\r\n \t\t\tcurrent, \r\n \t\t\t\"value\",\r\n \t\tlv_value_0_0, \r\n \t\t\"Number\");\r\n \t afterParserOrEnumRuleCall();\r\n \t \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n leaveRule(); \r\n }\r\n }\r\n \r\n catch (RecognitionException re) { \r\n recover(input,re); \r\n appendSkippedTokens();\r\n } \r\n finally {\r\n }\r\n return current;\r\n }",
"public int getNumber(){\r\n return num;\r\n }",
"public Value() {}",
"abstract Valuable createMoney(double value);",
"public T convert(Number source)\r\n/* 26: */ {\r\n/* 27:56 */ return NumberUtils.convertNumberToTargetClass(source, this.targetType);\r\n/* 28: */ }",
"public int getNumber(){return number;}",
"@Transaction()\n public Number createNumber(final Context ctx, final String key, final int number) {\n ChaincodeStub stub = ctx.getStub();\n\n String numberState = stub.getStringState(key);\n if (!numberState.isEmpty()) {\n String errorMessage = String.format(\"Number %s already exists\", key);\n System.out.println(errorMessage);\n throw new ChaincodeException(errorMessage, Errors.NUM_ALREADY_EXISTS.toString());\n }\n\n Number num = new Number(number);\n numberState = genson.serialize(num);\n stub.putStringState(key, numberState);\n\n return num;\n }",
"public int getNumber() {\r\n return number;\r\n }",
"public interface\tProvider {\n\t/** Provides the value of type |Num|\n\t * @return the provided |Num| value\n\t */\n\tNum\t\tgetNumValue();\n }",
"public abstract Number getPrimitiveType();",
"public static Value makeAnyNumOther() {\n return theNumOther;\n }",
"public NumberedParameter(ParameterType type, int number) {\n this.type = type;\n this.number = number;\n }",
"public long getNumber(){\n return number;\r\n }",
"IntValue createIntValue();",
"IntValue createIntValue();",
"public void setNumber(int number)\n {\n Number = number;\n }",
"public String getNumber(){return number;}",
"public String getNumber() {\r\n\t\treturn number;\r\n\t}",
"NumericExpression createNumericExpression();",
"public Builder clearNumber() {\n bitField0_ = (bitField0_ & ~0x00000001);\n number_ = getDefaultInstance().getNumber();\n onChanged();\n return this;\n }",
"public void setNumber(Integer number) {\r\n this.number = number;\r\n }",
"public String getNumber() {\n return number;\n }",
"public String getNumber() {\n return number;\n }",
"public String getNumber() {\n return number;\n }",
"public String getNumber() {\n return number;\n }",
"public Series setNumber( int theInteger) {\n\t\tmyNumber = new IntegerDt(theInteger); \n\t\treturn this; \n\t}",
"public String getNumber() {\n return this.mNumber;\n }"
]
| [
"0.75416666",
"0.7141855",
"0.7132185",
"0.6880114",
"0.6807263",
"0.6731508",
"0.6695912",
"0.66658664",
"0.66587245",
"0.662308",
"0.65951747",
"0.65306836",
"0.65125424",
"0.6472823",
"0.6438926",
"0.64128804",
"0.6403914",
"0.6367553",
"0.6338017",
"0.6322819",
"0.6316781",
"0.62977797",
"0.62977797",
"0.6237621",
"0.62326896",
"0.6219627",
"0.6205715",
"0.6169594",
"0.6169594",
"0.61439687",
"0.61439687",
"0.61242414",
"0.6089336",
"0.60873216",
"0.60360014",
"0.60238105",
"0.60162103",
"0.60154176",
"0.59892184",
"0.59608847",
"0.5944212",
"0.59297436",
"0.5924585",
"0.59071845",
"0.58956355",
"0.5889525",
"0.58687484",
"0.58497113",
"0.58497113",
"0.58242774",
"0.582253",
"0.5806102",
"0.5804545",
"0.57993686",
"0.5789764",
"0.5786206",
"0.57635367",
"0.57593864",
"0.5757284",
"0.57468754",
"0.57355636",
"0.57303065",
"0.57050914",
"0.5702998",
"0.5697521",
"0.5687693",
"0.56875366",
"0.56875366",
"0.56875366",
"0.56811124",
"0.5679806",
"0.567577",
"0.5674494",
"0.5670197",
"0.5660884",
"0.5658496",
"0.565621",
"0.56484485",
"0.5644634",
"0.5632399",
"0.56322104",
"0.5631402",
"0.5630463",
"0.5619569",
"0.5617952",
"0.5601978",
"0.560175",
"0.560175",
"0.56008565",
"0.5595566",
"0.5594594",
"0.5592886",
"0.55852485",
"0.55841",
"0.5578673",
"0.5578673",
"0.5578673",
"0.5578673",
"0.55779773",
"0.5570182"
]
| 0.8476016 | 0 |
Returns a new object of class 'String Value'. | StringValue createStringValue(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Value(String s) {\n string = s;\n itemClass = String.class;\n type = DataType.STRING;\n }",
"protected StringValue() {\r\n value = \"\";\r\n typeLabel = BuiltInAtomicType.STRING;\r\n }",
"static Value<String> of(String value) {\n return new ImmutableValue<>((value == null || value.isEmpty()) ? null : value);\n }",
"java.lang.String getStringValue();",
"java.lang.String getStringValue();",
"@Override\n public StringType asString() {\n return TypeFactory.getStringType(this.getValue());\n }",
"public static VariableValue createValueObject(String value) {\n\t\tif (value == null)\n\t\t\treturn null;\n\t\treturn new StringValue(value);\n\t}",
"public String getStringValue();",
"public static Value makeStr(String s) {\n Value r = new Value();\n r.str = s;\n return canonicalize(r);\n }",
"String getStringValue();",
"String getStringValue();",
"public ElementString(String value) {\n this.value = value;\n }",
"public static Value makeTemporaryStr(String s) {\n if (s == null)\n throw new NullPointerException();\n Value r = new Value();\n r.str = s;\n return r; // don't canonicalize here!\n }",
"@java.lang.Override\n public com.google.protobuf.ByteString\n getStringValueBytes() {\n java.lang.Object ref = \"\";\n if (typeCase_ == 5) {\n ref = type_;\n }\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n if (typeCase_ == 5) {\n type_ = b;\n }\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"String getValueAsString();",
"public com.google.protobuf.ByteString\n getStringValueBytes() {\n java.lang.Object ref = \"\";\n if (typeCase_ == 5) {\n ref = type_;\n }\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 if (typeCase_ == 5) {\n type_ = b;\n }\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public Value createStringValue(short type, String value, CSSEngine engine) throws DOMException {\n/* 53 */ throw createDOMException();\n/* */ }",
"StringConstant createStringConstant();",
"public static StringLiteral fromLiteralValue (String pValue)\n {\n return new StringLiteral (pValue);\n }",
"org.hl7.fhir.String getValueString();",
"public StringValue(CharSequence value) {\r\n this.value = (value == null ? \"\" : value);\r\n typeLabel = BuiltInAtomicType.STRING;\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();",
"public static Value makeAnyStr() {\n return theStrAny;\n }",
"public java.lang.String getStringValue() {\n java.lang.Object ref = \"\";\n if (typeCase_ == 5) {\n ref = type_;\n }\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 (typeCase_ == 5) {\n type_ = s;\n }\n return s;\n }\n }",
"@java.lang.Override\n public java.lang.String getStringValue() {\n java.lang.Object ref = \"\";\n if (typeCase_ == 5) {\n ref = type_;\n }\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 if (typeCase_ == 5) {\n type_ = s;\n }\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"@Nonnull\n public Function<String, Object> getStringToValue()\n {\n return _stringToValue;\n }",
"private static final Object getFieldValue(Field field, String value) {\r\n if (String.class == field.getType()) {\r\n // for fields of type String return value as-is\r\n return value;\r\n } else {\r\n // in all other cases try to construct an object using it's class single-arg constructor\r\n return newObjectFromString(field.getType(), value);\r\n }\r\n }",
"public String\ngetValueString();",
"@Override\n\tpublic String getString() {\n\t\treturn value;\n\t}",
"public java.lang.String getStringValue() {\n java.lang.Object ref = stringValue_;\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 stringValue_ = s;\n }\n return s;\n }\n }",
"public DataPrimitive(String value) {\n\t\tsuper();\n\t\tif (value == null) {\n\t\t\tthis.value = \"\"; \n\t\t} else {\n\t\t\tthis.value = value;\n\t\t}\n\t}",
"public final String getPrimitiveStringValue() {\r\n return (String) (value = value.toString());\r\n }",
"public java.lang.String getStringValue() {\n java.lang.Object ref = stringValue_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n stringValue_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public abstract String construct();",
"public static StringValue makeStringValue(CharSequence value) {\r\n if (value == null || value.length() == 0) {\r\n return StringValue.EMPTY_STRING;\r\n } else {\r\n return new StringValue(value);\r\n }\r\n }",
"public Builder setStringValue(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n typeCase_ = 5;\n type_ = value;\n onChanged();\n return this;\n }",
"org.hl7.fhir.String addNewValueString();",
"public java.lang.String getValue() {\n java.lang.Object ref = value_;\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 value_ = s;\n }\n return s;\n }\n }",
"public com.google.protobuf.ByteString\n getStringValueBytes() {\n java.lang.Object ref = stringValue_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n stringValue_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public String getValue( )\n {\n return _strValue;\n }",
"public abstract String valueAsText();",
"public String getString(T value);",
"public void testSetString() {\n ValueString vs = new ValueString();\n\n vs.setString(null);\n assertNull(vs.getString());\n vs.setString(\"\");\n assertEquals(\"\", vs.getString());\n vs.setString(\"Boden\");\n assertEquals(\"Boden\", vs.getString());\n }",
"public java.lang.String getValue() {\n java.lang.Object ref = value_;\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 value_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public java.lang.String getValue() {\n java.lang.Object ref = value_;\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 value_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public TokenString(String value) {\n\t\tthis.value = value;\n\t}",
"String value();",
"String value();",
"public java.lang.Object createObject() {\n\treturn new NlsString();\n}",
"public void testGetString() {\n ValueString vs = new ValueString(\"Boden\");\n\n assertEquals(\"Boden\", vs.getString());\n assertEquals(0.0, vs.getNumber(), 0.0D);\n assertNull(vs.getDate()); // will fail parsing\n assertEquals(false, vs.getBoolean());\n assertEquals(0, vs.getInteger());\n try {\n vs.getBigNumber();\n fail(\"Expected a NumberFormatException\");\n } catch (NumberFormatException ex) {\n vs = null;\n }\n }",
"public java.lang.String getValue() {\n java.lang.Object ref = value_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n value_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public java.lang.String getValue() {\n java.lang.Object ref = value_;\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 value_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"@SuppressWarnings({\"unchecked\", \"rawtypes\"})\n private void setStringValue(final String valueString) {\n // figure out the type of T and create object based on T=Integer, T=Double, T=Boolean, T=Valuable\n if (value instanceof List<?>) {\n List list = (List) get();\n list.clear();\n // remove start and end spaces\n String valueString2 = valueString.replaceAll(\"^\\\\s+\", \"\");\n valueString2 = valueString2.replaceAll(\"\\\\s+$\", \"\");\n // split into space-separated bits\n String[] valuesString = valueString2.split(\"\\\\s+\");\n for (int i = 0; i < valuesString.length; i++) {\n if (theClass.equals(Integer.class)) {\n list.add(new Integer(valuesString[i % valuesString.length]));\n } else if (theClass.equals(Double.class)) {\n list.add(new Double(valuesString[i % valuesString.length]));\n } else if (theClass.equals(Boolean.class)) {\n String str = valuesString[i % valuesString.length].toLowerCase();\n list.add(str.equals(\"1\") || str.equals(\"true\") || str.equals(\"yes\"));\n } else if (theClass.equals(String.class)) {\n list.add(new String(valuesString[i % valuesString.length]));\n }\n }\n return;\n }\n\n if (theClass.equals(Integer.class)) {\n setValue(new Integer(valueString));\n return;\n }\n if (theClass.equals(Double.class)) {\n \tsetValue(new Double(valueString));\n return;\n }\n if (theClass.equals(Boolean.class)) {\n final String valueString2 = valueString.toLowerCase();\n if (valueString2.equals(\"yes\") || valueString2.equals(\"true\")) {\n \tsetValue(Boolean.TRUE);\n return;\n } else if (valueString2.equals(\"no\") || valueString2.equals(\"false\")) {\n \tsetValue(Boolean.FALSE);\n return;\n }\n }\n if (theClass.equals(Function.class)) {\n \tfinal Function.Constant param = new Function.Constant(valueString);\n \tsetValue(param);\n param.getOutputs().add(BEASTObjectStore.INSTANCE.getBEASTObject(beastObject));\n return;\n }\n\n if (theClass.isEnum()) {\n \tif (possibleValues == null) {\n \t\tpossibleValues = (T[]) theClass.getDeclaringClass().getEnumConstants();\n \t}\n for (final T t : possibleValues) {\n if (valueString.equals(t.toString())) {\n \tsetValue(t);\n return;\n }\n }\n throw new IllegalArgumentException(\"Input 104: value \" + valueString + \" not found. Select one of \" + Arrays.toString(possibleValues));\n }\n\n // call a string constructor of theClass\n try {\n Constructor ctor;\n Object v = valueString;\n try {\n \tctor = theClass.getDeclaredConstructor(String.class);\n } catch (NoSuchMethodException e) {\n \t// we get here if there is not String constructor\n \t// try integer constructor instead\n \ttry {\n \t\tif (valueString.startsWith(\"0x\")) {\n \t\t\tv = Integer.parseInt(valueString.substring(2), 16);\n \t\t} else {\n \t\t\tv = Integer.parseInt(valueString);\n \t\t}\n \tctor = theClass.getDeclaredConstructor(int.class);\n \t\n \t} catch (NumberFormatException e2) {\n \t// could not parse as integer, try double instead\n \t\tv = Double.parseDouble(valueString);\n \tctor = theClass.getDeclaredConstructor(double.class);\n \t}\n }\n ctor.setAccessible(true);\n final Object o = ctor.newInstance(v);\n setValue(o);\n if (o instanceof BEASTInterface) {\n ((BEASTInterface) o).getOutputs().add(BEASTObjectStore.INSTANCE.getBEASTObject(beastObject));\n }\n } catch (Exception e) {\n throw new IllegalArgumentException(\"Input 103: type mismatch, cannot initialize input '\" + getName() +\n \"' with value '\" + valueString + \"'.\\nExpected something of type \" + getType().getName() +\n \".\\n\" + (e.getMessage() != null ? e.getMessage() : \"\"));\n }\n }",
"String getString();",
"String getString();",
"String getString();",
"public StringValue(String value, TokenValue<?> otherValue) {\n super(otherValue.getRule(), value, otherValue);\n }",
"protected final Object fromStringImpl(String string)\n throws TypeValueException {\n int y, m, d;\n try {\n y = Integer.parseInt(string.substring(0, 4));\n m = Integer.parseInt(string.substring(4, 6));\n d = Integer.parseInt(string.substring(6, 8));\n } catch (NumberFormatException nfe) {\n\n // Should never happen, since isValidValueImpl(String) will have been\n // called\n throw new TypeValueException(this, string);\n }\n\n // Check that the values are in the correct range\n return new Value(y, m, d);\n }",
"public String getString();",
"com.google.protobuf.ByteString\n getStringValueBytes();",
"com.google.protobuf.ByteString\n getStringValueBytes();",
"public java.lang.String getValue() {\n java.lang.Object ref = value_;\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 value_ = s;\n return s;\n }\n }",
"StringContent createStringContent();",
"String getValue();",
"String getValue();",
"String getValue();",
"String getValue();",
"String getValue();",
"String getValue();",
"String getValue();",
"String getValue();",
"String getValue();",
"String getValue();",
"@Override\r\n\tprotected Object stringToValue(String valueString) throws ParseException {\r\n\t\ttry {\r\n\t\t\treturn PersistentBean.findOrCreate(beanClass, valueString);\r\n\t\t} catch (Exception e) {\r\n\t\t\tthrow new ParseException(e.getMessage(), 0);\r\n\t\t}\r\n\t}",
"public String getVal() {\n Object ref = val_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n val_ = s;\n }\n return s;\n } else {\n return (String) ref;\n }\n }",
"public com.google.protobuf.ByteString\n getStringValueBytes() {\n java.lang.Object ref = stringValue_;\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 stringValue_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public Object makeValue(String source) throws Exception\n {\n if (isNil)\n return null;\n if (fromStringMethod == null) {\n try {\n fromStringMethod = MethodCache.getInstance().getMethod(javaType, \"fromString\", STRING_CLASS);\n } catch (Exception e) {\n throw new IntrospectionException(e.toString());\n }\n }\n return fromStringMethod.invoke(null,new Object [] { source });\n }",
"public String stringVal(){\n\n if (currentTokenType == TYPE.STRING_CONST){\n\n return currentToken.substring(1, currentToken.length() - 1);\n\n }else {\n throw new IllegalStateException(\"Current token is not a string constant!\");\n }\n }",
"public OracleXmlTypeValue(String value) {\n this.value = value;\n inputType = STRING;\n }",
"public String getVal() {\n Object ref = val_;\n if (ref instanceof String) {\n return (String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n val_ = s;\n }\n return s;\n }\n }",
"@Override\r\n\t\t\t\tpublic Object stringToValue(String text) throws ParseException {\n\t\t\t\t\treturn \"\";\r\n\t\t\t\t}",
"public StringTemplateElement()\n {\n super(String.class);\n }",
"public String getValue(String s) {\n return s;\n }",
"public java.lang.String getValue() {\n java.lang.Object ref = value_;\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 value_ = s;\n return s;\n }\n }",
"public abstract String getValue();",
"public abstract String getValue();",
"public abstract String getValue();",
"public java.lang.String getValue() {\n java.lang.Object ref = value_;\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 value_ = s;\n return s;\n }\n }",
"StringExpression createStringExpression();",
"public abstract String getString();",
"public abstract String getString();",
"StringOperation createStringOperation();"
]
| [
"0.7661585",
"0.7351084",
"0.72459245",
"0.71985435",
"0.71985435",
"0.7184971",
"0.7118731",
"0.7041215",
"0.7038899",
"0.7015325",
"0.7015325",
"0.68714666",
"0.6867559",
"0.68650675",
"0.6807683",
"0.680478",
"0.67962766",
"0.6775252",
"0.67638975",
"0.67541444",
"0.6699425",
"0.6667648",
"0.6667648",
"0.6667648",
"0.6667648",
"0.6667648",
"0.6667648",
"0.6631415",
"0.66297704",
"0.66240585",
"0.6608027",
"0.65637296",
"0.65023017",
"0.6502044",
"0.6460673",
"0.6449918",
"0.6429845",
"0.64028585",
"0.6400356",
"0.6385964",
"0.6345057",
"0.63299",
"0.6321024",
"0.63118124",
"0.6307509",
"0.6291084",
"0.6289376",
"0.6277645",
"0.62775946",
"0.6267272",
"0.62642",
"0.6261418",
"0.6261418",
"0.6247728",
"0.6236323",
"0.6232977",
"0.62327",
"0.62299055",
"0.62290126",
"0.62290126",
"0.62290126",
"0.6225007",
"0.6213611",
"0.6211587",
"0.61994433",
"0.61994433",
"0.6198659",
"0.6188661",
"0.6187651",
"0.6187651",
"0.6187651",
"0.6187651",
"0.6187651",
"0.6187651",
"0.6187651",
"0.6187651",
"0.6187651",
"0.6187651",
"0.6184973",
"0.6183753",
"0.6182177",
"0.61622405",
"0.61575925",
"0.615597",
"0.6149374",
"0.61447793",
"0.6144407",
"0.6142324",
"0.6141",
"0.6132746",
"0.6132746",
"0.6132746",
"0.61154854",
"0.6115302",
"0.61136866",
"0.61136866",
"0.61072624"
]
| 0.7492413 | 4 |
Returns a new object of class 'Boolean Value'. | BooleanValue createBooleanValue(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static VariableValue createValueObject(boolean value) {\n\t\treturn new BooleanValue(value);\n\t}",
"public BooleanValue(boolean bool) {\r\n this.val = bool;\r\n }",
"public BooleanValue(boolean value) {\r\n\t\tthis.value = value;\r\n\t}",
"public BooleanValue(boolean value) {\r\n\t\tthis.value = value;\r\n\t}",
"public TrueValue (){\n }",
"public Boolean asBoolean();",
"public static Value makeBool(boolean b) {\n if (b)\n return theBoolTrue;\n else\n return theBoolFalse;\n }",
"boolean getBoolValue();",
"boolean getBoolValue();",
"abstract public boolean getAsBoolean();",
"protected BooleanValue(Boolean bv) {\n boolValue = bv;\n }",
"public Boolean getValue() {\n/* 60 */ return Boolean.valueOf(this.val);\n/* */ }",
"BoolConstant createBoolConstant();",
"BooleanExpression createBooleanExpression();",
"BooleanExpression createBooleanExpression();",
"BoolOperation createBoolOperation();",
"public boolean getValue();",
"public BooleanStateValue( boolean value) {\n\t\tthis( value, false);\n\t}",
"@Override\n\t\tpublic BooleanType toBooleanType() {\n\t\t\treturn new BooleanType(false);\n\t\t}",
"@Override\n\t\tpublic BooleanType toBooleanType() {\n\t\t\treturn new BooleanType(false);\n\t\t}",
"BooleanLiteralExp createBooleanLiteralExp();",
"public static final BooleanConstantTrue getTrue()\n {\n return new BooleanConstant.BooleanConstantTrue();\n }",
"boolean booleanOf();",
"static SibillaValue of(boolean v) {\n if (v) {\n return SibillaBoolean.TRUE;\n } else {\n return SibillaBoolean.FALSE;\n }\n }",
"protected Boolean geBoolValue() {\n return boolValue;\n }",
"<C> BooleanLiteralExp<C> createBooleanLiteralExp();",
"public Boolean() {\n\t\tsuper(false);\n\t}",
"public RubyBoolean getTrue() {\n return trueObject;\n }",
"boolean getValue();",
"public BooleanType(final Boolean val) {\n\t\tthis.b = val;\n\t}",
"public boolean getBoolean();",
"boolean getBoolean();",
"boolean getBoolean();",
"public Boolean booleanValue() {\n\t\tif (this.getLiteralValue() instanceof Boolean) {\n\t\t\treturn (Boolean) this.getLiteralValue();\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}",
"public boolean getBoolValue() {\n return boolValue_;\n }",
"@JsSupport( {JsVersion.MOZILLA_ONE_DOT_ONE, \r\n\t\tJsVersion.JSCRIPT_TWO_DOT_ZERO})\r\npublic interface Boolean extends Object {\r\n\t\r\n\t@Constructor void Boolean();\r\n\t\r\n\t@Constructor void Boolean(boolean value);\r\n\t\r\n\t@Constructor void Boolean(Number value);\r\n\t\r\n\t@Constructor void Boolean(String value);\r\n\t\r\n\t@Function boolean valueOf();\r\n\t\r\n}",
"public BooleanType(final boolean val) {\n\t\tthis.b = new Boolean(val);\n\t}",
"public boolean getBoolValue() {\n return boolValue_;\n }",
"public Boolean getValue() {\n return value;\n }",
"public BooleanPhenotype() {\n dataValues = new ArrayList<Boolean>();\n }",
"public java.lang.Boolean value() {\n return value;\n }",
"static Nda<Boolean> of( boolean... value ) { return Tensor.of( Boolean.class, Shape.of( value.length ), value ); }",
"public static boolean toPrimitiveBoolean(Boolean value) {\n if (value == null) {\n return false;\n }\n return value;\n }",
"public static Value makeBool(Bool b) {\n if (b.isMaybeAnyBool())\n return theBoolAny;\n else if (b.isMaybeTrueButNotFalse())\n return theBoolTrue;\n else if (b.isMaybeFalseButNotTrue())\n return theBoolFalse;\n else\n return theNone;\n }",
"public BooleanLit createTrue(Position pos) {\n return (BooleanLit) xnf.BooleanLit(pos, true).type(xts.Boolean());\n }",
"public PropertyBoolean(String uid, String value) {\n super(uid, value);\n setFixedValues(new HashSet<Boolean>(Arrays.asList(Boolean.TRUE, Boolean.FALSE)));\n }",
"public Object bool(String value) {\r\n if (value == null) return null;\r\n return isOracle() ? Integer.valueOf((isTrue(value) ? 1 : 0)) :\r\n Boolean.valueOf(isTrue(value));\r\n }",
"@java.lang.Override\n public boolean getBoolValue() {\n if (typeCase_ == 2) {\n return (java.lang.Boolean) type_;\n }\n return false;\n }",
"public Boolean getValue() {\n\t\treturn b;\n\t}",
"public static boolean toBoolean(Boolean value)\r\n {\r\n return toBoolean(value, false);\r\n }",
"public boolean getBoolValue() {\n if (typeCase_ == 2) {\n return (java.lang.Boolean) type_;\n }\n return false;\n }",
"static Value<Boolean> parseBoolean(String value) {\n try {\n if (value == null || value.isEmpty()) return empty();\n return of(Boolean.parseBoolean(value));\n } catch (NumberFormatException error) {\n return empty();\n }\n }",
"public Builder setBoolValue(boolean value) {\n typeCase_ = 2;\n type_ = value;\n onChanged();\n return this;\n }",
"public boolean booleanValue() {\n if (originalValue instanceof Boolean) {\n return (Boolean) originalValue;\n } else if (originalValue instanceof Number) {\n return ((Number) originalValue).intValue() != 0;\n } else {\n throw new CellValueCastException();\n }\n }",
"public Boolean value() {\n return this.value;\n }",
"public Boolean value() {\n return this.value;\n }",
"public Boolean value() {\n return this.value;\n }",
"public static Value makeAnyBool() {\n return theBoolAny;\n }",
"public Builder setBoolValue(boolean value) {\n bitField0_ |= 0x00000040;\n boolValue_ = value;\n onChanged();\n return this;\n }",
"public BooleanStateValue( boolean value, long duration) {\n\t\tsuper( duration);\n\t\t_storage = value;\n\t}",
"public BooleanStateValue( boolean value, boolean isImmortal) {\n\t\tsuper( isImmortal);\n\t\t_storage = value;\n\t}",
"public Value restrictToBool() {\n checkNotPolymorphicOrUnknown();\n if (isMaybeAnyBool())\n return theBoolAny;\n else if (isMaybeTrueButNotFalse())\n return theBoolTrue;\n else if (isMaybeFalseButNotTrue())\n return theBoolFalse;\n else\n return theNone;\n }",
"protected boolean convertToBoolean(Object value) {\n if (value == null) {\n return false;\n }\n else if (value instanceof Boolean) {\n return (Boolean)value;\n }\n else if (value instanceof Number) {\n return isNumberTrue((Number)value);\n }\n else if (value instanceof String) {\n String stringValue = (String)value;\n if (\"true\".equals(stringValue)) {\n return true;\n }\n else if (\"false\".equals(stringValue)) {\n return false;\n }\n else if (NumberUtils.isCreatable(stringValue)) {\n Number number = NumberUtils.createNumber(stringValue);\n return isNumberTrue(number);\n }\n else {\n return stringValue.length() > 0;\n }\n }\n else if (value instanceof Collection) {\n return ((Collection) value).size() > 0;\n }\n return false;\n }",
"com.google.protobuf.BoolValue getPersistent();",
"public Boolean getBooleanValue() {\n return this.booleanValue;\n }",
"public Boolean getABoolean()\n {\n return aBoolean;\n }",
"boolean hasBoolValue();",
"@ZenCodeType.Caster\n @ZenCodeType.Method\n default boolean asBool() {\n \n return notSupportedCast(BasicTypeID.BOOL);\n }",
"public Boolean getBooleanAttribute();",
"BooleanType(String name, String value,boolean mutable) {\n\t\tsuper(name,Constants.BOOLEAN, mutable);\n\t\tif(value != null)\n\t\t\tthis.value = parseValue(value);\n\t\t\n\t}",
"public Boolean getValue() {\n return this.value;\n }",
"public Boolean getValue() {\n return this.value;\n }",
"public Boolean getValue() {\n return this.value;\n }",
"public Boolean getBoolean() {\r\n\t\ttype(ConfigurationItemType.BOOLEAN);\r\n\t\treturn booleanValue;\r\n\t}",
"@Column(name = \"BOOLEAN_VALUE\", length = 20)\n/* 35 */ public String getBooleanValue() { return this.booleanValue; }",
"public static Boolean toBoolean(Object value) {\n if (value instanceof Boolean)\n return (Boolean) value;\n else if (value == null)\n return null;\n else\n throw new RuntimeException(\"Can't convert [\" + value + \"] to Boolean\");\n }",
"public AttributeBooleanType buildUnchecked() {\n return new AttributeBooleanTypeImpl();\n }",
"public boolean isBoolean();",
"public DBBoolean(Boolean bool) {\n\t\tsuper(bool);\n\t}",
"static Nda<Boolean> of( Shape shape, boolean... values ) { return Tensor.ofAny( Boolean.class, shape, values ); }",
"public static MessageBoolean toBoolean(MessageValue<?> value) {\n\t\tif (value != null) {\n\t\t\tif (value instanceof MessageBoolean) {\n\t\t\t\treturn (MessageBoolean) value;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn new MessageBooleanImpl(value.asString());\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"boolean isValue();",
"public static boolean bVal( Boolean value ) {\n return value != null && value; \n }",
"public boolean booleanValue(Map<Prop, Object> map) {\n assert type == Boolean.class;\n Object o = map.get(this);\n return this.<Boolean>typeValue(o);\n }",
"public static Boolean booleanValue(String value) {\n\t\tfinal Boolean ret;\n\t\t\n\t\tif (value.equals(\"true\")) {\n\t\t\tret = true;\n\t\t}\n\t\telse if (value.equals(\"false\")) {\n\t\t\tret = false;\n\t\t}\n\t\telse {\n\t\t\tret = null;\n\t\t}\n\n\t\treturn ret;\n\t}",
"public BooleanMetadata(String key, Object value) {\n\n this(key, value, false);\n }",
"@Test\n\tpublic void test_TCM__boolean_getBooleanValue() {\n\t\tfinal Attribute attribute = new Attribute(\"test\", \"true\");\n\t\ttry {\n\t\t\tassertTrue(\"incorrect boolean true value\", attribute.getBooleanValue());\n\n attribute.setValue(\"false\");\n\t\t\tassertTrue(\"incorrect boolean false value\", !attribute.getBooleanValue());\n\n attribute.setValue(\"TRUE\");\n\t\t\tassertTrue(\"incorrect boolean TRUE value\", attribute.getBooleanValue());\n\n attribute.setValue(\"FALSE\");\n\t\t\tassertTrue(\"incorrect boolean FALSE value\", !attribute.getBooleanValue());\n\n attribute.setValue(\"On\");\n\t\t\tassertTrue(\"incorrect boolean TRUE value\", attribute.getBooleanValue());\n\n attribute.setValue(\"Yes\");\n\t\t\tassertTrue(\"incorrect boolean TRUE value\", attribute.getBooleanValue());\n\n attribute.setValue(\"1\");\n\t\t\tassertTrue(\"incorrect boolean TRUE value\", attribute.getBooleanValue());\n\n attribute.setValue(\"OfF\");\n\t\t\tassertTrue(\"incorrect boolean FALSE value\", !attribute.getBooleanValue());\n\n attribute.setValue(\"0\");\n\t\t\tassertTrue(\"incorrect boolean FALSE value\", !attribute.getBooleanValue());\n\n attribute.setValue(\"No\");\n\t\t\tassertTrue(\"incorrect boolean FALSE value\", !attribute.getBooleanValue());\n\n\t\t} catch (DataConversionException e) {\n\t\t\tfail(\"couldn't convert boolean value\");\n\t\t}\n\n\t\ttry {\n attribute.setValue(\"foo\");\n\t\t\tassertTrue(\"incorrectly returned boolean from non boolean value\", attribute.getBooleanValue());\n\n\t\t} catch (DataConversionException e) {\n\t\t\t// good\n\t\t} catch (Exception e) {\n\t\t\tfail(\"Expected DataConversionException, but got \" + e.getClass().getName());\n\t\t}\n\n\n\t}",
"public abstract boolean read_boolean();",
"public T caseValBool(ValBool object)\n {\n return null;\n }",
"void setBoolean(boolean value);",
"public DBBoolean() {\n\t}",
"public static BooleanConstantFalse getFalse()\n {\n return new BooleanConstant.BooleanConstantFalse();\n }",
"public static Boolean softToBooleanObject(Integer value) {\n return BooleanUtils.toBooleanObject(value == null ? new Integer(0) : value);\n }",
"boolean boolField(String name, boolean isDefined, boolean value)\n throws NullField, InvalidFieldValue;",
"public Boolean getBoolean(boolean defaultVal) {\n return get(ContentType.BooleanType, defaultVal);\n }",
"private BooleanValueProvider() {\n this.state = true;\n }",
"public PropertyBoolean(String name) {\n super(name);\n }"
]
| [
"0.80544055",
"0.7908705",
"0.7798928",
"0.7798928",
"0.77037126",
"0.7639771",
"0.7571819",
"0.7563204",
"0.7563204",
"0.7383103",
"0.7292967",
"0.72491115",
"0.7164722",
"0.71316034",
"0.71316034",
"0.7119032",
"0.7116819",
"0.70865273",
"0.70758677",
"0.70758677",
"0.70645916",
"0.7051614",
"0.7031425",
"0.70195156",
"0.7013552",
"0.7001354",
"0.69864213",
"0.6984783",
"0.6984548",
"0.69468623",
"0.6944416",
"0.6922383",
"0.6922383",
"0.6915916",
"0.69125706",
"0.6905255",
"0.6887024",
"0.6876008",
"0.68656677",
"0.6849881",
"0.6838546",
"0.68383944",
"0.681325",
"0.6812313",
"0.68005955",
"0.67946833",
"0.6784403",
"0.6683499",
"0.66800046",
"0.6666679",
"0.6660448",
"0.6660157",
"0.665712",
"0.66347116",
"0.66311306",
"0.66311306",
"0.66311306",
"0.66277564",
"0.6627746",
"0.6623269",
"0.6607084",
"0.65776974",
"0.6490433",
"0.6477265",
"0.64654034",
"0.6455934",
"0.6448844",
"0.6446318",
"0.64270836",
"0.6424768",
"0.6419574",
"0.6419574",
"0.6419574",
"0.6410942",
"0.6402661",
"0.6395564",
"0.6390896",
"0.6366772",
"0.6357871",
"0.63334346",
"0.6318642",
"0.6310857",
"0.6307608",
"0.6301884",
"0.6297208",
"0.6277459",
"0.6274091",
"0.62705547",
"0.626758",
"0.6258853",
"0.6257794",
"0.62535405",
"0.6241827",
"0.6221844",
"0.62018126",
"0.6193584",
"0.61818737"
]
| 0.8364047 | 3 |
Returns a new object of class 'Forward Action'. | ForwardAction createForwardAction(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"ForwardMinAction createForwardMinAction();",
"@Override\n\t\tpublic ActionTestFacade getForward() {\n\t\t\treturn null;\n\t\t}",
"public Action newAction(Object key) {\n\t\tif (key == null)\n\t\t\tthrow new IllegalArgumentException(\"No legal key passed!\");\n\t\tif (super.containsKey(key))\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\"Allready kontains a mapping for that key!\");\n\t\tAction action = new ActionForward();\n\t\tsuper.put(key, action);\n\t\tactionList.add(action);\n\t\treturn action;\n\t}",
"BackwardAction createBackwardAction();",
"Action createAction();",
"Action createAction();",
"Action createAction();",
"public Forwarding() {\n\n }",
"MoveActionController createMoveActionController();",
"public Action newAction(Object data) throws Exception;",
"public Action newAction(String command) {\n\t\tif (command == null)\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\"No legal command string passed!\");\n\t\tif (super.containsKey(command))\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\"Allready kontains a mapping for that key!\");\n\t\tAction action = new ActionForward();\n\t\taction.putValue(Action.ACTION_COMMAND_KEY, command);\n\t\tsuper.put(command, action);\n\t\tactionList.add(action);\n\t\treturn action;\n\t}",
"public void forward() {\n callFunction(\"forward\");\n }",
"TurnAction createTurnAction();",
"SendAction createSendAction();",
"public Forward (Forward c) {\r\n\t\tthis.goalsScored = c.goalsScored;\r\n\t\tthis.numAssists = c.numAssists;\r\n\t\tthis.shotsOnTarget = c.shotsOnTarget;\r\n\t}",
"public PDAction getFo() {\n/* 187 */ COSDictionary fo = (COSDictionary)this.actions.getDictionaryObject(\"Fo\");\n/* 188 */ PDAction retval = null;\n/* 189 */ if (fo != null)\n/* */ {\n/* 191 */ retval = PDActionFactory.createAction(fo);\n/* */ }\n/* 193 */ return retval;\n/* */ }",
"public void createAction() {\n }",
"ActionDefinition createActionDefinition();",
"public static void forward()\n {\n throw new UnsupportedOperationException();\n }",
"@Override\n\tpublic Object forward(Object input) {\n\t\treturn null;\n\t}",
"ActionMap getActionMap() {\n return createActionMap(); }",
"public static Action move() {\n return new Action() {\n @Override\n protected void perform(ActiveActor a) {\n if(a.canMove()) {\n a.move();\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 \"Move()\";\n }\n };\n }",
"public VisitAction() {\n }",
"public interface Action {\n\t\n\t/**\n\t * @return The action's printable value\n\t */\n\tpublic String toString();\n\n\tpublic Action actionClone();\n \t\n}",
"public Forward () {\r\n\t\tsuper();\r\n\t\tgoalsScored = 0;\r\n\t\tnumAssists = 0;\r\n\t\tshotsOnTarget = 0;\r\n\t}",
"private Action(){\r\n\t\tthis(-1);\r\n\t}",
"public MemberAction() {\n\t\tsuper();\n\t}",
"@Override\n\tpublic void newAction() {\n\t\t\n\t}",
"@Override\n public ForwardStrategy clone() {\n return new ForwardStrategy(this);\n }",
"Activity getRepairForwardActivity();",
"protected Action makeAcceptAction() {\n\t\tAction myAction;\n\t\tmyAction = new Accept(getAgentID(),\n\t\t\t\t((ActionWithBid) opponentAction).getBid());\n\t\treturn myAction;\n\t}",
"private JMenuItem getMniForward() {\r\n\t\tif (mniForward == null) {\r\n\t\t\tmniForward = new JMenuItem();\r\n\t\t\tmniForward.setText(\"Forward\");\r\n\t\t\tmniForward.addActionListener(new java.awt.event.ActionListener() {\r\n\t\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent e) {\r\n\t\t\t\t\tbtnForward.doClick();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn mniForward;\r\n\t}",
"public void forward()\n\t{ \n\t\tupdateState( MotorPort.FORWARD);\n\t}",
"public abstract Action getAction();",
"@Override\n protected Action[] createActions() {\n return new Action[0];\n }",
"@Override\r\n\tpublic void goForward() {\n\t\t\r\n\t}",
"public PDAction getX() {\n/* 99 */ COSDictionary x = (COSDictionary)this.actions.getDictionaryObject(\"X\");\n/* 100 */ PDAction retval = null;\n/* 101 */ if (x != null)\n/* */ {\n/* 103 */ retval = PDActionFactory.createAction(x);\n/* */ }\n/* 105 */ return retval;\n/* */ }",
"void moveForward();",
"DomainAction createDomainAction();",
"void forwardActionEvent(ActionEvent actionEvent) {\n\t\tIterator<ActionListener> iter = listeners.iterator();\n\t\twhile (iter.hasNext()) {\n\t\t\t(iter.next()).actionPerformed(actionEvent);\n\t\t}\n\t}",
"NoAction createNoAction();",
"public A getAction() {\r\n\t\treturn action;\r\n\t}",
"BackwardMinAction createBackwardMinAction();",
"protected PMBaseAction() {\r\n super();\r\n }",
"abstract public void moveForward();",
"@Override\r\n\tpublic ActionForward to_objectNew(ActionMapping mapping, ActionForm form,\r\n\t\t\tHttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows KANException {\n\t\treturn null;\r\n\t}",
"public AccessibleAction getAccessibleAction() {\n return this;\n }",
"public static Action push() {\n return new Action() {\n @Override\n protected void perform(ActiveActor a) {\n if(a.getGrid().isValid(a.getLocation().getAdjacentLocation(a.getDirection()))) {\n Actor b = a.getGrid().get(a.getLocation().getAdjacentLocation(a.getDirection()));\n if(b instanceof Movable && b instanceof DestructibleActor) {\n DestructibleActor c = (DestructibleActor) b;\n c.setDirection(a.getDirection());\n if(c.canMove()) {\n c.move();\n a.move();\n a.energy = a.energy - getCost();\n }\n\n }\n }\n }\n\n @Override\n public int getCost() {\n return 10;\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 \"Push()\";\n }\n };\n }",
"public interface ActionManager {\n\n Action.Forward execute(Action action, HttpServletRequest request, HttpServletResponse response) throws PersistentException;\n\n void close();\n}",
"private void addForwardButton() {\n\t\tforwardButton = new EAdSimpleButton(EAdSimpleButton.SimpleButton.FORWARD);\n\t\tforwardButton.setEnabled(false);\n toolPanel.add(forwardButton);\n\t\tforwardButton.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tcontroller.getNavigationController().goForward();\n\t\t\t}\n\t\t});\n\t}",
"@Override\r\n public PhoenixDriver forward()\r\n {\n return null;\r\n }",
"public void forward() {\n forward(DEFAULT_SPEED);\n }",
"public ActionState createActionState();",
"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 }",
"protected final ActionProxy getProxy(String action,String [] params){\n \tsetUpRequestTestParams(params);\n\t\tActionProxy actionProxy = getActionProxy(action);\n\t\tassertNotNull(\"Action proxy shouldn't be null\", actionProxy);\n\t\tactionProxy.setExecuteResult(false);\n\t\treturn actionProxy;\t \t\n }",
"void sendForward(HttpServletRequest request, HttpServletResponse response, String location) throws AccessControlException, ServletException, IOException;",
"private JButton getBtnForward() {\r\n\t\tif (btnForward == null) {\r\n\t\t\tbtnForward = new JButton();\r\n\t\t\tbtnForward.setText(\">\");\r\n\t\t\tbtnForward.setToolTipText(\"Forward\");\r\n\t\t\tbtnForward.addActionListener(new java.awt.event.ActionListener() {\r\n\t\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent e) {\r\n\t\t\t\t\tif(historyIndex < history.size() - 1) {\r\n\t\t\t\t\t\thistoryIndex ++;\r\n\t\t\t\t\t\tgoTo(history.get(historyIndex), HistoryManagement.NAVIGATE);\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\treturn btnForward;\r\n\t}",
"private Action refuelAt(Position target) {\n\t\tif (position.equals(target)) return new RefuelAction();\n\n\t\treturn moveTowardsPosition(target);\n\t}",
"TurnDegAction createTurnDegAction();",
"public boolean isForward() {\n return true;\n }",
"public Action(String name) {\n this.name = name;\n }",
"public SearchHistoryAction renew() {\r\n\t\t\r\n\t\tSearchHistoryAction action= new SearchHistoryAction(history);\r\n\t\tdispose();\r\n\t\treturn action;\r\n\t}",
"public Action getAction() {\n\treturn action;\n }",
"protected ActionFactory getActionFactory() {\n\t\treturn this.actionFactory;\n\t}",
"public abstract Action takeTurn();",
"void forward(IMessage message, IChannel sender);",
"public PDAction getE() {\n/* 71 */ COSDictionary e = (COSDictionary)this.actions.getDictionaryObject(\"E\");\n/* 72 */ PDAction retval = null;\n/* 73 */ if (e != null)\n/* */ {\n/* 75 */ retval = PDActionFactory.createAction(e);\n/* */ }\n/* 77 */ return retval;\n/* */ }",
"GrabActionController createGrabActionController(PersistentView view);",
"ActionType createActionType();",
"Activity getTransformForwardActivity();",
"public ExecuteAction()\n {\n this(null);\n }",
"public Route() {\n responseType = ResponseType.FORWARD;\n responsePath = FORWARD_TO_ERROR_PAGE;\n }",
"private ActionProxy prepareActionProxy() throws Exception {\r\n ActionProxy proxy = getActionProxy(\"/mockGetDocumentFileContestAction\");\r\n assertTrue(\"action is of wrong type\", proxy.getAction() instanceof GetDocumentFileContestAction);\r\n\r\n TestHelper.injectSessionMapIntoProxy(proxy);\r\n\r\n return proxy;\r\n }",
"public void a_Action(){}",
"ShootActionController createShootActionController();",
"LogAction createLogAction();",
"public javax.accessibility.AccessibleAction getAccessibleAction() {\n try {\n XAccessibleAction unoAccessibleAction = (XAccessibleAction)\n UnoRuntime.queryInterface(XAccessibleAction.class, unoAccessibleContext);\n return (unoAccessibleAction != null) ? \n new AccessibleActionImpl(unoAccessibleAction) : null;\n } catch (com.sun.star.uno.RuntimeException e) {\n return null;\n }\n }",
"@Override\n\tpublic void createAction(Model m) {\n\t\t\n\t}",
"public Action(GameManager gameManager){\n this.gameManager = gameManager;\n }",
"public Action getAction() {\n return action;\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 }",
"protected ForwardingMap() {}",
"public void fastForward() {\n try {\n mSessionBinder.fastForward(mContext.getPackageName(), mCbStub);\n } catch (RemoteException e) {\n Log.wtf(TAG, \"Error calling fastForward.\", e);\n }\n }",
"public void forward(Projection projection);",
"public CreateIndividualPreAction() {\n }",
"public Class<?> getActionClass() {\n return this.action;\n }",
"@Override\n\tpublic ActionForWard execute(HttpServletRequest request) {\n\t\trequest.setAttribute(\"member\",MemberDao.selectMember());\n\t\treturn new ActionForWard(path,redirect);\n\t}",
"public XpeDccWfActionROVORowImpl() {\n }",
"public Class getActionClass() {\n return actionClass;\n }",
"public UndoableAction getAction() {\n return (UndoableAction) super.getAction();\n }",
"public static AnnotatedActionFactory getActionFactory() {\n/* 84 */ return actionFactory;\n/* */ }",
"public static Vector4 forward()\n {\n return new Vector4(0,0,1,0);\n }",
"Activity getSynchronizeForwardActivity();",
"public void action() {\n action.action();\n }",
"void attach(Action p1) {\n }",
"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 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 T caseAction(Action object) {\n\t\treturn null;\n\t}",
"public RepeaterActionDefinition() {\n }"
]
| [
"0.710123",
"0.69875056",
"0.6927994",
"0.6679725",
"0.6653154",
"0.6653154",
"0.6653154",
"0.6533228",
"0.63044524",
"0.6304048",
"0.6300473",
"0.6300001",
"0.62473214",
"0.6136902",
"0.6077518",
"0.59227186",
"0.5848665",
"0.5844397",
"0.57653826",
"0.5753959",
"0.57498777",
"0.5734895",
"0.5700267",
"0.5675972",
"0.5580084",
"0.5556609",
"0.5552498",
"0.55512977",
"0.5538824",
"0.5508519",
"0.54940665",
"0.5488827",
"0.54849297",
"0.5463967",
"0.54493886",
"0.54408336",
"0.5439449",
"0.5438643",
"0.54255116",
"0.5421573",
"0.5415555",
"0.5394606",
"0.53940105",
"0.5375215",
"0.5370481",
"0.5368962",
"0.5355623",
"0.53544044",
"0.53504",
"0.5342553",
"0.53419256",
"0.53378576",
"0.53354084",
"0.5306587",
"0.5294762",
"0.5284506",
"0.5275573",
"0.52706677",
"0.5268726",
"0.52675915",
"0.5254157",
"0.5224666",
"0.521892",
"0.5209704",
"0.5201805",
"0.5189139",
"0.51864636",
"0.5185811",
"0.51821584",
"0.51800764",
"0.5172885",
"0.51573646",
"0.5150731",
"0.515018",
"0.5124349",
"0.51231366",
"0.5122165",
"0.5119844",
"0.5106725",
"0.51018333",
"0.5101816",
"0.5092459",
"0.50878",
"0.5083062",
"0.5078403",
"0.5077467",
"0.5074391",
"0.5070035",
"0.5069469",
"0.50506985",
"0.504723",
"0.5038603",
"0.5033738",
"0.5016289",
"0.50126773",
"0.50109",
"0.50081813",
"0.5005251",
"0.5003598",
"0.5003558"
]
| 0.8943775 | 0 |
Returns a new object of class 'Forward Min Action'. | ForwardMinAction createForwardMinAction(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"BackwardMinAction createBackwardMinAction();",
"ForwardAction createForwardAction();",
"private Action(){\r\n\t\tthis(-1);\r\n\t}",
"public static Action push() {\n return new Action() {\n @Override\n protected void perform(ActiveActor a) {\n if(a.getGrid().isValid(a.getLocation().getAdjacentLocation(a.getDirection()))) {\n Actor b = a.getGrid().get(a.getLocation().getAdjacentLocation(a.getDirection()));\n if(b instanceof Movable && b instanceof DestructibleActor) {\n DestructibleActor c = (DestructibleActor) b;\n c.setDirection(a.getDirection());\n if(c.canMove()) {\n c.move();\n a.move();\n a.energy = a.energy - getCost();\n }\n\n }\n }\n }\n\n @Override\n public int getCost() {\n return 10;\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 \"Push()\";\n }\n };\n }",
"public static Action move() {\n return new Action() {\n @Override\n protected void perform(ActiveActor a) {\n if(a.canMove()) {\n a.move();\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 \"Move()\";\n }\n };\n }",
"Action createAction();",
"Action createAction();",
"Action createAction();",
"BackwardAction createBackwardAction();",
"SendAction createSendAction();",
"public Action newAction(Object key) {\n\t\tif (key == null)\n\t\t\tthrow new IllegalArgumentException(\"No legal key passed!\");\n\t\tif (super.containsKey(key))\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\"Allready kontains a mapping for that key!\");\n\t\tAction action = new ActionForward();\n\t\tsuper.put(key, action);\n\t\tactionList.add(action);\n\t\treturn action;\n\t}",
"MoveActionController createMoveActionController();",
"POGOProtos.Rpc.CombatActionProto getMinigameAction();",
"public CCActionInterval action()\n {\n CCSize s = CCDirector.sharedDirector().getWinSize();\n return new CCMoveBy(m_fDuration, new CCPoint(s.width - 0.5f, 0));\n }",
"TurnAction createTurnAction();",
"protected PMBaseAction() {\r\n super();\r\n }",
"public POGOProtos.Rpc.CombatActionProto getMinigameAction() {\n if (minigameActionBuilder_ == null) {\n return minigameAction_ == null ? POGOProtos.Rpc.CombatActionProto.getDefaultInstance() : minigameAction_;\n } else {\n return minigameActionBuilder_.getMessage();\n }\n }",
"public Forward () {\r\n\t\tsuper();\r\n\t\tgoalsScored = 0;\r\n\t\tnumAssists = 0;\r\n\t\tshotsOnTarget = 0;\r\n\t}",
"@Override\r\n\t\tpublic Action BestMove(AI_Domain game) {\r\n\t\t\t return new Action(minimax(game,true,depth,true,null).getPath());\r\n\t\t}",
"public MinStack() {\n in = new Stack();\n out = new Stack();\n min = Integer.MAX_VALUE;\n out.push(min);\n }",
"public LightSideGoesFirstEffect(Action action) {\n super(action);\n }",
"public static MatrixAccumulator mkMinAccumulator() {\n return new MinMatrixAccumulator();\n }",
"private JMenuItem getMniForward() {\r\n\t\tif (mniForward == null) {\r\n\t\t\tmniForward = new JMenuItem();\r\n\t\t\tmniForward.setText(\"Forward\");\r\n\t\t\tmniForward.addActionListener(new java.awt.event.ActionListener() {\r\n\t\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent e) {\r\n\t\t\t\t\tbtnForward.doClick();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn mniForward;\r\n\t}",
"public RateLimiterAction getAction() {\n return action;\n }",
"@Override\n\tpublic void newAction() {\n\t\t\n\t}",
"public abstract Move launchMinMax();",
"public POGOProtos.Rpc.CombatActionProto.Builder getMinigameActionBuilder() {\n \n onChanged();\n return getMinigameActionFieldBuilder().getBuilder();\n }",
"public MinStack() {\n min = Integer.MIN_VALUE;\n stack = new Stack();\n }",
"public interface Action {\n\t\n\t/**\n\t * @return The action's printable value\n\t */\n\tpublic String toString();\n\n\tpublic Action actionClone();\n \t\n}",
"public final EObject ruleMinOperator() throws RecognitionException {\r\n EObject current = null;\r\n\r\n Token otherlv_1=null;\r\n\r\n enterRule(); \r\n \r\n try {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4953:28: ( ( () otherlv_1= 'min' ) )\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4954:1: ( () otherlv_1= 'min' )\r\n {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4954:1: ( () otherlv_1= 'min' )\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4954:2: () otherlv_1= 'min'\r\n {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4954:2: ()\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4955:5: \r\n {\r\n if ( state.backtracking==0 ) {\r\n\r\n current = forceCreateModelElement(\r\n grammarAccess.getMinOperatorAccess().getMinOperatorAction_0(),\r\n current);\r\n \r\n }\r\n\r\n }\r\n\r\n otherlv_1=(Token)match(input,69,FOLLOW_69_in_ruleMinOperator11209); if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n\r\n \tnewLeafNode(otherlv_1, grammarAccess.getMinOperatorAccess().getMinKeyword_1());\r\n \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n leaveRule(); \r\n }\r\n }\r\n \r\n catch (RecognitionException re) { \r\n recover(input,re); \r\n appendSkippedTokens();\r\n } \r\n finally {\r\n }\r\n return current;\r\n }",
"@Override\n\t\tpublic ActionTestFacade getForward() {\n\t\t\treturn null;\n\t\t}",
"@java.lang.Override\n public POGOProtos.Rpc.CombatActionProto getMinigameAction() {\n return minigameAction_ == null ? POGOProtos.Rpc.CombatActionProto.getDefaultInstance() : minigameAction_;\n }",
"protected Action makeAcceptAction() {\n\t\tAction myAction;\n\t\tmyAction = new Accept(getAgentID(),\n\t\t\t\t((ActionWithBid) opponentAction).getBid());\n\t\treturn myAction;\n\t}",
"public MemberAction() {\n\t\tsuper();\n\t}",
"@Override\n protected Action[] createActions() {\n return new Action[0];\n }",
"public BattleWeaponsSegmentAction() {\n }",
"public E min() {\n\n }",
"@Override\n\tpublic void createAction(Model m) {\n\t\t\n\t}",
"public Forward (Forward c) {\r\n\t\tthis.goalsScored = c.goalsScored;\r\n\t\tthis.numAssists = c.numAssists;\r\n\t\tthis.shotsOnTarget = c.shotsOnTarget;\r\n\t}",
"public VisitAction() {\n }",
"public CreateIndividualPreAction() {\n }",
"public StackWithMin() {\n st = new LinkedList<>();\n minSt = new LinkedList<>();\n }",
"POGOProtos.Rpc.CombatActionProtoOrBuilder getMinigameActionOrBuilder();",
"ActionBlock createActionBlock();",
"private com.google.protobuf.SingleFieldBuilderV3<\n POGOProtos.Rpc.CombatActionProto, POGOProtos.Rpc.CombatActionProto.Builder, POGOProtos.Rpc.CombatActionProtoOrBuilder> \n getMinigameActionFieldBuilder() {\n if (minigameActionBuilder_ == null) {\n minigameActionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<\n POGOProtos.Rpc.CombatActionProto, POGOProtos.Rpc.CombatActionProto.Builder, POGOProtos.Rpc.CombatActionProtoOrBuilder>(\n getMinigameAction(),\n getParentForChildren(),\n isClean());\n minigameAction_ = null;\n }\n return minigameActionBuilder_;\n }",
"public T min();",
"public interface IAction {\n /**\n * A function that returns the state of the object at a particular tick. The object's state is in\n * proportion to where the tick is in the action's interval (between start and end time).\n *\n * @param tick an int that represents the frame of the animation per unit of time.\n * @param accumulatorShape keeps track of the shape at tick.\n * @return the shape at the tick.\n * @throws IllegalArgumentException if the tick is negative. if the shape is null.\n */\n IShape getShapeAtTick(double tick, IShape accumulatorShape);\n\n /**\n * Gets the current shape of the Action object.\n *\n * @return the current shape of the Action object.\n */\n IShape getCurrentShape();\n\n /**\n * Gets the time of the Action object.\n *\n * @return the time of the Action object.\n */\n Time getTime();\n\n /**\n * Gets the type of the Action object.\n *\n * @return the type of the Action object.\n */\n Action getType();\n\n /**\n * Gets the name of the Action object.\n *\n * @return the name of the Action object.\n */\n String getName();\n\n /**\n * Gets the old position of the Action object.\n *\n * @return the old position of the Action object.\n */\n Position getOldPosition();\n\n /**\n * Gets the new position of the Action object.\n *\n * @return the new position of the Action object.\n */\n Position getNewPosition();\n\n /**\n * Gets the old with of the Action object.\n *\n * @return the old width of the Action object.\n */\n double getOldWidth();\n\n /**\n * Gets the old height of the Action object.\n *\n * @return the new height of the Action object.\n */\n double getOldHeight();\n\n /**\n * Gets the new width of the Action object.\n *\n * @return the new width of the Action object.\n */\n double getNewWidth();\n\n /**\n * Gets the new height of the Action object.\n *\n * @return the new height of the Action object.\n */\n double getNewHeight();\n\n /**\n * Gets the old color of the Action object.\n *\n * @return the old color of the Action object.\n */\n RGB getOldColor();\n\n /**\n * Gets the new color of the Action object.\n *\n * @return the new color of the Action object\n */\n RGB getNewColor();\n}",
"public MinStack() {\r\n\t\t}",
"public MinStack() {\n this.capacity = CAPACITY;\n this.objects = new Object[capacity];\n }",
"public Action newAction(String command) {\n\t\tif (command == null)\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\"No legal command string passed!\");\n\t\tif (super.containsKey(command))\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\"Allready kontains a mapping for that key!\");\n\t\tAction action = new ActionForward();\n\t\taction.putValue(Action.ACTION_COMMAND_KEY, command);\n\t\tsuper.put(command, action);\n\t\tactionList.add(action);\n\t\treturn action;\n\t}",
"public M csmiStatusMin(Object min){this.put(\"csmiStatusMin\", min);return this;}",
"@Override\r\n\tpublic Action getAction() {\n\t\treturn Action.GRUNINST;\r\n\t}",
"public ActionMeta getStartActionMeta() {\n return startActionMeta;\n }",
"public int getActionPoints() {\n\t\treturn actionPoints;\n\t}",
"public MinStack() {\n size = 0;\n }",
"public static Action pull() {\n return new Action() {\n @Override\n protected void perform(ActiveActor a) {\n if(a.getGrid().isValid(a.getLocation().getAdjacentLocation(a.getDirection()))) {\n Actor b = a.getGrid().get(a.getLocation().getAdjacentLocation(a.getDirection()));\n if(b instanceof Movable && b instanceof DestructibleActor) {\n DestructibleActor c = (DestructibleActor) b;\n a.setDirection(a.getDirection() + 180);\n c.setDirection(a.getDirection());\n if(c.canMove()) {\n a.move();\n c.move();\n a.setDirection(a.getDirection() + 180);\n a.energy = a.energy - getCost();\n }\n }\n }\n }\n\n @Override\n public int getCost() {\n return 10;\n }\n\n @Override\n public boolean isExclusive() {\n return false;\n }\n\n @Override\n public Object getData() {\n return null;\n }\n\n @Override\n public String toString() {\n return \"Pull()\";\n }\n };\n }",
"public POGOProtos.Rpc.CombatActionProtoOrBuilder getMinigameActionOrBuilder() {\n if (minigameActionBuilder_ != null) {\n return minigameActionBuilder_.getMessageOrBuilder();\n } else {\n return minigameAction_ == null ?\n POGOProtos.Rpc.CombatActionProto.getDefaultInstance() : minigameAction_;\n }\n }",
"public MinStack() {\n data = new Stack();\n min = new Stack();\n }",
"public PDAction getX() {\n/* 99 */ COSDictionary x = (COSDictionary)this.actions.getDictionaryObject(\"X\");\n/* 100 */ PDAction retval = null;\n/* 101 */ if (x != null)\n/* */ {\n/* 103 */ retval = PDActionFactory.createAction(x);\n/* */ }\n/* 105 */ return retval;\n/* */ }",
"public void createAction() {\n }",
"public MinStack() {\n stack = new Stack<IntMinPair>();\n }",
"public Action getBestAction() {\n long startTime = System.currentTimeMillis();\n\n // Continue iterating through the search algorithm until the time limit\n // is reached\n while (System.currentTimeMillis() < startTime + timeLimit) {\n Node newNode = selectAndExpandNewNode();\n double randomPlayout = simulateRandomPlayout(newNode);\n backPropagate(newNode, randomPlayout);\n }\n\n // Technically this function will take us slightly over timeLimit, but\n // that's why a buffer is removed from timeLimit when passed to this\n // class\n return bestActionFromFinishedTree();\n }",
"float getXStepMin();",
"public ResetAction() {\n width = height = mines = 0;\n }",
"public Action newAction(Object data) throws Exception;",
"public A getAction() {\r\n\t\treturn action;\r\n\t}",
"public Action(String name) {\n this.name = name;\n }",
"public interface PrioritizableAction<K extends PrioritizableAction<K,T>,T> extends Action<T>, Comparable<K>{\n}",
"NoAction createNoAction();",
"@java.lang.Override\n public POGOProtos.Rpc.CombatActionProtoOrBuilder getMinigameActionOrBuilder() {\n return getMinigameAction();\n }",
"public MinStack() {\n stack = new Stack<>();\n minStack = new Stack<>();\n }",
"public MinStack() {\n sort = new Stack<>();\n stack = new Stack<>();\n }",
"public PDAction getFo() {\n/* 187 */ COSDictionary fo = (COSDictionary)this.actions.getDictionaryObject(\"Fo\");\n/* 188 */ PDAction retval = null;\n/* 189 */ if (fo != null)\n/* */ {\n/* 191 */ retval = PDActionFactory.createAction(fo);\n/* */ }\n/* 193 */ return retval;\n/* */ }",
"public MinStack() {\n\n }",
"public PromotionOrderEntryAdjustActionDTO()\n\t{\n\t\tsuper();\n\t}",
"public MinStack() {\n }",
"private CalculateInitialAttritionEffect(Action action) {\n super(action);\n }",
"@Override\n\t\t\t\tpublic void onActionMove(float x, float y) {\n\n\t\t\t\t}",
"@Override\n\t\t\t\tpublic void onActionMove(float x, float y) {\n\n\t\t\t\t}",
"@Override\n\t\t\t\tpublic void onActionMove(float x, float y) {\n\n\t\t\t\t}",
"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 K min();",
"public MinStack() {\n stack = new Stack<Integer>();\n minStack = new Stack<Integer>();\n }",
"public MinStack() {\n\n }",
"public MinStack() {\n\n }",
"public MinStack() {\n stackList = new ArrayList<>();\n minList = new ArrayList<>();\n size = 0;\n }",
"@Override\n\tpublic void onActionStart(int action) {\n\t\t\n\t}",
"public M csmiPlaceMin(Object min){this.put(\"csmiPlaceMin\", min);return this;}",
"ActionDefinition createActionDefinition();",
"public GetMinStack() {\n stackData = new Stack<>();\n stackMin = new Stack<>();\n }",
"public Action() {\n //ensureInterpolator();\n }",
"private Action refuelAt(Position target) {\n\t\tif (position.equals(target)) return new RefuelAction();\n\n\t\treturn moveTowardsPosition(target);\n\t}",
"public M csmiHostMin(Object min){this.put(\"csmiHostMin\", min);return this;}",
"@OutVertex\n ActionTrigger getSource();",
"@Override\r\n\t\tpublic ActionMap getHotKeysActionMapper() {\n\t\t\treturn null;\r\n\t\t}",
"public void doActionBefore(DefaultInstanceActionCmd actionModel) {\n }",
"public NearAction(String name, int direction) {\r\n this(name, direction, 1, false);\r\n }",
"public MinHeap(){\r\n nextAvail = 1;\r\n }",
"@Override\n public ForwardStrategy clone() {\n return new ForwardStrategy(this);\n }",
"UAction nextAction() { What should we do next? Override this for custom AI.\n //\n updateSeenEntities();\n UAction bestAction = null;\n float bestUrgency = 0f;\n int bc=0;\n for (UBehavior behavior : behaviors) {\n bc++;\n UAction action = behavior.getAction(this);\n if (action != null) {\n if (bestAction == null) {\n bestAction = action;\n bestUrgency = behavior.getCurrentUrgency();\n } else if (behavior.getCurrentUrgency() > bestUrgency) {\n bestAction = action;\n bestUrgency = behavior.getCurrentUrgency();\n }\n }\n }\n return bestAction;\n }"
]
| [
"0.80866194",
"0.66362494",
"0.5896204",
"0.58211255",
"0.5820925",
"0.58157766",
"0.58157766",
"0.58157766",
"0.57028997",
"0.5661709",
"0.5573239",
"0.54614294",
"0.5451029",
"0.53293467",
"0.532704",
"0.5311633",
"0.5290724",
"0.5283771",
"0.5254541",
"0.52386594",
"0.52216977",
"0.5211423",
"0.52102274",
"0.52039295",
"0.519345",
"0.51906776",
"0.519016",
"0.5167396",
"0.51589936",
"0.5156445",
"0.51555014",
"0.51537865",
"0.5151743",
"0.5151184",
"0.51246935",
"0.51243144",
"0.51198155",
"0.5107195",
"0.50895256",
"0.50894004",
"0.5077528",
"0.5055073",
"0.5041957",
"0.5038182",
"0.50362533",
"0.5032091",
"0.5016696",
"0.5014964",
"0.501494",
"0.50138783",
"0.50023687",
"0.50018895",
"0.49984282",
"0.49980235",
"0.4993073",
"0.4991669",
"0.49821734",
"0.49786216",
"0.4973122",
"0.49650645",
"0.49625364",
"0.49529508",
"0.4938823",
"0.4936711",
"0.49365875",
"0.49149606",
"0.49142334",
"0.49069512",
"0.490431",
"0.49039993",
"0.49034846",
"0.49002138",
"0.4897271",
"0.48970202",
"0.4878218",
"0.4874832",
"0.48705238",
"0.4869915",
"0.4869915",
"0.4869915",
"0.48683164",
"0.4864752",
"0.48621863",
"0.4857492",
"0.4857492",
"0.48399812",
"0.48311144",
"0.4826265",
"0.48221534",
"0.48211953",
"0.48134118",
"0.48060298",
"0.48016527",
"0.47959793",
"0.47940886",
"0.47911933",
"0.47797456",
"0.477318",
"0.4770655",
"0.4768511"
]
| 0.8964748 | 0 |
Returns a new object of class 'Backward Action'. | BackwardAction createBackwardAction(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"BackwardMinAction createBackwardMinAction();",
"ForwardAction createForwardAction();",
"Activity getRepairBackwardActivity();",
"public INIntervalAction reverse() throws Exception\n {\n throw new Exception(\"Reverse Action Not Implemented for the base class of CCIntervalAction\");\n }",
"Activity getTransformBackwardActivity();",
"private Action(){\r\n\t\tthis(-1);\r\n\t}",
"StopAction createStopAction();",
"@Override\n public void backward() {\n }",
"Action createAction();",
"Action createAction();",
"Action createAction();",
"TurnAction createTurnAction();",
"public void backward()\n\t{\n\t\tupdateState( MotorPort.BACKWARD);\n\t}",
"private void addBackwardButton() {\n\t\tbackwardButton = new EAdSimpleButton(EAdSimpleButton.SimpleButton.BACKWARD);\n\t\tbackwardButton.setEnabled(false);\n toolPanel.add(backwardButton);\n\t\tbackwardButton.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tcontroller.getNavigationController().goBackward();\n\t\t\t}\n\t\t});\n\t}",
"@Override\r\n\tprotected String doBackward(List<Emotion> b) {\n\t\treturn null;\r\n\t}",
"public PDAction getBl() {\n/* 216 */ COSDictionary bl = (COSDictionary)this.actions.getDictionaryObject(\"Bl\");\n/* 217 */ PDAction retval = null;\n/* 218 */ if (bl != null)\n/* */ {\n/* 220 */ retval = PDActionFactory.createAction(bl);\n/* */ }\n/* 222 */ return retval;\n/* */ }",
"@Override\n\tpublic MoveState transitionAway() {\n\t\treturn this;\n\n\t}",
"public BackwardCommand() {\n setNumParams(NUM_PARAMS);\n }",
"public ActionState createActionState();",
"void actionBack();",
"TurnDegAction createTurnDegAction();",
"public X transferFocusBackward() {\n component.transferFocusBackward();\n return (X) this;\n }",
"public void undoAction(){}",
"ForwardMinAction createForwardMinAction();",
"public SearchHistoryAction renew() {\r\n\t\t\r\n\t\tSearchHistoryAction action= new SearchHistoryAction(history);\r\n\t\tdispose();\r\n\t\treturn action;\r\n\t}",
"public final flipsParser.forwardBackwardDirection_return forwardBackwardDirection() throws RecognitionException {\n flipsParser.forwardBackwardDirection_return retval = new flipsParser.forwardBackwardDirection_return();\n retval.start = input.LT(1);\n\n CommonTree root_0 = null;\n\n Token char_literal459=null;\n Token string_literal460=null;\n Token string_literal461=null;\n Token char_literal462=null;\n Token string_literal463=null;\n Token string_literal464=null;\n Token string_literal465=null;\n\n CommonTree char_literal459_tree=null;\n CommonTree string_literal460_tree=null;\n CommonTree string_literal461_tree=null;\n CommonTree char_literal462_tree=null;\n CommonTree string_literal463_tree=null;\n CommonTree string_literal464_tree=null;\n CommonTree string_literal465_tree=null;\n RewriteRuleTokenStream stream_199=new RewriteRuleTokenStream(adaptor,\"token 199\");\n RewriteRuleTokenStream stream_306=new RewriteRuleTokenStream(adaptor,\"token 306\");\n RewriteRuleTokenStream stream_308=new RewriteRuleTokenStream(adaptor,\"token 308\");\n RewriteRuleTokenStream stream_307=new RewriteRuleTokenStream(adaptor,\"token 307\");\n RewriteRuleTokenStream stream_310=new RewriteRuleTokenStream(adaptor,\"token 310\");\n RewriteRuleTokenStream stream_311=new RewriteRuleTokenStream(adaptor,\"token 311\");\n RewriteRuleTokenStream stream_309=new RewriteRuleTokenStream(adaptor,\"token 309\");\n\n try {\n // flips.g:676:2: ( ( 'f' | 'fwd' | 'forward' ) -> FORWARD | ( 'b' | 'bwd' | 'backward' | 'back' ) -> BACKWARD )\n int alt180=2;\n int LA180_0 = input.LA(1);\n\n if ( (LA180_0==199||(LA180_0>=306 && LA180_0<=307)) ) {\n alt180=1;\n }\n else if ( ((LA180_0>=308 && LA180_0<=311)) ) {\n alt180=2;\n }\n else {\n NoViableAltException nvae =\n new NoViableAltException(\"\", 180, 0, input);\n\n throw nvae;\n }\n switch (alt180) {\n case 1 :\n // flips.g:676:4: ( 'f' | 'fwd' | 'forward' )\n {\n // flips.g:676:4: ( 'f' | 'fwd' | 'forward' )\n int alt178=3;\n switch ( input.LA(1) ) {\n case 199:\n {\n alt178=1;\n }\n break;\n case 306:\n {\n alt178=2;\n }\n break;\n case 307:\n {\n alt178=3;\n }\n break;\n default:\n NoViableAltException nvae =\n new NoViableAltException(\"\", 178, 0, input);\n\n throw nvae;\n }\n\n switch (alt178) {\n case 1 :\n // flips.g:676:5: 'f'\n {\n char_literal459=(Token)match(input,199,FOLLOW_199_in_forwardBackwardDirection3950); \n stream_199.add(char_literal459);\n\n\n }\n break;\n case 2 :\n // flips.g:676:9: 'fwd'\n {\n string_literal460=(Token)match(input,306,FOLLOW_306_in_forwardBackwardDirection3952); \n stream_306.add(string_literal460);\n\n\n }\n break;\n case 3 :\n // flips.g:676:15: 'forward'\n {\n string_literal461=(Token)match(input,307,FOLLOW_307_in_forwardBackwardDirection3954); \n stream_307.add(string_literal461);\n\n\n }\n break;\n\n }\n\n\n\n // AST REWRITE\n // elements: \n // token labels: \n // rule labels: retval\n // token list labels: \n // rule list labels: \n // wildcard labels: \n retval.tree = root_0;\n RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.tree:null);\n\n root_0 = (CommonTree)adaptor.nil();\n // 677:2: -> FORWARD\n {\n adaptor.addChild(root_0, (CommonTree)adaptor.create(FORWARD, \"FORWARD\"));\n\n }\n\n retval.tree = root_0;\n }\n break;\n case 2 :\n // flips.g:678:4: ( 'b' | 'bwd' | 'backward' | 'back' )\n {\n // flips.g:678:4: ( 'b' | 'bwd' | 'backward' | 'back' )\n int alt179=4;\n switch ( input.LA(1) ) {\n case 308:\n {\n alt179=1;\n }\n break;\n case 309:\n {\n alt179=2;\n }\n break;\n case 310:\n {\n alt179=3;\n }\n break;\n case 311:\n {\n alt179=4;\n }\n break;\n default:\n NoViableAltException nvae =\n new NoViableAltException(\"\", 179, 0, input);\n\n throw nvae;\n }\n\n switch (alt179) {\n case 1 :\n // flips.g:678:5: 'b'\n {\n char_literal462=(Token)match(input,308,FOLLOW_308_in_forwardBackwardDirection3966); \n stream_308.add(char_literal462);\n\n\n }\n break;\n case 2 :\n // flips.g:678:9: 'bwd'\n {\n string_literal463=(Token)match(input,309,FOLLOW_309_in_forwardBackwardDirection3968); \n stream_309.add(string_literal463);\n\n\n }\n break;\n case 3 :\n // flips.g:678:15: 'backward'\n {\n string_literal464=(Token)match(input,310,FOLLOW_310_in_forwardBackwardDirection3970); \n stream_310.add(string_literal464);\n\n\n }\n break;\n case 4 :\n // flips.g:678:26: 'back'\n {\n string_literal465=(Token)match(input,311,FOLLOW_311_in_forwardBackwardDirection3972); \n stream_311.add(string_literal465);\n\n\n }\n break;\n\n }\n\n\n\n // AST REWRITE\n // elements: \n // token labels: \n // rule labels: retval\n // token list labels: \n // rule list labels: \n // wildcard labels: \n retval.tree = root_0;\n RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.tree:null);\n\n root_0 = (CommonTree)adaptor.nil();\n // 679:2: -> BACKWARD\n {\n adaptor.addChild(root_0, (CommonTree)adaptor.create(BACKWARD, \"BACKWARD\"));\n\n }\n\n retval.tree = root_0;\n }\n break;\n\n }\n retval.stop = input.LT(-1);\n\n retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);\n adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n \tretval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);\n\n }\n finally {\n }\n return retval;\n }",
"@Override\n int convertBackward(int unused) {\n throw new UnsupportedOperationException();\n }",
"@Override\n\tpublic Object backward(Object grad_output) {\n\t\treturn null;\n\t}",
"private void parseBackward() {\r\n \t\tELOperandToken token;\r\n \t\tfState = STATE_INITIAL;\r\n \t\twhile ((token = getNextToken()) != ELOperandToken.EOF) {\r\n \t\t\tif (token.type == ELOperandToken.EL_VARIABLE_NAME_TOKEN ||\r\n \t\t\t\t\ttoken.type == ELOperandToken.EL_PROPERTY_NAME_TOKEN ||\r\n \t\t\t\t\ttoken.type == ELOperandToken.EL_METHOD_TOKEN ||\r\n \t\t\t\t\ttoken.type == ELOperandToken.EL_SEPARATOR_TOKEN) {\r\n \r\n \t\t\t\tfTokens.add(0, token);\r\n \t\t\t}\r\n \t\t}\r\n \t\t// set first token as variable\r\n \t\tfor (int i=0; i<fTokens.size(); i++) {\r\n \t\t\ttoken = fTokens.get(i);\r\n \t\t\tif(token.isNameToken()) {\r\n \t\t\t\ttoken.type = ELOperandToken.EL_VARIABLE_NAME_TOKEN;\r\n \t\t\t\tbreak;\r\n \t\t\t}\r\n \t\t}\r\n \t}",
"public int getBackward() {\n return this.backward;\n }",
"ActionDefinition createActionDefinition();",
"public Action newAction(Object data) throws Exception;",
"public static Action pull() {\n return new Action() {\n @Override\n protected void perform(ActiveActor a) {\n if(a.getGrid().isValid(a.getLocation().getAdjacentLocation(a.getDirection()))) {\n Actor b = a.getGrid().get(a.getLocation().getAdjacentLocation(a.getDirection()));\n if(b instanceof Movable && b instanceof DestructibleActor) {\n DestructibleActor c = (DestructibleActor) b;\n a.setDirection(a.getDirection() + 180);\n c.setDirection(a.getDirection());\n if(c.canMove()) {\n a.move();\n c.move();\n a.setDirection(a.getDirection() + 180);\n a.energy = a.energy - getCost();\n }\n }\n }\n }\n\n @Override\n public int getCost() {\n return 10;\n }\n\n @Override\n public boolean isExclusive() {\n return false;\n }\n\n @Override\n public Object getData() {\n return null;\n }\n\n @Override\n public String toString() {\n return \"Pull()\";\n }\n };\n }",
"private JButton getBtnForward() {\r\n\t\tif (btnForward == null) {\r\n\t\t\tbtnForward = new JButton();\r\n\t\t\tbtnForward.setText(\">\");\r\n\t\t\tbtnForward.setToolTipText(\"Forward\");\r\n\t\t\tbtnForward.addActionListener(new java.awt.event.ActionListener() {\r\n\t\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent e) {\r\n\t\t\t\t\tif(historyIndex < history.size() - 1) {\r\n\t\t\t\t\t\thistoryIndex ++;\r\n\t\t\t\t\t\tgoTo(history.get(historyIndex), HistoryManagement.NAVIGATE);\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\treturn btnForward;\r\n\t}",
"private JButton getBtnBack() {\r\n\t\tif (btnBack == null) {\r\n\t\t\tbtnBack = new JButton();\r\n\t\t\tbtnBack.setText(\"<\");\r\n\t\t\tbtnBack.setToolTipText(\"Back\");\r\n\t\t\tbtnBack.addActionListener(new java.awt.event.ActionListener() {\r\n\t\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent e) {\r\n\t\t\t\t\tif(historyIndex > 0) {\r\n\t\t\t\t\t\thistoryIndex --;\r\n\t\t\t\t\t\tgoTo(history.get(historyIndex), HistoryManagement.NAVIGATE);\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\treturn btnBack;\r\n\t}",
"Activity getSynchronizeBackwardActivity();",
"public JButtonOperator btMoveDown() {\n if (_btMoveDown==null) {\n String moveDown = Bundle.getString(\"org.netbeans.modules.java.freeform.ui.Bundle\", \"LBL_ClasspathPanel_Move_Down\");\n _btMoveDown = new JButtonOperator(this, moveDown);// I18N\n }\n return _btMoveDown;\n }",
"public NodeActionInverse(DependentAction action) {\n this.action = action;\n }",
"public void grip(){\n\t\tthis.motor.backward();\n\t}",
"public T back();",
"NoAction createNoAction();",
"void reverseDirection();",
"Activity getConflictCheckBackwardActivity();",
"public int[] getBackward() { return _backwardDiag; }",
"public Edge revert (){\n\t\treturn new Edge(dst, src);\n\t}",
"public static ScaleEntityDownAction getInstance(){\r\n\t\tif(instance == null){\r\n\t\t\tinstance = new ScaleEntityDownAction();\r\n\t\t}\r\n\t\treturn instance;\r\n\t}",
"public void rotateFabBackward() {\n final OvershootInterpolator interpolator = new OvershootInterpolator();\n ViewCompat.animate(fab).\n rotation(0f).\n withLayer().\n setDuration(300).\n setInterpolator(interpolator).\n start();\n fab.setBackgroundTintList(ColorStateList.valueOf(getResources().getColor(R.color.colorPrimaryDark)));\n }",
"public void stepBackward() {\n\t\tposition = backwardPosition();\n\t}",
"public UndoableAction getAction() {\n return (UndoableAction) super.getAction();\n }",
"public Action newAction(Object key) {\n\t\tif (key == null)\n\t\t\tthrow new IllegalArgumentException(\"No legal key passed!\");\n\t\tif (super.containsKey(key))\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\"Allready kontains a mapping for that key!\");\n\t\tAction action = new ActionForward();\n\t\tsuper.put(key, action);\n\t\tactionList.add(action);\n\t\treturn action;\n\t}",
"Transition createTransition();",
"Transition createTransition();",
"public Reversal() {\n\t\tsuper();\n\t}",
"public JButtonOperator btMoveDown() {\n if (_btMoveDown==null) {\n _btMoveDown = new JButtonOperator(this, \"Move Down\"); // NOI18N\n }\n return _btMoveDown;\n }",
"static void changeDirectionBackwards() {\n\n if(--direction == -1)\n direction = 3;\n }",
"public void stepBackward(){\n\t\tif(timer == null){ return; }\n\t\ttimer.stop();\n\t\n\t\t//check to see if we are back to the first frame\n\t\tif(frameIndex == 0){ frameIndex = frames.length-1; }\n\t\telse{ frameIndex--; }\n\t\n\t\tframes[frameIndex].display();\n frames[frameIndex].clearDisplay();\n\t}",
"public void back() {\n\n\tGrid<Actor> gr = getGrid();\n\tif (gr == null)\n\t return;\n\n\tif (!crossLocation.isEmpty()) {\n\t\t\n\t crossLocation.pop();\n\n\t //back\n\t ArrayList<Location> lastNode = crossLocation.peek();\n\t next = lastNode.get(0);\n\t}\n\n\tLocation loc = getLocation();\n\t\n\tif (gr.isValid(next)) {\n\n\t setDirection(loc.getDirectionToward(next));\n\t moveTo(next);\n\n\t} else {\n\t removeSelfFromGrid();\n\t}\n\t\n\tint counter = dirCounter.get(getDirection());\n\tdirCounter.put(getDirection(), --counter);\n\n\tFlower flower = new Flower(getColor());\n\tflower.putSelfInGrid(gr, loc);\n\t\n\tlast = loc;\n }",
"@Override\n\t\tpublic ActionTestFacade getForward() {\n\t\t\treturn null;\n\t\t}",
"public interface Action {\n\t\n\t/**\n\t * @return The action's printable value\n\t */\n\tpublic String toString();\n\n\tpublic Action actionClone();\n \t\n}",
"public BackStepper() {\r\n\t\tengaged = true;\r\n\t\tbackSteps = new BackstepStack(Globals.maximumBacksteps);\r\n\t}",
"public void createAction() {\n }",
"Activity getRepairForwardActivity();",
"ActionBlock createActionBlock();",
"Minus createMinus();",
"Minus createMinus();",
"Minus createMinus();",
"void setActionBtnBack(LinkActionGUI mainAction, LinkActionGUI linkAction);",
"public Position reverseBoard()\n {\n return this;\n }",
"public Action newAction(String command) {\n\t\tif (command == null)\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\"No legal command string passed!\");\n\t\tif (super.containsKey(command))\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\"Allready kontains a mapping for that key!\");\n\t\tAction action = new ActionForward();\n\t\taction.putValue(Action.ACTION_COMMAND_KEY, command);\n\t\tsuper.put(command, action);\n\t\tactionList.add(action);\n\t\treturn action;\n\t}",
"public Node getChildNode(Node node, Action action) {\n\t\tint[] new_state = new int[2];\n\n new_state[0] = node.state[0];\n\t\tnew_state[1] = node.state[1];\n\n\t\tif (action != null) {\n\t\t\t// Implementing the transition model\n\t\t\tif (action.to == \"x\") {\n\t\t\t\tnew_state[0] = node.state[0] + action.quantity;\n\t\t\t} \n\n\t\t\tif (action.to == \"y\") {\n\t\t\t\tnew_state[1] = node.state[1] + action.quantity;\n\t\t\t}\n\n\t\t\tif (action.from == \"x\") {\n\t\t\t\tnew_state[0] = node.state[0] - action.quantity;\n\t\t\t}\n\n\t if (action.from == \"y\") {\n\t\t\t\tnew_state[1] = node.state[1] - action.quantity;\n\n\t\t\t}\n\n\t\t}\n\n\t\tNode new_node = new Node(new_state, action, node);\n\n\t\treturn new_node;\n\t}",
"public String findBackward() {\n\t\t\tString result=\"\";\n\t\t\treturn result ;\n\t\t}",
"public FallingPiece moveDown() {\r\n return new FallingPiece(coord.moveDown(), innerPiece);\r\n }",
"private JButton getJButton_back() {\r\n\t\tif (jButton_back == null) {\r\n\t\t\tjButton_back = new JButton();\r\n\t\t\tjButton_back.setLocation(new Point(94, 480));\r\n\t\t\tjButton_back.setText(\"Back\");\r\n\t\t\tjButton_back.setSize(new Dimension(208, 34));\r\n\t\t\tjButton_back.addActionListener(this);\r\n\t\t}\r\n\t\treturn jButton_back;\r\n\t}",
"public Direction invertTurns(){\n switch(this){\n case SPIN_BACK:\n return SPIN_BACK;\n case SPIN_LEFT:\n return SPIN_RIGHT; \n case SPIN_RIGHT:\n return SPIN_LEFT;\n case ARC_LEFT:\n return ARC_RIGHT;\n case ARC_RIGHT:\n return ARC_LEFT; \n default:\n return this; \n }\n }",
"private Action refuelAt(Position target) {\n\t\tif (position.equals(target)) return new RefuelAction();\n\n\t\treturn moveTowardsPosition(target);\n\t}",
"@Override\n protected Action[] createActions() {\n return new Action[0];\n }",
"public void past(int back);",
"public boolean isBackward()\n {\n return (state == AnimationState.BACKWARD);\n }",
"@Override\n\tpublic void newAction() {\n\t\t\n\t}",
"public void previous();",
"Object previous();",
"public void frameBackward()\n{\n stop();\n setTime(getTime() - getInterval());\n}",
"ActionEvent createActionEvent();",
"public PDAction getFo() {\n/* 187 */ COSDictionary fo = (COSDictionary)this.actions.getDictionaryObject(\"Fo\");\n/* 188 */ PDAction retval = null;\n/* 189 */ if (fo != null)\n/* */ {\n/* 191 */ retval = PDActionFactory.createAction(fo);\n/* */ }\n/* 193 */ return retval;\n/* */ }",
"void undoPreviousAction() throws NothingToUndoException;",
"public ActionListener newResetAction() {\n // TODO Auto-generated method stub\n return new ResetAction();\n }",
"public PDAction getE() {\n/* 71 */ COSDictionary e = (COSDictionary)this.actions.getDictionaryObject(\"E\");\n/* 72 */ PDAction retval = null;\n/* 73 */ if (e != null)\n/* */ {\n/* 75 */ retval = PDActionFactory.createAction(e);\n/* */ }\n/* 77 */ return retval;\n/* */ }",
"CaseAction createCaseAction();",
"public T negative() {\n T A = copy();\n ops.changeSign(A.mat);\n return A;\n }",
"private void faceBackwards(){\n\t\tturnLeft();\n\t\tturnLeft();\n\t}",
"@FXML public void goBackward(ActionEvent e){\n\t\tphotoNumber--;\n\t\tif (photoNumber<0){\n\t\t\tphotoNumber=listOfPhotos.size()-1;\n\t\t}\n\t\tPhoto photo = listOfPhotos.get(photoNumber);\n\t\tImage photoImage = new Image(photo.getLocation(),610,450,false,false);\n\t\tphotoImageView.setImage(photoImage);\n Tooltip tt = new Tooltip();\n tt.setText(photo.printAttributes());\n tt.setStyle(\"-fx-font: normal bold 20 Langdon; \"\n + \"-fx-base: #AE3522; \"\n + \"-fx-text-fill: orange;\");\n infoHoverButton.setTooltip(tt);\n\t}",
"public interface Action {\n /**\n * Takes an action based on the provided state\n * If the action for the state is forbidden it must return NULL\n * @param state Generic State Object (MAY NEED CAST TO YOUR OWN STATE OBJECT)\n * @return State This method must return your new State declaration created after taking the action using the second constructor.\n */\n State takeAction(State state);\n}",
"public UndoableCommand undo() {\n logger.info(String.format(\"----------------[UNDOING][%s]\", this));\n return new DeleteActivityCommand(null, activityAdded);\n }",
"public Direction invertAll(){\n switch(this){\n case STAY:\n return STAY;\n case SPIN_BACK:\n return SPIN_BACK;\n case FORWARD:\n return BACKWARD;\n case BACKWARD:\n return FORWARD;\n case SPIN_LEFT:\n return SPIN_RIGHT; \n case SPIN_RIGHT:\n return SPIN_LEFT;\n case ARC_LEFT:\n return ARC_RIGHT;\n case ARC_RIGHT:\n return ARC_LEFT; \n default:\n return this; \n }\n }",
"private JMenuItem getMniForward() {\r\n\t\tif (mniForward == null) {\r\n\t\t\tmniForward = new JMenuItem();\r\n\t\t\tmniForward.setText(\"Forward\");\r\n\t\t\tmniForward.addActionListener(new java.awt.event.ActionListener() {\r\n\t\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent e) {\r\n\t\t\t\t\tbtnForward.doClick();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn mniForward;\r\n\t}",
"public CCActionInterval action()\n {\n CCSize s = CCDirector.sharedDirector().getWinSize();\n return new CCMoveBy(m_fDuration, new CCPoint(s.width - 0.5f, 0));\n }",
"MoveActionController createMoveActionController();",
"SendAction createSendAction();",
"public MoveUpAction() {\n\tsuper(\"▲ Move Row Up\");\n }",
"public abstract Action getAction();"
]
| [
"0.71449035",
"0.64168966",
"0.6345156",
"0.6171649",
"0.61684173",
"0.6147266",
"0.6137622",
"0.61055",
"0.61024934",
"0.61024934",
"0.61024934",
"0.608576",
"0.5997448",
"0.5980009",
"0.58837694",
"0.58089334",
"0.57387763",
"0.57359594",
"0.5689269",
"0.5575337",
"0.55700535",
"0.55557346",
"0.5535273",
"0.5519085",
"0.54964805",
"0.54938304",
"0.5461695",
"0.545337",
"0.54362756",
"0.54228026",
"0.5400333",
"0.5399231",
"0.5362545",
"0.5360003",
"0.53596777",
"0.5355181",
"0.53311306",
"0.53116965",
"0.5283846",
"0.52790624",
"0.5278687",
"0.5270066",
"0.52570146",
"0.52204525",
"0.521725",
"0.5216673",
"0.5213189",
"0.52097774",
"0.51982206",
"0.5183915",
"0.51742595",
"0.51742595",
"0.5165854",
"0.5165665",
"0.5137168",
"0.5121734",
"0.51176405",
"0.51144296",
"0.5098081",
"0.5092775",
"0.509155",
"0.5088591",
"0.50821453",
"0.50756705",
"0.50756705",
"0.50756705",
"0.5073007",
"0.5072179",
"0.50612545",
"0.5059094",
"0.50473434",
"0.5039223",
"0.50379354",
"0.50321543",
"0.50186944",
"0.5010587",
"0.50080186",
"0.50053215",
"0.49977338",
"0.49934435",
"0.49801394",
"0.49783215",
"0.4975349",
"0.49737695",
"0.49709153",
"0.49694642",
"0.49610373",
"0.49558386",
"0.49521077",
"0.49489722",
"0.49448505",
"0.4924143",
"0.49219954",
"0.49107194",
"0.49009082",
"0.48969102",
"0.48868117",
"0.48828492",
"0.48732096",
"0.48721838"
]
| 0.90947 | 0 |
Returns a new object of class 'Backward Min Action'. | BackwardMinAction createBackwardMinAction(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"ForwardMinAction createForwardMinAction();",
"BackwardAction createBackwardAction();",
"private Action(){\r\n\t\tthis(-1);\r\n\t}",
"Minus createMinus();",
"Minus createMinus();",
"Minus createMinus();",
"public CCActionInterval action()\n {\n CCSize s = CCDirector.sharedDirector().getWinSize();\n return new CCMoveBy(m_fDuration, new CCPoint(s.width - 0.5f, 0));\n }",
"StopAction createStopAction();",
"Action createAction();",
"Action createAction();",
"Action createAction();",
"@Override\n\t\tprotected JButton createDecreaseButton(int o) {\n\t\t\tJButton jbutton = new JButton();\n\t\t\tjbutton.setVisible(false);\n\t\t\tjbutton.setEnabled(false);\n\t\t\tjbutton.setPreferredSize(new Dimension(0, 0));\n\t\t\tjbutton.setMinimumSize(new Dimension(0, 0));\n\t\t\tjbutton.setMaximumSize(new Dimension(0, 0));\n\t\t\treturn jbutton;\n\t\t}",
"public static OperationMBean getSubtractOperationMBean()\n {\n return new Operation(\"subtract\");\n }",
"public static Action pull() {\n return new Action() {\n @Override\n protected void perform(ActiveActor a) {\n if(a.getGrid().isValid(a.getLocation().getAdjacentLocation(a.getDirection()))) {\n Actor b = a.getGrid().get(a.getLocation().getAdjacentLocation(a.getDirection()));\n if(b instanceof Movable && b instanceof DestructibleActor) {\n DestructibleActor c = (DestructibleActor) b;\n a.setDirection(a.getDirection() + 180);\n c.setDirection(a.getDirection());\n if(c.canMove()) {\n a.move();\n c.move();\n a.setDirection(a.getDirection() + 180);\n a.energy = a.energy - getCost();\n }\n }\n }\n }\n\n @Override\n public int getCost() {\n return 10;\n }\n\n @Override\n public boolean isExclusive() {\n return false;\n }\n\n @Override\n public Object getData() {\n return null;\n }\n\n @Override\n public String toString() {\n return \"Pull()\";\n }\n };\n }",
"public POGOProtos.Rpc.CombatActionProto.Builder getMinigameActionBuilder() {\n \n onChanged();\n return getMinigameActionFieldBuilder().getBuilder();\n }",
"public static ScaleEntityDownAction getInstance(){\r\n\t\tif(instance == null){\r\n\t\t\tinstance = new ScaleEntityDownAction();\r\n\t\t}\r\n\t\treturn instance;\r\n\t}",
"ActionBlock createActionBlock();",
"public PDAction getBl() {\n/* 216 */ COSDictionary bl = (COSDictionary)this.actions.getDictionaryObject(\"Bl\");\n/* 217 */ PDAction retval = null;\n/* 218 */ if (bl != null)\n/* */ {\n/* 220 */ retval = PDActionFactory.createAction(bl);\n/* */ }\n/* 222 */ return retval;\n/* */ }",
"public Command getUnmaximizeCommand() {\n return unmaximizeCommand;\n }",
"public JButtonOperator btMoveDown() {\n if (_btMoveDown==null) {\n String moveDown = Bundle.getString(\"org.netbeans.modules.java.freeform.ui.Bundle\", \"LBL_ClasspathPanel_Move_Down\");\n _btMoveDown = new JButtonOperator(this, moveDown);// I18N\n }\n return _btMoveDown;\n }",
"TurnAction createTurnAction();",
"@Override\n\tpublic int getAction() {\n\t\tint bstar = -1;\n\t\tdouble bstarval = Double.NEGATIVE_INFINITY;\n\t\tfor (int b : actions) {\n\t\t\t// now we need to look at each possible state transition\n\t\t\tdouble newStateSum = 0;\n\t\t\t// which means for every possible next state\n\t\t\tfor (int newX = 0; newX < beliefs.length; newX++) {\n\t\t\t\tfor (int newY = 0; newY < beliefs[0].length; newY++) {\n\t\t\t\t\tint[] newState = new int[]{newX,newY};\n\t\t\t\t\t// we need to look at every possible previous state\n\t\t\t\t\tdouble stateSum = 0;\n\t\t\t\t\tfor (int x = 0; x < beliefs.length; x++) {\n\t\t\t\t\t\tfor (int y = 0; y < beliefs[0].length; y++) {\n\t\t\t\t\t\t\tstateSum += beliefs[x][y] * // belief in CURRENT state if we were to make the observation, times\n\t\t\t\t\t\t\t\t\t\tworld.transitionProbability(newX, newY, x, y, b) * // probability of getting into the new state\n\t\t\t\t\t\t\t\t\t\tworld.getReward(newState);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tnewStateSum += stateSum;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (newStateSum > bstarval) {\n\t\t\t\tbstar = b;\n\t\t\t\tbstarval = newStateSum;\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"(EntropicExplorer) Choosing action: \" + world.actionToString(bstar) + \" (value = \" + bstarval + \")\");\n\t\tlastAction = bstar;\n\t\tadvanceBeliefs(bstar);\n\t\treturn bstar;\n\t}",
"public BattleWeaponsSegmentAction() {\n }",
"public E min() {\n\n }",
"Activity getRepairBackwardActivity();",
"public ResetAction() {\n width = height = mines = 0;\n }",
"Model minimize(Model model);",
"float getXStepMin();",
"public interface IAction {\n /**\n * A function that returns the state of the object at a particular tick. The object's state is in\n * proportion to where the tick is in the action's interval (between start and end time).\n *\n * @param tick an int that represents the frame of the animation per unit of time.\n * @param accumulatorShape keeps track of the shape at tick.\n * @return the shape at the tick.\n * @throws IllegalArgumentException if the tick is negative. if the shape is null.\n */\n IShape getShapeAtTick(double tick, IShape accumulatorShape);\n\n /**\n * Gets the current shape of the Action object.\n *\n * @return the current shape of the Action object.\n */\n IShape getCurrentShape();\n\n /**\n * Gets the time of the Action object.\n *\n * @return the time of the Action object.\n */\n Time getTime();\n\n /**\n * Gets the type of the Action object.\n *\n * @return the type of the Action object.\n */\n Action getType();\n\n /**\n * Gets the name of the Action object.\n *\n * @return the name of the Action object.\n */\n String getName();\n\n /**\n * Gets the old position of the Action object.\n *\n * @return the old position of the Action object.\n */\n Position getOldPosition();\n\n /**\n * Gets the new position of the Action object.\n *\n * @return the new position of the Action object.\n */\n Position getNewPosition();\n\n /**\n * Gets the old with of the Action object.\n *\n * @return the old width of the Action object.\n */\n double getOldWidth();\n\n /**\n * Gets the old height of the Action object.\n *\n * @return the new height of the Action object.\n */\n double getOldHeight();\n\n /**\n * Gets the new width of the Action object.\n *\n * @return the new width of the Action object.\n */\n double getNewWidth();\n\n /**\n * Gets the new height of the Action object.\n *\n * @return the new height of the Action object.\n */\n double getNewHeight();\n\n /**\n * Gets the old color of the Action object.\n *\n * @return the old color of the Action object.\n */\n RGB getOldColor();\n\n /**\n * Gets the new color of the Action object.\n *\n * @return the new color of the Action object\n */\n RGB getNewColor();\n}",
"public Image getMinimDown();",
"public MinStack() {\n in = new Stack();\n out = new Stack();\n min = Integer.MAX_VALUE;\n out.push(min);\n }",
"POGOProtos.Rpc.CombatActionProto getMinigameAction();",
"public E removeMin() {\n // TODO: YOUR CODE HERE\n E min = getElement(1);\n swap(1, size());\n setElement(size(), null);\n bubbleDown(1);\n size -= 1;\n return min;\n }",
"public JButtonOperator btMoveDown() {\n if (_btMoveDown==null) {\n _btMoveDown = new JButtonOperator(this, \"Move Down\"); // NOI18N\n }\n return _btMoveDown;\n }",
"public T removeMin ();",
"public Action getBestAction(State state);",
"private JButton getJbtnPreviousStep() {\n\t\tif (jbtnPreviousStep == null) {\n\t\t\tjbtnPreviousStep = new JButton();\n\t\t\tjbtnPreviousStep.setHorizontalAlignment(SwingConstants.CENTER);\n\t\t\tjbtnPreviousStep.setHorizontalTextPosition(SwingConstants.TRAILING);\n\t\t\tjbtnPreviousStep.setIcon(new ImageIcon(getClass().getResource(\"/org/measureyourgradient/images/back.png\")));\n\t\t\tjbtnPreviousStep.setText(\" Previous Step\");\n\t\t\tjbtnPreviousStep.setSize(new Dimension(178, 34));\n\t\t\tjbtnPreviousStep.setLocation(new Point(6, 576));\n\t\t\tjbtnPreviousStep.setActionCommand(\"Previous Step\");\n\t\t}\n\t\treturn jbtnPreviousStep;\n\t}",
"TurnDegAction createTurnDegAction();",
"public static Action move() {\n return new Action() {\n @Override\n protected void perform(ActiveActor a) {\n if(a.canMove()) {\n a.move();\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 \"Move()\";\n }\n };\n }",
"public static Action push() {\n return new Action() {\n @Override\n protected void perform(ActiveActor a) {\n if(a.getGrid().isValid(a.getLocation().getAdjacentLocation(a.getDirection()))) {\n Actor b = a.getGrid().get(a.getLocation().getAdjacentLocation(a.getDirection()));\n if(b instanceof Movable && b instanceof DestructibleActor) {\n DestructibleActor c = (DestructibleActor) b;\n c.setDirection(a.getDirection());\n if(c.canMove()) {\n c.move();\n a.move();\n a.energy = a.energy - getCost();\n }\n\n }\n }\n }\n\n @Override\n public int getCost() {\n return 10;\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 \"Push()\";\n }\n };\n }",
"public T negative() {\n T A = copy();\n ops.changeSign(A.mat);\n return A;\n }",
"public JButtonOperator btMoveUp() {\n if (_btMoveUp==null) {\n String moveUp = Bundle.getString(\"org.netbeans.modules.java.freeform.ui.Bundle\", \"LBL_ClasspathPanel_Move_Up\");\n _btMoveUp = new JButtonOperator(this, moveUp);// I18N\n }\n return _btMoveUp;\n }",
"private Action bestActionFromFinishedTree() {\n return Collections.max(validActionsDiscretized, Comparator.comparing(\n c -> root.getActionReward(c) / (double) root.getActionVisits(c)));\n }",
"public static MatrixAccumulator mkMinAccumulator() {\n return new MinMatrixAccumulator();\n }",
"public Command getMaximizeCommand() {\n return maximizeCommand;\n }",
"public RateLimiterAction getAction() {\n return action;\n }",
"public Node getChildNode(Node node, Action action) {\n\t\tint[] new_state = new int[2];\n\n new_state[0] = node.state[0];\n\t\tnew_state[1] = node.state[1];\n\n\t\tif (action != null) {\n\t\t\t// Implementing the transition model\n\t\t\tif (action.to == \"x\") {\n\t\t\t\tnew_state[0] = node.state[0] + action.quantity;\n\t\t\t} \n\n\t\t\tif (action.to == \"y\") {\n\t\t\t\tnew_state[1] = node.state[1] + action.quantity;\n\t\t\t}\n\n\t\t\tif (action.from == \"x\") {\n\t\t\t\tnew_state[0] = node.state[0] - action.quantity;\n\t\t\t}\n\n\t if (action.from == \"y\") {\n\t\t\t\tnew_state[1] = node.state[1] - action.quantity;\n\n\t\t\t}\n\n\t\t}\n\n\t\tNode new_node = new Node(new_state, action, node);\n\n\t\treturn new_node;\n\t}",
"public BubblePowerUp() {\n super(-50, -50);\n \n }",
"protected IntervalAction action() {\n CCSize s = Director.sharedDirector().winSize();\n return MoveBy.action(duration, s.width-ADJUST_FACTOR,0);\n }",
"@Override\n\t\t\tpublic double reward(State s1, Action a, State s2) {\n\t\t\t\tif ((Double)s2.get(\"x\") >= 0.5) {\n\t\t\t\t\treturn 100;\n\t\t\t\t}\n\t\t\t\tif ((Double)s2.get(\"x\") == mcGen.physParams.xmin) {\n\t\t\t\t\treturn -100;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}",
"public Action getBestAction() {\n long startTime = System.currentTimeMillis();\n\n // Continue iterating through the search algorithm until the time limit\n // is reached\n while (System.currentTimeMillis() < startTime + timeLimit) {\n Node newNode = selectAndExpandNewNode();\n double randomPlayout = simulateRandomPlayout(newNode);\n backPropagate(newNode, randomPlayout);\n }\n\n // Technically this function will take us slightly over timeLimit, but\n // that's why a buffer is removed from timeLimit when passed to this\n // class\n return bestActionFromFinishedTree();\n }",
"public abstract Move launchMinMax();",
"public JButtonOperator btMoveUp() {\n if (_btMoveUp==null) {\n _btMoveUp = new JButtonOperator(this, \"Move Up\"); // NOI18N\n }\n return _btMoveUp;\n }",
"public void min(View view) {\n liter--;\n botol();\n }",
"public final EObject ruleMinOperator() throws RecognitionException {\r\n EObject current = null;\r\n\r\n Token otherlv_1=null;\r\n\r\n enterRule(); \r\n \r\n try {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4953:28: ( ( () otherlv_1= 'min' ) )\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4954:1: ( () otherlv_1= 'min' )\r\n {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4954:1: ( () otherlv_1= 'min' )\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4954:2: () otherlv_1= 'min'\r\n {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4954:2: ()\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4955:5: \r\n {\r\n if ( state.backtracking==0 ) {\r\n\r\n current = forceCreateModelElement(\r\n grammarAccess.getMinOperatorAccess().getMinOperatorAction_0(),\r\n current);\r\n \r\n }\r\n\r\n }\r\n\r\n otherlv_1=(Token)match(input,69,FOLLOW_69_in_ruleMinOperator11209); if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n\r\n \tnewLeafNode(otherlv_1, grammarAccess.getMinOperatorAccess().getMinKeyword_1());\r\n \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n leaveRule(); \r\n }\r\n }\r\n \r\n catch (RecognitionException re) { \r\n recover(input,re); \r\n appendSkippedTokens();\r\n } \r\n finally {\r\n }\r\n return current;\r\n }",
"public T deleteMin();",
"@Override\n public Action getBestAction(Agent r, Maze m, QLearning q) {\n double epsilon = 0.000001d;\n ArrayList<Action> actions = m.getValidActions(r);\n double[] actionValues = q.getActionValues(r.getState(m), actions);\n\n ArrayList<Action> bestActions = new ArrayList<>();\n double maxValue = Double.MIN_VALUE;\n\n for (int i = 0; i < actionValues.length; i++)\n {\n if (actionValues[i] > maxValue)\n {\n bestActions = new ArrayList<>();\n maxValue = actionValues[i];\n bestActions.add(actions.get(i));\n } else if (Math.abs(actionValues[i] - maxValue) < epsilon) {\n bestActions.add(actions.get(i));\n }\n }\n\n Random rand = new Random();\n return bestActions.get(rand.nextInt(bestActions.size()));\n }",
"public ActionState createActionState();",
"ForwardAction createForwardAction();",
"@Override\n public Expression create(Expression a, Expression b) {\n return new Minus(a, b);\n }",
"public MoveUpAction() {\n\tsuper(\"▲ Move Row Up\");\n }",
"SomeMinus createSomeMinus();",
"public ActionListener newResetAction() {\n // TODO Auto-generated method stub\n return new ResetAction();\n }",
"public POGOProtos.Rpc.CombatActionProto getMinigameAction() {\n if (minigameActionBuilder_ == null) {\n return minigameAction_ == null ? POGOProtos.Rpc.CombatActionProto.getDefaultInstance() : minigameAction_;\n } else {\n return minigameActionBuilder_.getMessage();\n }\n }",
"public Image getMinimUp();",
"Activity getTransformBackwardActivity();",
"public void minusPoint_action()\r\n/* */ {\r\n/* 87 */ this.points_action -= 1;\r\n/* */ }",
"public INIntervalAction reverse() throws Exception\n {\n throw new Exception(\"Reverse Action Not Implemented for the base class of CCIntervalAction\");\n }",
"public ModifyCacheMaxSizeAction build() {\n if (currentCacheMaxSizeInBytes == null || heapMaxSizeInBytes == null) {\n LOG.error(\n \"Action: Fail to read cache max size or heap max size from node config cache. Return an non-actionable action\");\n return new ModifyCacheMaxSizeAction(\n esNode, cacheType, appContext, -1, -1, coolOffPeriodInMillis, false);\n }\n // skip the step size bound check if we set desiredCapacity\n // explicitly in action builder\n if (desiredCacheMaxSizeInBytes == null) {\n desiredCacheMaxSizeInBytes = currentCacheMaxSizeInBytes;\n if (isIncrease) {\n desiredCacheMaxSizeInBytes += stepSizeInBytes;\n }\n }\n long upperBoundInBytes = (long) (upperBoundThreshold * heapMaxSizeInBytes);\n desiredCacheMaxSizeInBytes = Math.min(desiredCacheMaxSizeInBytes, upperBoundInBytes);\n return new ModifyCacheMaxSizeAction(\n esNode,\n cacheType,\n appContext,\n desiredCacheMaxSizeInBytes,\n currentCacheMaxSizeInBytes,\n coolOffPeriodInMillis,\n canUpdate);\n }",
"@OutVertex\n ActionTrigger getSource();",
"public StackWithMin() {\n st = new LinkedList<>();\n minSt = new LinkedList<>();\n }",
"public Action createOperation(int choose) {\n if (choose==0) {\n action = new Addition();\n } else if (choose==1) {\n action = new Subtracting();\n } else if (choose==2) {\n action = new Multiplication();\n } else if (choose==3) {\n action = new Dividing();\n } else {\n action = null;\n }\n return action;\n }",
"public static State min(State a, State b){\n return a.score <= b.score ? a: b;\n }",
"private ScaleEntityDownAction(){\r\n\t\tscaleFactor = 0.1f;\r\n\t}",
"Operation getBestOp() {\n\t\t\tPriorityQueue<Operation> pq = new PriorityQueue<Operation>(new Comparator<Operation>() {\n\t\t\t\tpublic int compare(Operation op1, Operation op2) {\n\t\t\t\t\treturn op1.val - op2.val;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tpq.add(this.minAddOp);\n\t\t\tpq.add(this.minDeleteOp);\n\t\t\tpq.add(this.minSwapOp);\n\n\t\t\treturn pq.poll();\n\t\t}",
"public interface PrioritizableAction<K extends PrioritizableAction<K,T>,T> extends Action<T>, Comparable<K>{\n}",
"@Override\r\n\tpublic void minusFromCost() {\n\t\t\r\n\t}",
"public LightSideGoesFirstEffect(Action action) {\n super(action);\n }",
"public BackwardCommand() {\n setNumParams(NUM_PARAMS);\n }",
"public ComplementOp() {\r\n\t\tsuper();\r\n\t}",
"public void undoAction(){}",
"@Override\n\tpublic void createAction(Model m) {\n\t\t\n\t}",
"public MinStack() {\n min = Integer.MIN_VALUE;\n stack = new Stack();\n }",
"@Override\n public BinaryFunc get() { return new AbsPlus(); }",
"Transition createTransition();",
"Transition createTransition();",
"public FreeColAction clone() throws CloneNotSupportedException {\n throw new CloneNotSupportedException(\"FreeColAction can not be cloned.\");\n }",
"public abstract int deleteMin();",
"public MinStack() {\n data = new Stack();\n min = new Stack();\n }",
"private CalculateInitialAttritionEffect(Action action) {\n super(action);\n }",
"private com.google.protobuf.SingleFieldBuilderV3<\n POGOProtos.Rpc.CombatActionProto, POGOProtos.Rpc.CombatActionProto.Builder, POGOProtos.Rpc.CombatActionProtoOrBuilder> \n getMinigameActionFieldBuilder() {\n if (minigameActionBuilder_ == null) {\n minigameActionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<\n POGOProtos.Rpc.CombatActionProto, POGOProtos.Rpc.CombatActionProto.Builder, POGOProtos.Rpc.CombatActionProtoOrBuilder>(\n getMinigameAction(),\n getParentForChildren(),\n isClean());\n minigameAction_ = null;\n }\n return minigameActionBuilder_;\n }",
"POGOProtos.Rpc.CombatActionProtoOrBuilder getMinigameActionOrBuilder();",
"@Override\r\n\tpublic Action getAction() {\n\t\treturn Action.GRUNINST;\r\n\t}",
"private JMenuItem getMniForward() {\r\n\t\tif (mniForward == null) {\r\n\t\t\tmniForward = new JMenuItem();\r\n\t\t\tmniForward.setText(\"Forward\");\r\n\t\t\tmniForward.addActionListener(new java.awt.event.ActionListener() {\r\n\t\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent e) {\r\n\t\t\t\t\tbtnForward.doClick();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn mniForward;\r\n\t}",
"public T min();",
"public interface Action {\n\t\n\t/**\n\t * @return The action's printable value\n\t */\n\tpublic String toString();\n\n\tpublic Action actionClone();\n \t\n}",
"public static ObjectInstance getDivideToSubtractOperationCallObjectInstance()\n {\n ObjectName o = null;\n try\n {\n Hashtable<String, String> properties = new Hashtable<String, String>(\n 4);\n properties.put(\"sourceEndpoint\", StringMangler\n .EncodeForJmx(getDivideEndpointMBean().getUrl()));\n properties.put(\"sourceOperation\", getDivideOperationMBean()\n .getName());\n properties.put(\"targetEndpoint\", StringMangler\n .EncodeForJmx(getSubtractEndpointMBean().getUrl()));\n properties.put(\"targetOperation\", getSubtractOperationMBean()\n .getName());\n properties.put(\"jmxType\", new OperationCall().getJmxType());\n o = new ObjectName(_domain, properties);\n }\n catch (Exception e)\n {\n Assert\n .fail(\"'Divide-Subtract' OperationCall ObjectInstance could not be created. \"\n + e.getMessage());\n }\n return new ObjectInstance(o, new OperationCall().getClass().getName());\n }",
"public Vector minus(Vector m) {\n\t\treturn new Vector((deltaX - m.getDeltaX()), (deltaY - m.getDeltaY()));\n\t}",
"public void reduce() {\n if (numTransitions <= 1) {\n return;\n }\n sortTransitions(Transition.CompareByDestThenMinMax);\n State p = null;\n int min = -1, max = -1;\n int upto = 0;\n for (int i=0;i<numTransitions;i++) {\n final Transition t = transitionsArray[i];\n if (p == t.to) {\n if (t.min <= max + 1) {\n if (t.max > max) max = t.max;\n } else {\n if (p != null) {\n transitionsArray[upto++] = new Transition(min, max, p);\n }\n min = t.min;\n max = t.max;\n }\n } else {\n if (p != null) {\n transitionsArray[upto++] = new Transition(min, max, p);\n }\n p = t.to;\n min = t.min;\n max = t.max;\n }\n }\n\n if (p != null) {\n transitionsArray[upto++] = new Transition(min, max, p);\n }\n numTransitions = upto;\n }",
"protected PMBaseAction() {\r\n super();\r\n }"
]
| [
"0.73908067",
"0.72783405",
"0.59768593",
"0.56821203",
"0.56821203",
"0.56821203",
"0.5563103",
"0.5431185",
"0.53476757",
"0.53476757",
"0.53476757",
"0.5341887",
"0.5273214",
"0.5197699",
"0.51027405",
"0.50716656",
"0.506882",
"0.5047806",
"0.50457525",
"0.5024322",
"0.50080633",
"0.5004896",
"0.4967643",
"0.49640593",
"0.49620923",
"0.49552503",
"0.49498358",
"0.49314848",
"0.49240413",
"0.4923461",
"0.49223796",
"0.4919206",
"0.4917597",
"0.4917549",
"0.49018824",
"0.49012792",
"0.48977298",
"0.48924983",
"0.48817265",
"0.48808387",
"0.48620686",
"0.48496452",
"0.48491496",
"0.48484805",
"0.48413026",
"0.483985",
"0.4838435",
"0.48374215",
"0.48297164",
"0.48277637",
"0.48145255",
"0.48054072",
"0.47985512",
"0.47960642",
"0.4796047",
"0.47953498",
"0.47862494",
"0.47803086",
"0.4780098",
"0.47701538",
"0.4762251",
"0.4753298",
"0.47499317",
"0.47458896",
"0.47351778",
"0.47346607",
"0.47252536",
"0.47161713",
"0.47144225",
"0.47057575",
"0.47003907",
"0.46968374",
"0.4695683",
"0.4694765",
"0.46938044",
"0.46872944",
"0.46828136",
"0.46777478",
"0.4658561",
"0.46426016",
"0.46415606",
"0.46415347",
"0.46373004",
"0.46351737",
"0.46162128",
"0.46162128",
"0.46161923",
"0.4615698",
"0.4615348",
"0.46149135",
"0.46147606",
"0.46110442",
"0.460127",
"0.45950034",
"0.4591655",
"0.45862123",
"0.458522",
"0.45824024",
"0.45777932",
"0.45747888"
]
| 0.9074621 | 0 |
Returns a new object of class 'Turn Action'. | TurnAction createTurnAction(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Turn createTurn();",
"public SetPlayerTurnAction() {}",
"Action createAction();",
"Action createAction();",
"Action createAction();",
"public abstract Action takeTurn();",
"TurnDegAction createTurnDegAction();",
"public void createTurn() {\n Turn turn = new Turn(this.getOnlinePlayers());\n this.setCurrentTurn(turn);\n }",
"SendAction createSendAction();",
"TurnController createTurnController(PlayerTurn turn);",
"public static Action turn(final int direction) {\n return new Action() {\n @Override\n protected void perform(ActiveActor a) {\n a.setDirection(direction);\n }\n\n @Override\n public int getCost() {\n return 0;\n }\n\n @Override\n public boolean isExclusive() {\n return false;\n }\n\n @Override\n public Object getData() {\n return direction;\n }\n\n @Override\n public String toString() {\n return \"Turn(\" + direction + \")\";\n }\n };\n }",
"public ActionState createActionState();",
"public interface Action {\n\t\n\t/**\n\t * @return The action's printable value\n\t */\n\tpublic String toString();\n\n\tpublic Action actionClone();\n \t\n}",
"CaseAction createCaseAction();",
"public Action newAction(Object data) throws Exception;",
"public GameAction runTurnAction() {\r\n // Is the game over? If so return\r\n if (this.isGameOver) {\r\n return this.currentAction;\r\n }\r\n \r\n // Get the next game action for this turn\r\n GameAction currentTurnAction = this.turnActions.get(turnActionLocation);\r\n \r\n // Clear out the return values for this gameAction\r\n currentTurnAction.clearActionReturnValues();\r\n \r\n // Set the currentAction (used for setting return values)\r\n this.currentAction = currentTurnAction;\r\n \r\n // Process the next action for this turn\r\n this.processGameAction(currentTurnAction);\r\n \r\n // Increment the turn action location or loop back to 0\r\n this.turnActionLocation++;\r\n \r\n // Check to make sure we haven't gone over the turn list size\r\n if (this.turnActionLocation >= this.turnActions.size()) {\r\n turnActionLocation = 0;\r\n }\r\n\r\n // Return any necessary values to the caller as a gameAction\r\n return currentTurnAction;\r\n }",
"ActionType createActionType();",
"public Action(GameManager gameManager){\n this.gameManager = gameManager;\n }",
"public void createAction() {\n }",
"public Action(String name) {\n this.name = name;\n }",
"void provideNewTurn();",
"public static Action move() {\n return new Action() {\n @Override\n protected void perform(ActiveActor a) {\n if(a.canMove()) {\n a.move();\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 \"Move()\";\n }\n };\n }",
"public ScheduledActionAction() {\n\n }",
"public static Action turn(final ModifiableInteger direction) {\n return new Action() {\n @Override\n protected void perform(ActiveActor a) {\n a.setDirection(direction.getValue());\n }\n\n @Override\n public int getCost() {\n return 0;\n }\n\n @Override\n public boolean isExclusive() {\n return false;\n }\n\n @Override\n public Object getData() {\n return direction;\n }\n\n @Override\n public String toString() {\n return \"Turn(\" + (direction != null ? direction.toString() : \"null\") + \")\";\n }\n };\n }",
"protected Action makeAcceptAction() {\n\t\tAction myAction;\n\t\tmyAction = new Accept(getAgentID(),\n\t\t\t\t((ActionWithBid) opponentAction).getBid());\n\t\treturn myAction;\n\t}",
"@Override\n protected Action[] createActions() {\n return new Action[0];\n }",
"private Action initializeAction(final String classname) {\n\t\tAction action = null;\n\t\tif (classname != null && !\"\".equals(classname)) {\n\t\t\tClass<?> clazz = null;\n\t\t\ttry {\n\t\t\t\tclazz = Class.forName(classname);\n\t\t\t\taction = (Action) clazz.newInstance();\n\t\t\t} catch (InstantiationException e) {\n\t\t\t\tlog.error(\"Cannot instantiate action class: \" + classname);\n\t\t\t} catch (IllegalAccessException e) {\n\t\t\t\tlog.error(\"Not privileged to access action instance: \"\n\t\t\t\t\t\t+ classname);\n\t\t\t} catch (Throwable e) {\n\t\t\t\tlog.error(\"Cannot load action class: \" + classname);\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\tif (action == null) {\n\t\t\t// Instantiate a mock action such that menu item can\n\t\t\t// be displayed.\n\t\t\taction = new DummyAction();\n\t\t\tlog.warn(\"Instantiated mock action class.\");\n\t\t}\n\t\treturn action;\n\t}",
"ForwardAction createForwardAction();",
"public static Action make(int type)\n {\n switch(type)\n {\n case FIREBALL:\n return new Action();\n case DEFEND:\n return new ActShield();\n case SPIRIT_BURST:\n return new SpiritBurst();\n case INVINCIBILITY:\n return new Invincibility();\n }\n return null;\n }",
"@Override\r\n\tpublic void makeMove(A action) {\r\n\t\tgame.execute(action);\r\n\t}",
"ActionDefinition createActionDefinition();",
"BackwardAction createBackwardAction();",
"public NamedAction createNamedAction(String name) {\n NamedActionImpl action = new NamedActionImpl();\n action.setName(name);\n return action;\n }",
"public BattleWeaponsSegmentAction() {\n }",
"public Turn newTurn() {\n int newStudentNb = formula.newStudent();\n\n this.updateCurrentEvents();\n this.currentEvents.addAll(EventManager.getEvents());\n this.reloadHires(); // Reload list of professors available for hire\n this.sortProfessors();\n\n Turn turn = new Turn(this.getWeek()+1);\n turn.newStudent = newStudentNb;\n turn.newCash = this.getIncome();\n turn.newMoral = 0;\n turn.events = University.get().getCurrentEvents();\n\n for (Event event : turn.events){\n event.getResult(AnsType.YES).setComputation(eventComputation(event, AnsType.YES));\n if (event.getType() == EventType.TWO_CHOICES){\n event.getResult(AnsType.NO).setComputation(eventComputation(event, AnsType.NO));\n }\n }\n\n // TODO WHEN APPLY\n if (basicData.getMoney()+getIncome() < 0){\n turn.resultTurn = removeBestProfessor();\n }\n return turn;\n }",
"public void myTurn();",
"public Action newAction(String command) {\n\t\tif (command == null)\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\"No legal command string passed!\");\n\t\tif (super.containsKey(command))\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\"Allready kontains a mapping for that key!\");\n\t\tAction action = new ActionForward();\n\t\taction.putValue(Action.ACTION_COMMAND_KEY, command);\n\t\tsuper.put(command, action);\n\t\tactionList.add(action);\n\t\treturn action;\n\t}",
"public void takeAction(BoardGameController.BoardBugAction action)\n {\n\n }",
"public static Action buildShip(int id, char type) {\n\t\treturn new Action(id, type);\n\t}",
"LogAction createLogAction();",
"StateClass(String action) {\r\n setAccountAction(action); \r\n }",
"public Action(String id) {\n\t\tthis.id = id;\n\t}",
"protected void init_actions()\r\n {\r\n action_obj = new CUP$CircuitCup$actions(this);\r\n }",
"public UpcomingContestsManagerAction() {\r\n }",
"public FlowAction(FlowActionType type) {\n this.actionType = type;\n }",
"public static Action action(String id) {\n/* 205 */ return actions.get(id);\n/* */ }",
"public Action newAction(Object key) {\n\t\tif (key == null)\n\t\t\tthrow new IllegalArgumentException(\"No legal key passed!\");\n\t\tif (super.containsKey(key))\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\"Allready kontains a mapping for that key!\");\n\t\tAction action = new ActionForward();\n\t\tsuper.put(key, action);\n\t\tactionList.add(action);\n\t\treturn action;\n\t}",
"@Override\n public void toTurnPhase() {\n changePhase(new TurnPhase());\n }",
"public CreateIndividualPreAction() {\n }",
"protected PMBaseAction() {\r\n super();\r\n }",
"public abstract Action getAction();",
"public void Turn(){\r\n \r\n }",
"NoAction createNoAction();",
"public interface Action {\n /**\n * Takes an action based on the provided state\n * If the action for the state is forbidden it must return NULL\n * @param state Generic State Object (MAY NEED CAST TO YOUR OWN STATE OBJECT)\n * @return State This method must return your new State declaration created after taking the action using the second constructor.\n */\n State takeAction(State state);\n}",
"public AgentLogoffAction() {\n\n }",
"private Action(){\r\n\t\tthis(-1);\r\n\t}",
"@Override\n public void setNewAction(Mossa.Action action) {\n jumpMove.setDisable(false);\n Platform.runLater(() -> {\n submitAction.setDisable(true);\n\n });\n switch (action) {\n case BUILD:\n lightBuild();\n if (!inTurno) {\n lightMyPawns();\n inTurno = true;\n firstAction = true;\n } else {\n c = table.getTableCell(table.getXYPawn(getID(), currentPawn, true),\n table.getXYPawn(getID(), currentPawn, false));\n firstAction = false;\n lightAvailable(c, bt[table.getXYPawn(getID(), currentPawn, true)][table.getXYPawn(getID(), currentPawn, false)]);\n\n }\n currentMove = new Mossa();\n currentMove.setAction(action);\n\n break;\n case MOVE:\n lightMove();\n currentMove = new Mossa();\n currentMove.setAction(action);\n if (!inTurno) {\n effetto = true;\n lightMyPawns();\n inTurno = true;\n firstAction = true;\n } else {\n firstAction = false;\n c = table.getTableCell(table.getXYPawn(getID(), currentPawn, true),\n table.getXYPawn(getID(), currentPawn, false));\n lightAvailable(c, bt[table.getXYPawn(getID(), currentPawn, true)][table.getXYPawn(getID(), currentPawn, false)]);//prima era true\n\n }\n }\n }",
"public Action(long id) {\n this(id, \"\");\n }",
"StopAction createStopAction();",
"public void otherTurn\n (String name);",
"protected void init_actions()\r\n {\r\n action_obj = new CUP$LuaGrammarCup$actions(this);\r\n }",
"public MemberAction() {\n\t\tsuper();\n\t}",
"public void yourTurn();",
"POGOProtos.Rpc.CombatActionProto getCurrentAction();",
"public static Action push() {\n return new Action() {\n @Override\n protected void perform(ActiveActor a) {\n if(a.getGrid().isValid(a.getLocation().getAdjacentLocation(a.getDirection()))) {\n Actor b = a.getGrid().get(a.getLocation().getAdjacentLocation(a.getDirection()));\n if(b instanceof Movable && b instanceof DestructibleActor) {\n DestructibleActor c = (DestructibleActor) b;\n c.setDirection(a.getDirection());\n if(c.canMove()) {\n c.move();\n a.move();\n a.energy = a.energy - getCost();\n }\n\n }\n }\n }\n\n @Override\n public int getCost() {\n return 10;\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 \"Push()\";\n }\n };\n }",
"public void beginTurn(){\n }",
"@Override\n\tpublic void newAction() {\n\t\t\n\t}",
"MoveActionController createMoveActionController();",
"public ExecuteAction()\n {\n this(null);\n }",
"public Action createOperation(int choose) {\n if (choose==0) {\n action = new Addition();\n } else if (choose==1) {\n action = new Subtracting();\n } else if (choose==2) {\n action = new Multiplication();\n } else if (choose==3) {\n action = new Dividing();\n } else {\n action = null;\n }\n return action;\n }",
"private ActionPackage() {}",
"ForwardMinAction createForwardMinAction();",
"public VisitAction() {\n }",
"@Override\r\n\tpublic void startTurn() {\n\t\t\r\n\t}",
"GameState requestActionGamePiece();",
"public IPSAAClientAction getAction(String actionType)\n {\n IPSAAClientAction action = m_actions.get(actionType);\n if(action == null)\n {\n // Use reflection to instantiate the class\n String pack = getClass().getPackage().getName();\n String className = pack + \".impl.PS\" + actionType + \"Action\";\n \n try\n {\n Class clazz = Class.forName(className);\n action = (IPSAAClientAction) clazz.newInstance();\n m_actions.put(actionType, action);\n }\n catch (ClassNotFoundException ignore)\n {\n // ignore\n }\n catch (InstantiationException e)\n {\n ms_log.error(e.getLocalizedMessage(), e);\n }\n catch (IllegalAccessException e)\n {\n ms_log.error(e.getLocalizedMessage(), e);\n }\n \n }\n return action;\n }",
"protected void init_actions()\n {\n action_obj = new CUP$Grm$actions();\n }",
"DomainAction createDomainAction();",
"protected void init_actions()\n {\n action_obj = new CUP$FractalParser$actions(this);\n }",
"ActionBlock createActionBlock();",
"public void newTurn() {\r\n\t\tthis.money = 0;\r\n\t\tthis.blackTurns = 1;\r\n\t\tthis.blueTurns = 0;\r\n\t\tthis.purpleTurns = 0;\r\n\t\tthis.brownTurns = 0;\r\n\t\tthis.redTurns = 0;\r\n\t}",
"protected void init_actions()\n {\n action_obj = new CUP$Asintactico$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$CoolParser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$CoolParser$actions(this);\n }",
"public abstract ActionInMatch act();",
"protected void init_actions()\r\n {\r\n action_obj = new CUP$Parser$actions(this);\r\n }",
"public ChooseNormalActionTurnState(Turn turn) {\n super(turn);\n turn.setTurnPhase(TurnPhase.NORMAL_TO_LEADER_ACTION);\n }",
"public LCAction(int id, String msgText, String name, String actionType, int msgId) {\r\n this.id = id;\r\n this.msgText = msgText;\r\n this.name = name;\r\n if (actionType == null)\r\n actionType = \"playLearningCompanion\";\r\n this.actionType = actionType;\r\n this.msgId = msgId;\r\n }",
"CustomAction(String actionType, String message) {\n action.put(\"Object\", actionType);\n JSONObject attributes = new JSONObject();\n attributes.put(\"message\", message);\n action.put(\"Action\", attributes);\n }",
"public void action(){\n turn.sendMsg(turn.getController().getTurnOwner().getName()+\"'s turn!\");\n if(turn.getPlayer().isDown()){\n turn.setPhase(new RecoveryPhase());\n }else {\n turn.setPhase(new StarsPhase());\n }\n }",
"protected void init_actions()\r\n {\r\n action_obj = new CUP$parser$actions(this);\r\n }",
"protected abstract int getTurn();",
"protected void init_actions()\n {\n action_obj = new CUP$Sintactico$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$Parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$Parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$Parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$Parser$actions(this);\n }",
"protected void init_actions()\n {\n action_obj = new CUP$Parser$actions(this);\n }",
"List<Action> build();",
"public A getAction() {\r\n\t\treturn action;\r\n\t}"
]
| [
"0.75133675",
"0.7470925",
"0.73743635",
"0.73743635",
"0.73743635",
"0.7212178",
"0.69567955",
"0.6662123",
"0.6578773",
"0.65760565",
"0.6501821",
"0.6474791",
"0.64580816",
"0.6409831",
"0.63806033",
"0.63796914",
"0.63645875",
"0.63493925",
"0.6310226",
"0.63075954",
"0.6299121",
"0.62830085",
"0.62450254",
"0.6147311",
"0.61248875",
"0.6101164",
"0.6070136",
"0.6045569",
"0.60048145",
"0.5948707",
"0.59170556",
"0.5884913",
"0.58796614",
"0.58463764",
"0.5840334",
"0.58348835",
"0.5800802",
"0.57841647",
"0.57751197",
"0.5763631",
"0.57503724",
"0.5739793",
"0.57263374",
"0.5719622",
"0.57141966",
"0.5702828",
"0.56858635",
"0.5658822",
"0.56559205",
"0.56458265",
"0.56451726",
"0.56350374",
"0.5624576",
"0.56208116",
"0.5619258",
"0.5618573",
"0.56178033",
"0.56159055",
"0.5594988",
"0.5594758",
"0.55939794",
"0.55899584",
"0.558658",
"0.5582471",
"0.55726147",
"0.5565148",
"0.5557572",
"0.5550012",
"0.5541185",
"0.5525061",
"0.55238295",
"0.55184364",
"0.55135024",
"0.55109614",
"0.55053145",
"0.54920727",
"0.54837656",
"0.5480836",
"0.5477949",
"0.5477556",
"0.5475328",
"0.5472709",
"0.54665506",
"0.54665506",
"0.5465287",
"0.5458373",
"0.5457384",
"0.5451452",
"0.54501086",
"0.54498774",
"0.54495925",
"0.54313296",
"0.5416258",
"0.5414998",
"0.5414998",
"0.5414998",
"0.5414998",
"0.5414998",
"0.54115236",
"0.5401495"
]
| 0.8867969 | 0 |
Returns a new object of class 'Turn Deg Action'. | TurnDegAction createTurnDegAction(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"TurnAction createTurnAction();",
"BackwardAction createBackwardAction();",
"public PDAction getD() {\n/* 128 */ COSDictionary d = (COSDictionary)this.actions.getDictionaryObject(COSName.D);\n/* 129 */ PDAction retval = null;\n/* 130 */ if (d != null)\n/* */ {\n/* 132 */ retval = PDActionFactory.createAction(d);\n/* */ }\n/* 134 */ return retval;\n/* */ }",
"Action createAction();",
"Action createAction();",
"Action createAction();",
"Turn createTurn();",
"public SetPlayerTurnAction() {}",
"CaseAction createCaseAction();",
"SendAction createSendAction();",
"public abstract Action takeTurn();",
"public static Action pull() {\n return new Action() {\n @Override\n protected void perform(ActiveActor a) {\n if(a.getGrid().isValid(a.getLocation().getAdjacentLocation(a.getDirection()))) {\n Actor b = a.getGrid().get(a.getLocation().getAdjacentLocation(a.getDirection()));\n if(b instanceof Movable && b instanceof DestructibleActor) {\n DestructibleActor c = (DestructibleActor) b;\n a.setDirection(a.getDirection() + 180);\n c.setDirection(a.getDirection());\n if(c.canMove()) {\n a.move();\n c.move();\n a.setDirection(a.getDirection() + 180);\n a.energy = a.energy - getCost();\n }\n }\n }\n }\n\n @Override\n public int getCost() {\n return 10;\n }\n\n @Override\n public boolean isExclusive() {\n return false;\n }\n\n @Override\n public Object getData() {\n return null;\n }\n\n @Override\n public String toString() {\n return \"Pull()\";\n }\n };\n }",
"StopAction createStopAction();",
"public BattleWeaponsSegmentAction() {\n }",
"public static ScaleEntityDownAction getInstance(){\r\n\t\tif(instance == null){\r\n\t\t\tinstance = new ScaleEntityDownAction();\r\n\t\t}\r\n\t\treturn instance;\r\n\t}",
"ActionType createActionType();",
"public PDAction getE() {\n/* 71 */ COSDictionary e = (COSDictionary)this.actions.getDictionaryObject(\"E\");\n/* 72 */ PDAction retval = null;\n/* 73 */ if (e != null)\n/* */ {\n/* 75 */ retval = PDActionFactory.createAction(e);\n/* */ }\n/* 77 */ return retval;\n/* */ }",
"public ScheduledActionAction() {\n\n }",
"ActionDefinition createActionDefinition();",
"public void createAction() {\n }",
"DomainAction createDomainAction();",
"ForwardAction createForwardAction();",
"public AgentLogoffAction() {\n\n }",
"public Action newAction(Object data) throws Exception;",
"NoAction createNoAction();",
"public PDAction getBl() {\n/* 216 */ COSDictionary bl = (COSDictionary)this.actions.getDictionaryObject(\"Bl\");\n/* 217 */ PDAction retval = null;\n/* 218 */ if (bl != null)\n/* */ {\n/* 220 */ retval = PDActionFactory.createAction(bl);\n/* */ }\n/* 222 */ return retval;\n/* */ }",
"public Action(GameManager gameManager){\n this.gameManager = gameManager;\n }",
"public Action(String name) {\n this.name = name;\n }",
"public ActionState createActionState();",
"public static Action move() {\n return new Action() {\n @Override\n protected void perform(ActiveActor a) {\n if(a.canMove()) {\n a.move();\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 \"Move()\";\n }\n };\n }",
"public interface Action {\n\t\n\t/**\n\t * @return The action's printable value\n\t */\n\tpublic String toString();\n\n\tpublic Action actionClone();\n \t\n}",
"@Override\r\n\tpublic Action getAction() {\n\t\treturn Action.GRUNINST;\r\n\t}",
"Action(String desc){\n this.desc = desc;\n this.append = \"\";\n }",
"public PDAction getFo() {\n/* 187 */ COSDictionary fo = (COSDictionary)this.actions.getDictionaryObject(\"Fo\");\n/* 188 */ PDAction retval = null;\n/* 189 */ if (fo != null)\n/* */ {\n/* 191 */ retval = PDActionFactory.createAction(fo);\n/* */ }\n/* 193 */ return retval;\n/* */ }",
"BackwardMinAction createBackwardMinAction();",
"void provideNewTurn();",
"@Test\n\tpublic void testEndTurnEffect_2() {\n\t\tEndTurnAction action = new EndTurnAction();\n\t\tEndTurnEffect effect = new EndTurnEffect(action);\n\t\tassertEquals(action, effect.getAction());\n\t}",
"public PDAction getU() {\n/* 158 */ COSDictionary u = (COSDictionary)this.actions.getDictionaryObject(\"U\");\n/* 159 */ PDAction retval = null;\n/* 160 */ if (u != null)\n/* */ {\n/* 162 */ retval = PDActionFactory.createAction(u);\n/* */ }\n/* 164 */ return retval;\n/* */ }",
"private Action(){\r\n\t\tthis(-1);\r\n\t}",
"public FinalJeopardyAction(String name) \n\t\t{\n\t\t\tsuper(name);\n\t\t \n\t\t}",
"private ActionPackage() {}",
"private DeleteAction makeDeleteAction(String input)\r\n throws MakeActionException {\r\n if (params.length == 0) {\r\n throw new MakeActionException(DeleteAction.ERR_INSUFFICIENT_ARGS);\r\n }\r\n DeleteAction da = new DeleteAction(goku);\r\n da.input = input;\r\n\r\n if (params.length == 1) {\r\n try {\r\n int id = Integer.parseInt(params[0]);\r\n da.id = id;\r\n } catch (NumberFormatException e) {\r\n da.id = null;\r\n da.title = params[0];\r\n }\r\n } else {\r\n da.title = Joiner.on(\" \").join(params);\r\n }\r\n return da;\r\n }",
"public UpcomingContestsManagerAction() {\r\n }",
"protected Action makeAcceptAction() {\n\t\tAction myAction;\n\t\tmyAction = new Accept(getAgentID(),\n\t\t\t\t((ActionWithBid) opponentAction).getBid());\n\t\treturn myAction;\n\t}",
"protected Reaction() {/* intentionally empty block */}",
"public void createTurn() {\n Turn turn = new Turn(this.getOnlinePlayers());\n this.setCurrentTurn(turn);\n }",
"TurnController createTurnController(PlayerTurn turn);",
"public CreateIndividualPreAction() {\n }",
"private DrawDestinyToAttritionOnlyEffect(Action action, String playerId) {\n super(action);\n _playerId = playerId;\n }",
"public void takeAction(BoardGameController.BoardBugAction action)\n {\n\n }",
"private ServiceAction createDeleteEnrichmentAction() {\n final MarcRecord deleteRecord = new MarcRecord(marcRecord);\n final MarcRecordReader reader = new MarcRecordReader(deleteRecord);\n final String recordId = reader.getRecordId();\n final String agencyId = reader.getAgencyId();\n\n LOGGER.use(log -> log.info(\"Create action to delete old enrichment record {{}:{}}\", recordId, agencyId));\n\n final MarcRecordWriter writer = new MarcRecordWriter(deleteRecord);\n writer.markForDeletion();\n return createUpdateRecordAction(deleteRecord);\n }",
"public static Action getDisabledAction() {\n Action action = new Action() {\n };\n action.setEnabled(false);\n return action;\n }",
"@Override\n protected Action[] createActions() {\n return new Action[0];\n }",
"public Command createInstance() {\n\t\t\n\t\tif(name == \"Direction\")\n\t\t\treturn new Direction();\n\t\t\n\t\tif(name == \"Gear\")\n\t\t\treturn new Gear();\n\t\t\n\t\tif(name == \"Pause\")\n\t\t\treturn new Pause();\n\t\t\n\t\treturn null;\n\t\t\n\t}",
"public static Action make(int type)\n {\n switch(type)\n {\n case FIREBALL:\n return new Action();\n case DEFEND:\n return new ActShield();\n case SPIRIT_BURST:\n return new SpiritBurst();\n case INVINCIBILITY:\n return new Invincibility();\n }\n return null;\n }",
"public FallingPiece moveDown() {\r\n return new FallingPiece(coord.moveDown(), innerPiece);\r\n }",
"public MemberAction() {\n\t\tsuper();\n\t}",
"protected PMBaseAction() {\r\n super();\r\n }",
"public static Action turn(final int direction) {\n return new Action() {\n @Override\n protected void perform(ActiveActor a) {\n a.setDirection(direction);\n }\n\n @Override\n public int getCost() {\n return 0;\n }\n\n @Override\n public boolean isExclusive() {\n return false;\n }\n\n @Override\n public Object getData() {\n return direction;\n }\n\n @Override\n public String toString() {\n return \"Turn(\" + direction + \")\";\n }\n };\n }",
"public DressedAction(int timeToEnd) {\n\t\tsuper(timeToEnd, \"Dressing\");\n\t}",
"public static AdmBoardOptionActionFactory getInstacne() {\n\t\treturn instance;\r\n\t}",
"public PDAction getX() {\n/* 99 */ COSDictionary x = (COSDictionary)this.actions.getDictionaryObject(\"X\");\n/* 100 */ PDAction retval = null;\n/* 101 */ if (x != null)\n/* */ {\n/* 103 */ retval = PDActionFactory.createAction(x);\n/* */ }\n/* 105 */ return retval;\n/* */ }",
"public ActionDefinition actdef(String n){\n ActionDefinition rc = isAction(n);\n if (rc == null){\n return(null);\n }\n else\n return(rc);\n }",
"public XpeDccWfActionROVORowImpl() {\n }",
"LogAction createLogAction();",
"public DeckAbility(int amount, Destination destination, Choice choice, AbilityTarget target, AbilityType type) {\n this.calculation = new Calculation();\n this.calculation.setTarget(Calculation.CountTarget.NULL);\n this.calculation.setOperator(Calculation.Operator.NULL);\n this.amount = amount;\n this.destination = destination;\n this.choice = choice;\n this.target = target;\n this.type = type;\n }",
"protected ActionFactory getActionFactory() {\n\t\treturn this.actionFactory;\n\t}",
"public static Action buildShip(int id, char type) {\n\t\treturn new Action(id, type);\n\t}",
"public VisitAction() {\n }",
"private DrawDestinyToPowerOnlyEffect(Action action, String playerId) {\n super(action);\n _playerId = playerId;\n }",
"public RedoCommand() {\n }",
"public static Action action(String id) {\n/* 205 */ return actions.get(id);\n/* */ }",
"public DeallocateActionScript(final AdaptationData data, final DeallocateAction action) {\n super(data);\n this.action = action;\n }",
"POGOProtos.Rpc.CombatActionProto getCurrentAction();",
"public AddApplicationReleaseAction() {\r\n }",
"public DeathtpCommandDTP(DeathTpPlus instance) {\n this.plugin = instance;\n log = LoggerDTP.getLogger();\n config = ConfigDTP.getInstance();\n deathLocationLog = plugin.getDeathLocationLog();\n log.informational(\"deathtp command registered\");\n }",
"public void action(){\n turn.sendMsg(turn.getController().getTurnOwner().getName()+\"'s turn!\");\n if(turn.getPlayer().isDown()){\n turn.setPhase(new RecoveryPhase());\n }else {\n turn.setPhase(new StarsPhase());\n }\n }",
"public static Action actionFromDB(DBObject dbObject) {\r\n\t\tString strType = (String)dbObject.get(\"type\");\r\n\t\tif (strType == null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t\r\n\t\tActionType type = ActionType.valueOf(strType);\r\n\t\tswitch (type) {\r\n\t\t\tcase START_CONVO:\r\n\t\t\tcase RESTART_CONVO:\r\n\t\t\tcase UPDATE_CONVO:\r\n\t\t\t\treturn new StartConvoAction(dbObject);\r\n\t\t\tcase JOIN_CONVO:\r\n\t\t\t\treturn new JoinConvoAction(dbObject);\r\n\t\t\tcase ANSWER_CONVO:\r\n\t\t\tcase REPLY_CONVO:\r\n\t\t\t\treturn new AnswerConvoAction(dbObject);\r\n\t\t\tcase ANSWER_VOTED:\r\n\t\t\t\treturn new AnswerVotedAction(dbObject);\r\n\t\t\tcase SUMMARY_ADDED:\r\n\t\t\tcase SUMMARY_EDITED:\r\n\t\t\t\treturn new SummaryConvoAction(dbObject);\r\n\t\t\tcase TOPIC_ADDED:\r\n\t\t\t\treturn new TopicAddedAction(dbObject);\r\n\t\t\tcase GIVE_THANKS:\r\n\t\t\t\treturn new GiveThanksAction(dbObject);\r\n\t\t\tcase FOLLOW_CONVO:\r\n\t\t\t\treturn new FollowConvoAction(dbObject);\r\n\t\t\tcase FOLLOW_TALKER:\r\n\t\t\t\treturn new FollowTalkerAction(dbObject);\r\n\t\t\tcase PERSONAL_PROFILE_COMMENT:\r\n\t\t\tcase PERSONAL_PROFILE_REPLY:\r\n\t\t\t\treturn new PersonalProfileCommentAction(dbObject);\r\n\t\t\tcase UPDATE_BIO:\r\n\t\t\tcase UPDATE_HEALTH:\r\n\t\t\tcase UPDATE_PERSONAL:\r\n\t\t\t\treturn new UpdateProfileAction(dbObject);\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tthrow new IllegalArgumentException(\"Bad Action Type\");\r\n\t\t}\r\n\t}",
"ForwardMinAction createForwardMinAction();",
"public RepeaterActionDefinition() {\n }",
"public DropCommand()\n\t{\n\t\tthis(Environment.getInstance().getPlayer());\n\t}",
"com.cantor.drop.aggregator.model.CFTrade.TradeAction getAction();",
"protected BattleFightState fightState(){\n return new BattleFightState(\n this.mFightButton,\n this.mPokemonButton,\n this.mBagButton,\n this.mRunButton,\n this.mActionButton,\n this.mOptionList,\n this.mBattle,\n this.mMessage\n );\n }",
"public void otherTurn\n (String name);",
"public Action newAction(String command) {\n\t\tif (command == null)\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\"No legal command string passed!\");\n\t\tif (super.containsKey(command))\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\"Allready kontains a mapping for that key!\");\n\t\tAction action = new ActionForward();\n\t\taction.putValue(Action.ACTION_COMMAND_KEY, command);\n\t\tsuper.put(command, action);\n\t\tactionList.add(action);\n\t\treturn action;\n\t}",
"public UndoableCommand undo() {\n logger.info(String.format(\"----------------[UNDOING][%s]\", this));\n return new DeleteActivityCommand(null, activityAdded);\n }",
"public static AnnotatedActionFactory getActionFactory() {\n/* 84 */ return actionFactory;\n/* */ }",
"public Turn newTurn() {\n int newStudentNb = formula.newStudent();\n\n this.updateCurrentEvents();\n this.currentEvents.addAll(EventManager.getEvents());\n this.reloadHires(); // Reload list of professors available for hire\n this.sortProfessors();\n\n Turn turn = new Turn(this.getWeek()+1);\n turn.newStudent = newStudentNb;\n turn.newCash = this.getIncome();\n turn.newMoral = 0;\n turn.events = University.get().getCurrentEvents();\n\n for (Event event : turn.events){\n event.getResult(AnsType.YES).setComputation(eventComputation(event, AnsType.YES));\n if (event.getType() == EventType.TWO_CHOICES){\n event.getResult(AnsType.NO).setComputation(eventComputation(event, AnsType.NO));\n }\n }\n\n // TODO WHEN APPLY\n if (basicData.getMoney()+getIncome() < 0){\n turn.resultTurn = removeBestProfessor();\n }\n return turn;\n }",
"public NamedAction createNamedAction(String name) {\n NamedActionImpl action = new NamedActionImpl();\n action.setName(name);\n return action;\n }",
"public Class getActionClass() {\n return actionClass;\n }",
"public ActionType getActionType(com.kcdataservices.partners.kcdebdmnlib_hva.businessobjects.abedmnlib_hva.v1.ActionType res){\n\t\tActionType actionType = new ActionType();\n\t\t\n\t\tactionType.setActionCode( res.getActionCode() );\n\t\tactionType.setDescription( res.getDescription() );\n\t\t\n\t\treturn actionType;\n\t}",
"@Override\n public void toTurnPhase() {\n changePhase(new TurnPhase());\n }",
"@SuppressWarnings(\"serial\")\r\n\tprotected Action getDeleteAction() {\r\n\t\tif (this.deleteAction != null)\r\n\t\t\treturn this.deleteAction; // Already defined;\r\n\t\tAction action = new AbstractAction(\"Delete\") {\r\n\t\t\tpublic void actionPerformed(ActionEvent ev) {\r\n\t\t\t\tif (ExtendedTupleEditorSupport.this.tuple == null)\r\n\t\t\t\t\treturn;\r\n\t\t\t\tAttrType type = ((AttrInstance) ExtendedTupleEditorSupport.this.tuple).getType();\r\n\t\t\t\tint slot = ExtendedTupleEditorSupport.this.tableView.getSelectedRow();\r\n\t\t\t\t\r\n\t\t\t\tif (slot >= type.getNumberOfEntries(ExtendedTupleEditorSupport.this.viewSetting)){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\telse if (!type.isOwnMemberAt(ExtendedTupleEditorSupport.this.viewSetting, slot)) {\r\n\t\t\t\t\tsetMessage(\"Cannot delete this attribute member which belongs to a parent type.\"\r\n\t\t\t\t\t\t\t+\" Each attribute member must be deleted from its own type tuple.\");\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null,\r\n\t\t\t\t\t\t\t\"<html><body>\"\r\n\t\t\t\t\t\t\t+\"Cannot delete this attribute member which belongs to a parent type.\"\r\n\t\t\t\t\t\t\t+\"<br>\"\r\n\t\t\t\t\t\t\t+\"Each attribute member must be deleted from its own type tuple.\",\r\n\t\t\t\t\t\t\t\" Cannot delete \",\r\n\t\t\t\t\t\t\tJOptionPane.ERROR_MESSAGE);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\ttype.deleteMemberAt(ExtendedTupleEditorSupport.this.viewSetting, slot);\r\n\t\t\t}\r\n\t\t};\r\n\t\taction\r\n\t\t\t\t.putValue(Action.SHORT_DESCRIPTION,\r\n\t\t\t\t\t\t\"Removes the selected member\");\r\n\t\taddMemberAction(action);\r\n\t\tthis.deleteAction = action;\r\n\t\treturn action;\r\n\t}",
"public static Action attackBuilding(int id, int slot, int damage) {\n\t\treturn new Action(id, slot, damage);\n\t}",
"public void newTurn() {\r\n\t\tthis.money = 0;\r\n\t\tthis.blackTurns = 1;\r\n\t\tthis.blueTurns = 0;\r\n\t\tthis.purpleTurns = 0;\r\n\t\tthis.brownTurns = 0;\r\n\t\tthis.redTurns = 0;\r\n\t}",
"private Action initializeAction(final String classname) {\n\t\tAction action = null;\n\t\tif (classname != null && !\"\".equals(classname)) {\n\t\t\tClass<?> clazz = null;\n\t\t\ttry {\n\t\t\t\tclazz = Class.forName(classname);\n\t\t\t\taction = (Action) clazz.newInstance();\n\t\t\t} catch (InstantiationException e) {\n\t\t\t\tlog.error(\"Cannot instantiate action class: \" + classname);\n\t\t\t} catch (IllegalAccessException e) {\n\t\t\t\tlog.error(\"Not privileged to access action instance: \"\n\t\t\t\t\t\t+ classname);\n\t\t\t} catch (Throwable e) {\n\t\t\t\tlog.error(\"Cannot load action class: \" + classname);\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\tif (action == null) {\n\t\t\t// Instantiate a mock action such that menu item can\n\t\t\t// be displayed.\n\t\t\taction = new DummyAction();\n\t\t\tlog.warn(\"Instantiated mock action class.\");\n\t\t}\n\t\treturn action;\n\t}",
"GameState requestActionGamePiece();",
"private GestionTour() {}",
"void finishTurn();",
"public Node getChildNode(Node node, Action action) {\n\t\tint[] new_state = new int[2];\n\n new_state[0] = node.state[0];\n\t\tnew_state[1] = node.state[1];\n\n\t\tif (action != null) {\n\t\t\t// Implementing the transition model\n\t\t\tif (action.to == \"x\") {\n\t\t\t\tnew_state[0] = node.state[0] + action.quantity;\n\t\t\t} \n\n\t\t\tif (action.to == \"y\") {\n\t\t\t\tnew_state[1] = node.state[1] + action.quantity;\n\t\t\t}\n\n\t\t\tif (action.from == \"x\") {\n\t\t\t\tnew_state[0] = node.state[0] - action.quantity;\n\t\t\t}\n\n\t if (action.from == \"y\") {\n\t\t\t\tnew_state[1] = node.state[1] - action.quantity;\n\n\t\t\t}\n\n\t\t}\n\n\t\tNode new_node = new Node(new_state, action, node);\n\n\t\treturn new_node;\n\t}"
]
| [
"0.7357415",
"0.6451293",
"0.6312232",
"0.62502116",
"0.62502116",
"0.62502116",
"0.61219543",
"0.6010292",
"0.5862641",
"0.56986195",
"0.5697264",
"0.5678254",
"0.56357807",
"0.5630241",
"0.5604581",
"0.5573851",
"0.55683017",
"0.5542",
"0.55402035",
"0.5520514",
"0.55134165",
"0.54823315",
"0.5474317",
"0.5469746",
"0.5441643",
"0.5437232",
"0.54324555",
"0.542541",
"0.542525",
"0.53914565",
"0.5353",
"0.5335869",
"0.5319474",
"0.53159237",
"0.5312725",
"0.53082466",
"0.5277299",
"0.52391773",
"0.52371913",
"0.5224265",
"0.5217008",
"0.5210685",
"0.5194292",
"0.5183529",
"0.5171975",
"0.5153935",
"0.51509875",
"0.5150088",
"0.5148557",
"0.5132192",
"0.51283866",
"0.5126614",
"0.5120529",
"0.5112205",
"0.5104221",
"0.50821435",
"0.5079678",
"0.50796473",
"0.5076485",
"0.50685984",
"0.5055959",
"0.503885",
"0.5038639",
"0.50381094",
"0.50344",
"0.50219715",
"0.5017292",
"0.5016523",
"0.50160635",
"0.50117207",
"0.5008981",
"0.5008406",
"0.5006217",
"0.5004069",
"0.4996295",
"0.49948302",
"0.49783576",
"0.49685234",
"0.49680528",
"0.49599215",
"0.4939609",
"0.49394292",
"0.4938907",
"0.49318677",
"0.49263543",
"0.49248305",
"0.49233076",
"0.49183118",
"0.491804",
"0.49143466",
"0.49126506",
"0.49092218",
"0.49087274",
"0.4906797",
"0.49029502",
"0.49009785",
"0.48975846",
"0.48955283",
"0.4881809",
"0.48785314"
]
| 0.72293913 | 1 |
Returns a new object of class 'Stop Action'. | StopAction createStopAction(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String stop()\r\n {\r\n return \"{ \\\"action\\\": \\\"stop\\\" }\";\r\n }",
"public Stop(String name) {\n this.name = name;\n }",
"public void stop() {}",
"public void stop();",
"public void stop();",
"public void stop();",
"public void stop();",
"public void stop();",
"public void stop();",
"public void stop();",
"public void stop();",
"public void stop();",
"public void stop();",
"public void stop();",
"public void stop();",
"public void stop();",
"public void stop();",
"public void stop();",
"public abstract void stop();",
"public abstract void stop();",
"public abstract void stop();",
"public abstract void stop();",
"public abstract void stop();",
"public void stop()\n {\n }",
"public void stop(){\n }",
"public void stop() {\n }",
"public void stop() {\n }",
"abstract public void stop();",
"void stop() {\n }",
"ActivityType stop();",
"public void stop(){\n\t\t\n\t}",
"public void stop() {\n\t\t\n\t}",
"public void stop() {\n\t}",
"private JButton getCmdStop() {\r\n\t\tif (cmdStop == null) {\r\n\t\t\tcmdStop = new JButton();\r\n\t\t\tcmdStop.setText(\"\");\r\n\t\t\tcmdStop.setIcon(new ImageIcon(getClass().getResource(\"/Stop-48.png\")));\r\n\t\t\tcmdStop.setToolTipText(\"Stop all current operation.\");\r\n\t\t\tcmdStop.setEnabled(false);\r\n\t\t\tcmdStop.addActionListener(new java.awt.event.ActionListener() {\r\n\t\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent e) {\r\n\t\t\t\t\tchkproxy.cancel(true);\r\n\t\t\t\t\tcmdStart.setEnabled(true);\r\n\t\t\t\t\tcmdPause.setEnabled(false);\r\n\r\n\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn cmdStop;\r\n\t}",
"public abstract void stopped();",
"public void stopped();",
"void stop();",
"void stop();",
"void stop();",
"void stop();",
"void stop();",
"void stop();",
"void stop();",
"void stop();",
"void stop();",
"void stop();",
"void stop();",
"void stop();",
"void stop();",
"void stop();",
"void stop();",
"void stop();",
"void stop();",
"@Override\n public void stop() {}",
"public void stop (String message);",
"@Override\n\tpublic void stop() {\n\t\t\n\t}",
"@Override\n\tpublic void stop() {\n\t\t\n\t}",
"@Override\n\tpublic void stop() {\n\t\t\n\t}",
"@Override\n\tpublic void stop() {\n\t\t\n\t}",
"@Override\n\tpublic void stop() {\n\t\t\n\t}",
"@Override\n\tpublic void stop() {\n\t\t\n\t}",
"@Override\n\tpublic void stop() {\n\t\t\n\t}",
"@Override\n\tpublic void stop() {\n\t\t\n\t}",
"@Override\n\tpublic void stop() {\n\t}",
"@Override\n\tpublic void stop() {\n\t}",
"@Override\n public StopOperator getStopOperator() {\n return null;\n }",
"@Override\n\tpublic void stop()\n\t\t{\n\t\t}",
"public AbstractEffect stop() {\n\t\tTask task = effectData.getTask();\n\t\tif (task == null)\n\t\t\treturn this;\n\t\ttry {\n\t\t\ttask.cancel();\n\t\t\ttask = null;\n\t\t} catch (IllegalStateException exc) {\n\t\t}\n\t\treturn this;\n\t}",
"@Override\r\n\tpublic void stop() {\n\t\t\r\n\t}",
"@Override\r\n public void stop() {\r\n }",
"@Override\r\n public void stop() {\r\n }",
"protected void finalAction(){\n Robot.stop();\n requestOpModeStop();\n }",
"public void stopping();",
"@Override\n public void stop() {\n }",
"@Override\n public void stop() {\n }",
"@Override\n public void stop() {\n }",
"@Override\n public void stop() {\n }",
"@Override\n public void stop() {\n }",
"@Override\n public void stop() {\n }",
"@Override\n public void stop() {\n }",
"@Override\n public void stop() {\n }",
"@Override\n public void stop() {\n }",
"@Override\n public void stop() {\n }",
"@Override\n public void stop() {\n }",
"@Override\n public void stop() {\n }",
"@Override\npublic String stop() {\n\treturn \"the Truck has stopped\";\n}",
"BackwardAction createBackwardAction();",
"@Override\r\n public void stop() {\r\n\r\n }",
"@Override\n\t\tpublic void stop() {\n\t\t\t// Nothing to do for now\n\t\t}",
"public boolean stop();",
"@Override\r\n\tpublic void stop() {\n\t\tSystem.out.println(\"Stop Movie\");\r\n\t\t\r\n\t}",
"@Override public void stop () {\n }",
"@Override\n public void stop() {\n }",
"@Override\n public void stop() {\n\n }",
"void call_Stops(CObject pHo)\r\n {\r\n short oi;\r\n\r\n // On ne traite qu'un seul objet!\r\n // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n oi = pHo.hoOi;\t\t\t\t\t\t\t// L'Oi en question\r\n rh2EventCount += 1; // des actions...\r\n evt_AddCurrentObject(pHo);\r\n\r\n // Premiere execution : toutes les actions STOP\r\n // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n rh2ActionCount++;\t\t\t\t\t// Marqueur de boucle d'actions\r\n rh2ActionLoop = false;\t\t\t\t\t// Flag boucle\r\n rh2ActionLoopCount = 0;\t\t\t// Numero de boucle d'actions\r\n rh2ActionOn = true;\t\t\t\t\t// On est dans les actions\r\n CAct actPtr;\r\n int count = 0;\r\n int num, numOi;\r\n do\r\n {\r\n actPtr = (CAct) rhEventGroup.evgEvents[rhEventGroup.evgNCond + count];\r\n num = actPtr.evtCode & 0xFFFF0000;\r\n if (num == (4 << 16) || num == (9 << 16)) // ACTL_EXTSTOP - ACTL_EXTBOUNCE\r\n {\r\n if (oi == actPtr.evtOi)\r\n {\r\n actPtr.execute(rhPtr);\r\n }\r\n else\r\n {\r\n short oil = actPtr.evtOiList;\t\t\t// Un qualifier?\r\n if ((oil & 0x8000) != 0)\r\n {\r\n CQualToOiList pq = qualToOiList[oil & 0x7FFF];\r\n numOi = 0;\r\n while (numOi < pq.qoiList.length)\r\n {\r\n if (pq.qoiList[numOi] == oi)\r\n {\r\n actPtr.execute(rhPtr);\r\n break;\r\n }\r\n numOi += 2;\r\n }\r\n ;\r\n }\r\n }\r\n }\r\n count++;\r\n } while (count < rhEventGroup.evgNAct);\r\n rh2ActionOn = false;\t\t\t\t\t// On est dans les actions\r\n }",
"public void stop() throws CoreHunterException;",
"public void stop(){\n return;\n }",
"public void stop() {\n System.out.println(\"stop\");\n }",
"public void stop()\r\n\t{\r\n\t\tdoStop = true;\r\n\t}",
"public Builder componentStopTimeoutAction(final ComponentStopTimeoutAction action) {\n this.timeoutAction = action;\n return this;\n }"
]
| [
"0.7717652",
"0.6725603",
"0.65652305",
"0.647202",
"0.647202",
"0.647202",
"0.647202",
"0.647202",
"0.647202",
"0.647202",
"0.647202",
"0.647202",
"0.647202",
"0.647202",
"0.647202",
"0.647202",
"0.647202",
"0.647202",
"0.6466521",
"0.6466521",
"0.6466521",
"0.6466521",
"0.6466521",
"0.6425083",
"0.640558",
"0.6390007",
"0.6390007",
"0.6386089",
"0.6367407",
"0.6306456",
"0.6287939",
"0.62719625",
"0.6269096",
"0.6214177",
"0.62072366",
"0.62022024",
"0.61776966",
"0.61776966",
"0.61776966",
"0.61776966",
"0.61776966",
"0.61776966",
"0.61776966",
"0.61776966",
"0.61776966",
"0.61776966",
"0.61776966",
"0.61776966",
"0.61776966",
"0.61776966",
"0.61776966",
"0.61776966",
"0.61776966",
"0.61487305",
"0.60919315",
"0.60669935",
"0.60669935",
"0.60669935",
"0.60669935",
"0.60669935",
"0.60669935",
"0.60669935",
"0.60669935",
"0.60477006",
"0.60477006",
"0.6037382",
"0.60285676",
"0.6027884",
"0.6003828",
"0.5980832",
"0.5980832",
"0.59679633",
"0.59642047",
"0.5962473",
"0.5962473",
"0.5962473",
"0.5962473",
"0.5962473",
"0.5962473",
"0.5962473",
"0.5962473",
"0.5962473",
"0.5962473",
"0.5962473",
"0.5956043",
"0.5946719",
"0.59356624",
"0.5932515",
"0.5929118",
"0.59121454",
"0.5911544",
"0.59095144",
"0.59094",
"0.5898587",
"0.5894169",
"0.58843446",
"0.5879582",
"0.5879508",
"0.58686763",
"0.5866882"
]
| 0.8866162 | 0 |
Returns a new object of class 'Log Action'. | LogAction createLogAction(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void Log(String action) {\r\n\t}",
"public LogEvent newInstance()\n {\n return new LogEvent();\n }",
"public Logger(int ActorID, int TargetID, Action action){\n this.date = new Date();\n this.actorID = ActorID;\n this.targetID = TargetID;\n this.action = action;\n }",
"Action createAction();",
"Action createAction();",
"Action createAction();",
"private TicketLog createLog() throws SQLException {\n\t\t\t\t\treturn new TicketLog(rs.getLong(1), rs.getString(2),\n\t\t\t\t\t\t\trs.getLong(3),\n\t\t\t\t\t\t\tTicketLog.Action.valueOf(rs.getString(4)),\n\t\t\t\t\t\t\trs.getInt(5));\n\t\t\t\t}",
"public String getActionLog() {\n \t\treturn actionLog;\n \t}",
"public RedpacketActivityOperationLog() {\n this(\"redpacket_activity_operation_log\", null);\n }",
"public Action newAction(Object data) throws Exception;",
"private Log() {\n }",
"Action(String desc){\n this.desc = desc;\n this.append = \"\";\n }",
"private Log() {\r\n\t}",
"public void createAction() {\n }",
"@Override\r\n\tpublic ItemLog createItemLog() {\n\t\treturn new HpLog();\r\n\t}",
"public ScheduledActionAction() {\n\n }",
"ActionType createActionType();",
"protected PMBaseAction() {\r\n super();\r\n }",
"protected Log getLog()\n/* */ {\n/* 59 */ return log;\n/* */ }",
"public LogFilter() {}",
"public interface Action {\n\t\n\t/**\n\t * @return The action's printable value\n\t */\n\tpublic String toString();\n\n\tpublic Action actionClone();\n \t\n}",
"public static Log get(Class<? extends Object> clazz) {\n return new Log(clazz);\n }",
"public Action(String name) {\n this.name = name;\n }",
"private Log()\n {\n //Hides implicit constructor.\n }",
"public MyLogs() {\n }",
"public RedpacketActivityOperationLog(String alias) {\n this(alias, REDPACKET_ACTIVITY_OPERATION_LOG);\n }",
"public TOpLogs(Name alias) {\n this(alias, T_OP_LOGS);\n }",
"public TOpLogs() {\n this(DSL.name(\"t_op_logs\"), null);\n }",
"private TypicalLogEntries() {}",
"public AgentLogoffAction() {\n\n }",
"public ActionManager() {\n\t\tsuper();\n\t}",
"@Override\n protected Action[] createActions() {\n return new Action[0];\n }",
"public static LogType EVENT()\n {\n if (g_oEvent == null)\n {\n try\n {\n g_oEvent = new LogType(\"EVENT\", 30);\n }\n catch (Goliath.Exceptions.InvalidParameterException ex)\n {}\n }\n return g_oEvent;\n }",
"public Logger (){}",
"public VisitAction() {\n }",
"TurnAction createTurnAction();",
"public LogEntry () {\n }",
"public TMacLog() {\n this(DSL.name(\"t_mac_log\"), null);\n }",
"public Action(long id) {\n this(id, \"\");\n }",
"public AddApplicationReleaseAction() {\r\n }",
"private ActionPackage() {}",
"private static void LogStatic(String action) {\r\n\t}",
"private LogEvent()\n\t{\n\t\tsuper();\n\t}",
"public Builder clearActionLog() {\n if (actionLogBuilder_ == null) {\n actionLog_ = java.util.Collections.emptyList();\n bitField0_ = (bitField0_ & ~0x00000100);\n onChanged();\n } else {\n actionLogBuilder_.clear();\n }\n return this;\n }",
"@Override\n\tpublic CreditrepayplanLog getLogInstance() {\n\t\treturn new CreditrepayplanLog();\n\t}",
"public static TimeTakenLogEntry create() {\n return builder().build();\n }",
"private Action initializeAction(final String classname) {\n\t\tAction action = null;\n\t\tif (classname != null && !\"\".equals(classname)) {\n\t\t\tClass<?> clazz = null;\n\t\t\ttry {\n\t\t\t\tclazz = Class.forName(classname);\n\t\t\t\taction = (Action) clazz.newInstance();\n\t\t\t} catch (InstantiationException e) {\n\t\t\t\tlog.error(\"Cannot instantiate action class: \" + classname);\n\t\t\t} catch (IllegalAccessException e) {\n\t\t\t\tlog.error(\"Not privileged to access action instance: \"\n\t\t\t\t\t\t+ classname);\n\t\t\t} catch (Throwable e) {\n\t\t\t\tlog.error(\"Cannot load action class: \" + classname);\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\tif (action == null) {\n\t\t\t// Instantiate a mock action such that menu item can\n\t\t\t// be displayed.\n\t\t\taction = new DummyAction();\n\t\t\tlog.warn(\"Instantiated mock action class.\");\n\t\t}\n\t\treturn action;\n\t}",
"public AuditLogAction findById(String id) {\r\n log.debug(\"getting AuditLogAction instance with id: \" + id);\r\n try {\r\n AuditLogAction instance = (AuditLogAction) this.getHibernateSession().get(AuditLogAction.class, id);\r\n return instance;\r\n } catch (Exception re) {\r\n log.error(\"get failed\", re);\r\n throw new RuntimeException(re);\r\n }\r\n }",
"public static Action action(String id) {\n/* 205 */ return actions.get(id);\n/* */ }",
"public LogX() {\n\n }",
"public Action(String id) {\n\t\tthis.id = id;\n\t}",
"public LogAction(BiConsumer<EventLog.Mutator, Game> applier, BiConsumer<EventLog.Mutator, Game> undoer) {\n\t\tthis.undoer = undoer;\n\t\tthis.applier = applier;\n\t\tthis.executed = false;\n\t}",
"CaseAction createCaseAction();",
"public PanelPayload_cmd( Log log ) {\r\n initComponents();\r\n this.log = log; \r\n if( this.log == null ) this.log = new Log();\r\n }",
"Object createLogger(String name);",
"public LogMessageController() {\n\t}",
"ActionDefinition createActionDefinition();",
"SendAction createSendAction();",
"public TOpLogs(String alias) {\n this(DSL.name(alias), T_OP_LOGS);\n }",
"public Log(String name) {\n this.name = name;\n this.entries = new ArrayList<>();\n }",
"CustomAction(String actionType, String message) {\n action.put(\"Object\", actionType);\n JSONObject attributes = new JSONObject();\n attributes.put(\"message\", message);\n action.put(\"Action\", attributes);\n }",
"protected Class<? extends ActionStd<S>> getActionClassHook() {\n\t\treturn null;\r\n\t}",
"Object createLogger(Class<?> clazz);",
"public ActionState createActionState();",
"DomainAction createDomainAction();",
"abstract void initiateLog();",
"public ClipLog() { }",
"public Action(GameManager gameManager){\n this.gameManager = gameManager;\n }",
"public static Log getInstance() {\r\n if (firstInstance == null) {\r\n firstInstance = new Log();\r\n }\r\n return firstInstance;\r\n }",
"public Object getServicingEventLogInitiateActionRecord() {\n return servicingEventLogInitiateActionRecord;\n }",
"public LogContract(){}",
"private Logger(){ }",
"public static void LogIt(String action, File entity) {\n\t\t\r\n\t}",
"protected abstract Logger newInstance(String name);",
"private static Log getLog() {\n if (log == null) {\n log = new SystemStreamLog();\n }\n\n return log;\n }",
"public ActionFile() {\n }",
"NoAction createNoAction();",
"public FoodLogEntry(String name) {\n super(name);\n }",
"public Log newInstance(String str) {\n Log log;\n try {\n if (this.logConstructor == null) {\n log = discoverLogImplementation(str);\n } else {\n log = (Log) this.logConstructor.newInstance(new Object[]{str});\n }\n if (this.logMethod != null) {\n this.logMethod.invoke(log, new Object[]{this});\n }\n return log;\n } catch (LogConfigurationException e) {\n throw e;\n } catch (InvocationTargetException e2) {\n Throwable targetException = e2.getTargetException();\n if (targetException != null) {\n throw new LogConfigurationException(targetException);\n }\n throw new LogConfigurationException((Throwable) e2);\n } catch (Throwable th) {\n throw new LogConfigurationException(th);\n }\n }",
"private Logger() {\n\n }",
"public Log() { //Null constructor is adequate as all values start at zero\n\t}",
"public Activity createActivity(Action action, Rate rate) {\n ActivityImpl activity = new ActivityImpl();\n activity.setAction(action);\n activity.setRate(rate);\n return activity;\n }",
"public DumpObjectAction()\n\t{\n\n\t\tsuper();\n\t}",
"@Override\n\tpublic void newAction() {\n\t\t\n\t}",
"private Logger(){\n\n }",
"public Logger() {\n map = new LinkedHashMap<>();\n }",
"public ActionInfo(Class actionClass, Preferences actionPrefs) {\n this.actionClass = actionClass;\n this.actionPrefs = actionPrefs;\n }",
"public Class<?> getActionClass() {\n return this.action;\n }",
"public static AnnotatedActionFactory getActionFactory() {\n/* 84 */ return actionFactory;\n/* */ }",
"public LogPoster() {\n\t\t\n\t}",
"public RepeaterActionDefinition() {\n }",
"public CreateIndividualPreAction() {\n }",
"private JavaUtilLogHandlers() { }",
"public OrderLogRecord() {\n super(OrderLog.ORDER_LOG);\n }",
"public OperateLog(User admin, BasicModel basicModel, String className, String methodName, String argList,\n\t\t\tString action, String target, String status, String retrunDat) {\n\t\tsuper();\n\t\tDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss SSS\");\n\t\tthis.dateTime = df.format(new Date());\n\t\tif (admin != null) {\n\t\t\tthis.adminId = admin.getId();\n\t\t\tthis.adminName = admin.getRealname();\n\t\t} else {\n\t\t\tthis.adminId = -1;\n\t\t\tthis.adminName = \"\";\n\t\t}\n\t\tif (basicModel != null) {\n\t\t\tthis.basicId = basicModel.getId();\n\t\t\tthis.basicRemark = basicModel.getRemark();\n\t\t} else {\n\t\t\tthis.basicId = -1;\n\t\t\tthis.basicRemark = \"\";\n\t\t}\n\t\tthis.className = className;\n\t\tthis.methodName = methodName;\n\t\tthis.argList = argList;\n\t\tthis.action = action;\n\t\tthis.target = target;\n\t\tthis.status = status;\n\t\tthis.retrunDat = retrunDat;\n\t}",
"public static MethodInvocation GetPushInvocation(ASTNode node) {\n\t\tAST ast = node.getAST();\r\n\t\tMethodInvocation invocation = ast.newMethodInvocation();\r\n\t\tinvocation.setExpression(ast.newSimpleName(\"Log\"));\r\n\t\tinvocation.setName(ast.newSimpleName(\"Push\"));\r\n\t\treturn invocation;\r\n\t}",
"public MemberAction() {\n\t\tsuper();\n\t}",
"@Override\n\tprotected void initial() throws SiDCException, Exception {\n\t\tLogAction.getInstance().initial(logger, this.getClass().getCanonicalName());\n\t}",
"public TMacLog(Name alias) {\n this(alias, T_MAC_LOG);\n }",
"public TActLogsExample() {\n oredCriteria = new ArrayList<Criteria>();\n offset = 0;\n limit = Integer.MAX_VALUE;\n }"
]
| [
"0.6397505",
"0.638288",
"0.6370962",
"0.63324517",
"0.63324517",
"0.63324517",
"0.6218582",
"0.60860115",
"0.6067569",
"0.6014347",
"0.5991437",
"0.5917812",
"0.59097695",
"0.5858322",
"0.5789651",
"0.57634246",
"0.57457775",
"0.5724104",
"0.5710521",
"0.570518",
"0.56869847",
"0.5686939",
"0.5686445",
"0.56845874",
"0.56655574",
"0.5618133",
"0.55985403",
"0.5594217",
"0.5577042",
"0.5576494",
"0.5563753",
"0.5559051",
"0.55540323",
"0.5538796",
"0.5535747",
"0.5527689",
"0.5517982",
"0.5516419",
"0.5510426",
"0.5499987",
"0.549439",
"0.54907084",
"0.54847115",
"0.5452547",
"0.5447576",
"0.542999",
"0.5427747",
"0.5402616",
"0.53850734",
"0.53491724",
"0.53487384",
"0.5337662",
"0.5337342",
"0.5320151",
"0.53078425",
"0.5307021",
"0.5298418",
"0.52936614",
"0.52881926",
"0.5286266",
"0.52839714",
"0.5279235",
"0.5225006",
"0.521665",
"0.5210318",
"0.5208177",
"0.52007276",
"0.51979023",
"0.51897216",
"0.5188614",
"0.51883715",
"0.51859957",
"0.517826",
"0.5169205",
"0.5158246",
"0.515796",
"0.51527494",
"0.51526487",
"0.51468486",
"0.5140991",
"0.5104102",
"0.5097372",
"0.5096736",
"0.5095134",
"0.5092396",
"0.5088772",
"0.5084763",
"0.50771606",
"0.50633603",
"0.5062881",
"0.50541955",
"0.5048905",
"0.50462943",
"0.5036567",
"0.5029454",
"0.5025716",
"0.5017322",
"0.5015659",
"0.5000122",
"0.49968225"
]
| 0.87103325 | 0 |
Returns a new object of class 'Send Action'. | SendAction createSendAction(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Action createAction();",
"Action createAction();",
"Action createAction();",
"public static Action push() {\n return new Action() {\n @Override\n protected void perform(ActiveActor a) {\n if(a.getGrid().isValid(a.getLocation().getAdjacentLocation(a.getDirection()))) {\n Actor b = a.getGrid().get(a.getLocation().getAdjacentLocation(a.getDirection()));\n if(b instanceof Movable && b instanceof DestructibleActor) {\n DestructibleActor c = (DestructibleActor) b;\n c.setDirection(a.getDirection());\n if(c.canMove()) {\n c.move();\n a.move();\n a.energy = a.energy - getCost();\n }\n\n }\n }\n }\n\n @Override\n public int getCost() {\n return 10;\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 \"Push()\";\n }\n };\n }",
"CustomAction(String actionType, String message) {\n action.put(\"Object\", actionType);\n JSONObject attributes = new JSONObject();\n attributes.put(\"message\", message);\n action.put(\"Action\", attributes);\n }",
"TurnAction createTurnAction();",
"public void createAction() {\n }",
"ActionType createActionType();",
"public synchronized void sendMessage(CfAction actionToSend){\n\t\t\tcfCommnicationBridge.sendAction(actionToSend);\n\t}",
"public ScheduledActionAction() {\n\n }",
"protected Action makeAcceptAction() {\n\t\tAction myAction;\n\t\tmyAction = new Accept(getAgentID(),\n\t\t\t\t((ActionWithBid) opponentAction).getBid());\n\t\treturn myAction;\n\t}",
"public Action newAction(Object data) throws Exception;",
"public static Action move() {\n return new Action() {\n @Override\n protected void perform(ActiveActor a) {\n if(a.canMove()) {\n a.move();\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 \"Move()\";\n }\n };\n }",
"private void sendRequest(Action action) {\n ACLMessage request = new ACLMessage(ACLMessage.REQUEST);\n request.setLanguage(new SLCodec().getName());\n request.setOntology(MobilityOntology.getInstance().getName());\n try {\n getContentManager().fillContent(request, action);\n request.addReceiver(action.getActor());\n send(request);\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }",
"public Action(String name) {\n this.name = name;\n }",
"protected PMBaseAction() {\r\n super();\r\n }",
"private void sendCommand(int recipient, int action) {\r\n\t\tString command = \"*\" + recipient + \";\" + action + \";\" + \"0\" + \";\" + \"0\"\r\n\t\t\t\t+ \"#\";\r\n\t\tlogger.debug(\"Sende Kommando\");\r\n\t\tcom.sendString(command);\r\n\t\tlogger.debug(\"Senden des Kommandos beendet\");\r\n\t}",
"public static void sendAction(Action act, String hubAddress, Context c) {\n try {\n \t// Loading my identity from preferences\n SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(c);\n\n // for saving the last time the device sent a message to any device\n SharedPreferences.Editor editor = sharedPref.edit();\n\t\t\tCalendar calendar = Calendar.getInstance();\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\t\t\tString curTime = sdf.format(calendar.getTime());\n\t\t\teditor.putString(\"lastDeviceMsg\", curTime);\n\t\t\teditor.commit();\n\n\t\t\tString myIdentity = sharedPref.getString(\"my_identity\", \"\");\n \tact.addArgument(\"fromUser\", myIdentity);\n \t\n \tString msg = serializeAction(act);\n \n \tIntent i = new Intent(c, GenericService.class);\n \n i.setAction(Constants.SEND_MSG_INTENT);\n i.putExtra(\"action\", msg); // msgTextToSend\n i.putExtra(\"hub_address\", hubAddress);\n \n Log.v(\"Helper\", \"Sending: \" + msg + \"To: \" + hubAddress);\n \n c.startService(i);\n } catch(Exception e) {\n \tLog.e(\"sendAction\", \"Something goofy:\" + e.getMessage());\n }\n\t}",
"public FlowAction(FlowActionType type) {\n this.actionType = type;\n }",
"ActionBlock createActionBlock();",
"public void send() {\n\t}",
"Action(String desc){\n this.desc = desc;\n this.append = \"\";\n }",
"public interface Action {\n\t\n\t/**\n\t * @return The action's printable value\n\t */\n\tpublic String toString();\n\n\tpublic Action actionClone();\n \t\n}",
"public static Action spawn(final Class<?> e) {\n return new Action() {\n @Override\n protected void perform(ActiveActor a) {\n if(a.isFacingValidLocation() && a.getFacing() == null) {\n if(a.energy >= getCost()) {\n try {\n Actor b = (Actor) e.newInstance();\n b.putSelfInGrid(a.getGrid(), a.getLocation().getAdjacentLocation(a.getDirection()));\n } catch(InstantiationException r) {\n r.printStackTrace();\n } catch(IllegalAccessException r) {\n r.printStackTrace();\n }\n a.energy = a.energy - 400;\n }\n }\n }\n\n @Override\n public int getCost() {\n return 400;\n }\n\n @Override\n public boolean isExclusive() {\n return true;\n }\n\n @Override\n public Object getData() {\n return e;\n }\n\n @Override\n public String toString() {\n return \"Spawn(\" + (e != null ? e.toString() : \"null\") + \")\";\n }\n };\n }",
"public Intent intent( String inAction ) {\r\n\t\treturn new Intent( kMessagePlayer ).putExtra( \"action\" , inAction );\r\n\t}",
"public void action(BotInstance bot, Message message);",
"public JButton getSend() {\n\t\treturn send;\n\t}",
"@Override\n protected Action[] createActions() {\n return new Action[0];\n }",
"public static Action buildShip(int id, char type) {\n\t\treturn new Action(id, type);\n\t}",
"ForwardMinAction createForwardMinAction();",
"public void handleSend(ActionEvent actionEvent) {\r\n String to=textFieldTo.getText();\r\n try{\r\n Long idto = Long.parseLong(to);\r\n\r\n FriendshipRequest request = new FriendshipRequest();\r\n Tuple<Long,Long> f = new Tuple<>(user.getId(), idto);\r\n request.setId(f);\r\n\r\n service.addRequest(request);\r\n showMessage(Alert.AlertType.CONFIRMATION,\"Request sent!\",\"Request is now pending!\");\r\n\r\n textFieldTo.clear();\r\n\r\n\r\n }catch(NumberFormatException exception){\r\n showMessage(Alert.AlertType.ERROR,\"Error\",exception.toString());\r\n }catch (ServiceException exception){\r\n showMessage(Alert.AlertType.ERROR,\"Error\",exception.toString());\r\n }\r\n }",
"private JButton initializeSendButton() {\r\n\t\tJButton sendButton = new JButton(\"Send\");\r\n\t\tsendButton.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\t// send message which taken from text field.\r\n\t\t\t\ttry {\r\n\t\t\t\t\tnotifyMessageFromUI();\r\n\t\t\t\t\tchatArea.append(messageField.getText() + \"\\n\");\r\n\t\t\t\t\tmessageField.setText(\"\");\r\n\t\t\t\t} catch (IOException e1) {\r\n\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\treturn sendButton;\r\n\t}",
"CustomAction(String actionType, String color, double startX, double startY, String text, double fontSize) {\n action.put(\"Object\", actionType);\n JSONObject attributes = new JSONObject();\n attributes.put(\"color\", color);\n attributes.put(\"startX\", startX);\n attributes.put(\"startY\", startY);\n attributes.put(\"text\", text);\n attributes.put(\"fontSize\", fontSize);\n action.put(\"Action\", attributes);\n }",
"CustomAction(String actionType, String color, double startX, double startY){\n action.put(\"Object\", actionType);\n JSONObject attributes = new JSONObject();\n attributes.put(\"color\", color);\n attributes.put(\"startX\", startX);\n attributes.put(\"startY\", startY);\n action.put(\"Action\", attributes);\n }",
"public void send(Message msg);",
"@Override\n\tpublic void createAction(Model m) {\n\t\t\n\t}",
"public ExecuteAction()\n {\n this(null);\n }",
"@Override\r\n\tpublic Sender getInstance() {\n\t\treturn new SmsSender();\r\n\t}",
"public MemberAction() {\n\t\tsuper();\n\t}",
"public BattleWeaponsSegmentAction() {\n }",
"public SmsSendRequestDto() {\n super();\n }",
"public static SendResult getSendResult() {\n\t\treturn new SendResult(\"0\", \"\", \"\");\r\n\t}",
"public CreateIndividualPreAction() {\n }",
"public POGOProtos.Rpc.CombatActionProto getMinigameAction() {\n if (minigameActionBuilder_ == null) {\n return minigameAction_ == null ? POGOProtos.Rpc.CombatActionProto.getDefaultInstance() : minigameAction_;\n } else {\n return minigameActionBuilder_.getMessage();\n }\n }",
"NoAction createNoAction();",
"static public BasicAction createActionFor(Object o, String methodName)\n {\n BasicAction ba = null;\n try {\n ba = ByteCodeBuilder.generateBasicAction(o, methodName);\n } catch (GeneratorException ex) {\n SimUtilities.showError(\"Error creating action: \" + methodName +\n \" on \" + o.getClass().getName(), ex);\n System.exit(0);\n }\n\n return ba;\n }",
"private PSAAClientActionFactory()\n {\n }",
"DomainAction createDomainAction();",
"public Message(Account accountSend) {\r\n\t\tm_accountSend = accountSend;\r\n\t\tformatTime();\r\n\t}",
"public POGOProtos.Rpc.CombatActionProto.Builder getMinigameActionBuilder() {\n \n onChanged();\n return getMinigameActionFieldBuilder().getBuilder();\n }",
"private void sendCommand(int recipient, int action, int parameter) {\r\n\t\tString command = \"*\" + recipient + \";\" + action + \";\" + parameter + \";\"\r\n\t\t\t\t+ \"0\" + \"#\";\r\n\t\tlogger.debug(\"Sende Kommando\");\r\n\t\tcom.sendString(command);\r\n\t\tlogger.debug(\"Senden des Kommandos beendet\");\r\n\t}",
"ClientMessageSender() {\n\n\t}",
"public void sendRegister(ActionEvent actionEvent) {\n }",
"public static Action sendShips(String[] ids, int loc, int dest) {\n\t\treturn new Action(ids, loc, dest);\n\t}",
"public Action(GameManager gameManager){\n this.gameManager = gameManager;\n }",
"public void sendMsg(){\r\n\t\tsuper.getPPMsg(send);\r\n\t}",
"protected void send(O operation)\n {\n }",
"protected javax.swing.JButton getJButtonSend() {\n\t\tif(jButton == null) {\n\t\t\tjButton = new javax.swing.JButton();\n\t\t\tjButton.setPreferredSize(new java.awt.Dimension(85,25));\n\t\t\tjButton.setText(\"Send\");\n\t\t\tjButton.setName(\"Send\");\n\t\t\tjButton.setMnemonic(java.awt.event.KeyEvent.VK_S);\n\t\t\t\n\t\t\tjButton.setToolTipText(\"Send the play list file and save it locally\");\n\n\t\t\tjButton.addActionListener(new java.awt.event.ActionListener() { \n\t\t\t\tpublic void actionPerformed(java.awt.event.ActionEvent e) {\n\t\t\t\t\t\n\t\t\t\t\tString msg = getInvalidMsg();\n\t\t\t\t\tif( msg != null ) {\t\t\t\t\t\t\t\n\t\t\t\t\t\tJOptionPane.showMessageDialog(PlayListDialog.this,\n\t\t\t\t\t\t\tmsg,\n\t\t\t\t\t\t\t\"Invalid Input\", JOptionPane.OK_OPTION);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\twriteToPropFile( LMMUtils.PLAYER_FILE );\n\t\n\t\t\t\t\t\t\tsendFileMsg();\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch( IOException ioe ) {\n\t\t\t\t\t\t\tLMMLogger.error( \"Unable to write & send play list file\", ioe );\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\tdispose();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\treturn jButton;\n\t}",
"ForwardAction createForwardAction();",
"public Sender(String name) {\n super(name);\n }",
"public static void sendActionMessage(ServerPlayer player, Component textComponent) {\n sendMessage(player, textComponent, true);\n }",
"LogAction createLogAction();",
"public abstract Action getAction();",
"public POGOProtos.Rpc.CombatActionProto getCurrentAction() {\n if (currentActionBuilder_ == null) {\n return currentAction_ == null ? POGOProtos.Rpc.CombatActionProto.getDefaultInstance() : currentAction_;\n } else {\n return currentActionBuilder_.getMessage();\n }\n }",
"void send();",
"POGOProtos.Rpc.CombatActionProto getMinigameAction();",
"public String getAction() {\n Object ref = action_;\n if (ref instanceof String) {\n return (String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n action_ = s;\n return s;\n }\n }",
"public interface Sendable {\n\n}",
"@Override\n\tpublic String getAction() {\n\t\treturn action;\n\t}",
"public IPSAAClientAction getAction(String actionType)\n {\n IPSAAClientAction action = m_actions.get(actionType);\n if(action == null)\n {\n // Use reflection to instantiate the class\n String pack = getClass().getPackage().getName();\n String className = pack + \".impl.PS\" + actionType + \"Action\";\n \n try\n {\n Class clazz = Class.forName(className);\n action = (IPSAAClientAction) clazz.newInstance();\n m_actions.put(actionType, action);\n }\n catch (ClassNotFoundException ignore)\n {\n // ignore\n }\n catch (InstantiationException e)\n {\n ms_log.error(e.getLocalizedMessage(), e);\n }\n catch (IllegalAccessException e)\n {\n ms_log.error(e.getLocalizedMessage(), e);\n }\n \n }\n return action;\n }",
"public static void sendAction(UUID uuid, Action action) throws IOException {\n sendMessage(new Gson().toJson(new ControlMessage(uuid, action)));\n }",
"public static final PSAAClientActionFactory getInstance()\n {\n if(ms_instance == null)\n ms_instance = new PSAAClientActionFactory();\n return ms_instance;\n }",
"public Class<?> getActionClass() {\n return this.action;\n }",
"private JButton getButButton() { \n if (butButton == null) { \n butButton = new JButton(); \n butButton.setBounds(new Rectangle(58, 110, 177, 50)); \n butButton.setText(\"Enviar\"); \n butButton.addActionListener(new java.awt.event.ActionListener() { \n public void actionPerformed(java.awt.event.ActionEvent e) { \n send(); \n } \n }); \n } \n return butButton; \n }",
"private void sendCommand(int recipient, int action, int parameter,\r\n\t\t\tint options) {\r\n\t\tString command = \"*\" + recipient + \";\" + action + \";\" + parameter + \";\"\r\n\t\t\t\t+ options + \"#\";\r\n\t\tlogger.debug(\"Sende Kommando\");\r\n\t\tcom.sendString(command);\r\n\t\tlogger.debug(\"Senden des Kommandos beendet\");\r\n\r\n\t}",
"private ActionCommand(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n super(builder);\n this.unknownFields = builder.getUnknownFields();\n }",
"ActionDefinition createActionDefinition();",
"@Override\n\tpublic String execute() throws Exception {\n\t\treturn \"send\";\n\t}",
"private void makeAction(JSONObject request, DataOutputStream clientStream) throws IOException, ParseException {\n\t\tGossip_action_message.Action action = Gossip_parser.getClientAction(request);\n\t\tString sender = Gossip_parser.getClientName(request);\n\t\tString receiver = Gossip_parser.getClientReceiver(request);\n\n\t\ttry {\n\t\t\tswitch(action) {\n\t\t\t\n\t\t\t\tcase LOOKUP_OP: {\n\t\t\t\t\tif (data.searchUser(receiver) == true)\n\t\t\t\t\t\tsendReply(new Gossip_userinfo_message(Gossip_success_message.successMsg.USERINFO, data.getUser(receiver)), clientStream);\n\t\t\t\t} break;\n\t\t\t\t\n\t\t\t\tcase FRIENDSHIP_OP: {\n\t\t\t\t\tif (!data.addFriendship(sender, receiver))\n\t\t\t\t\t\tsendReply(new Gossip_fail_message(Gossip_fail_message.failMsg.FRIENDALREADY), clientStream);\n\t\t\t\t\telse\n\t\t\t\t\t\tsendReply(new Gossip_server_message(Gossip_server_message.Op.SUCCESS_OP), clientStream);\n\t\t\t\t} break;\n\t\t\t\t\n\t\t\t\tcase RM_FRIENDSHIP_OP: {\n\t\t\t\t\tif (!data.removeFriendship(sender, receiver))\n\t\t\t\t\t\tsendReply(new Gossip_server_message(Gossip_server_message.Op.FAIL_OP), clientStream);\n\t\t\t\t\telse\n\t\t\t\t\t\tsendReply(new Gossip_server_message(Gossip_server_message.Op.SUCCESS_OP), clientStream);\n\t\t\t\t} break;\n\t\t\t\t\n\t\t\t\tcase MSG_FRIEND_OP: {\n\t\t\t\t\t//non è permesso scambiare messaggi tra utenti non amici\n\t\t\t\t\tif (!data.getFriends(sender).contains(data.getUser(receiver)))\n\t\t\t\t\t\tsendReply(new Gossip_fail_message(Gossip_fail_message.failMsg.OPNOTALLOWED), clientStream);\n\t\t\t\t\telse {\n\t\t\t\t\t\tGossip_text_notification_message notification;\n\t\t\t\t\t\tString text = Gossip_parser.getText(request);\n\t\t\t\t\t\tString senderLang = Gossip_parser.getLang(data.getUser(sender).getLanguage());\n\t\t\t\t\t\tString receiverLang = Gossip_parser.getLang(data.getUser(receiver).getLanguage());\n\t\t\t\t\t\t//traduco testo\n\t\t\t\t\t\tString translatedText = Gossip_translator.translate(text, senderLang, receiverLang);\n\t\t\t\t\t\tSocket receiver_socket;\n\t\t\t\t\t\t//se la traduzione mi restituisce null, invio il testo non tradotto\n\t\t\t\t\t\tif (translatedText == null)\n\t\t\t\t\t\t\tnotification = new Gossip_text_notification_message(sender, text);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tnotification = new Gossip_text_notification_message(sender, translatedText);\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t//recupero il socket per le notifiche al client\n\t\t\t\t\t\t\treceiver_socket = data.getUser(receiver).getMessageSocket();\n\t\t\t\t\t\t\tsynchronized(receiver_socket) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//invio notifica\n\t\t\t\t\t\t\t\tsendReply(notification, new DataOutputStream(receiver_socket.getOutputStream()));\n\t\t\t\t\t\t\t\t//invio risposta\n\t\t\t\t\t\t\t\tsendReply(new Gossip_server_message(Gossip_server_message.Op.SUCCESS_OP), clientStream);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (FriendOfflineException e) {\n\t\t\t\t\t\t\t//amico offline\n\t\t\t\t\t\t\tsendReply(new Gossip_fail_message(Gossip_fail_message.failMsg.FRIENDOFFLINE), clientStream);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} break;\n\t\t\t\t\n\t\t\t\tcase FILE_FRIEND_OP: {\n\t\t\t\t\t//non è permesso inviare file a utenti che non sono amici\n\t\t\t\t\tif (!data.getFriends(sender).contains(data.getUser(receiver)))\n\t\t\t\t\t\tsendReply(new Gossip_fail_message(Gossip_fail_message.failMsg.OPNOTALLOWED), clientStream);\n\t\t\t\t\telse {\n\t\t\t\t\t\tString filename = Gossip_parser.getFilename(request);\n\t\t\t\t\t\tSocket receiver_socket;\n\t\t\t\t\t\tGossip_file_notification_message notification = new Gossip_file_notification_message(sender, filename);\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t//recupero socket per le notificihe\n\t\t\t\t\t\t\treceiver_socket = data.getUser(receiver).getMessageSocket();\n\t\t\t\t\t\t\tsynchronized (receiver_socket) {\n\t\t\t\t\t\t\t\tsendReply(notification, new DataOutputStream(receiver_socket.getOutputStream()));\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t//ridirigo quello che scrive il receiver verso il mittente (hostname e porta per ricevere il file)\n\t\t\t\t\t\t\t\tclientStream.writeUTF(new DataInputStream(new BufferedInputStream(receiver_socket.getInputStream())).readUTF());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (FriendOfflineException e) {\n\t\t\t\t\t\t\t//friend offline\n\t\t\t\t\t\t\tsendReply(new Gossip_fail_message(Gossip_fail_message.failMsg.FRIENDOFFLINE), clientStream);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} break;\n\t\t\t}\n\t\t} catch (NodeNotFoundException e) {\n\t\t\t//utente non registrato\n\t\t\tsendReply(new Gossip_fail_message(Gossip_fail_message.failMsg.NICKUNKNOWN), clientStream);\n\t\t}\n\t}",
"public Simulator send(String cmd) {\n //robotEntities.robotAgent.receive(cmd);\n return this;\n }",
"void sendMessage() {\n\n\t}",
"public TriggerMessage() {\n\t}",
"public String getAction() {\n Object ref = action_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n action_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }",
"private Command createPushCommand() {\n\t\treturn new PushCommand();\n\t}",
"public LCAction(int id, String msgText, String name, String actionType, int msgId) {\r\n this.id = id;\r\n this.msgText = msgText;\r\n this.name = name;\r\n if (actionType == null)\r\n actionType = \"playLearningCompanion\";\r\n this.actionType = actionType;\r\n this.msgId = msgId;\r\n }",
"private Thread actualSend(String action, String image, String message) {\n\t\treturn new Thread(() -> {\n\t\t\tSubscription.Keys keys = new Subscription.Keys(key, auth);\n\t\t\tSubscription subscription = new Subscription(endpoint, keys);\n\t\t\tJsonObjectBuilder payload = Json.createObjectBuilder();\n\t\t\tJsonObjectBuilder options = Json.createObjectBuilder();\n\t\t\toptions.add(\"body\", message);\n\t\t\toptions.add(\"badge\", \"icons/grayscale.png\");\n\t\t\toptions.add(\"icon\", \"icons/256.png\");\n\t\t\toptions.add(\"timestamp\",System.currentTimeMillis());\n\t\t\tif(!image.equals(\"\")) options.add(\"image\",image);\n\t\t\tif(action!=null) options.add(\"data\",action);\n\t\t\t//action kan ook een URL zijn!\n\t\t\tpayload.add(\"options\", options);\n\t\t\tpayload.add(\"title\", \"CloneBook\");\n\t\t\tif(action!=null) payload.add(\"data\",action);\n\t\t\ttry {\n\t\t\t\tNotification notification = new Notification(subscription,payload.build().toString());\n\t\t\t\tHttpResponse response = pushService.send(notification);\n\t\t\t\tint code = response.getStatusLine().getStatusCode();\n\t\t\t\tif (code == 201) return;\n\t\t\t\tif (code == 410) {\n\t\t\t\t\tdelete();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"code = \" + code);\n\t\t\t\treturn;\n\t\t\t} catch (JoseException | InterruptedException | IOException | ExecutionException | GeneralSecurityException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\tSystem.out.println(\"NOTIFICATION ERROR!\");\n\t\t\t}\n\t\t\tthrow new UnsupportedOperationException();\n\t\t});\n\t}",
"public ExecuteAction(String className)\n {\n _className = className;\n }",
"public com.exacttarget.wsdl.partnerapi.TriggeredSendDefinition addNewAutoForwardTriggeredSend()\n {\n synchronized (monitor())\n {\n check_orphaned();\n com.exacttarget.wsdl.partnerapi.TriggeredSendDefinition target = null;\n target = (com.exacttarget.wsdl.partnerapi.TriggeredSendDefinition)get_store().add_element_user(AUTOFORWARDTRIGGEREDSEND$16);\n return target;\n }\n }",
"public A getAction() {\r\n\t\treturn action;\r\n\t}",
"EchoedRequestType createEchoedRequestType();",
"public Class getActionClass() {\n return actionClass;\n }",
"public AddApplicationReleaseAction() {\r\n }",
"protected void init_actions()\r\n {\r\n action_obj = new CUP$CircuitCup$actions(this);\r\n }",
"@Action(\n value = \"send\",\n results = {\n @Result(name=\"error\", location=\"/messages-add.tiles\", type=\"tiles\"),\n @Result(name=\"input\", location=\"/messages-add.tiles\", type=\"tiles\"),\n @Result(name=\"success\", type = \"redirectAction\", params = {\n \"namespace\", \"/\", \"actionName\", \"home\", \"message\", \"\"\n })\n }\n )\n public String execute() throws Exception{\n\n\n try {\n Message message = ModelFactory.create(Message.class, this.messageBean);\n\n message.setTo( userDAO.get( Long.parseLong(this.messageBean.getDestinator())) );\n message.setFrom( this.authenticatedUser );\n\n messageDAO.save( message );\n\n // Copy attached piece\n // @todo this part works but is deactivated because I don't really now where to put the file for now ...\n String destPath = \"C:/\";\n if( ! this.messageBean.getFileUploadFileName().isEmpty() ){\n// try{\n// File destFile = new File(destPath, this.messageBean.getFileUploadFileName());\n// FileUtils.copyFile( this.messageBean.getFileUpload(), destFile);\n// }catch(IOException e){\n// throw new Exception(e);\n// }\n }\n\n return SUCCESS;\n\n } catch (Exception e) {\n this.addActionError(\"Could not send message: \" + e.getMessage());\n e.printStackTrace();\n return ERROR;\n }\n\n }",
"CustomAction(String actionType, String color, double strokeWidth, ArrayList<Double> pointBuffer) {\n action.put(\"Object\", actionType);\n JSONObject attributes = new JSONObject();\n attributes.put(\"StrokeWidth\", strokeWidth);\n attributes.put(\"color\", color);\n attributes.put(\"pointBuffer\", pointBuffer);\n action.put(\"Action\", attributes);\n }",
"@Test\n public void testSend() throws Exception {\n System.out.println(\"send\");\n Sendable s = sendAMessage();\n }",
"@Override\n\tpublic void newAction() {\n\t\t\n\t}",
"public String getAction () {\n return action;\n }",
"public POGOProtos.Rpc.CombatActionProtoOrBuilder getMinigameActionOrBuilder() {\n if (minigameActionBuilder_ != null) {\n return minigameActionBuilder_.getMessageOrBuilder();\n } else {\n return minigameAction_ == null ?\n POGOProtos.Rpc.CombatActionProto.getDefaultInstance() : minigameAction_;\n }\n }",
"public NamedAction createNamedAction(String name) {\n NamedActionImpl action = new NamedActionImpl();\n action.setName(name);\n return action;\n }"
]
| [
"0.66983455",
"0.66983455",
"0.66983455",
"0.6318581",
"0.62955046",
"0.6127827",
"0.61252505",
"0.59852105",
"0.59336793",
"0.5908902",
"0.59045774",
"0.59016013",
"0.5854192",
"0.58256984",
"0.58061147",
"0.5799112",
"0.5765156",
"0.5729759",
"0.56729734",
"0.56528956",
"0.5645242",
"0.5579625",
"0.5563379",
"0.5538872",
"0.5536237",
"0.55309534",
"0.55266243",
"0.55239064",
"0.55179226",
"0.54998994",
"0.5497242",
"0.5489372",
"0.5470816",
"0.5467308",
"0.545233",
"0.54402953",
"0.5431674",
"0.5417956",
"0.54166424",
"0.5412388",
"0.5394649",
"0.5391137",
"0.53864866",
"0.5381788",
"0.53775406",
"0.5364456",
"0.53633225",
"0.53596586",
"0.53547204",
"0.5353986",
"0.5353927",
"0.5353424",
"0.53424543",
"0.53332645",
"0.5329792",
"0.53275484",
"0.5320473",
"0.53203475",
"0.5315964",
"0.53050417",
"0.53038025",
"0.53008723",
"0.5299869",
"0.5298812",
"0.5291677",
"0.52889884",
"0.5288298",
"0.5285245",
"0.5273587",
"0.5272755",
"0.5266287",
"0.52648425",
"0.5262101",
"0.52562207",
"0.5254188",
"0.52446765",
"0.524352",
"0.5240764",
"0.5236631",
"0.5230843",
"0.5229774",
"0.52286506",
"0.52263916",
"0.5224709",
"0.5223096",
"0.52203244",
"0.5215035",
"0.5213466",
"0.52117765",
"0.5210248",
"0.5207322",
"0.51974165",
"0.51953536",
"0.5192154",
"0.51893044",
"0.518314",
"0.51800877",
"0.51746494",
"0.5171322",
"0.51648927"
]
| 0.89458907 | 0 |
Returns a new object of class 'Var Ref'. | VarRef createVarRef(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"VarReference createVarReference();",
"VariableRef createVariableRef();",
"private cat.footoredo.mx.ir.Variable ref (Entity entity) {\n return new cat.footoredo.mx.ir.Variable(varType(entity.getType()), entity);\n }",
"VarAssignment createVarAssignment();",
"Variable createVariable();",
"Variable createVariable();",
"DynamicVariable createDynamicVariable();",
"public VariableIF createVariable(VariableDecl decl);",
"VariableExp createVariableExp();",
"public Object clone() { return new ReferenceType((Name) name.clone()); }",
"Var getVar();",
"Symbol getRef();",
"AliasVariable createAliasVariable();",
"FieldRefType createFieldRefType();",
"public ASTNode createReference() {\n return new ASTFunctionReference(getName(), getNumParams());\n }",
"ControlVariable createControlVariable();",
"ReferenceProperty createReferenceProperty();",
"ComponentRefType createComponentRefType();",
"public IAspectVariable<V> createNewVariable(PartTarget target);",
"static Pool newVariablePool() {\n return new VariablePool();\n }",
"public abstract R createReference(T type, Object value);",
"public LiveRef(int paramInt) {\n/* 74 */ this(new ObjID(), paramInt);\n/* */ }",
"LocalReference createLocalReference();",
"public void ref() {\n\n\t}",
"public void generateRef(PhpWriter out)\n throws IOException\n {\n ExprGenerator objGen = ((ExprPro) _objExpr).getGenerator();\n\n objGen.generateVar(out);\n out.print(\".getFieldVar(env, \");\n out.printIntern(_name);\n out.print(\")\");\n }",
"public Var(String var) {\r\n this.variable = var;\r\n }",
"Variable(Object names[]) {\n _vname = makeName(names).intern();\n _names = names;\n \n }",
"private void declareWithReference(Variable newVar,String variableName, boolean isFinal,boolean\r\n\t\t\tisArgument, String value)throws IllegalDeclarationException,\r\n\t\t\tIncompatibleTypeException, TypeNotSupportedException{\r\n\t\tVariable reference = findVariable(value);\r\n\t\tif (reference != null) {//if it is indeed a reference to a previously declared variable:\r\n\t\t\t// we'll check if the referenced var is initialised + if it's type's compatible with newVar's\r\n\t\t\tif (newVar.compatibleWith(reference)&&reference.isInitialized()){\r\n\t\t\t\tVariable varToDeclare = vFactory.createVariable(true,isFinal,isArgument,reference.getType(),\r\n\t\t\t\t\t\tparent==null);\r\n\t\t\t\tscopeVariables.put(variableName, varToDeclare);//if it is, we'll declare a new variable\r\n\t\t\t\treturn;\r\n\t\t\t}else{\r\n\t\t\t\t//check if value's an uninitialised global var that we've already initialised in this scope\r\n\t\t\t\treference = uninitialisedGlobalVariables.get(value);\r\n\t\t\t\tif(reference!=null&&newVar.compatibleWith(reference)){\r\n\t\t\t\t\tVariable varToDeclare = vFactory.createVariable(true,isFinal,isArgument,reference.getType(),\r\n\t\t\t\t\t\t\tparent==null);\r\n\t\t\t\t\tscopeVariables.put(variableName, varToDeclare);//if it is, declare a new variable\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}//if value's type isn't compatible with type ,value isn't a reference or isn't a good one:\r\n\t\tthrow new IllegalDeclarationException();\r\n\r\n\t}",
"Variable getRefers();",
"public abstract T ref(ID id);",
"public Variant(final Variant var) {\n filter = var.filter;\n qual = var.qual;\n info = var.info;\n varId = var.varId;\n chr = var.chr;\n pos = var.pos;\n referenceAlleleLength = var.referenceAlleleLength;\n ref = var.ref == null ? null : var.ref.clone();\n refDeleted = var.refDeleted;\n clippedSequence = var.clippedSequence;\n if (var.alts != null) {\n alts = new Alt[var.alts.length];\n for (int i = 0; i < var.alts.length; i++) {\n if (var.alts[i] != null) {\n alts[i] = var.alts[i].copy();\n } else {\n alts[i] = null;\n }\n }\n }\n\n this.chr2 = var.chr2;\n this.pos2 = var.pos2;\n this.end2 = var.end2;\n paternal = var.paternal;\n maternal = var.maternal;\n isPhased = var.isPhased;\n rand = var.rand;\n isinv = var.isinv;\n isLengthImprecise = var.isLengthImprecise;\n traid = var.traid;\n compositions = var.getCompositions();\n }",
"public IVariable createInternalVariable(String name, IJavaType referencType) {\n IVariable var = new InterpreterVariable(name, referencType, fContext.getVM());\n fInternalVariables.put(name, var);\n return var;\n }",
"Variable(String _var) {\n this._var = _var;\n }",
"public int getVarRef(Variable var) throws ParseException {\r\n\t\tDimensions dims = ((MatrixVariableI) var).getDimensions();\r\n\t\tObjStore store = getStoreByDim(dims);\r\n\t\tint ref = store.addVar((MatrixVariableI) var);\r\n\t\treturn ref;\r\n\t}",
"@Override\n\tpublic IBasicObject getForCreateVar() {\n\t\treturn heldObj.getForCreateVar();\n\t}",
"private Ref handleRef() throws XMLStreamException{\n String name = reader.getAttributeValue(0);\n nextTag();\n nextTag();\n return new Ref(definedGrammar, name);\n }",
"public VRefVariableElement(boolean forbidSpaces, String nam) {\n\t\tsuper(forbidSpaces);\n\n\t\tthis.nam = nam;\n\t}",
"public LiveRef(ObjID paramObjID, int paramInt) {\n/* 93 */ this(paramObjID, TCPEndpoint.getLocalEndpoint(paramInt), true);\n/* */ }",
"public interface IVariable<A extends AbstractDomain<?>> extends IReferenceHolder<A>, ITerm {\n\n\t@SuppressWarnings(\"unchecked\")\n\t@Override\n\tpublic default Set<IVariable<?>> getVariables() {\n\t\tSet<IVariable<?>> values = new HashSet<>();\n\t\tvalues.add((IVariable<AbstractDomain<?>>) this);\n\t\treturn values;\n\t}\n\n\t/**\n\t * Lets the visitor visit the variable.\n\t * \n\t * @param IVariableVisitor\n\t * The visitor.\n\t */\n\tpublic void processWith(IVariableVisitor iVariableVisitor);\n\n\t/**\n\t * Returns whether it is a constant.\n\t * \n\t * @return Whether it is a constant.\n\t */\n\tpublic boolean isConstant();\n}",
"static Obj NewObj (String name,int kind) {\r\n\t\tObj p, obj = new Obj();\r\n obj.name = new String(name); \r\n\t\tobj.type = null; obj.kind = kind;\r\n\t\tobj.level = curLevel;\r\n\t\tp = topScope.locals;\r\n\t\t/*Para buscar si el nb de la variable nueva ya esta!!!*/\r\n\t\twhile (p != null) { \r\n \t \tif (p.name.equals(name)) Parser.SemError(1);\r\n\t\t\tp = p.next;\r\n\t\t}\r\n \t//FILO!!\r\n obj.next = topScope.locals; \r\n\t\ttopScope.locals = obj;\r\n \t//if (kind == vars) {}\r\n \t//obj.adr = topScope.nextAdr; topScope.nextAdr++;\r\n \t//obj.view();\r\n\t\treturn obj;\r\n }",
"public Variable(String name) {\n this.name = name;\n checkRep();\n }",
"PropertyReference createPropertyReference();",
"public Code visitVariableNode(ExpNode.VariableNode node) {\n beginGen(\"Variable\");\n SymEntry.VarEntry var = node.getVariable();\n Code code = new Code();\n code.genMemRef(staticLevel - var.getLevel(), var.getOffset());\n endGen(\"Variable\");\n return code;\n }",
"d(a aVar) {\n super(0);\n this.this$0 = aVar;\n }",
"protected Element myVar(){\n\t\treturn el(\"bpws:variable\", new Node[]{\n\t\t\t\tattr(\"messageType\", \"nswomo:receiveMessage\"),\n\t\t\t\tattr(\"name\", VARNAME)\n\t\t});\n\t}",
"public PhpVariableRef(String name, Location location, String scope) {\n\t\tsuper(name, location);\n\t\tthis.scope = scope;\n\t}",
"@Override\r\n\tpublic Ref getRef() {\n\t\treturn ref;\r\n\t}",
"<C, PM> Variable<C, PM> createVariable();",
"@Override String opStr() { return \"var\"; }",
"public DetachedVarSymbol(long flags, Name name, Type type, Symbol owner) {\n super(flags, name, type, owner);\n this.decl = null;\n }",
"public static Variable variable( String name )\n {\n NullArgumentException.validateNotNull( \"Variable name\", name );\n return new Variable( name );\n }",
"public final C5420a invoke(C5420a aVar) {\n C5420a aVar2 = new C5420a((DefaultAccount) this.f12943c.mo31015c(), (List) this.f12943c.mo31016d(), false, false, false, 28, null);\n return aVar2;\n }",
"public ReferenceRemote getReferenceLocal()\n throws RemoteException, IOException {\n refObj = new ReferenceAdapter();\n return refObj;\n }",
"public Variable(String name){\n this.name = name;\n }",
"public Variable(String name) {\r\n\tthis.name = name;\r\n }",
"public ObjectReference getObject();",
"public Variable(String name) {\r\n\t\tName = name;\r\n\t\tValues = new ArrayList<>();\r\n\t\tParents = new ArrayList<>();\r\n\t\tCPT = new TreeMap<>();\r\n\t}",
"public LiveRef(ObjID paramObjID, int paramInt, RMIClientSocketFactory paramRMIClientSocketFactory, RMIServerSocketFactory paramRMIServerSocketFactory) {\n/* 103 */ this(paramObjID, TCPEndpoint.getLocalEndpoint(paramInt, paramRMIClientSocketFactory, paramRMIServerSocketFactory), true);\n/* */ }",
"public TypeVarWithInitializerElements getTypeVarWithInitializerAccess() {\r\n\t\treturn pTypeVarWithInitializer;\r\n\t}",
"c(a aVar) {\n super(0);\n this.this$0 = aVar;\n }",
"protected URIReferenceImpl makeRefImpl(URIReference ref) {\n return (ref instanceof URIReferenceImpl) ? (URIReferenceImpl)ref : new URIReferenceImpl(ref.getURI());\n }",
"public ValueFunction reference() throws DynamicParamException {\n return new PlainValueFunction(getNumberOfActions(), (DirectFunctionEstimator)functionEstimator.reference(), getParams());\n }",
"public PrimObject reference(String name) {\n return resolveObject(name);\n }",
"public TypeVarElements getTypeVarAccess() {\r\n\t\treturn pTypeVar;\r\n\t}",
"public ExprVar(FEContext context, String name)\n {\n super(context);\n this.name = name;\n }",
"public ReferenceType(Name name) {\n super(name.line, name.byteOffset);\n this.name = name;\n }",
"VariableDeclaration createVariableDeclaration();",
"public Value makeNonPolymorphic() {\n if (var == null)\n return this;\n Value r = new Value(this);\n r.var = null;\n r.flags &= ~(PRESENT_DATA | PRESENT_ACCESSOR);\n return canonicalize(r);\n }",
"public final C5420a invoke(C5420a aVar) {\n C5420a aVar2 = new C5420a(null, null, false, true, this.f12938c.f12932d.mo13695j(), 7, null);\n return aVar2;\n }",
"Aliasing getVariable();",
"private ConsistentVariable(String name, Class<V> type, V initValue, long initVersion) {\n super(name, type);\n versionedValue = new AtomicReference<>(new VersionedValue<>(initVersion, initValue));\n }",
"public Value( String inName, Variable inVar, int inIndex )\n {\n _var = inVar;\n _name = inName;\n _index = inIndex;\n }",
"public int getVarRef(MatrixVariableI var) throws ParseException {\r\n\t\tDimensions dims = var.getDimensions();\r\n\t\tObjStore store = getStoreByDim(dims);\r\n\t\tint ref = store.addVar(var);\r\n\t\treturn ref;\r\n\t}",
"public LiveRef(int paramInt, RMIClientSocketFactory paramRMIClientSocketFactory, RMIServerSocketFactory paramRMIServerSocketFactory) {\n/* 85 */ this(new ObjID(), paramInt, paramRMIClientSocketFactory, paramRMIServerSocketFactory);\n/* */ }",
"public AbstractVariable getVariable () {\n try {\n RemoteStackVariable rsv = thread.getCurrentFrame ().getLocalVariable (\"this\"); // NOI18N\n return new ToolsVariable (\n (ToolsDebugger) getDebugger (),\n rsv.getName (),\n rsv.getValue (),\n rsv.getType ().toString ()\n );\n } catch (Exception e) {\n return null;\n }\n }",
"ReferenceRealization createReferenceRealization();",
"public Reference() {\n super();\n }",
"public interface Scope {\n public Object getVar(String varName);\n\n public Scope defineVar(String varName, Object value);\n\n public Scope defineConst(String varName, Object value);\n\n public Scope setVar(String varName, Object value);\n\n public Scope delVar(String varName);\n}",
"public interface TeaVariable extends TeaNamedElement {\n boolean hasInitializer();\n TeaExpression getInitializer();\n void setInitializer(TeaExpression expr) throws IncorrectOperationException;\n TeaType getType();\n// boolean isConst();\n ASTNode findNameIdentifier();\n\n TeaReferenceExpression findNameExpression();\n}",
"Variables createVariables();",
"@Override\n\tpublic Object clone() {\n\t\treturn new MeanVar(n, mean, s);\n\t}",
"public ItemReference alloc();",
"public final void rule__Affectation__RefAssignment_0() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalBrowser.g:4181:1: ( ( ruleVarReference ) )\n // InternalBrowser.g:4182:2: ( ruleVarReference )\n {\n // InternalBrowser.g:4182:2: ( ruleVarReference )\n // InternalBrowser.g:4183:3: ruleVarReference\n {\n before(grammarAccess.getAffectationAccess().getRefVarReferenceParserRuleCall_0_0()); \n pushFollow(FOLLOW_2);\n ruleVarReference();\n\n state._fsp--;\n\n after(grammarAccess.getAffectationAccess().getRefVarReferenceParserRuleCall_0_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"ReferenceEmbed createReferenceEmbed();",
"public VariableView getVarView() {\n \t\treturn this.varView;\n \t}",
"public Variable(){\n name = \"\";\n initialValue = 0;\n }",
"protected void sequence_RefPourcentVar(ISerializationContext context, RefPourcentVar semanticObject) {\n\t\tif (errorAcceptor != null) {\n\t\t\tif (transientValues.isValueTransient(semanticObject, DroneDSLLibPackage.Literals.REF_POURCENT_VAR__VAR) == ValueTransient.YES)\n\t\t\t\terrorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, DroneDSLLibPackage.Literals.REF_POURCENT_VAR__VAR));\n\t\t}\n\t\tSequenceFeeder feeder = createSequencerFeeder(context, semanticObject);\n\t\tfeeder.accept(grammarAccess.getRefPourcentVarAccess().getVarPourcentDeclIDTerminalRuleCall_0_1(), semanticObject.eGet(DroneDSLLibPackage.Literals.REF_POURCENT_VAR__VAR, false));\n\t\tfeeder.finish();\n\t}",
"public T newInstance();",
"HxType createReference(final String className);",
"@Override\n public VariableListNode deepCopy(BsjNodeFactory factory);",
"public static <T extends @TestAnnotation2 Number & Comparable> TypeInstance createTypeVariable() {\n AnnotatedType referencedTypeVariable = getAnnotatedType();\n TypeInstance typeInstance = Diamond.types().from(referencedTypeVariable);\n return typeInstance;\n }",
"public final void rule__FindProperty__RefAssignment_0() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \t\n try {\n // InternalBrowser.g:4740:1: ( ( ruleVarReference ) )\n // InternalBrowser.g:4741:2: ( ruleVarReference )\n {\n // InternalBrowser.g:4741:2: ( ruleVarReference )\n // InternalBrowser.g:4742:3: ruleVarReference\n {\n before(grammarAccess.getFindPropertyAccess().getRefVarReferenceParserRuleCall_0_0()); \n pushFollow(FOLLOW_2);\n ruleVarReference();\n\n state._fsp--;\n\n after(grammarAccess.getFindPropertyAccess().getRefVarReferenceParserRuleCall_0_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public VariableBinding formVarbind(MetaData mdata) {\n VariableBinding vbind = null;\n if (mdata.m_oidValue != null) {\n vbind = new VariableBinding(new OID(mdata.m_oid), castOidType(mdata.m_oidType, mdata.m_oidValue));\n }\n return vbind;\n }",
"public abstract Value getReferenceValue();",
"public Variables(String name, VariablesHistory VH) {\n this.name = name;\n this.VH = VH;\n }",
"public cy mo1942a(dm dmVar) {\r\n return new cs(dmVar, this.f6454a);\r\n }",
"@Override\n\tprotected String getVariableClassName() {\n\t\treturn \"variable\";\n\t}",
"public org.python.types.Type __new__(org.python.types.Type cls);",
"<C, PM> VariableExp<C, PM> createVariableExp();",
"protected JvmParameterizedTypeReference newTypeRef(EObject context, Class<?> type) {\n\t\tTypeReferences typeRefs = getTypeReferences();\n\t\treturn newTypeRef(context, type.getName(), typeRefs.getTypeForName(type, context));\n\t}"
]
| [
"0.8279827",
"0.82204866",
"0.68243355",
"0.67264885",
"0.66755515",
"0.66755515",
"0.6164317",
"0.61392987",
"0.603127",
"0.59536433",
"0.58818686",
"0.5847861",
"0.57412547",
"0.5719027",
"0.5716407",
"0.56954503",
"0.56497407",
"0.5645504",
"0.5644635",
"0.5620166",
"0.5615718",
"0.5602451",
"0.55673784",
"0.55427194",
"0.55389035",
"0.5538691",
"0.5523111",
"0.55191135",
"0.5499039",
"0.54967",
"0.54946995",
"0.5470032",
"0.5469159",
"0.54584813",
"0.5432486",
"0.543208",
"0.54304665",
"0.54137623",
"0.5346035",
"0.53397053",
"0.53370726",
"0.5313213",
"0.5312211",
"0.53036547",
"0.5302018",
"0.5297681",
"0.5296848",
"0.52888155",
"0.5288744",
"0.528826",
"0.52862453",
"0.52766657",
"0.5237879",
"0.52376044",
"0.52310485",
"0.5227165",
"0.5219402",
"0.5218611",
"0.521673",
"0.52134955",
"0.52036047",
"0.520267",
"0.5196547",
"0.5189444",
"0.51860875",
"0.5179819",
"0.5177656",
"0.517309",
"0.5171459",
"0.5171067",
"0.51587033",
"0.5157475",
"0.5149036",
"0.5143444",
"0.5129777",
"0.51275975",
"0.5120983",
"0.51209766",
"0.51140195",
"0.5102284",
"0.5096546",
"0.50915873",
"0.5089589",
"0.50835437",
"0.5081292",
"0.5070598",
"0.50482535",
"0.50423145",
"0.50407624",
"0.5036905",
"0.50314003",
"0.5030009",
"0.50193274",
"0.5006689",
"0.5005621",
"0.5000528",
"0.50002843",
"0.49894917",
"0.49862865",
"0.4975902"
]
| 0.84648705 | 0 |
Returns a new object of class 'Centimeter'. | Centimeter createCentimeter(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public CentreBean() {\r\n if(centreToAdd == null){\r\n centreToAdd = new Centres();\r\n }\r\n \r\n }",
"public static double FeetToCentimeter(double f){\n return f*929;\n }",
"public CentredCCD(CentredCCD original)\n\t{\n\t\tsuper(original);\n\t\t\n\t\tsetCentrePosition(original.getCentrePosition().clone());\n\t}",
"private void createCentipede() {\n\t\tcentipede = new ArrayList<>();\n\t\tfor(int i = 0; i < centipedeSize; i ++) {\n\t\t\tcentipede.add(new Segment(304 + 16 * i, 0));\n\t\t}\n\t}",
"public abstract float getPerimeter();",
"@Override\n public double getPerimeter() {\n return 4 * ((int) this.radiusX + (int) this.radiusY - (4 - Math.PI) * ((int) this.radiusX * (int) this.radiusY) / ((int) this.radiusX + (int) this.radiusY));\n }",
"public Point2D getCentre() {\n return new Point2D.Float(centreX, centreY);\n }",
"@Override\n\tpublic double calPerimeter() {\n\t\treturn 2*Math.PI*radius;\n\t}",
"@Override\r\n\tpublic void calcPerimeter() {\n\t\t\r\n\t}",
"public static double meterToCentimeter(final double meter) {\n return meter / METERS_PER_CENTIMETER;\n }",
"private RadiusSector() {}",
"@Override\n public double getPerimeter() {\n return a + b + c;\n }",
"public double getCircleArea();",
"public PointF centroid()\n {\n if (cachedCentroid == null)\n {\n PointF centroid = new PointF();\n\n for (int i = 0; i < size(); i++)\n {\n PointF curr = get(i);\n PointF next = get(i + 1);\n\n float mult = curr.x * next.y - next.x * curr.y;\n centroid.x += (curr.x + next.x) * mult;\n centroid.y += (curr.y + next.y) * mult;\n }\n\n centroid.x /= 6 * signedArea();\n centroid.y /= 6 * signedArea();\n\n cachedCentroid = centroid;\n }\n\n return Geometry.clone(cachedCentroid);\n }",
"private static Point areaCentre() {\r\n\t\tvar centreLon = (lonLB + lonUB)/2;\r\n\t\tvar centreLat = (latLB + latUB)/2;\r\n\t\treturn Point.fromLngLat(centreLon, centreLat);\r\n\t}",
"public double getPerimeter();",
"public double getPerimeter();",
"double getPerimeter();",
"double getPerimeter();",
"double getPerimeter();",
"double getPerimeter();",
"public Shape getAreaColision();",
"public double getPerimeter(){\n return 0;\n }",
"Inch createInch();",
"public Punto getCentroide() {\n \treturn centroide;\n }",
"EDataType getPerCent();",
"public double perimeter();",
"public Coords getCenter()\r\n {\r\n return new Coords(Math.round(x + width / 2), Math.round(y + height / 2));\r\n }",
"public Centroid(double xCoordinate, double yCoordinate) {\n this.xCoordinate = xCoordinate;\n this.yCoordinate = yCoordinate;\n }",
"double[] circleCentre()\n\t{\n\t\tdouble toOriginLength = Math.sqrt(originX*originX + originY*originY);\n\t\tdouble toCentreLength = toOriginLength + radius;\n\t\t\n\t\tdouble[] centrePoint = new double[2];\n\t\t\n\t\tcentrePoint[0] = (toCentreLength * originX)/toOriginLength;\n\t\tcentrePoint[1] = (toCentreLength * originY)/toOriginLength;\n\t\t\n\t\treturn centrePoint;\n\t}",
"public Circle getShape(){\n\t\treturn new Circle();\n\t}",
"@Override\n\tpublic double calPerimeter() {\n\t\treturn a+b+c;\n\t}",
"protected double getPerimeter()\r\n {\r\n return ( 2 + Math.sqrt( 2.0 ) ) * getSide();\r\n }",
"double getPerimeter() {\n return width + width + height + height;\n }",
"@Override\n public final Map<Class<? extends MiWithConfigurationSupport<?>>, EntityCentre<?>> getCentres() {\n return webUiBuilder.getCentres();\n }",
"public int getPerimeter()\t{\n//\t\treturn 2 * x + 2 * y;\n\t\treturn x + y + width + height;\n\t}",
"@Override\n\tpublic float perimeter() {\n\t\treturn 0;\n\t}",
"public Coordinate getCircle();",
"@Override\n\tpublic double perimeter() {\n\t\t\n\t\treturn circumference();\n\t\t\n\t}",
"public Point getCentrePoint()\n\t\t{\n\t\t\tif(shape.equals(\"circle\") || shape.equals(\"ellipse\"))\n\t\t\t\treturn new Point((int)((Ellipse2D)obj).getCenterX(),(int)((Ellipse2D)obj).getCenterY());\n\t\t\tif(shape.equals(\"poly\"))\n\t\t\t{\n\t\t\t\tint xtot = 0;\n\t\t\t\tint ytot = 0;\n\t\t\t\tfor(int i=0; i < coords.length; i++)\n\t\t\t\t{\n\t\t\t\t\tif((i % 2) == 0)\n\t\t\t\t\t\txtot += coords[i];\n\t\t\t\t\telse\n\t\t\t\t\t\tytot += coords[i];\n\t\t\t\t}\n\t\t\t\treturn new Point((xtot*2)/coords.length,(ytot*2)/coords.length);\n\t\t\t}else\n\t\t\t{\n\t\t\t\treturn new Point((int)((Rectangle)obj).getCenterX(),(int)((Rectangle)obj).getCenterY());\n\t\t\t}\n\t\t}",
"@Override\r\n public double getPerimeter() {\n double Perimeter = 2*Math.PI*radius;\r\n DecimalFormat df2 = new DecimalFormat(\"0.00\");\r\n return Double.parseDouble(df2.format(Perimeter));\r\n\r\n }",
"double getPerimeter(){\n return 2*height+width;\n }",
"public int perimeter() {\n \treturn 0;\n }",
"public Coordinates getCentroid() {\r\n return centroid;\r\n }",
"public Circle(int x, int y) {\n\t \n\tSystem.out.println(\"Circel constructor called.\"); \n \n\tthis.X=x;\n\tthis.Y=y;\n}",
"@Override\n\tpublic double perimeter() {\n\t\t// TODO Auto-generated method stub\n\t\treturn 0;\n\t}",
"@Override\r\n\tpublic double getPerimeter() {\r\n\t\treturn 2 * (width + height);\r\n\t}",
"@Override\r\n\tpublic double getPerimeter() {\r\n\t\treturn 2 * (width + height);\r\n\t}",
"public int getPerimeter()\n\t{\n\t\treturn (int) (Math.PI * radius * 2);\n\t}",
"public Point2D centerOfMass() \n {\n double cx = 0, cy = 0;\n double area = areaUnsigned();\n double factor = 0;\n for (Line2D line : lines) \n {\n factor = line.getP1().getX() * line.getP2().getY() - line.getP2().getX() * line.getP1().getY();\n cx += (line.getP1().getX() + line.getP2().getX()) * factor;\n cy += (line.getP1().getY() + line.getP2().getY()) * factor;\n }\n area *= 6.0d;\n factor = 1 / area;\n cx *= factor;\n cy *= factor;\n return new Point2D.Double(cx, cy);\n }",
"@Override\n\tpublic double getPerimeter() {\n\t\treturn width + width + length + length;\n\t}",
"public double calculatePerimeter()\n {\n return 2 * Math.PI * radius;\n }",
"private double centerY() {\n return (piece.boundingBox().getHeight() % 2) / 2.0;\n }",
"@Override\n\tpublic double calcPerimeter() {\n\t\treturn 2*(x+y);\n\t}",
"@Override\n\tpublic double getPerimeter()\n\t{\n\t\tdouble perimeter = radius*2*pi;\n\t\treturn perimeter;\n\t}",
"protected static float toCentimeters(int type, float value) {\n \t\tswitch (type) {\n \t\tcase CSSPrimitiveValue.CSS_CM:\n \t\t\treturn value;\n \t\tcase CSSPrimitiveValue.CSS_MM:\n \t\t\treturn (value / 10);\n \t\tcase CSSPrimitiveValue.CSS_IN:\n \t\t\treturn (value * 2.54f);\n \t\tcase CSSPrimitiveValue.CSS_PT:\n \t\t\treturn (value * 2.54f / 72);\n \t\tcase CSSPrimitiveValue.CSS_PC:\n \t\t\treturn (value * 2.54f / 6);\n \t\tdefault:\n \t\t\tthrow new DOMException(DOMException.INVALID_ACCESS_ERR, \"\");\n \t\t}\n \t}",
"@Override\r\n public double perimeter() {\n return (height+width)*2;\r\n }",
"public abstract Vector2 getCentreOfMass();",
"@Override\n public Shape getCelkoveHranice() {\n return new Rectangle2D.Double(super.getX() + 22, super.getY() + 45, 45, 45);\n }",
"public double getPerimeter() {\n return 2 * radius * Math.PI;\n }",
"public abstract Area newArea();",
"public Coordinate getCenter() {\n return center;\n }",
"public abstract double calculatePerimeter();",
"public abstract double calculatePerimeter();",
"public double getPerimeter(){\r\n\t\t\r\n\t\tdouble obim = 2 * PI * this.radius;\r\n\t\t\r\n\t\treturn obim;\r\n\t}",
"public double calculatePerimeter() {\r\n return 2 * PI * radius;\r\n }",
"public double Perimeter() {\r\n \treturn((getLength() * 2) + (getWidth() * 2));\r\n }",
"public Circle(){}",
"private void assignSpacePerimeter()\n {\n\n }",
"@Override\n public double obtenerArea(){\n return c.obtenerArea() * 4;\n }",
"private void calculateCentre() {\n \t\t// The size of the centre is presently one 5th of the maze size\n \t\tcentreSize = size / 5;\n \t\t// System.out.println(\"centreSize is: \" + centreSize);\n \n \t\t// Min and max are the start points of the centre\n \t\tint min = (int) Math.ceil((centreSize * 2.0));\n \t\tint max = min + centreSize;\n \t\tmin++; // this adjusts for the border\n \t\tmax++;\n \t\t// System.out.println(\"min is: \" + min);\n \t\t// System.out.println(\"max is: \" + max);\n \n \t\t// centre is the centre point of the maze\n \t\tdouble centre = (centreSize / 2.0) + min;\n \t\t// System.out.println(\"centre is: \" + centre);\n \t\tcentrePoint = new Point2D.Double(centre, centre);\n \t\t\n \t\t//set the min and max points for the centre\n \t\tcentreMin = min;\n \t\tcentreMax = max;\n \t}",
"static Double computePerimeter() {\n // Perimeter is 2(height) + 2(width)\n Double perimeter = height*2 + width*2;\n return perimeter;\n }",
"@Test\n public void testCircleGetArea()\n {\n Circle c = new Circle(5.678, new Point(2, 3), Color.BLACK);\n\n assertEquals(101.2839543, c.getArea(), DELTA);\n }",
"public EastNorth getCenter() {\n\t\treturn null;\n\t}",
"double perimeter();",
"public Area() {\n }",
"abstract void findPerimeter();",
"public double basePerimeter()\r\n {\r\n double basePerimeter = (radius * 2) * Math.PI;\r\n return basePerimeter;\r\n }",
"@Override\n\tpublic double calculatePerimeter() {\n\t\treturn 2* Shape.PI * r;\n\t}",
"public Coche() {\n super();\n }",
"@Override\n\tpublic Object getCentroid() {\n\t\treturn centroid;\n\t}",
"public Circle() {\r\n this.radius = 0.0;\r\n this.center = new Point();\r\n }",
"@Override\n\tpublic double getperimeter() {\n\t\treturn 2*width+2*length;\n\t}",
"public Point centeroid ()\r\n {\r\n return new Point ((v1.getX()+v2.getX()+v3.getX())/3,(v1.getY()+v2.getY()+v3.getY())/3);\r\n }",
"public double getPerimeter(){\n if (getHeight()<0 || getWidth()<0){\n System.out.println(\"Input Invalid\");\n return -1;\n }\n return 2*( getHeight() + getWidth());\n }",
"@Override\n\tpublic double getPerimeter() {\n\t\treturn 8 * side;\n\t}",
"public void setPerimeter() {\n\t\tthis.perimeter= 2*(height+width);\n\t}",
"public Point getCenter() {\n \treturn new Point(x+width/2,y+height/2);\n }",
"public void claShapeArea(){\r\n\t\tshape.calArea();\r\n\t}",
"@Override\n\tpublic double getPerimeter() {\n\t\treturn 2*(width+length);\n\t}",
"public Point2D.Double GetCentrePoint() {\n \t\treturn new Point2D.Double(centrePoint.getX(), centrePoint.getY());\n \t}",
"public Vector getCentroid() {\n return centroid;\n }",
"@Override\r\n\tpublic double perimeter() {\n\t\t\r\n\t\tdouble result;\r\n\t\t\r\n\t\tint width = this.getWidth();\r\n\t\tint height = this.getHeight();\r\n\t\t\r\n\t\tresult = (width + height) * 2;\r\n\t\t\r\n\t\treturn result;\r\n\t}",
"public double getPerimeter(){\n this.fperimeter = getSide() * 4;\n return fperimeter ;\n\n }",
"@Override\r\n\tpublic double getPerimeter() {\n\t\treturn (this.side1 + this.side2 + this.base);\r\n\t}",
"@Override\n\tpublic double getPerimeter() {\n\t\treturn this.N * getSide();\n\t}",
"public double getArea(){\n return 3.14 * radius * radius;\n }",
"@Override\n public double perimeter() {\n return 2 * (width + length);\n }",
"public FPointType calculateCenter() {\n fRectBound = getBounds2D();\n FPointType fptCenter = new FPointType();\n fptCenter.x = fRectBound.x + fRectBound.width / 2.0f;\n fptCenter.y = fRectBound.y + fRectBound.height / 2.0f;\n calculate(fptCenter);\n \n rotateRadian = 0.0f;\n \n return fptCenter;\n }",
"public Area() {\n\t}"
]
| [
"0.58281976",
"0.5752019",
"0.57271194",
"0.5722723",
"0.5567953",
"0.555503",
"0.5541556",
"0.5536377",
"0.5512617",
"0.55117255",
"0.54103017",
"0.5362586",
"0.53453684",
"0.53264934",
"0.53214693",
"0.5321442",
"0.5321442",
"0.53189945",
"0.53189945",
"0.53189945",
"0.53189945",
"0.5317411",
"0.52967787",
"0.5288598",
"0.52873385",
"0.52582455",
"0.5256013",
"0.52407914",
"0.5238957",
"0.5229885",
"0.5223472",
"0.5216523",
"0.5215816",
"0.52137977",
"0.5190593",
"0.5165684",
"0.51631325",
"0.5141884",
"0.51346606",
"0.51267445",
"0.512604",
"0.5118673",
"0.51059794",
"0.5097937",
"0.5096678",
"0.5096158",
"0.5080067",
"0.5080067",
"0.50789845",
"0.5076795",
"0.5073889",
"0.5063803",
"0.5052431",
"0.5050935",
"0.50483775",
"0.5046853",
"0.5044466",
"0.50431323",
"0.5033862",
"0.50336915",
"0.5031584",
"0.50270456",
"0.50179666",
"0.50179666",
"0.5013566",
"0.5006257",
"0.49941885",
"0.4991007",
"0.49892595",
"0.49826026",
"0.49767503",
"0.49705014",
"0.49582103",
"0.49573758",
"0.49548686",
"0.49474385",
"0.49451244",
"0.49329248",
"0.493253",
"0.49323004",
"0.49201286",
"0.49174324",
"0.49146208",
"0.4911646",
"0.4908456",
"0.49071923",
"0.48927274",
"0.4889915",
"0.48786595",
"0.48781037",
"0.4876104",
"0.48755684",
"0.48703885",
"0.48651677",
"0.48639095",
"0.48590988",
"0.48590758",
"0.48547325",
"0.48455772",
"0.48441747"
]
| 0.8857576 | 0 |
Returns a new object of class 'Millimeter'. | Millimeter createMillimeter(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static Velocity newMillimetersPerSecondValue()\n\t{\n\t\treturn new Velocity(0.0, VelocityUnit.MILLIMETERS_PER_SECOND);\n\t}",
"public static double meterToMillimeter(final double meter) {\n return meter / METERS_PER_MILLIMETER;\n }",
"public static Velocity newMillimetersPerSecondValue(Double new_val)\n\t{\n\t\treturn new Velocity(new_val, VelocityUnit.MILLIMETERS_PER_SECOND);\n\t}",
"Meter createMeter();",
"public static Velocity newMicrometersPerSecondValue()\n\t{\n\t\treturn new Velocity(0.0, VelocityUnit.MICROMETERS_PER_SECOND);\n\t}",
"public static Velocity newMetersPerSecondValue()\n\t{\n\t\treturn new Velocity(0.0, VelocityUnit.METERS_PER_SECOND);\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 static double millimeterToMeter(final double millimeter) {\n return millimeter * METERS_PER_MILLIMETER;\n }",
"public MMTMeasurement(){\n }",
"public static Velocity newMicrometersPerSecondValue(Double new_val)\n\t{\n\t\treturn new Velocity(new_val, VelocityUnit.MICROMETERS_PER_SECOND);\n\t}",
"MeterProvider create();",
"public LEDMeter() {\r\n\t\t\r\n\t\tthis(13, 100, \"LED Meter\", 50);\r\n\t}",
"public static Velocity newKilometersPerSecondValue()\n\t{\n\t\treturn new Velocity(0.0, VelocityUnit.KILOMETERS_PER_SECOND);\n\t}",
"public Double millimetersPerSecond()\n\t{\n\t\treturn getValue(VelocityUnit.MILLIMETERS_PER_SECOND);\n\t}",
"KafkaMetricMeterType() {\n }",
"public void setMiliSeconds(int nt) {\r\n\t\tthis.milis = nt;\r\n\t}",
"public MillisecondConverter(long millis) {\n\t\t\tmilliseconds = millis;\n\t\t\tseconds = millis / 1000;\n\t\t\tminutes = seconds / 60;\n\t\t\thours = minutes / 60;\n\t\t}",
"public static Velocity newMetersPerSecondValue(Double new_val)\n\t{\n\t\treturn new Velocity(new_val, VelocityUnit.METERS_PER_SECOND);\n\t}",
"public int getMiliSeconds() {\r\n\t\treturn milis;\r\n\t}",
"public static double meterToMile(final double meter) {\n return meter / METERS_PER_MILE;\n }",
"public Metric(){\n\t}",
"public static double millilitresToLitres(double num) { return (num/1000); }",
"public void millimetersPerSecond(Double val)\n\t{\n\t\tsetValue(val, VelocityUnit.MILLIMETERS_PER_SECOND);\n\t}",
"public static final float pointsToMillimeters(float value) {\n\t return inchesToMillimeters(pointsToInches(value));\n\t}",
"public Kilometers(BigDecimal numUnits) { super(numUnits); }",
"public long toMilli(long sec) {\n\t\t\n\t\treturn sec * 1000;\n\t}",
"public MolapMeasure(String measureName) \r\n\t{\r\n\t\tthis.measureName = measureName;\r\n\t}",
"public static Velocity newKilometersPerSecondValue(Double new_val)\n\t{\n\t\treturn new Velocity(new_val, VelocityUnit.KILOMETERS_PER_SECOND);\n\t}",
"public static double fluidOuncesToMillilitres(double num) { return (num*29.574); }",
"public Builder setTimeInMilliSeconds(long value) {\n\n timeInMilliSeconds_ = value;\n onChanged();\n return this;\n }",
"public static double mileToMeter(final double mile) {\n return mile * METERS_PER_MILE;\n }",
"public Integer getMeterNumerator() {\n return this.meterNumerator;\n }",
"KafkaMetricMeterType(@NonNull final MeterType meterType, final String description, @NonNull final TimeUnit timeUnit) {\n this.meterType = meterType;\n this.description = description;\n this.timeUnit = timeUnit;\n }",
"public Thermometer(Person person){\r\n super(person);\r\n temperature = new MeasureUnit(\"Celsius\",\"º C\", 1);\r\n }",
"public static long milliSecondFromNano()\r\n/* 15: */ {\r\n/* 16: 44 */ return System.nanoTime() / 1000000L;\r\n/* 17: */ }",
"KafkaMetricMeterType(@NonNull final MeterType meterType, final String description, @NonNull final TimeUnit timeUnit, final String baseUnit) {\n this.meterType = meterType;\n this.description = description;\n this.timeUnit = timeUnit;\n this.baseUnit = baseUnit;\n }",
"public static double centiToMeter(double num) { return (num/Math.pow(10,2)); }",
"public static Velocity newNanometersPerSecondValue()\n\t{\n\t\treturn new Velocity(0.0, VelocityUnit.NANOMETERS_PER_SECOND);\n\t}",
"@Override\n\tpublic Metro Convertir() {\n\n\t\treturn new Metro(getValor() * 0.01);\n\t}",
"public static double inchesToMillimeters(double inches) {\n return inches * 25.4;\n }",
"public long getMillis() {\r\n \treturn millis;\r\n }",
"public void setWidthMM(float millimeters){\n\t\tthis.setWidth(millimeters*0.03937f);\n\t}",
"public static double squareKiloMetersToSquareMilliMeters(double num) { return squareCentimetersToSquareMillimeters(squareKiloMetersToSquareCentiMeters(num)); }",
"public java.lang.Integer getMillis() {\n return millis;\n }",
"public Unit<Length> kilometre() {return kilometre;}",
"public java.lang.Integer getMillis() {\n return millis;\n }",
"static public LnTrafficController instance() {\n if (Meter == null) {\n new MeterLnTrafficController();\n }\n return Meter;\n }",
"public static double microSecondsToMilliSeconds(double num) { return (num/Math.pow(10,3)); }",
"@Override\r\n\tpublic int getMS() {\n\t\treturn MS;\r\n\t}",
"public static double squareMetersToSquareMilliMeters(double num){ return (num*Math.pow(10,6)); }",
"public HiloM() { }",
"private static interface NewMetric<T> {\n T newMetric(Class<?> clazz, String name, String scope);\n }",
"public static double millimetersOfMercuryToAtmosphere(double num) { return (num/760); }",
"public static double getKilometer(double number) {\n\t\tdouble asKilometer = 0;\n\n\t\tasKilometer = number * 1.6;\n\n\t\treturn asKilometer;\n\t}",
"public static final float inchesToMillimeters(float value) {\n\t return value * 25.4f;\n\t}",
"KafkaMetricMeterType(@NonNull final MeterType meterType, final String description, final String baseUnit) {\n this.meterType = meterType;\n this.description = description;\n this.baseUnit = baseUnit;\n }",
"public static double squareCentimetersToSquareMillimeters(double num) { return (num*100); }",
"public double getWidthInMillimeters()\n {\n return MILLIMETERS * width;\n }",
"public static double kilometerToMeter(final double kilometer) {\n return kilometer * METERS_PER_KILOMETER;\n }",
"public long toMillisecond(long value) { return value; }",
"LengthUnit(double metres) {\n/* 24 */ this.metres = metres;\n/* 25 */ this.dx = new Dx(1.0D, this);\n/* */ }",
"public static MetricParameterBuilder metrics()\n {\n return new MetricParameterBuilder();\n }",
"public double toMetersPerSecond(){\n\t\tdouble mps = mph * 1609.34/3600;\n\t\treturn mps;\n\t}",
"public double teaspoonsToMilliliters(double teaspoons){\n return teaspoons * 4.92892;\n }",
"public long getMilliseconds() {\n\t\treturn milliseconds;\n\t}",
"public Time( int minutes ) {\n this.minutes = minutes;\n }",
"static long getMilliSecondsPart(Duration d) {\n long u = d.toMillis() % 1000;\n\n return u;\n }",
"public WaterMeter()\r\n\t{\r\n\t\tsuper(DeviceTypeEnum.WATER_METER);\r\n\t}",
"public Double micrometersPerSecond()\n\t{\n\t\treturn getValue(VelocityUnit.MICROMETERS_PER_SECOND);\n\t}",
"@Override\r\n\tpublic int getMM() {\n\t\treturn MM;\r\n\t}",
"@Override\n protected AngularSpeed createMeasurement(double value, AngularSpeedUnit unit) {\n return new AngularSpeed(value, unit);\n }",
"TimeUnit() {\n }",
"public static int GetMills() {\r\n return (int) System.currentTimeMillis() - StartUpTimeMS;\r\n }",
"public Unit<Length> metre() {return metre;}",
"public Builder setMPPerSecond(int value) {\n bitField0_ |= 0x00000020;\n mPPerSecond_ = value;\n onChanged();\n return this;\n }",
"public static double squareMilesToSquareMilliMeters(double num){ return squareKiloMetersToSquareMilliMeters(squareMilesToSquareKiloMeters(num)); }",
"public static double cubicFeetToMillilitres(double num) { return cupsToMillilitres(cubicFeetToCups(num)); }",
"long getTimeInMilliSeconds();",
"public Double metersPerSecond()\n\t{\n\t\treturn getValue(VelocityUnit.METERS_PER_SECOND);\n\t}",
"public static double yardToMeter(final double yard) {\n return yard * METERS_PER_YARD;\n }",
"public double getM() {\r\n return m;\r\n }",
"public double getMtm() {\r\n return mtm;\r\n }",
"KafkaMetricMeterType(@NonNull final MeterType meterType, final String description) {\n this.meterType = meterType;\n this.description = description;\n }",
"public int getMM() {\n\t\treturn MM;\n\t}",
"public static double squareYardsToSquareMilliMeters(double num){ return squareMetersToSquareMilliMeters(squareYardsToSquareMeters(num)); }",
"public static String timem( long p_lMillis ) {\n String sTime = \"\";\n if ( p_lMillis > 999 ) sTime =time( p_lMillis );\n sTime += \" \" + (p_lMillis % 1000 ) + \"ms\"; \n return sTime;\n }",
"Units getUnits();",
"public double getMeterPower() {\n final double current = this.getMeterCurrent().isPresent() ? this.getMeterCurrent().get() : 0;\n final double voltage = this.getMeterVoltage().isPresent() ? this.getMeterVoltage().get() : 0;\n return current * voltage;\n }",
"public static Datarate newMegabytesPerSecondValue()\n\t{\n\t\treturn new Datarate(0.0, DataRateUnit.MEGABYTES_PER_SEC);\n\t}",
"public LocalDateTime getTimeMilliObj(String columnName) {\n TimeMilliVector vector = (TimeMilliVector) table.getVector(columnName);\n return vector.getObject(rowNumber);\n }",
"public static long mass () { return mass;}",
"public static Velocity newNanometersPerSecondValue(Double new_val)\n\t{\n\t\treturn new Velocity(new_val, VelocityUnit.NANOMETERS_PER_SECOND);\n\t}",
"public static double metresPerSecondToCentiMetresPerSecond(double num) { return (num*100); }",
"public static double cubicMetreToMillilitres(double num) { return (num*Math.exp(6)); }",
"public void micrometersPerSecond(Double val)\n\t{\n\t\tsetValue(val, VelocityUnit.MICROMETERS_PER_SECOND);\n\t}",
"public ArrayList<String> Mass(String from, float amount, String[] units) {\n\t\tfrom = findFrom(from);\n\t\tif (from.equals(\"gram\")) {\n\t\t\tArrayList<String> kaduvil = new ArrayList<String>();\n\t\t\tkaduvil.add(\"\" + amount + \" \" + units[0] );\n\t\t\tkaduvil.add(\"\" + amount / 1000 + \" \" + units[1] );\n\t\t\tkaduvil.add(\"\" + amount / 453.59237f + \" \" + units[2] );\n\t\t\treturn kaduvil;\n\t\t} else {\n\t\t\tif (from.equals(\"pounds\")) {\n\t\t\t\treturn Mass(\"gram\", amount * 453.59237f, units);\n\t\t\t} else {\n\t\t\t\treturn Mass(\"gram\", amount * 1000, units);\n\t\t\t}\n\t\t}\n\t}",
"public PvaClientNTMultiMonitor createNTMonitor()\n {\n return createNTMonitor(\"value,alarm,timeStamp\");\n }",
"@Override\n\tpublic int newtomMeterTorque() {\n\t\treturn 0;\n\t}",
"@SuppressWarnings(\"restriction\")\npublic interface Meter {\n\n Collection<? extends Metric<?>> supportedMetrics();\n\n Collection<? extends Measure<?>> measureData(MonitoredVm vm);\n}",
"public final int getMM()\n {\n return mm;\n }"
]
| [
"0.73244196",
"0.6918242",
"0.66238105",
"0.6611028",
"0.6591752",
"0.6334624",
"0.62356806",
"0.6226619",
"0.6154845",
"0.607714",
"0.60565895",
"0.59648263",
"0.5963099",
"0.5850244",
"0.5798534",
"0.5765936",
"0.5750729",
"0.56939024",
"0.56284183",
"0.5617186",
"0.560001",
"0.5598463",
"0.55469716",
"0.5540205",
"0.55292207",
"0.5506356",
"0.547576",
"0.5464287",
"0.5424144",
"0.5421451",
"0.5404964",
"0.5404497",
"0.53868276",
"0.538578",
"0.5337616",
"0.5332711",
"0.5321514",
"0.5294614",
"0.52914876",
"0.5290885",
"0.52753854",
"0.5274763",
"0.5268719",
"0.52607334",
"0.52605784",
"0.52590317",
"0.5256421",
"0.5247667",
"0.52444386",
"0.5235883",
"0.5231883",
"0.5225846",
"0.5176265",
"0.5170043",
"0.5154972",
"0.51518136",
"0.51371205",
"0.51314956",
"0.5127515",
"0.5125708",
"0.5123246",
"0.5092141",
"0.50734556",
"0.5066137",
"0.5032891",
"0.50311095",
"0.5028937",
"0.50262463",
"0.50230986",
"0.50224984",
"0.5017851",
"0.49930248",
"0.49924582",
"0.49875927",
"0.4973777",
"0.49692845",
"0.49687633",
"0.4964482",
"0.495531",
"0.49537885",
"0.49370092",
"0.4936259",
"0.49343175",
"0.4931184",
"0.49306482",
"0.49170354",
"0.49098164",
"0.48988247",
"0.4897731",
"0.48969138",
"0.48967618",
"0.4896026",
"0.48954463",
"0.48936784",
"0.4881211",
"0.4877605",
"0.48776037",
"0.48700482",
"0.48699173",
"0.48695764"
]
| 0.87886196 | 0 |
Returns a new object of class 'Meter'. | Meter createMeter(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"MeterProvider create();",
"public WaterMeter()\r\n\t{\r\n\t\tsuper(DeviceTypeEnum.WATER_METER);\r\n\t}",
"public static Velocity newMetersPerSecondValue()\n\t{\n\t\treturn new Velocity(0.0, VelocityUnit.METERS_PER_SECOND);\n\t}",
"static public LnTrafficController instance() {\n if (Meter == null) {\n new MeterLnTrafficController();\n }\n return Meter;\n }",
"Millimeter createMillimeter();",
"public LEDMeter() {\r\n\t\t\r\n\t\tthis(13, 100, \"LED Meter\", 50);\r\n\t}",
"public OpenFlowMeterProvider() {\n super(new ProviderId(\"of\", \"org.onosproject.provider.meter\"));\n }",
"public Thermometer(Person person){\r\n super(person);\r\n temperature = new MeasureUnit(\"Celsius\",\"º C\", 1);\r\n }",
"KafkaMetricMeterType() {\n }",
"public Integer getMeterNumerator() {\n return this.meterNumerator;\n }",
"public interface IMeter {\n\n String getName();\n\n String getType();\n}",
"public WaterMeter(Radio radio)\r\n\t{\r\n\t\tsuper(radio, DeviceTypeEnum.WATER_METER);\r\n\t}",
"@Override\n protected AngularSpeed createMeasurement(double value, AngularSpeedUnit unit) {\n return new AngularSpeed(value, unit);\n }",
"public Metric(){\n\t}",
"private void addMeter(MetricsRecordBuilder builder, String name, String desc, long count,\n double meanRate, double oneMinuteRate, double fiveMinuteRate, double fifteenMinuteRate) {\n builder.addGauge(Interns.info(name + \"_count\", EMPTY_STRING), count);\n builder.addGauge(Interns.info(name + \"_mean_rate\", EMPTY_STRING), convertRate(meanRate));\n builder.addGauge(Interns.info(name + \"_1min_rate\", EMPTY_STRING), convertRate(oneMinuteRate));\n builder.addGauge(Interns.info(name + \"_5min_rate\", EMPTY_STRING), convertRate(fiveMinuteRate));\n builder.addGauge(Interns.info(name + \"_15min_rate\", EMPTY_STRING),\n convertRate(fifteenMinuteRate));\n }",
"public static Velocity newMetersPerSecondValue(Double new_val)\n\t{\n\t\treturn new Velocity(new_val, VelocityUnit.METERS_PER_SECOND);\n\t}",
"public MMTMeasurement(){\n }",
"public static Velocity newMicrometersPerSecondValue()\n\t{\n\t\treturn new Velocity(0.0, VelocityUnit.MICROMETERS_PER_SECOND);\n\t}",
"public Integer getMeterDenominator() {\n return this.meterDenominator;\n }",
"public static Velocity newKilometersPerSecondValue()\n\t{\n\t\treturn new Velocity(0.0, VelocityUnit.KILOMETERS_PER_SECOND);\n\t}",
"public DCU() {\r\n meters = new ArrayList<Meter>();\r\n id = \"unknown\";\r\n }",
"public static Velocity newMillimetersPerSecondValue()\n\t{\n\t\treturn new Velocity(0.0, VelocityUnit.MILLIMETERS_PER_SECOND);\n\t}",
"public WaterMeter(String deviceIdParam, Radio radio)\r\n\t{\r\n\t\tsuper(deviceIdParam, radio, DeviceTypeEnum.WATER_METER);\r\n\t}",
"public static Velocity newMicrometersPerSecondValue(Double new_val)\n\t{\n\t\treturn new Velocity(new_val, VelocityUnit.MICROMETERS_PER_SECOND);\n\t}",
"private static interface NewMetric<T> {\n T newMetric(Class<?> clazz, String name, String scope);\n }",
"public boolean isMetered() {\n return mIsMetered;\n }",
"KafkaMetricMeterType(@NonNull final MeterType meterType, final String description, final String baseUnit) {\n this.meterType = meterType;\n this.description = description;\n this.baseUnit = baseUnit;\n }",
"public abstract double getMeasurement();",
"public abstract double getMeasurement();",
"public double getMeterPower() {\n final double current = this.getMeterCurrent().isPresent() ? this.getMeterCurrent().get() : 0;\n final double voltage = this.getMeterVoltage().isPresent() ? this.getMeterVoltage().get() : 0;\n return current * voltage;\n }",
"public static Velocity newKilometersPerSecondValue(Double new_val)\n\t{\n\t\treturn new Velocity(new_val, VelocityUnit.KILOMETERS_PER_SECOND);\n\t}",
"KafkaMetricMeterType(@NonNull final MeterType meterType, final String description, @NonNull final TimeUnit timeUnit, final String baseUnit) {\n this.meterType = meterType;\n this.description = description;\n this.timeUnit = timeUnit;\n this.baseUnit = baseUnit;\n }",
"public Counter create(Type type){\n Counter counter = Counter.builder(CounterPath+\".\"+type.getCounterName()).description(\"\").baseUnit(\"Counter\").register(meterRegistry);\r\n counters.put(type.getName(), counter);\r\n \r\n return counter;\r\n }",
"public MeterSkin(MeterView control) {\n\t\tsuper(control);\n\t\tPane pane = new Pane();\n\t\tArc arc = new Arc(0, 0, 2, 2, 90 - control.getAngle()/2, control.getAngle());\n\t\tarc.lengthProperty().bind(control.angleProperty());\n\t\tarc.startAngleProperty().bind(Bindings.subtract(90, control.angleProperty().divide(2)));\n\t\tarc.radiusXProperty().bind(arc.radiusYProperty());\n\t\tarc.radiusYProperty().bind(Bindings.min(pane.widthProperty(), pane.heightProperty()).multiply(0.35));\n\t\tarc.centerXProperty().bind(pane.widthProperty().divide(2));\n\t\tarc.centerYProperty().bind(pane.heightProperty().divide(2));\n\t\tarc.typeProperty().bind(control.arcTypeProperty());\n\t\tarc.setStrokeLineCap(StrokeLineCap.ROUND);\n\t\tarc.strokeProperty().bind(control.arcStrokeProperty());\n\t\tarc.strokeWidthProperty().bind(arc.radiusYProperty().divide(10));\n\t\tarc.fillProperty().bind(control.arcFillProperty());\n\n\t\tLabel label = new Label(\"\");\n\t\tlabel.textProperty().bind(control.nameProperty());\n\t\tlabel.setMaxWidth(60);\n\t\tlabel.setWrapText(true);\n\t\tlabel.setTextAlignment(TextAlignment.CENTER);\n\t\tlabel.layoutXProperty().bind(pane.widthProperty().divide(2).subtract(label.widthProperty().divide(2)));\n\t\tlabel.layoutYProperty().bind(pane.heightProperty().divide(2).subtract(arc.radiusYProperty().divide(2))\n\t\t\t\t.subtract(label.heightProperty().divide(2)));\n\t\tlabel.scaleXProperty().bind(label.scaleYProperty());\n\t\tlabel.scaleYProperty().bind(arc.radiusYProperty().multiply(0.025));\n\n\t\tLabel valueText = new Label();\n\t\tChangeListener<String> formatListener = (v1, v2, v3) -> {\n\t\t\tif (v3 == null) {\n\t\t\t\tvalueText.setVisible(false);\n\t\t\t} else {\n\t\t\t\tvalueText.textProperty().bind(Bindings.format(v3, control.valueProperty()));\n\t\t\t\tvalueText.setVisible(true);\n\t\t\t}\n\t\t};\n\t\tformatListener.changed(null, null, control.getTextFormat());\n\t\tcontrol.textFormatProperty().addListener(formatListener);\n\t\tvalueText.layoutXProperty().bind(pane.widthProperty().divide(2).subtract(valueText.widthProperty().divide(2)));\n\t\tvalueText.layoutYProperty().bind(pane.heightProperty().subtract(valueText.heightProperty())\n\t\t\t\t.subtract(valueText.heightProperty().multiply(valueText.scaleYProperty())\n\t\t\t\t\t\t.subtract(valueText.heightProperty()).divide(2)));\n\t\tvalueText.scaleXProperty().bind(valueText.scaleYProperty());\n\t\tvalueText.scaleYProperty().bind(arc.radiusYProperty().multiply(0.035));\n\n\t\tPath arrow = new Path(\n\t\t\t\tnew MoveTo(110, 0),\n\t\t\t\tnew LineTo(0, 10),\n\t\t\t\tnew ArcTo(10, 10, 180, 0, -10, true, true),\n\t\t\t\tnew LineTo(110, 0));\n\t\tarrow.layoutXProperty().bind(pane.widthProperty().divide(2));\n\t\tarrow.layoutYProperty().bind(pane.heightProperty().divide(2));\n\t\tarrow.strokeProperty().bind(control.arrowStrokeProperty());\n\t\tarrow.fillProperty().bind(control.arrowFillProperty());\n\n\t\tScale sc = new Scale(1, 1, 0, 0);\n\t\tsc.xProperty().bind(sc.yProperty());\n\t\tsc.yProperty().bind(arc.radiusYProperty().divide(100));\n\t\tRotate rt = new Rotate(0, 0, 0);\n\t\tChangeListener<Number> valueListener = (v1, v2, v3) -> {\n\t\t\t\tnew Timeline(\n\t\t\t\t\t\tnew KeyFrame(Duration.ZERO,\n\t\t\t\t\t\t\t\tnew KeyValue(rt.angleProperty(), rt.getAngle())),\n\t\t\t\t\t\tnew KeyFrame(Duration.millis(400),\n\t\t\t\t\t\t\t\tnew KeyValue(rt.angleProperty(), -arc.getStartAngle() - (arc.getLength() -\n\t\t\t\t\t\t\t\t\t\t(v3.doubleValue() / (control.getMax() - control.getMin()) * arc.getLength())),\n\t\t\t\t\t\t\t\t\t\tnew SmoothInterpolator(SmoothInterpolator.AnimType.ACCELDECEL)))\n\t\t\t\t).playFromStart();\n\t\t};\n\t\tvalueListener.changed(null, null, Double.isNaN(control.getValue()) ? 0 : control.getValue());\n\t\tcontrol.valueProperty().addListener(valueListener);\n\t\tarrow.getTransforms().addAll(rt, sc);\n\n\t\tpane.getChildren().addAll(label, valueText, arc, arrow);\n\t\tpane.setMinSize(75, 75);\n\t\tpane.setPrefSize(200, 200);\n\t\tgetChildren().add(pane);\n\t}",
"KafkaMetricMeterType(@NonNull final MeterType meterType, final String description, @NonNull final TimeUnit timeUnit) {\n this.meterType = meterType;\n this.description = description;\n this.timeUnit = timeUnit;\n }",
"public OFMeterStatsRequest buildMeterStatsRequest() {\n\t\t\treturn factory.buildMeterStatsRequest().setMeterId(OFMeterSerializerVer13.ALL_VAL).build();\n\t\t}",
"public static Velocity newMillimetersPerSecondValue(Double new_val)\n\t{\n\t\treturn new Velocity(new_val, VelocityUnit.MILLIMETERS_PER_SECOND);\n\t}",
"public static double yardToMeter(final double yard) {\n return yard * METERS_PER_YARD;\n }",
"KafkaMetricMeterType(@NonNull final MeterType meterType, final String description) {\n this.meterType = meterType;\n this.description = description;\n }",
"protected abstract float getMeasurement();",
"public ZElectricMeterExample() {\n oredCriteria = new ArrayList<Criteria>();\n }",
"public static Datarate newMegabytesPerSecondValue()\n\t{\n\t\treturn new Datarate(0.0, DataRateUnit.MEGABYTES_PER_SEC);\n\t}",
"private OFMeterMod meterBuild(OFMeterModCommand command, int meterId, long rate, long burst, boolean useKBPS,\n\t\t\t\tboolean useStats) {\n\t\t\tMeter meter = new Meter();\n\t\t\tmeter.setId(meterId);\n\t\t\tmeter.getBands().add(new Band(rate, burst));\n\t\t\tmeter.getFlags().add((useKBPS ? OFMeterFlags.KBPS : OFMeterFlags.PKTPS));\n\t\t\tif (useStats)\n\t\t\t\tmeter.getFlags().add(OFMeterFlags.STATS);\n\t\t\tif (burst != 0)\n\t\t\t\tmeter.getFlags().add(OFMeterFlags.BURST);\n\n\t\t\treturn meterBuild(command, meter);\n\t\t}",
"public WaterMeter(String deviceIdParam)\r\n\t{\r\n\t\tthis();\r\n\t\tsetDeviceId(deviceIdParam);\r\n\t}",
"public TemperatureUnit(double width, double height, double length, StorageLocation myLoc, int tempLvl)\n {\n super(width, height, length, myLoc);\n setTempLvl(tempLvl);\n }",
"public MolapMeasure(String measureName) \r\n\t{\r\n\t\tthis.measureName = measureName;\r\n\t}",
"public MetricCalculator(JavaClass jc){\r\n\t\tjavaclass = jc;\r\n\t\tmccabe = new McCabeCyclomaticComplexity(jc);\r\n\t\tinherit = new Inheritance(jc);\r\n\t\tclassStat = new ClassStatistic(jc);\r\n\t\tresponseFC = new ResponseForClass(jc);\r\n\t}",
"public Kilometers(BigDecimal numUnits) { super(numUnits); }",
"private static MeasureProcessing getMeasureProcessing() {\n if(measure == null) {\n measure = new MeasureProcessing();\n }\n return measure;\n }",
"public T caseUbqVuMeter(UbqVuMeter object) {\r\n\t\treturn null;\r\n\t}",
"public static Datarate newMegabytesPerSecondValue(Double new_val)\n\t{\n\t\treturn new Datarate(new_val, DataRateUnit.MEGABYTES_PER_SEC);\n\t}",
"public Unit<Length> kilometre() {return kilometre;}",
"public Measurement(Handler handler)\n\t{\n\t\tmHandler = handler;\n\t\tmeasurementArray = new AnalogMeasurement[MAX_MEASUREMENTS];\n\t}",
"public interface MemoryEstimator {\n\n /**\n * Returns an estimate of how much memory an object consumes.\n * @param instance the object instance\n * @return the estimated memory in bytes\n */\n long getObjectSize(Object instance);\n\n\n /**\n * A MemoryEstimator implementation that leverages org.github.jamm.MemoryMeter\n */\n class DefaultMemoryEstimator implements MemoryEstimator {\n\n private Object meter;\n private Method measureDeep;\n\n /**\n * Constructor\n */\n public DefaultMemoryEstimator() {\n try {\n final Class<?> clazz = Class.forName(\"org.github.jamm.MemoryMeter\");\n final Method method = clazz.getDeclaredMethod(\"hasInstrumentation\");\n final boolean instrumentation = (Boolean) method.invoke(clazz);\n if (instrumentation) {\n this.meter = clazz.newInstance();\n this.measureDeep = clazz.getDeclaredMethod(\"measureDeep\", Object.class);\n }\n } catch (ClassNotFoundException ex) {\n System.err.println(\"Unable to initialize MemoryMeter, class not found\");\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }\n\n @Override\n public long getObjectSize(Object instance) {\n try {\n final Object result = measureDeep != null ? measureDeep.invoke(meter, instance) : -1;\n return result instanceof Number ? ((Number)result).longValue() : -1;\n } catch (Exception ex) {\n throw new RuntimeException(\"Failed to measure memory for instance: \" + instance, ex);\n }\n }\n }\n\n}",
"public static double millimeterToMeter(final double millimeter) {\n return millimeter * METERS_PER_MILLIMETER;\n }",
"public static Metrics createDetached() {\n return new Metrics();\n }",
"@Override\n\tpublic LightTank create() {\n\t\treturn new LightTank(GameContext.getGameContext());\n\t}",
"public WaterMeter(Alarm alarmParam)\r\n\t{\r\n\t\tthis();\r\n\t\taddAlarm(alarmParam);\r\n\t}",
"MetricsFactory getMetricsFactory();",
"public abstract double getMeasure();",
"public MeasureUnitProxy() {\n }",
"public CloudWatchMeterRegistry getCloudWatchMeterRegistry() {\n return this.cloudWatchMeterRegistry;\n }",
"public MeterGenerator(MeterWizard meterWizard, XMLTreeNode root, String name) {\r\n this.wiz = meterWizard; \r\n this.root = root;\r\n this.name = name;\r\n meterWizard.setMeterGenerator(this); \r\n }",
"public LEDMeter(int width, int height, int meterMode,\r\n\t\t\t\t\tString fontName, int fontStyle, int fontSize,\r\n\t\t\t\t\tString caption, boolean hasLabels, String labelsString,\r\n\t\t\t\t\tint labelPercent,\r\n\t\t\t\t\tint value, boolean hasHighlight, int numberOfSections, \r\n\t\t\t\t\tColor panelColor, Color textColor) {\r\n\r\n\t\tsuper(width, height, meterMode, fontName, fontStyle, fontSize,\r\n\t\t\t caption, hasLabels, labelsString, value, hasHighlight,\r\n\t\t\t numberOfSections, panelColor, Color.black, textColor);\r\n\r\n\t\tsetLabelPercent(labelPercent);\r\n\t\tsetNumberOfSections(numberOfSections);\r\n\t\r\n\t}",
"MetricModel createMetricModel();",
"public void addElts(Meters meter){\r\n MetersList.add(meter);\r\n }",
"public SoilMoisture(double value, Unit unit) throws IllegalArgumentException {\r\n super(value, unit, COMPARE_PRECISION, SoilMoisture::new);\r\n }",
"public static MetricParameterBuilder metrics()\n {\n return new MetricParameterBuilder();\n }",
"@SuppressWarnings(\"restriction\")\npublic interface Meter {\n\n Collection<? extends Metric<?>> supportedMetrics();\n\n Collection<? extends Measure<?>> measureData(MonitoredVm vm);\n}",
"Measure getMeasure ()\n {\n return null;\n }",
"public static double meterToMillimeter(final double meter) {\n return meter / METERS_PER_MILLIMETER;\n }",
"public SmallStatistic() {\n\n }",
"public static double centiToMeter(double num) { return (num/Math.pow(10,2)); }",
"public HiloM() { }",
"MetricOuterClass.Metric getMetricControl();",
"public static double meterToKilometer(final double meter) {\n return meter / METERS_PER_KILOMETER;\n }",
"public static double meterToMile(final double meter) {\n return meter / METERS_PER_MILE;\n }",
"public static Velocity newNanometersPerSecondValue()\n\t{\n\t\treturn new Velocity(0.0, VelocityUnit.NANOMETERS_PER_SECOND);\n\t}",
"LengthUnit(double metres) {\n/* 24 */ this.metres = metres;\n/* 25 */ this.dx = new Dx(1.0D, this);\n/* */ }",
"public MeasuresRecorder(String modelName) {\n super(modelName);\n currentNanoTime = () -> timeCount;\n }",
"@Override\n\tpublic int newtomMeterTorque() {\n\t\treturn 0;\n\t}",
"public LEDMeter(int width, int height, String caption, int value) {\r\n\r\n\t\tthis(width, height, MODEPEAK, \r\n\t\t\t DEFAULTFONTNAME, DEFAULTFONTSTYLE, DEFAULTFONTSIZE,\r\n\t\t\t caption, false, \"\", DEFAULTLABELPERCENT, value,\r\n\t\t\t true, DEFAULTNUMBEROFSECTIONS,\r\n\t\t\t PANELCOLOR, TEXTCOLOR);\r\n\t}",
"public static Velocity newNanometersPerSecondValue(Double new_val)\n\t{\n\t\treturn new Velocity(new_val, VelocityUnit.NANOMETERS_PER_SECOND);\n\t}",
"public OFMeterConfigStatsRequest buildMeterConfigRquest() {\n\t\t\treturn factory.buildMeterConfigStatsRequest().setMeterId(OFMeterSerializerVer13.ALL_VAL).build();\n\t\t}",
"Unit getUnit();",
"public static double kilometerToMeter(final double kilometer) {\n return kilometer * METERS_PER_KILOMETER;\n }",
"public static double mileToMeter(final double mile) {\n return mile * METERS_PER_MILE;\n }",
"public void metersPerSecond(Double val)\n\t{\n\t\tsetValue(val, VelocityUnit.METERS_PER_SECOND);\n\t}",
"public Double metersPerSecond()\n\t{\n\t\treturn getValue(VelocityUnit.METERS_PER_SECOND);\n\t}",
"public Light(){\n this(0.0, 0.0, 0.0);\n }",
"public static MetricTransformation2DRobustEstimator create() {\n return create(DEFAULT_ROBUST_METHOD);\n }",
"public MeterLnTrafficController() {\n super();\n Meter = this;\n MyGovernor = new Governor();\n Governor.OutputThread = new Thread(MyGovernor);\n Governor.OutputThread.setName(\"LnMeter\");\n Governor.OutputThread.start();\n Governor.OutputThread.setPriority(Thread.MAX_PRIORITY);\n if (FlowRate == null) {\n FlowRate = CounterFactory.CountKeeper.findSequence(\n CounterFactory.LNTAG);\n CounterFactory.CountKeeper.exposeSequence(CounterFactory.LNTAG);\n FlowRate.registerAdjustmentListener(this);\n DecoratedController = findLNController();\n }\n }",
"public static double inchToMeter(final double inch) {\n return inch * METERS_PER_INCH;\n }",
"@Override\n\tpublic void setPersonal_4_HalfGaugeMeter() \n\t{\n\t}",
"public Units(final SystemOfUnits system) {\n metre = system.getUnit(Length.class);\n radian = system.getUnit(Angle.class);\n second = system.getUnit(Time.class);\n pascal = system.getUnit(Pressure.class);\n one = getDimensionless(system);\n kilometre = metre .multiply(1000);\n foot = metre .multiply(0.3048);\n footSurveyUS = metre .multiply(12 / 39.37);\n degree = radian.multiply(Math.PI / 180);\n grad = radian.multiply(Math.PI / 200);\n arcSecond = radian.multiply(Math.PI / (180*60*60));\n microradian = radian.divide(1E6);\n day = second.multiply(24*60*60);\n hectopascal = pascal.multiply(100);\n ppm = one .divide(1000000);\n }",
"private Units() {\n // Nothing to do\n }",
"@Test\n\tpublic static void testConstructorAndGetters() {\n\t\tMetalDTO m = new MetalDTO(1, 2, 3, 4.0, \"Name\", 3.7, 8.4);\n\t\tassertEquals(m.getAtomicMass(), 4.0, 0.01);\n\t\tassertEquals(m.getAtomicNumber(), 2);\n\t\tassertEquals(m.getDissolvedBy(), 3);\n\t\tassertEquals(m.getID(), 1);\n\t\tassertEquals(m.getName(), \"Name\");\n\t\tassertEquals(m.getMoles(), 3.7, 0.01);\n\t\tassertEquals(m.getMolesOfAcidToDissolve(), 8.4, 0.01);\n\t}",
"public VelocityMetric velocityMetric() {\n _initialize();\n return velocityMetric;\n }",
"@Override\n\tpublic Metro Convertir() {\n\n\t\treturn new Metro(getValor() * 0.01);\n\t}",
"public SoundlevelMeasurement() {\n this.dBval = 0;\n this.timestamp = null;\n }"
]
| [
"0.8109553",
"0.67857647",
"0.66068584",
"0.6575465",
"0.65751106",
"0.653242",
"0.6440154",
"0.6428509",
"0.6422597",
"0.6355417",
"0.6269954",
"0.6268082",
"0.62596196",
"0.61506045",
"0.6101417",
"0.60440093",
"0.6040206",
"0.5991018",
"0.5854935",
"0.5825591",
"0.57955015",
"0.57935125",
"0.5778828",
"0.5774267",
"0.5723825",
"0.5693613",
"0.56862783",
"0.5671332",
"0.5671332",
"0.5670422",
"0.5654648",
"0.56350416",
"0.5610402",
"0.5586111",
"0.5578965",
"0.5560083",
"0.549427",
"0.5468965",
"0.5463013",
"0.5448723",
"0.5441177",
"0.5436096",
"0.54353696",
"0.5368839",
"0.5358923",
"0.5350023",
"0.5347613",
"0.53421956",
"0.5333926",
"0.53272635",
"0.53258145",
"0.5312408",
"0.5299976",
"0.5279554",
"0.5279129",
"0.52694577",
"0.52674127",
"0.52652687",
"0.52488965",
"0.5246239",
"0.5239208",
"0.5234328",
"0.5217716",
"0.5212353",
"0.52107924",
"0.5204318",
"0.52001965",
"0.51999503",
"0.5187369",
"0.51733655",
"0.51709443",
"0.51491016",
"0.51429033",
"0.5142464",
"0.514186",
"0.51347125",
"0.51292664",
"0.51246756",
"0.5113795",
"0.51040506",
"0.5099365",
"0.50553876",
"0.5049468",
"0.5038755",
"0.5037894",
"0.50347424",
"0.50336653",
"0.5031898",
"0.5019648",
"0.50120807",
"0.5007829",
"0.49968082",
"0.4995929",
"0.4983667",
"0.49804088",
"0.49766645",
"0.496974",
"0.49659008",
"0.4960006",
"0.49580848"
]
| 0.8518484 | 0 |
Returns a new object of class 'Foot'. | Foot createFoot(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public FrontFoot(){\n super(1);\n }",
"public Unit<Length> foot() {return foot;}",
"public static FootprintFragment newInstance() {\n FootprintFragment fragment = new FootprintFragment();\n\n return fragment;\n }",
"static Football getFootBall(){\n return new Football();\n }",
"public com.walgreens.rxit.ch.cda.StrucDocTfoot addNewTfoot()\n {\n synchronized (monitor())\n {\n check_orphaned();\n com.walgreens.rxit.ch.cda.StrucDocTfoot target = null;\n target = (com.walgreens.rxit.ch.cda.StrucDocTfoot)get_store().add_element_user(TFOOT$8);\n return target;\n }\n }",
"public com.walgreens.rxit.ch.cda.StrucDocTitleFootnote addNewFootnote()\n {\n synchronized (monitor())\n {\n check_orphaned();\n com.walgreens.rxit.ch.cda.StrucDocTitleFootnote target = null;\n target = (com.walgreens.rxit.ch.cda.StrucDocTitleFootnote)get_store().add_element_user(FOOTNOTE$8);\n return target;\n }\n }",
"public com.walgreens.rxit.ch.cda.StrucDocFootnoteRef addNewFootnoteRef()\n {\n synchronized (monitor())\n {\n check_orphaned();\n com.walgreens.rxit.ch.cda.StrucDocFootnoteRef target = null;\n target = (com.walgreens.rxit.ch.cda.StrucDocFootnoteRef)get_store().add_element_user(FOOTNOTEREF$10);\n return target;\n }\n }",
"@Override\n public List<Component> getFooters()\n {\n if (footers == null)\n {\n footers = new ArrayList<>();\n }\n return footers;\n }",
"public com.walgreens.rxit.ch.cda.StrucDocTfoot getTfoot()\n {\n synchronized (monitor())\n {\n check_orphaned();\n com.walgreens.rxit.ch.cda.StrucDocTfoot target = null;\n target = (com.walgreens.rxit.ch.cda.StrucDocTfoot)get_store().find_element_user(TFOOT$8, 0);\n if (target == null)\n {\n return null;\n }\n return target;\n }\n }",
"public Fish create(){\n\t\tMovementStyle style = new NoMovement();\n\t\treturn new Shark(style);\n\t}",
"public void getFootPrint(){\n\t\tcarbonFootPrint = ((milesDriven/FuelEfficency)*(19.36/(carbondioxide/gallons)))/2204.6;\n\t}",
"@Override\n\tpublic IProduct factoryMethod() {\n\t\treturn new Toy();\n\t}",
"public void setTfoot(com.walgreens.rxit.ch.cda.StrucDocTfoot tfoot)\n {\n synchronized (monitor())\n {\n check_orphaned();\n com.walgreens.rxit.ch.cda.StrucDocTfoot target = null;\n target = (com.walgreens.rxit.ch.cda.StrucDocTfoot)get_store().find_element_user(TFOOT$8, 0);\n if (target == null)\n {\n target = (com.walgreens.rxit.ch.cda.StrucDocTfoot)get_store().add_element_user(TFOOT$8);\n }\n target.set(tfoot);\n }\n }",
"@Override\n public Animal newChild() {\n return new Fox(0);\n }",
"Foco createFoco();",
"public static double footToMeter(final double foot) {\n return foot * METERS_PER_FOOT;\n }",
"public Ocean()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(600, 400, 1); \n BF bf = new BF();\n addObject(bf,500,300);\n SF sf = new SF();\n addObject(sf,100,300);\n }",
"public int getFootprintLength() {\n return 1;\n }",
"FooterType createFooterType();",
"public Unit<Length> footSurveyUS() {return footSurveyUS;}",
"public abstract AlleleFootprintType getFootprintType();",
"public MyWorld()\n { \n // Create a new world with 600x550 cells with a cell size of 1x1 pixels.\n super(600, 550, 1);\n // Set the order in which Actors are drawn on the screen in this World\n setPaintOrder ( Counter.class, HighScore.class, Fader.class);\n // Counter\n counter = new Counter (\"Score: \");\n addObject (counter, 50, 30);\n // Initialize the player\n player = new Player ();\n addObject (player, 300, 530); \n platforms = new Platform[10]; \n startingPlatform = new Platform();\n addObject (startingPlatform, 300, 550);\n // Loop through as many Meteors as there are on this level\n for (int i = 0; i < platforms.length; i++)\n {\n // Initialize a new Platform object for each spot in the array\n platforms[i] = new Platform ();\n // Add each platform at a random position anywhere on the X axis and at intervals of 15 on the Y axis\n addObject (platforms[i], Greenfoot.getRandomNumber(600), platformCounter);\n platformCounter = platformCounter - 55;\n }\n }",
"public com.walgreens.rxit.ch.cda.StrucDocTitleFootnote insertNewFootnote(int i)\n {\n synchronized (monitor())\n {\n check_orphaned();\n com.walgreens.rxit.ch.cda.StrucDocTitleFootnote target = null;\n target = (com.walgreens.rxit.ch.cda.StrucDocTitleFootnote)get_store().insert_element_user(FOOTNOTE$8, i);\n return target;\n }\n }",
"static public Tour makeTour() {\r\n Tour t = new Tour();\r\n t.index = null;\r\n return t;\r\n }",
"public static double feetToMeters(double foot){\r\n\t\t\r\n\t\tdouble meter = 0.305 * foot;\r\n\t\t\r\n\t\treturn meter;\r\n\t}",
"public HELPFit getHF(){\n return HF;\n }",
"public BF() {\n\t\tsuper(\"Body Fat\", \"%\");\n\t}",
"public HiloM() { }",
"public static double meterToFoot(final double meter) {\n return meter / METERS_PER_FOOT;\n }",
"public BF(double o) {\n\t\tsuper(o, \"Body Fat\", \"%\");\n\t}",
"public Toy(String mainColor, String material, String origin, double price, int[] ageDelta) {\n this.type = getClass().getSuperclass().getSimpleName();\n this.name = getClass().getSimpleName();\n this.mainColor = mainColor;\n this.material = material;\n this.origin = origin;\n this.price = price;\n this.ageDelta = ageDelta;\n }",
"public Furniture (float pricePerHour, float workedHours)\n {\n\t this.pricePerHour = pricePerHour;\n\t this.workedHours = workedHours;\n }",
"public InternalFloaterFactory() {\n super();\n }",
"public com.walgreens.rxit.ch.cda.StrucDocFootnoteRef insertNewFootnoteRef(int i)\n {\n synchronized (monitor())\n {\n check_orphaned();\n com.walgreens.rxit.ch.cda.StrucDocFootnoteRef target = null;\n target = (com.walgreens.rxit.ch.cda.StrucDocFootnoteRef)get_store().insert_element_user(FOOTNOTEREF$10, i);\n return target;\n }\n }",
"protected abstract Body newBodyImpl();",
"public void newGameWorld()\r\n {\r\n addObject(new Blackout(\"Fade\"), getWidth() / 2, getHeight() / 2);\r\n removeAllObjects();\r\n\r\n GameWorld gameWorld = new GameWorld();\r\n Greenfoot.setWorld(gameWorld);\r\n }",
"public House()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(480, 352, 1); \n addObject(new GravesHouse(),110,60);\n addObject(new Kid(),300,200);\n addObject(new Sofa(),190,270);\n addObject(new Piano(),275,100);\n }",
"private Fight() { }",
"public FootprintEstimate(long nDays) {\n this.nDays = nDays;\n }",
"public MyWorld()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(600, 400, 1); \n \n Player player = new Player();\n Point point0 = new Point();\n Point point1 = new Point();\n Point point2 = new Point();\n Point point3 = new Point();\n Point point4 = new Point();\n Danger danger0 = new Danger();\n Danger danger1 = new Danger();\n addObject(player, getWidth()/2, getHeight()/2);\n \n addObject(point0,Greenfoot.getRandomNumber(getWidth()),Greenfoot.getRandomNumber(getHeight()));\n addObject(point1,Greenfoot.getRandomNumber(getWidth()),Greenfoot.getRandomNumber(getHeight()));\n addObject(point2,Greenfoot.getRandomNumber(getWidth()),Greenfoot.getRandomNumber(getHeight()));\n addObject(point3,Greenfoot.getRandomNumber(getWidth()),Greenfoot.getRandomNumber(getHeight()));\n addObject(point4,Greenfoot.getRandomNumber(getWidth()),Greenfoot.getRandomNumber(getHeight()));\n \n addObject(danger0,Greenfoot.getRandomNumber(getWidth()),Greenfoot.getRandomNumber(getHeight()));\n addObject(danger1,Greenfoot.getRandomNumber(getWidth()),Greenfoot.getRandomNumber(getHeight()));\n }",
"public BodyPart(int x, int y, int size){\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.size = size;\n\t}",
"public void createPhilosophers() {\n\t\tphil1 = new Philosopher(1,stick1,stick2);\n\t\tphil2 = new Philosopher(2,stick2,stick3);\n\t\tphil3 = new Philosopher(3,stick3,stick4);\n\t\tphil4 = new Philosopher(4,stick4,stick5);\n\t\tphil5 = new Philosopher(5,stick5,stick1);\n\t}",
"@Override\n public CTFtnEdn addFootnote(BigInteger footnoteID) throws Docx4JException {\n CTFtnEdnRef ftnednref = myFactory.createCTFtnEdnRef();\n JAXBElement<CTFtnEdnRef> ftnednrefWrapped = myFactory.createRFootnoteReference(ftnednref);\n R ftnR = myFactory.createR();\n getP().getContent().add(ftnR);\n\n ftnR.getContent().add(ftnednrefWrapped);\n\n RPr ftnRPr = myFactory.createRPr();\n ftnR.setRPr(ftnRPr);\n\n RStyle ftnRStyle = myFactory.createRStyle();\n ftnRPr.setRStyle(ftnRStyle);\n\n ftnRStyle.setVal(myRendererOptions.FOOTNOTE_ANCHOR_STYLE);\n\n // see if we need to create a new footnote id or can re-use existing one\n boolean haveID = footnoteID.compareTo(BigInteger.ZERO) > 0;\n BigInteger i = haveID ? footnoteID : BigInteger.valueOf(myFootnoteRef++);\n ftnednref.setId(i);\n\n if (haveID) {\n for (CTFtnEdn ftnEdn : getFootnotesPart().getContents().getFootnote()) {\n if (ftnEdn.getId().compareTo(footnoteID) == 0) {\n return ftnEdn;\n }\n }\n }\n\n // Create a footnote in the footnotesPart\n // @formatter:off\n //String openXML = \"<w:footnote w:id=\\\"\" + i + \"\\\" xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\" xmlns:xml=\\\"http://www.w3.org/XML/1998/namespace\\\">\"\n // + \"<w:p>\"\n // + \"<w:pPr>\"\n // + \"<w:pStyle w:val=\\\"Footnote\\\"/>\"\n // //+ \"<w:rPr>\"\n // // + \"<w:lang w:val=\\\"en-AU\\\"/>\"\n // //+\"</w:rPr>\"\n // +\"</w:pPr>\"\n // + \"<w:r>\"\n // + \"<w:rPr>\"\n // + \"<w:rStyle w:val=\\\"FootnoteAnchor\\\"/>\"\n // +\"</w:rPr>\"\n // + \"<w:footnoteRef/>\"\n // +\"</w:r>\"\n // + \"<w:r>\"\n // + \"<w:t xml:space=\\\"preserve\\\"> </w:t>\"\n // +\"</w:r>\"\n // + \"<w:r>\"\n // //+ \"<w:rPr>\"\n // // + \"<w:lang w:val=\\\"en-AU\\\"/>\"\n // //+\"</w:rPr>\"\n // + \"<w:t>\" + text +\"</w:t>\"\n // +\"</w:r>\"\n // +\"</w:p>\"\n // +\"</w:footnote>\";\n //// @formatter:on\n //CTFtnEdn ftnedn = (CTFtnEdn) XmlUtils.unmarshalString(openXML, Context.jc, CTFtnEdn.class);\n\n CTFtnEdn ftnEdn = myFactory.createCTFtnEdn();\n ftnEdn.setId(i);\n\n P p = myFactory.createP();\n ftnEdn.getContent().add(p);\n\n PPr pPr = myFactory.createPPr();\n p.setPPr(pPr);\n\n PStyle pStyle = myFactory.createPPrBasePStyle();\n pPr.setPStyle(pStyle);\n\n pStyle.setVal(myRendererOptions.FOOTNOTE_STYLE);\n\n R r1 = myFactory.createR();\n p.getContent().add(r1);\n RPr rPr = myFactory.createRPr();\n r1.setRPr(rPr);\n RStyle rStyle = myFactory.createRStyle();\n rPr.setRStyle(rStyle);\n rStyle.setVal(myRendererOptions.FOOTNOTE_ANCHOR_STYLE);\n\n FootnoteRef footnoteRef = myFactory.createRFootnoteRef();\n r1.getContent().add(footnoteRef);\n\n R r2 = myFactory.createR();\n Text text1 = myFactory.createText();\n JAXBElement<Text> textWrapped = myFactory.createRT(text1);\n r2.getContent().add(textWrapped);\n text1.setSpace(RunFormatProvider.SPACE_PRESERVE);\n text1.setValue(\"\\t\");\n p.getContent().add(r2);\n\n getFootnotesPart().getContents().getFootnote().add(ftnEdn);\n return ftnEdn;\n }",
"public final Body newBody()\n {\n Body body = newBodyImpl();\n \n //addBody(body);\n \n return ( body );\n }",
"public Quadcopter(Quadcopter anotherQuadcopter) {\r\n\t\tthis.brand = anotherQuadcopter.brand;\r\n\t\tthis.price = anotherQuadcopter.price;\r\n\t\tthis.hp = anotherQuadcopter.hp;\r\n\t\tthis.cylinderNum = anotherQuadcopter.cylinderNum;\r\n\t\tthis.creationYear = anotherQuadcopter.creationYear;\r\n\t\tthis.passengerCap = anotherQuadcopter.passengerCap;\r\n\t\tthis.maxFlyingSpeed = anotherQuadcopter.maxFlyingSpeed;\r\n\t\t\r\n\t}",
"public static Unit fang(){\n\t\tUnit unit = new Unit(\"Fang\", \"O_S_WhiteMane\", 15, 5, 12, 14, 4);\n\t\tunit.base=2;\n\t\tunit.addWep(new Weapon(\"Greataxe\",11,4));\n\t\tunit.addActive(ActiveType.CLEAVE);\n\t\tunit.addPassive(PassiveType.TOUGH);\n\t\treturn unit;\n\t}",
"private Hero createHeroObject(){\n return new Hero(\"ImageName\",\"SpiderMan\",\"Andrew Garfield\",\"6 feet 30 inches\",\"70 kg\",\n \"Webs & Strings\",\"Fast thinker\",\"Webs & Flexible\",\n \"200 km/hour\",\"Very fast\",\"Spiderman - Super Hero saves the world\",\n \"SuperHero saves the city from all the villians\");\n }",
"public World(double width, double height) {\n this.width = width;\n this.height = height;\n\n\n shapes = new Shape[3]; // an array of references (change to non-zero size)\n // Create the actual Shape objects (sub types)\n // ....\n\n shapes[0] = new Line(50,100,50,50, Color.BLUE);\n shapes[1] = new Circle(75,75,30,Color.BLACK);\n shapes[2] = new Rectangle(40,50,40,40,Color.GREEN);\n\n\n }",
"protected abstract FixedJoint newFixedJointImpl( Body body1, Body body2 );",
"protected Figure newFigure( Point2D p, Figure f ) {\n\t\tSistema.logger.info( \"Creating actor at \" + p.getX() + \",\" + p.getY() );\n\t\tActorFigure figure = new ActorFigure( \"teste\" );\n\t\tfigure.setLocation( p );\n\t\treturn figure;\n\t}",
"public Bike createCityBike() {\n Wheels cityWheels = new Wheels(559,50f,10000); //Räder des Stadtrads erstellen\n Gears cityGears = new Gears(3,1,5000); //Gangschaltung des Stadtrads erstellen\n Bike newCityBike = new Bike(cityGears, cityWheels, \"Stahl\", \"CB105\", true, true, 30000); //Stadtrad erstellen\n return newCityBike; //Stadtrad zurückgeben\n}",
"@Override\r\n protected SimpleBody addObject(Entity e) {\n PhysicsShape ps = e.get(PhysicsShape.class);\r\n PhysicsMassType pmt = e.get(PhysicsMassType.class);\r\n Position pos = e.get(Position.class);\r\n\r\n // Right now only works for CoG-centered shapes \r\n SimpleBody newBody = createBody(e.getId(), pmt.getTypeName(ed), ps.getFixture(), true);\r\n\r\n newBody.setPosition(pos); //ES position: Not used anymore, since Dyn4j controls movement\r\n\r\n newBody.getTransform().setTranslation(pos.getLocation().x, pos.getLocation().y); //Dyn4j position\r\n newBody.getTransform().setRotation(pos.getRotation());\r\n\r\n newBody.setUserData(e.getId());\r\n\r\n newBody.setLinearDamping(0.3);\r\n\r\n return newBody;\r\n }",
"public static Bounty createEntity() {\n Bounty bounty = new Bounty()\n// .status(DEFAULT_STATUS)\n// .issueUrl(DEFAULT_URL)\n .amount(DEFAULT_AMOUNT)\n// .experience(DEFAULT_EXPERIENCE)\n// .commitment(DEFAULT_COMMITMENT)\n// .type(DEFAULT_TYPE)\n// .category(DEFAULT_CATEGORY)\n// .keywords(DEFAULT_KEYWORDS)\n .permission(DEFAULT_PERMISSION)\n .expiryDate(DEFAULT_EXPIRES);\n return bounty;\n }",
"public Fish() {\r\n\t}",
"public Unit(float length, float width, float height, float totalCost, String unitKind, Furniture furniture, Electrictiy electrictiy, Wall wall, Roof roof, Floor floor, Plumbing plumbing) {\n this.length = length;\n this.width = width;\n this.height = height;\n this.totalCost = totalCost;\n this.unitKind = unitKind;\n this.furniture = furniture;\n this.electrictiy = electrictiy;\n this.wall = wall;\n this.roof = roof;\n this.floor = floor;\n this.plumbing = plumbing;\n }",
"public static Item create( TopComponent tc ) {\n return new TopItem( tc );\n }",
"public FObj(FONode parent) {\n super(parent);\n \n // determine if isOutOfLineFODescendant should be set\n if (parent != null && parent instanceof FObj) {\n if (((FObj)parent).getIsOutOfLineFODescendant()) {\n isOutOfLineFODescendant = true;\n } else {\n int foID = getNameId();\n if (foID == FO_FLOAT || foID == FO_FOOTNOTE\n || foID == FO_FOOTNOTE_BODY) {\n isOutOfLineFODescendant = true;\n }\n }\n }\n }",
"public StShhnKnyMs newEntity() { return new StShhnKnyMs(); }",
"@Override\r\n protected SimpleBody addObject(Entity e) {\n PhysicsShape ps = e.get(PhysicsShape.class);\r\n PhysicsMassType pmt = e.get(PhysicsMassType.class);\r\n Position pos = e.get(Position.class);\r\n\r\n // Right now only works for CoG-centered shapes \r\n SimpleBody newBody = createStatic(e.getId(), pmt.getTypeName(ed), ps.getFixture(), true);\r\n\r\n newBody.setPosition(pos); //ES position: Not used anymore, since Dyn4j controls movement\r\n\r\n newBody.getTransform().setTranslation(pos.getLocation().x, pos.getLocation().y); //Dyn4j position\r\n newBody.getTransform().setRotation(pos.getRotation());\r\n\r\n newBody.setUserData(e.getId());\r\n\r\n newBody.setLinearDamping(0.3);\r\n\r\n return newBody;\r\n }",
"public static Flipkart createFlipkart()throws Exception {\r\n\t\t //create target class obj\r\n\t\t Flipkart fpkt=new Flipkart();\r\n\t\t \r\n\t\t // Load Dependent class \r\n\t\t Class c=Class.forName(props.getProperty(\"dependent.comp\"));\r\n\t\t //create object using refflection object\r\n\t\t Constructor cons[]=c.getDeclaredConstructors();\r\n\t\t //create object\r\n\t\t Courier courier=(Courier) cons[0].newInstance();\r\n\t\t //set Dependent class object to target class obj\r\n\t\t fpkt.setCourier(courier);\r\n\t return fpkt;\r\n }",
"private Body createFeet(World world, Vector2 pos){\n\n BodyDef bodyDefFeet = new BodyDef();\n bodyDefFeet.type = BodyDef.BodyType.DynamicBody;\n bodyDefFeet.position.set(new Vector2((pos.x + HERO_WIDTH_PIXEL / 2) / GameInfo.PPM, pos.y / GameInfo.PPM)); //TODO\n //bodyDefFeet.position.set(new Vector2(((pos.x + HERO_WIDTH_PIXEL) / GameInfo.PPM), (pos.y) / GameInfo.PPM));\n\n Body bodyFeet = world.createBody(bodyDefFeet);\n\n //Shape of box\n PolygonShape shape = new PolygonShape();\n shape.setAsBox(((HERO_WIDTH_PIXEL / 3.5f) / GameInfo.PPM), (HERO_HEIGHT_PIXEL / 12) / GameInfo.PPM); //TODO OVERFLOW?\n\n //FixtureDef for box\n FixtureDef fixtureDefFeet = new FixtureDef();\n fixtureDefFeet.shape = shape;\n fixtureDefFeet.density = 0;\n fixtureDefFeet.friction = 1;\n fixtureDefFeet.restitution = 0;\n fixtureDefFeet.isSensor = true;\n\n //Create fixture and attach it to the body\n Fixture fixtureFeet = bodyFeet.createFixture(fixtureDefFeet);\n\n shape.dispose();\n\n bodyFeet.getFixtureList().get(0).setUserData(FEET_ID);\n bodyFeet.setGravityScale(0);\n\n return bodyFeet;\n }",
"public static FireFighting newInstance() {\n FireFighting fragment = new FireFighting();\n return fragment;\n }",
"@Override\r\n\tpublic Product factory() {\n\t\treturn new ConcreteProduct2();\r\n\t}",
"public Particle() {\n\t}",
"public DumbEnemy(){\n setImage(new GreenfootImage(SPRITE_W,SPRITE_H));\n }",
"public int\ngetFootprint() {\n\treturn footprint;\n}",
"Centimeter createCentimeter();",
"public T hent(int pos);",
"public Obj GetSDFObj() {\n/* 512 */ return Obj.__Create(this.a, this.b);\n/* */ }",
"public Wiese() \n {\n // Erzeugt eine neue Welt\n super(WORLD_WIDTH, WORLD_HEIGHT, CELL_SIZE);\n\n setPaintOrder(Kara.class, Tree.class, Mushroom.class, Leaf.class);\n Greenfoot.setSpeed(15);\n\n // Erzeuge die Anfangs-Objekte fuer die Welt.\n prepare();\n }",
"public void unsetTfoot()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(TFOOT$8, 0);\n }\n }",
"public static ForecastFragment newInstance() {\n\n //Create new fragment\n ForecastFragment frag = new ForecastFragment();\n return(frag);\n }",
"public Tiempo2( int h, int m ) { \n this( h, m, 0 ); // invoca al constructor de Tiempo2 con tres argumentos\n }",
"public Unit(float length, float width, float height, float totalCost, String unitKind, Furniture furniture, Electrictiy electrictiy, Wall wall, Roof roof, Floor floor) {\n this.length = length;\n this.width = width;\n this.height = height;\n this.totalCost = totalCost;\n this.unitKind = unitKind;\n this.furniture = furniture;\n this.electrictiy = electrictiy;\n this.wall = wall;\n this.roof = roof;\n this.floor = floor;\n }",
"public a mo8520o() {\n return new a();\n }",
"public interface IFootService {\n\n //添加食品\n public boolean addFoot(Foot foot);\n //查询食品\n public List footList();\n //根据名称查询食品\n public Foot findFootByName(String fname);\n}",
"public Thermometer(Person person){\r\n super(person);\r\n temperature = new MeasureUnit(\"Celsius\",\"º C\", 1);\r\n }",
"public NewShape() {\r\n\t\tsuper();\r\n\t}",
"public Bout()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(600, 400, 1); \n CreaBoutique();\n\n }",
"private void createObstacole()\n {\n //Create Obstacole\n Obstacole topObstacole = new Obstacole(\"top\");\n Obstacole botObstacole = new Obstacole(\"bottom\");\n Obstacole midObstacole = new Obstacole(\"mid\");\n //amount of space between obstacole\n int ObstacoleSpacing = 150;\n \n //get object image\n GreenfootImage image = botObstacole.getImage();\n \n //random number to vary\n int numOfObstacoles = Greenfoot.getRandomNumber(40) + 15;\n \n //counter increment to 50\n ObstacoleCounter++;\n if (ObstacoleCounter == 50)\n {\n if (getObjects(Obstacole.class).size() < numOfObstacoles)\n {\n addObject(botObstacole, getWidth(), getHeight() / 2 + image.getHeight() - Greenfoot.getRandomNumber(100) - 10);\n addObject(topObstacole, getWidth(), botObstacole.getY() - image.getHeight() - ObstacoleSpacing);\n addObject(midObstacole, getWidth(), botObstacole.getY() + image.getHeight() / 3 + ObstacoleSpacing);\n }\n ObstacoleCounter = 0;\n }\n }",
"@Override\n\tpublic Location newInstance() {\n\t\treturn new Location(this.X,this.Y,0);\n\t}",
"public Heart() {\n super();\n }",
"public HealthyWorld()\n { \n // Create a new wolrd with 800x400 cells and a cell size of 1x1 pixels\n super(800, 400, 1);\n healthLevel = 10;\n time = 2000;\n showHealthLevel();\n showTime();\n // Create a kid in the middle of the screen\n Kid theKid = new Kid();\n this.addObject(theKid, 400, 350);\n }",
"protected Basket makeBasket() {\n\t\treturn new Basket();\n\t}",
"public static Bounty createUpdatedEntity() {\n Bounty bounty = new Bounty()\n// .status(UPDATED_STATUS)\n// .issueUrl(UPDATED_URL)\n .amount(UPDATED_AMOUNT)\n// .experience(UPDATED_EXPERIENCE)\n// .commitment(UPDATED_COMMITMENT)\n// .type(UPDATED_TYPE)\n// .category(UPDATED_CATEGORY)\n// .keywords(UPDATED_KEYWORDS)\n .permission(UPDATED_PERMISSION)\n .expiryDate(UPDATED_EXPIRES);\n return bounty;\n }",
"public static ao m50836b() {\n return new ao();\n }",
"public Tiempo2( int h ) { \n this( h, 0, 0 ); // invoca al constructor de Tiempo2 con tres argumentos\n }",
"public Shoe makeShoe() {\n\treturn new Shoe();\r\n}",
"public Bomb newBomb() {\r\n return new Bomb(id(), position().containingCell(),\r\n Ticks.BOMB_FUSE_TICKS, bombRange);\r\n }",
"public HomePieceOfFurniture createHomePieceOfFurniture(PieceOfFurniture piece) {\n if (piece instanceof DoorOrWindow) {\n return new HomeDoorOrWindow((DoorOrWindow)piece);\n } else if (piece instanceof Light) {\n return new HomeLight((Light)piece);\n } else {\n return new HomePieceOfFurniture(piece);\n }\n }",
"Ball create(int xpos, int ypos);",
"public Unit<Pressure> hectopascal() {return hectopascal;}",
"private IntroductionBean createBean(Cursor cur) {\n String title = cur.getString(cur.getColumnIndexOrThrow(IntroductionBean.Table.FIELD_TITLE));\n String content = cur.getString(cur.getColumnIndexOrThrow(IntroductionBean.Table.FIELD_CONTENT));\n return new IntroductionBean(title, content);\n }",
"public Tip() { ; }",
"public static ChessPiece createPiece(String tname,int tx, int ty, int tsize){\n\t\tChessPiece ret=null;\n\t\tif(tname.equalsIgnoreCase(\"k\")){\n\t\t\tret=new King(tx,ty,tsize,tname.equals(\"k\"));\n\t\t}\n\t\telse if(tname.equalsIgnoreCase(\"q\")){\n\t\t\tret=new Queen(tx,ty,tsize,tname.equals(\"q\"));\n\t\t}\n\t\telse if(tname.equalsIgnoreCase(\"r\")){\n\t\t\tret=new Rook(tx,ty,tsize,tname.equals(\"r\"));\n\t\t}\n\t\telse if(tname.equalsIgnoreCase(\"n\")){\n\t\t\tret=new Knight(tx,ty,tsize,tname.equals(\"n\"));\n\t\t}\n\t\telse if(tname.equalsIgnoreCase(\"b\")){\n\t\t\tret=new Bishop(tx,ty,tsize,tname.equals(\"b\"));\n\t\t}\n\t\telse if(tname.equalsIgnoreCase(\"p\")){\n\t\t\tret=new Pawn(tx,ty,tsize,tname.equals(\"p\"));\n\t\t}\n\t\treturn ret;\n\t}",
"public ObjectFactory() {\n super(grammarInfo);\n }",
"public Hero createHero() {\r\n\t\t// Creates hero with the defines statistics\r\n\t\tHero hero = new Hero(getTotalHealth(), getIllusion(), getHealing(), getHaggling());\r\n\t\t\r\n\t\treturn hero;\r\n\t\t\r\n\t}",
"public Entity newEntity() { return newMyEntity(); }",
"public Entity newEntity() { return newMyEntity(); }",
"public GosuClassParseInfo createNewParseInfo() {\n if( _parseInfo == null ) {\n _parseInfo = new GosuClassParseInfo((IGosuClassInternal) getOrCreateTypeReference());\n }\n return _parseInfo;\n }"
]
| [
"0.6701757",
"0.6522237",
"0.63954866",
"0.6142052",
"0.60095656",
"0.5660303",
"0.5534858",
"0.54766726",
"0.5376431",
"0.52943516",
"0.5269169",
"0.51939464",
"0.5112799",
"0.50731415",
"0.5061401",
"0.5042767",
"0.50307965",
"0.50065345",
"0.49250662",
"0.49185574",
"0.4881644",
"0.48265922",
"0.4811104",
"0.48094693",
"0.47919515",
"0.47740546",
"0.47636965",
"0.47404653",
"0.47327453",
"0.4725697",
"0.47195205",
"0.47154254",
"0.47154146",
"0.47149736",
"0.471209",
"0.47077742",
"0.46838528",
"0.46794048",
"0.46724364",
"0.46542424",
"0.46533337",
"0.4647259",
"0.46427014",
"0.46392357",
"0.46218988",
"0.46151114",
"0.45905843",
"0.45904043",
"0.45857906",
"0.45843136",
"0.45835277",
"0.45797676",
"0.45751846",
"0.45639962",
"0.45632252",
"0.45458484",
"0.45376834",
"0.4534383",
"0.45268494",
"0.45259365",
"0.45251992",
"0.4520266",
"0.45190614",
"0.45143846",
"0.45117554",
"0.45115802",
"0.45057616",
"0.45006385",
"0.45004264",
"0.44952846",
"0.4493045",
"0.4493006",
"0.4480384",
"0.4480218",
"0.44801822",
"0.44790107",
"0.44764337",
"0.44745284",
"0.4472394",
"0.44715187",
"0.44652107",
"0.44623205",
"0.4461037",
"0.4454846",
"0.4450735",
"0.44495663",
"0.4446886",
"0.44437116",
"0.4433832",
"0.4432502",
"0.4426319",
"0.44241586",
"0.4419471",
"0.441495",
"0.44123572",
"0.44118607",
"0.4408539",
"0.44084558",
"0.44084558",
"0.4407734"
]
| 0.8375137 | 0 |
Returns a new object of class 'Inch'. | Inch createInch(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static double inchToMeter(final double inch) {\n return inch * METERS_PER_INCH;\n }",
"public HiloM() { }",
"Unit(Apfloat unitIn, UnitType utIn) {\n\t\tthis(unitIn, utIn, 1);\n\t}",
"public static Vector2 getInchZero() {\n float zeroInInchesX = (REAL_ZERO.x * CALIBRATED_INCH_WIDTH) / Overlay.fieldManager.getPixelWidth();\n float zeroInInchesY = (REAL_ZERO.y * CALIBRATED_INCH_HEIGHT) / Overlay.fieldManager.getPixelHeight();\n\n return new Vector2(zeroInInchesX, zeroInInchesY);\n }",
"Centimeter createCentimeter();",
"protected BrowserTestObject iE() \n\t{\n\t\treturn new BrowserTestObject(\n getMappedTestObject(\"iE\"));\n\t}",
"protected BrowserTestObject iE() \n\t{\n\t\treturn new BrowserTestObject(\n getMappedTestObject(\"iE\"));\n\t}",
"public static double meterToInch(final double meter) {\n return meter / METERS_PER_INCH;\n }",
"InOper createInOper();",
"public static double inchesToCms(double inch)\n {\n return inch * INCH_PER_CM;\n }",
"InOut createInOut();",
"public ControllerImpl(Readable in, EnhancedImageModel model) {\n super(model);\n this.in = in;\n }",
"public VT10xEmulator(ICharacterTerminal term, InputStream in, OutputStream out) {\n super(term, in, out);\n }",
"public ExchangeRate(Parcel in) {\r\n\t\t_header = in.readParcelable(HeaderInfo.class.getClassLoader());\r\n\t\t\r\n\t\t_currencies = new ArrayList<CurrencyInfo>(DEFAULT_SIZE);\r\n\t\tin.readTypedList(this._currencies, new Parcelable.Creator<CurrencyInfo>() {\r\n\t\t\t@Override\r\n\t\t\tpublic CurrencyInfo createFromParcel(Parcel source) {\r\n\t\t\t\treturn new CurrencyInfo(source);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic CurrencyInfo[] newArray(int size) {\r\n\t\t\t\treturn new CurrencyInfo[size];\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\t_currencyCodesCache = new ArrayList<String>(DEFAULT_SIZE);\r\n\t\tin.readList(_currencyCodesCache, null);\r\n\t}",
"public AETinteractions(InputInteractions inIn, OutputInteractions ouIn) {\r\n\t\t// assegna le interazioni di input\r\n\t\tthis.InIn = inIn;\r\n\t\t// assegna le interazioni di output\r\n\t\tthis.OuIn = ouIn;\r\n\t}",
"public static II getUUIDAsII() {\n\t\tII ii = new II();\n\t\tii.setValue( MiscUtility.getIDAsString() );\n\t\treturn ii;\n\t}",
"public Intake (Motor intake) {\n this.intake = intake;\n }",
"public Interface()\n {\n this(10); //stats object of size 10\n }",
"public static void main(String[] args) {\n\n\n System.out.println(\"Please input a value for inch:\");\n Scanner scanner = new Scanner(System.in);\n int inchValue = scanner.nextInt();\n double meterValue = 0.0254 * inchValue;\n System.out.println((double)inchValue + \" inch is \" + meterValue + \" meters\");\n }",
"Unit(String unitIn, UnitType utIn) {\n\t\tthis(new Apfloat(unitIn, APFLOATPRECISION), utIn, 1);\n\t}",
"Unit(Apfloat unitIn, UnitType utIn, int expIn) {\n\t\tunitValue = unitIn;\n\t\tunitType = utIn;\n\t\texponent = expIn;\n\t}",
"public Prism(){//consturctor for Cube class with h initialzed to 10.0.\r\n super();//constructor of superclass called.\r\n h = 10.0;\r\n }",
"public Interval(Interval in){\r\n firstExtreme = in.getFirstExtreme();\r\n secondExtreme = in.getSecondExtreme();\r\n feIncluded = in.getFEincluded();\r\n seIncluded = in.getSEincluded();\r\n }",
"Unit(String unitIn, UnitType utIn, int expIn) {\n\t\tthis(new Apfloat(unitIn, APFLOATPRECISION), utIn, expIn);\n\t}",
"public Number getBlncInch() {\n return (Number)getAttributeInternal(BLNCINCH);\n }",
"@Override\n\tpublic Army getArmy() {\n\t\treturn new IndianArmy();\n\t}",
"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}",
"Inning getFirstInning() throws CloneNotSupportedException {\n return (Inning) firstInning.clone();\n }",
"public static int lengthInInches(int feet, int inches){\n return inches = (12*feet)+inches;\n }",
"public static ItemIngredient of(ItemStack input) {\n\t\treturn new ItemStackIngredient(input);\n\t}",
"Ion(double x,double y){\r\n\t\tthis.x=x;\r\n\t\tthis.y=y;\r\n\t}",
"public E getIn() {\n return in;\n }",
"public static ICC_Profile getICC_Profile(InputStream in) throws IOException {\n/* 126 */ synchronized (ICC_Profile.class) {\n/* 127 */ return ICC_Profile.getInstance(in);\n/* */ } \n/* */ }",
"public IntProvider() {\n super();\n }",
"public void setWidthInch(float inches){\n\t\tthis.setWidth(inches);\n\t}",
"public Inventory() {\r\n invPower = 0;\r\n invDefense = 0;\r\n invSpeed = 0;\r\n invAwareness = 0;\r\n treasures = new ArrayList<>();\r\n }",
"@Override\r\n public SeatingCover createSeatingCover() {\r\n return new Linen();\r\n }",
"I createI();",
"public Mech() {\n this(Mech.GYRO_STANDARD, Mech.COCKPIT_STANDARD);\n }",
"public static double cmToInches(double cms)\n {\n return cms * CM_PER_INCH;\n }",
"public Square(double sideIn)\r\n {\r\n super(sideIn, sideIn);\r\n }",
"public IntegerGenotype create() \r\n\t{\n\t\tIntegerGenotype genotype = new IntegerGenotype(1,3);\r\n\t\tgenotype.init(new Random(), Data.numeroCuardillas); \r\n\t\t\r\n\t\treturn genotype;\r\n\t}",
"protected AbstractMeasurementDevice(String inId) {\r\n\t\tsuper();\r\n\r\n\t\tValidate.isTrue(StringUtils.isNotBlank(inId), \"inId is required!\");\r\n\t\tid = inId.toLowerCase();\r\n\t}",
"public Vin() {\n super(\"Vin\");\n\n }",
"public Scania() {\n\n super(2, 600, Color.white, \"Scania\", 13000);\n truckBed = new Ramp();\n }",
"@Bean\n public InkSupply getInkSupply() {\n return new InkSupply();\n }",
"public ArmasHija2(int objetoHija2){\r\n super(objetoHija2);\r\n this.objetoHija2=objetoHija2;\r\n }",
"public Ingredient(int fixed) {\n\t\tthis.volume = fixed;\n\t}",
"Meter createMeter();",
"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 }",
"public Inicio()\n { \n super(600, 400, 1);\n prepararInicio();\n\n }",
"public Human(int theShipType){\n super(theShipType);\n }",
"@SuppressWarnings(\"resource\")\r\n\tpublic static void main(String[] args) {\r\n\t\tScanner input = new Scanner(System.in);\r\n\t\tSystem.out.println(\"Please input an amount in Inches to convert to Meters: \");\r\n\t\tdouble inch = input.nextDouble();\r\n\t\tdouble meters = inch * 0.0254;\r\n\t\tSystem.out.println(inch+\" inch is \"+meters+\" in Meters.\");\r\n\t\t\r\n\t}",
"public ResolutionUnitTag()\r\n\t{\r\n\t\tthis(INCH);\r\n\t}",
"public interface NewLine extends ClouBausteinElement {\n\n static NewLine create(CodePosition codePosition){\n return new NewLineImpl(codePosition);\n }\n\n}",
"private Units() {\n // Nothing to do\n }",
"public void setBlncInch(Number value) {\n setAttributeInternal(BLNCINCH, value);\n }",
"Mitarbeiter getMitarbeiter();",
"public IntHolder() {\r\n\t}",
"public abstract void setInChI(String inchi);",
"private static AgentInfo newAgent(StringTokenizer in) {\n AgentInfo agent = new AgentInfo();\n agent.setGroupId(Factory.getRandomGroup());\n agent.setName(Factory.getRandomAgentName());\n String agentId = in.nextToken();\n String ip = in.nextToken();\n int port = Integer.parseInt(in.nextToken());\n int agentPort = Integer.parseInt(in.nextToken());\n agent.setAgentId(agentId);\n agent.setCurLocation(new HostInfo(ip, port));\n agent.setPort(agentPort);\n AgentInfoList.add(agent);\n\n /*\n * adds to the tally of how many agents are using the host.\n */\n List<HostInfo> hosts = HostInfoList.getList();\n\n for (HostInfo h : hosts) {\n if (h.equals(agent.getCurLocation())) {\n h.incNumAgents();\n }\n }\n\n return agent;\n\n\n }",
"public static final Instrument getDummy() {\n return new Instrument();\n }",
"public ManageEngineIncident() {\n setType(TicketType.INCIDENT);\n }",
"@Override\n\tpublic IVoiture newVoiture() {\n\t\treturn new VoitureSport();\n\t}",
"public UserInterface() { // UserInterface constructor\n\t\tscan = new Scanner(System.in); // initializes scan to new Scanner(System.in)\n\t\tinventoryObject = new InventoryManagement(); // initializes inventoryObject as a new InventoryManagement object\n\t}",
"public HSIImage()\r\n {\r\n }",
"public Ex5Panel(Interface inter) {\n initComponents();\n this.inter = inter;\n this.ex5 = new Ex5();\n }",
"public InGameDisplay(int x, int y) {\n super(ResourceManager.getImage(\"IngameHUD.png\"), 0, 600, 1200, ALLOCATED_HEIGHT);\n healthToDraw = 1;\n maxHealthToDraw = 1;\n minesToDraw = 0;\n maxMinesToDraw = 1;\n skillsToDraw = new Skill[4];\n }",
"public Instrument getInstrument()\n {\n return instrument;\n }",
"public ArduinoIn(ComPort comport) {\n this.comPort = comport;\n }",
"public static IOR makeIOR(InputStream paramInputStream) {\n/* 98 */ return (IOR)new IORImpl(paramInputStream);\n/* */ }",
"public FrontFoot(){\n super(1);\n }",
"public interface IPower360 {\n void outPower360();\n}",
"public SharpIR(double mul, double exp, AnalogInput input) {\n\t\tsetCustomFactors(mul, exp);\n\t\tthis.input = input;\n\t\tinput.setAverageBits(10);\n\t}",
"public Intake() {\n motor_0.setInverted(true);\n }",
"public Object setintrate(double rate)\r\n/* */ {\r\n\t\t\t\tlogger.info(count++ + \" About to setintrate : \" + \"Agent\");\r\n/* 67 */ \tthis.intrate = rate;\r\n/* 68 */ \tthis.intratep1 = (this.intrate + 1.0D);\r\n/* 69 */ \treturn this;\r\n/* */ }",
"public ImageResource makeInversion(ImageResource inputImg) {\n // creates the outputImg with same dimensions\n ImageResource outputImg = new ImageResource(inputImg.getWidth(), inputImg.getHeight());\n //for each pixel in outputImg\n for (Pixel pixel : outputImg.pixels()) {\n Pixel inputImgPixel = inputImg.getPixel(pixel.getX(), pixel.getY());\n // r= red g= green b= blue\n int r,g,b;\n r= inputImgPixel.getRed();\n g=inputImgPixel.getGreen();\n b=inputImgPixel.getBlue();\n pixel.setRed(255-r);\n pixel.setGreen(255-g);\n pixel.setBlue(255-b);\n }\n return outputImg;\n }",
"public InputInteractions getInIn() {\r\n\t\t// restituisce le interazioni di input\r\n\t\treturn this.InIn;\r\n\t}",
"private Infer() {\n\n }",
"public Intake() {\n\n }",
"@Override\n public Dice upView() {\n char[] newSides = this.sides.clone();\n newSides[0] = this.sides[3];\n newSides[1] = this.sides[0];\n newSides[3] = this.sides[5];\n newSides[5] = this.sides[1];\n return new Dice(newSides);\n }",
"MeterProvider create();",
"public Thermometer(Person person){\r\n super(person);\r\n temperature = new MeasureUnit(\"Celsius\",\"º C\", 1);\r\n }",
"public Unit (java.lang.Integer unitId) {\n\t\tsuper(unitId);\n\t}",
"public interface IInventoryObject extends IID\n{\n}",
"public interface IwInput extends IwNode {\r\n\tIwCustomizableNode getIwInputProcessingNode();\r\n\tvoid setIwInputProcessingNode(IwCustomizableNode iwInputProcessingNode);\r\n\tvoid explore(IwStep currentStep);\r\n\t\r\n\tram.Class getRamInputData();\r\n\tvoid setRamInputData(ram.Class ramInputData);\r\n}",
"public InCellReader() { super(\"InCell 1000\", \"xdce\"); }",
"public JumpIN() {\r\n\t\tthis.scanner = new Scanner(System.in);\r\n\t\tthis.parser = new Parser();\r\n\r\n\t\t// Defaulting to level 1 for now\r\n\t\tboard = new Board(2);\r\n\t}",
"public EngineClass(EngineClass inEngine)\n {\n cyl = inEngine.getCyl();\n fuel = inEngine.getFuel();\n }",
"public static DrawInstruction read(DataInputStream in) throws IOException\n {\n DrawInstruction di = new DrawInstruction(\n Image.read(in),\n in.readFloat(),\n in.readFloat(),\n in.readFloat(),\n in.readFloat(),\n in.readFloat()\n );\n return di;\n }",
"public HSIImage(HSIImage otherImage)\r\n {\r\n\thue = MatrixTools.copy(otherImage.hue);\r\n\tsaturation = MatrixTools.copy(otherImage.saturation);\r\n\tintensity = MatrixTools.copy(otherImage.intensity);\r\n }",
"public static Image returnImage (InputStream in){\n InputStream stream = in;\n return new Image(stream);\n }",
"public <E extends IETeam> E into(E into);",
"public void setInIn(InputInteractions inIn) {\r\n\t\t// assegna le interazioni di input\r\n\t\tthis.InIn = inIn;\r\n\t}",
"Unit getUnit();",
"public In(){\n\t\tscanner=new Scanner(new BufferedInputStream(System.in),CHARSET_NAME);\n\t\tscanner.useLocale(LOCALE);\n\t}",
"public static RadianceIcon of(int width, int height) {\n ext_h base = new ext_h();\n base.width = width;\n base.height = height;\n return base;\n }",
"public ElasticInteger(int valueAtStart, long duration, Easing easing) {\n super(valueAtStart, duration, easing);\n }",
"public ObixDecoder(InputStream in)\n throws Exception\n { \n super(in);\n }",
"public BigDecimal getIstrue() {\n return istrue;\n }"
]
| [
"0.553828",
"0.53715706",
"0.5352397",
"0.5221849",
"0.5122267",
"0.5039355",
"0.5039355",
"0.50262326",
"0.5026143",
"0.50246125",
"0.4920937",
"0.48731223",
"0.4862724",
"0.48574477",
"0.4847598",
"0.4803238",
"0.48008704",
"0.47957078",
"0.47828373",
"0.47769958",
"0.47753412",
"0.4770154",
"0.4761224",
"0.4746681",
"0.47356614",
"0.472041",
"0.47019646",
"0.4680307",
"0.46729642",
"0.46576625",
"0.4647117",
"0.4636734",
"0.46161228",
"0.4596613",
"0.4592353",
"0.45911917",
"0.4583864",
"0.45825893",
"0.4570665",
"0.45665857",
"0.4565628",
"0.45655087",
"0.45617464",
"0.4554552",
"0.45410335",
"0.4539991",
"0.45335642",
"0.45310143",
"0.45199716",
"0.4514814",
"0.45048526",
"0.45035163",
"0.45034677",
"0.45028615",
"0.44970587",
"0.44911966",
"0.44876814",
"0.4487458",
"0.44842404",
"0.44810173",
"0.44767234",
"0.44677904",
"0.44614133",
"0.44518992",
"0.44475013",
"0.4441034",
"0.4440936",
"0.44368437",
"0.443663",
"0.44327304",
"0.44319522",
"0.44291818",
"0.44280878",
"0.44259667",
"0.442005",
"0.44161507",
"0.44155335",
"0.4410932",
"0.44106695",
"0.4404065",
"0.44034556",
"0.440098",
"0.4394882",
"0.43946218",
"0.4393769",
"0.43922454",
"0.4386195",
"0.4384915",
"0.43831745",
"0.4372547",
"0.43707433",
"0.43673682",
"0.43660566",
"0.43648815",
"0.43592423",
"0.4356926",
"0.43565476",
"0.43562365",
"0.4354793",
"0.43481973"
]
| 0.8358771 | 0 |
Returns a new object of class 'Yard'. | Yard createYard(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic IProduct factoryMethod() {\n\t\treturn new Toy();\n\t}",
"public Shoe makeShoe() {\n\treturn new Shoe();\r\n}",
"@Override\n\tDough createDought() {\n\t\treturn new NYDough();\n\t}",
"RentalObject createRentalObject();",
"private BsTestY createY(String yAttr) {\n TestYDelegate delegate = Memcached_testDelegateFactory.getTestYDelegate();\n BigInteger testYId = null;\n BsTestY y = delegate.createTestY(testYId, yAttr);\n List<BsTestY> list = new ArrayList<BsTestY>(1);\n list.add(y);\n delegate.insert(list);\n return y;\n }",
"public static void createArmy() {\n Unit unitOne = new Unit(\"Unit One\");\n Unit unitTwo = new Unit(\"Unit Two\");\n Unit unitThree = new Unit(\"Unit Three\");\n Unit unitFour = new Unit(\"Unit Four\");\n Unit unitFive = new Unit(\"Unit Five\");\n\n Knight knightOne = new Knight(\"Knight One\");\n Knight knightTwo = new Knight(\"Knight Two\");\n Knight knightThree = new Knight(\"Knight Three\");\n\n General general = new General(\"General\");\n Doctor doctor = new Doctor(\"Doctor\");\n }",
"public static Movie getJokerMovieObject(){\n Movie j = new Movie(\"Joker\", 2.5, \"Drama\");\n return j;\n }",
"public Toy orderToy(String toy){\n\t\t\r\n\t\tswitch(toy) {\r\n\t\tcase \"doll\":\r\n\t\t\treturn new Doll();\r\n\t\tcase \"car\":\r\n\t\t\treturn new Car();\r\n\t\tcase \"rattle\":\r\n\t\t\treturn new Rattle();\r\n\t\t}\r\n\t\t\r\n\t\treturn null;\r\n\t\t\r\n\t}",
"public Command createInstance() {\n\t\t\n\t\tif(name == \"Direction\")\n\t\t\treturn new Direction();\n\t\t\n\t\tif(name == \"Gear\")\n\t\t\treturn new Gear();\n\t\t\n\t\tif(name == \"Pause\")\n\t\t\treturn new Pause();\n\t\t\n\t\treturn null;\n\t\t\n\t}",
"DescribedClass createDescribedClass();",
"public Builder yhid(String yhid) {\n obj.setYhid(yhid);\n return this;\n }",
"public Fish create(){\n\t\tMovementStyle style = new NoMovement();\n\t\treturn new Shark(style);\n\t}",
"Quote createQuote();",
"public a mo8520o() {\n return new a();\n }",
"@Override\r\n\tpublic Explore getNewInstance() {\n\t\treturn new ZYDCExplore();\r\n\t}",
"@Override\n\tpublic Army getArmy() {\n\t\treturn new IndianArmy();\n\t}",
"public TemSourceAccountingLine createNewAdvanceAccountingLine() {\n try {\n TemSourceAccountingLine accountingLine = getAdvanceAccountingLineClass().newInstance();\n accountingLine.setFinancialDocumentLineTypeCode(TemConstants.TRAVEL_ADVANCE_ACCOUNTING_LINE_TYPE_CODE);\n accountingLine.setCardType(TemConstants.ADVANCE); // really, card type is ignored but it is validated so we have to set something\n accountingLine.setFinancialObjectCode(this.getParameterService().getParameterValueAsString(TravelAuthorizationDocument.class, TemConstants.TravelAuthorizationParameters.TRAVEL_ADVANCE_OBJECT_CODE, KFSConstants.EMPTY_STRING));\n return accountingLine;\n }\n catch (IllegalAccessException iae) {\n throw new RuntimeException(\"unable to create a new source accounting line for advances\", iae);\n }\n catch (InstantiationException ie) {\n throw new RuntimeException(\"unable to create a new source accounting line for advances\", ie);\n }\n }",
"Oracion createOracion();",
"OBJECT createOBJECT();",
"public Lexicon lex()\n/* */ {\n/* 505 */ return new BaseLexicon();\n/* */ }",
"public ShearY() {\n this(0);\n }",
"public StShhnKnyMs newEntity() { return new StShhnKnyMs(); }",
"Noodle orderBeefNoodle() {\n Noodle noodle =\n new Noodle(); // for flexibility, we really want this to be an abstract class or interface, but we can't directly instantiate either of those.\n\n noodle.prepare();\n noodle.make();\n noodle.cook();\n noodle.fill();\n return noodle;\n }",
"public IResourceDepot createResourceDepot() {\n\n /*\n * Defining a ResourceDepot \"JackTruckDepot\" that can store DeliverGood and PickupGood.\n *\n */\n\n // We can store a maximum of 10 DeliverGood on our track (assuming that no other load is\n // present)\n // Further, we start with an initial load of 5 DeliverGoods.\n ILoadCapacity deliverGoodCapacity = new SimpleLoadCapacity(\"DeliverGood\", 10, 5);\n\n // We can store a maximum of 5 PickupGood on our track (assuming that no other load is present)\n ILoadCapacity pickupGoodCapacity = new SimpleLoadCapacity(\"PickupGood\", 5, 0);\n\n // Our depot can store a maximum of 10 total items. For example, 7 DeliverGoods\n // and 3 PickupGoods.\n IResourceDepot depot = new SimpleResourceDepot(\"JackTruckDepot\", 10);\n\n // Adding the capacities to our depot\n depot.add(deliverGoodCapacity);\n depot.add(pickupGoodCapacity);\n\n return depot;\n }",
"public Idea create() {\n \t\t\tIdea idea = new Idea();\n \n \t\t\treturn idea;\n \t\t}",
"static Yarn create(String fiber, String color, int yards) {\n return new Yarn(fiber, color, yards);\n }",
"static Football getFootBall(){\n return new Football();\n }",
"public Card() { this(12, 3); }",
"public Deck()\n {\n this(1);\n }",
"public @NotNull Bidder newBidder();",
"Make createMake();",
"Clase createClase();",
"private Operation creator(Scope scope, Vector queue)\r\n {\r\n Operation root = null;\r\n Type t = new Type();\r\n\r\n if ((t.type = basicType()) != Keyword.NONESY)\r\n {\r\n root = arrayCreatorRest(t, scope, queue);\r\n }\r\n else\r\n {\r\n Token x = nextToken;\r\n\r\n t.ident = new Token(nextToken);\r\n t.ident.string = x.string = qualident();\r\n unresolved.add(x.string);\r\n\r\n if (nextSymbol == Keyword.LBRACKETSY)\r\n {\r\n root = arrayCreatorRest(t, scope, queue);\r\n }\r\n else\r\n {\r\n root = classCreatorRest(x, scope, queue);\r\n }\r\n }\r\n\r\n return root;\r\n }",
"public WOComponent newDirector() {\n EOEditingContext ec = ERXEC.newEditingContext();\n EOEnterpriseObject director = ERXEOControlUtilities.createAndInsertObject(ec, \"Talent\");\n \n // Let's throw to a regular edit page\n EditPageInterface epi = (EditPageInterface)D2W.factory().pageForConfigurationNamed(\"EditTalent\", session());\n epi.setObject(director);\n epi.setNextPageDelegate(new CreateDirectorDelegate(movie(), context().page()));\n return (WOComponent)epi;\n }",
"QuoteTerm createQuoteTerm();",
"public Bike createCityBike() {\n Wheels cityWheels = new Wheels(559,50f,10000); //Räder des Stadtrads erstellen\n Gears cityGears = new Gears(3,1,5000); //Gangschaltung des Stadtrads erstellen\n Bike newCityBike = new Bike(cityGears, cityWheels, \"Stahl\", \"CB105\", true, true, 30000); //Stadtrad erstellen\n return newCityBike; //Stadtrad zurückgeben\n}",
"public CMObject newInstance();",
"public BaseballCard(){\r\n\r\n\t}",
"public Armor() {\n super();\n}",
"public Builder() {\n this.obj = new Yhzh();\n }",
"public LaundryCard() {\n\t}",
"public YardCalculator(double length, double width)\n {\n this.length = length * METERS_PER_FOOT;\n this.width = width * METERS_PER_FOOT;\n \n }",
"Hurt createHurt();",
"protected Basket makeBasket() {\n\t\treturn new Basket();\n\t}",
"public Spell() {}",
"@Override\n public ArbolSplay<T> clonar(){\n ArbolSplay<T> t=new ArbolSplay<T>();\n t.setRaiz(clonarAS(this.getRaiz()));\n return(t);\n }",
"DsmlClass createDsmlClass();",
"private DarthSidious(){\n }",
"Notentyp createNotentyp();",
"QuoteType createQuoteType();",
"public godot.wire.Wire.Vector2.Builder getYBuilder() {\n \n onChanged();\n return getYFieldBuilder().getBuilder();\n }",
"@Override\n public Animal createAnimal() {\n return new Monkey();\n }",
"public LyricAnswer() {\n }",
"@Override\n\tpublic Maze MakeMaze() {\n\t\treturn new Maze();\t\n\t}",
"public void make();",
"Class createClass();",
"TypedObjectDecl createTypedObjectDecl();",
"QuoteNote createQuoteNote();",
"public Card () {}",
"QuoteAttribute createQuoteAttribute();",
"public ObjectFactory() {\n super(grammarInfo);\n }",
"public Sandwich getSandwich(){\n return new Sandwich();\n }",
"@Override\n public Room makeRoom() {\n return new MagicRoom();\n }",
"DeclRule createDeclRule();",
"public TestObject createObject() {\n String word;\n Scanner scanner = new Scanner(System.in);\n System.out.println(\"Enter a word to send to the server: \");\n word = scanner.nextLine();\n\n TestObject testObject = new TestObject(word);\n scanner.close();\n return testObject;\n }",
"public Mage(String name){\n this.name = name; //Set the name of the new mage to the supplied String parameter \"name\"\n this.className = \"Mage\"; //All mages are of the class Mage\n this.sex = \"F\"; //New mages are created as female by default\n this.health = 100; //New mages are created with 100 health\n this.mana = 100; //New mages are created with 100 mana\n this.spells = new ArrayList<Spell>(); //For now, an empty list of spells.\n this.fireball = new Spell(); //All spells are fireballs for now.\n }",
"public Card()\n {}",
"@Override\n public Card generateCard() {\n Card card = new Card(\n \"Minotaur\",\n \"Bull-headed Monster\",\n \"Your Move: Your Worker may move into an opponent Worker’s space \" +\n \"\\n(using normal movement rules), if the next space in the same direction is \" +\n \"\\nunoccupied. Their Worker is forced into that space (regardless of its level).\",\n 1,\n false,\n this\n );\n this.card = card;\n return card;\n }",
"public static addbooks newInstance() {\n return new addbooks();\n }",
"public Deck() {\n generateDeckOfCards();\n }",
"@Override\n\tpublic LightTank create() {\n\t\treturn new LightTank(GameContext.getGameContext());\n\t}",
"public Dynamics newDynamics(ComponentType ct) {\n\t\tDynamics ret = new Dynamics(ct);\n\t\treturn ret;\n\t}",
"public EspressoDrink(){\t\n\t}",
"public Guide create() {\n\t\tfinal Guide res = super.create(Guide.class);\n\n\t\tres.setIncidents(new HashSet<Incident>());\n\t\tres.setExhibitions(new HashSet<Exhibition>());\n\n\t\treturn res;\n\t}",
"QuoteItem createQuoteItem();",
"private Node getAndy() {\n Node base = new Node();\n base.setRenderable(andyRenderable);\n Context c = this;\n base.setOnTapListener((v, event) -> {\n Toast.makeText(\n c, \"Andy touched.\", Toast.LENGTH_LONG)\n .show();\n });\n return base;\n }",
"public Wine(long _id, String name, Date year, String producer, String techNotes, List<Vineyard> vineyards) {\r\n this._id = _id;\r\n this.name = name;\r\n this.year = year;\r\n this.producer = producer;\r\n this.techNotes = techNotes;\r\n }",
"public Hand() {\n }",
"public Card build() {\n return new Card(frontFace, backFace);\n }",
"public Loyalty() {}",
"public static Twitter createTwitterObject() {\n\t\tOAuth2Token token = createFactory();\n\t\tConfigurationBuilder cb = new ConfigurationBuilder();\n\n\t\tcb.setApplicationOnlyAuthEnabled(true);\n\t\tcb.setOAuthConsumerKey(Secret.cKey);\n\t\tcb.setOAuthConsumerSecret(Secret.cSecret);\n\t\tcb.setOAuth2TokenType(token.getTokenType());\n\t\tcb.setOAuth2AccessToken(token.getAccessToken());\n\n\t\tTwitter twitter = new TwitterFactory(cb.build()).getInstance();\n\t\t\n\t\treturn twitter;\n }",
"Lehrkraft createLehrkraft();",
"Thing createThing();",
"@Override\r\n\tprotected Keywords getNewObject() {\n\t\treturn null;\r\n\t}",
"T create();",
"T create();",
"public void createDeck(){\n //Does nothing because it will be overridden in the child classes.\n }",
"@Override\n\tpublic Airport createNew()\n\t{\n\t\treturn new Airport();\n\t}",
"public MageTowerCard() {\n\t\tsuper(cardName, cardId, cardCost);\n\t}",
"QuoteRole createQuoteRole();",
"ZenModel createZenModel();",
"Rental createRental();",
"public Grammar() {\n }",
"private Movie createNewMovie(String movieName, String directorName, String act1, String act2, String act3, int star)\n {\n Movie clip = new Movie(movieName, directorName, act1, act2, act3, star);\n return clip;\n }",
"public de.uni_koblenz.jgralabtest.schemas.gretl.pddsl.Card createCard();",
"AxiomDeclRule createAxiomDeclRule();",
"InstanceDecl createInstanceDecl();",
"protected abstract AbstractExtendedDepictor createExtendedDepictor();",
"public KnowledgeBase newKnowledgeBase() {\n KnowledgeBuilder knowledgeBuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();\n knowledgeBuilder.add(ResourceFactory.newClassPathResource(\"WidgetsAndGadgets.bpmn\"), ResourceType.BPMN2);\n\n KnowledgeBase knowledgeBase = knowledgeBuilder.newKnowledgeBase();\n return knowledgeBase;\n }",
"public LoyaltyCard(String theTitle, String theFirstName, \r\n String theLastName, String street, \r\n String town, String postcode, \r\n String theCardNumber)\r\n {\r\n title = theTitle; \r\n firstName = theFirstName;\r\n lastName = theLastName;\r\n address = new LoyaltyCardAddress(street, town, postcode);\r\n cardNumber = theCardNumber;\r\n points = 0;\r\n }"
]
| [
"0.5815547",
"0.5685635",
"0.55474526",
"0.5489201",
"0.54487586",
"0.543521",
"0.54169065",
"0.53926563",
"0.53696185",
"0.5329518",
"0.5305515",
"0.52988034",
"0.524067",
"0.5161002",
"0.5137787",
"0.5133488",
"0.5120971",
"0.5102258",
"0.5100365",
"0.50885206",
"0.5076646",
"0.50500506",
"0.50451785",
"0.50416046",
"0.50359935",
"0.50355625",
"0.50338507",
"0.5027823",
"0.5020044",
"0.5005756",
"0.5004713",
"0.5000854",
"0.49931544",
"0.4990996",
"0.49867538",
"0.49866968",
"0.49770024",
"0.49684027",
"0.49655414",
"0.49628294",
"0.4951791",
"0.49511626",
"0.4939348",
"0.49390143",
"0.49377185",
"0.49309716",
"0.4924356",
"0.49138436",
"0.49106112",
"0.48835048",
"0.48736218",
"0.48676094",
"0.48523042",
"0.48446867",
"0.4828767",
"0.48170304",
"0.48166043",
"0.48158947",
"0.48046455",
"0.48009908",
"0.47987705",
"0.4795194",
"0.4792221",
"0.47905126",
"0.47881314",
"0.47814804",
"0.47800007",
"0.47756845",
"0.47752362",
"0.4765502",
"0.475745",
"0.47564688",
"0.47501427",
"0.4744491",
"0.47414485",
"0.4736147",
"0.47345722",
"0.47345397",
"0.4730882",
"0.47249955",
"0.47249246",
"0.47205424",
"0.47197556",
"0.47196755",
"0.47077972",
"0.47077972",
"0.4706444",
"0.4698061",
"0.46940142",
"0.46932378",
"0.4692256",
"0.46865967",
"0.46662495",
"0.46637857",
"0.46630684",
"0.4661443",
"0.4660853",
"0.4660033",
"0.4660001",
"0.46552813"
]
| 0.8431612 | 0 |
Returns a new object of class 'Radian'. | Radian createRadian(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Unit<Angle> radian() {return radian;}",
"public Rational() {\n\t\tthis(1,1);\n\t}",
"public Circulo (double r) {\n radio = r;\n }",
"public Circle(double r)\n {\n setRad(r);\n\n }",
"public Circle(double radio) {\n\n super(\"circle\");\n this.radio=radio;\n }",
"public String getRad() {\n\t\treturn rad;\r\n\t}",
"void getRadiationlevel();",
"public Rational(int a)\n {\n this(a,1);\n }",
"public Rational() {\n\tnumerator = 0;\n\tdenominator = 1;\n }",
"public static edu.pa.Rat.Builder newBuilder() {\n return new edu.pa.Rat.Builder();\n }",
"public L1513_Rational() {\n\t this(0, 1);\n\t }",
"public abstract float getRadius();",
"public abstract float getRadius();",
"public T setRadius(float radius) {\n if (radius <= 0) {\n throw new IllegalArgumentException(\"radius must be greater than 0\");\n }\n this.radius = radius;\n return self();\n }",
"public float getRad() {\n\t\treturn rad;\n\t}",
"public double getRadius(){\n return r;\n }",
"public RadioButtons()\n {\n }",
"RentalObject createRentalObject();",
"public Rational()\n\t{\n\t\tthis.setNumer(0);\n\t\tthis.setDenom(0);\n\t}",
"public Builder setRadius(int value) {\n bitField0_ |= 0x00000004;\n radius_ = value;\n onChanged();\n return this;\n }",
"public Color getRadColor() {\n return radColor;\n }",
"double getRadius();",
"public double getRadius() { return radius; }",
"public double getRadius(){return radius;}",
"public int getRadius() { return radius; }",
"public double getRadius(){\n return radius;\n }",
"public RegionCreator radius(int radius)\n\t{\n\t\tthis.radius = radius;\n\t\treturn this;\n\t}",
"public PaxosRound createRound()\n {\n return createRound(0);\n }",
"public void setRadius(int radius);",
"public interface CircleRadiusSetViolated\r\n{\r\n void setRadius(int rad);\r\n int getRadius();\r\n}",
"public static Matrix4rad newReadOnly() {\r\n\t\treturn (new Matrix4rad(true));\r\n\t}",
"public static edu.pa.Rat.Builder newBuilder(edu.pa.Rat other) {\n return new edu.pa.Rat.Builder(other);\n }",
"public Circle() {\n\t\tr=0.0; //by defalut set radius to something so we have a circle \n\t}",
"SimpleCircle() {\n\t\tradius=1;\n\t}",
"@Override\n public ArbolSplay<T> clonar(){\n ArbolSplay<T> t=new ArbolSplay<T>();\n t.setRaiz(clonarAS(this.getRaiz()));\n return(t);\n }",
"public double getRadius() {\n return radius; \n }",
"public RadioModel(Operation operation) {\n this.operation = operation;\n }",
"public Circle(double r)\r\n\t{\r\n\t\tradius=r;\r\n\t}",
"SimpleCircle() {\n\t\tradius = 1;\n\t}",
"private JSpinner getRadialBufferSpinner() {\n\t\tif (radialBufferSpinner == null) {\n\t\t\tInteger one = new Integer(1);\n\t\t\tInteger two = new Integer(2);\n\t\t\tInteger three = new Integer(3);\n\t\t\tSpinnerListModel listModel = new SpinnerListModel(new Integer[] {\n\t\t\t\t\tone, two, three });\n\t\t\tradialBufferSpinner = new JSpinner(listModel);\n\t\t\tradialBufferSpinner.setBounds(new java.awt.Rectangle(298, 3, 137,\n\t\t\t\t\t19));\n\n\t\t\t// Disable keyboard edits in the spinner\n\t\t\tJFormattedTextField tf = ((JSpinner.DefaultEditor) radialBufferSpinner\n\t\t\t\t\t.getEditor()).getTextField();\n\t\t\ttf.setEditable(false);\n\t\t\ttf.setBackground(Color.white);\n\t\t}\n\t\treturn radialBufferSpinner;\n\t}",
"public Unit<Angle> microradian() {return microradian;}",
"public interface IRadius {\r\n IPrecipitationLevel radius(Double radius);\r\n}",
"public double getRadius(){\r\n return radius;\r\n }",
"public double getRadius()\r\n {\r\n return radius;\r\n }",
"AngleSmaller createAngleSmaller();",
"public double getRadius() {\n return radius;\n }",
"SimpleCircle(double newRadius){\n\t\tradius=newRadius;\n\t}",
"public double getRadio() {\n return radio;\n }",
"public double getRadio() {\n return radio;\n }",
"public Fraction reciprocal()\n {\n int newNumerator = this.getDenominator();\n int newDenominator = this.getNumerator();\n Fraction newFraction = new Fraction(newNumerator, newDenominator);\n return newFraction;\n }",
"public Circle() {\n this( 1.0 ); \n }",
"public float getRadius()\n {\n return _radius;\n }",
"public Circle(double radius){\n this.radius = radius;\n }",
"public Cartesiana polar_cartesiano (float radio, float angulo) {\n return new Cartesiana (radio * (float)Math.cos(angulo),radio * (float)Math.sin(angulo)); \n}",
"public Circle() {\n radius = 1.0;\n color = \"red\";\n }",
"public NewtonRaphsonCalibrator()\r\n\t{\r\n\t}",
"public RadialGeometry(Color emissionLight, double radius, Material material) {\n super(emissionLight, material);\n setRadius(radius);\n }",
"int getRadius();",
"public Circle() {\n radius = 1.0;\n color = \"red\";\n }",
"public Matrix4rad() {\r\n\t\tthis(false);\r\n\t}",
"public int getRadius() {\n return radius_;\n }",
"public Circle(int r) {\n\t\tthis.radius = r;\n\t}",
"public Loan() {\n this(2.5, 1, 1000);\n }",
"public float getRadius() {\n return radius;\n }",
"public double getRadius() {\n return radius;\n }",
"public double getRadius() {\n return radius;\n }",
"public double getRadius() {\n return radius;\n }",
"public double getRadius() {\n return radius;\n }",
"public double getRadius() {\n return radius;\n }",
"public double getRadius() {\n return radius;\n }",
"public double getRadius() {\n return radius;\n }",
"public double getRadius() {\n return radius;\n }",
"public double getRadius() {\n return radius;\n }",
"public double getRadius() {\n return radius;\n }",
"@Override\n\tpublic AbstractReine createReine() {\n\t\treturn new ReineSN();\n\t}",
"public Circle(double r) {\n this.r = r;\n }",
"public void setRadius(int r) {\n this.radius = r;\n }",
"public Fraction reciprocal(){\n return new Fraction(this.denominator,this.numerator);\n }",
"public String raiz1 (){\r\n //primero, invocamos el determiante\r\n float det=determinante(); //se asigna al determinante de arriba\r\n String sol=\"raiz 1\"; //la solucion la evuelve como string\r\n if (det<0){\r\n sol=\"Raiz imaginaria\";\r\n }else {\r\n float r1= (float)(-b+ Math.sqrt(det) )/(2*a); \r\n //tambien aplicamos casting pata Math, con (float)\r\n sol=\"Raiz 1: \"+r1; //texto + valor agregado\r\n }\r\n return sol;\r\n \r\n //Uno para R1 y otro para R2 \r\n }",
"public int getRadius() {\n return radius_;\n }",
"public double getRadius(){\n\t\treturn radius;\n\t}",
"public Builder clearRadius() {\n bitField0_ = (bitField0_ & ~0x00000004);\n radius_ = 0;\n onChanged();\n return this;\n }",
"public double getRadius() {\n\t\treturn r;\n\t}",
"public void setRadian(float rad) {\n radian = rad;\n drawMirrorCenter(drawingPad.getTransformedGraphics(), true);\n }",
"public double getRadius()\n {\n return m_Radius;\n }",
"public Rate rate() {\n _initialize();\n return rate;\n }",
"public Double getRadius() {\n return this.radius;\n }",
"public RadialGeometry(Material material,Color emmission,double radius) {\r\n\t\tsuper(material,emmission);\r\n\t\tthis.radius = radius;\r\n\t}",
"public MoodRadioButton(Context context) {\n this(context, null);\n }",
"public static Rubric createRubric(String name, ArrayList<Criterion> criteria) {\n\t\t\n\t\tRubric newRubric = new Rubric(name, criteria); \n\t\t\t\treturn newRubric;\n\t\t\n }",
"RoverValue createRoverValue();",
"public int getRadius() {\n return getType().getClaimableRadius();\n }",
"public int getRadius() {\n return radius;\n }",
"public Corrida(){\n\n }",
"public Circle(){\n\t\t\n\t\tradius = 1.0;\n\t\tcolor =\"Red\";\n\t}",
"@Basic\n\t@Raw\n\tpublic double getRadius() {\n\t\treturn this.radius;\n\t}",
"public void setR( double radius ) {\n if ( radius < -100 ) {\n throw new IllegalArgumentException(\"ERROR: \" + radius + \" is too small for [\" + getType() +\"]\");\n }\n if ( radius > 100 ) {\n throw new IllegalArgumentException(\"ERROR: \" + radius + \" is too large for [\" + getType() +\"]\");\n }\n this.r = radius;\n }",
"@Override\n public Element createDomImpl(Renderable element) {\n InputElement radioInputElement =\n Document.get().createRadioInputElement(\"xx\");\n radioInputElement.setClassName(CheckConstants.css.radio());\n radioInputElement.setTabIndex(0);\n return radioInputElement;\n }",
"public int getRadius_() {\r\n\t\treturn radius_;\r\n\t}",
"public double getRadius()\r\n\t{\r\n\t\treturn radius;\r\n\t}"
]
| [
"0.6686968",
"0.59010863",
"0.5805336",
"0.5758894",
"0.5665627",
"0.5505598",
"0.54832226",
"0.5443281",
"0.5440559",
"0.53856325",
"0.53555775",
"0.53231895",
"0.53231895",
"0.53172046",
"0.5300274",
"0.5267904",
"0.5266316",
"0.52491295",
"0.52187026",
"0.5197017",
"0.5193892",
"0.5192971",
"0.5188316",
"0.5185192",
"0.51567197",
"0.51536804",
"0.5139618",
"0.5139048",
"0.5137133",
"0.5136775",
"0.5127536",
"0.51191676",
"0.5104741",
"0.51044494",
"0.5089055",
"0.5083806",
"0.50817156",
"0.50798905",
"0.507832",
"0.50693107",
"0.5067937",
"0.50650424",
"0.5062642",
"0.5056467",
"0.50545335",
"0.5024943",
"0.5021086",
"0.50180155",
"0.50180155",
"0.5016135",
"0.50116324",
"0.50080013",
"0.50029844",
"0.49989152",
"0.49915037",
"0.49850765",
"0.49810445",
"0.4978234",
"0.49774987",
"0.49757037",
"0.49692813",
"0.49678752",
"0.49670893",
"0.4963181",
"0.4958239",
"0.4958239",
"0.4958239",
"0.4958239",
"0.4958239",
"0.4958239",
"0.4958239",
"0.4958239",
"0.4958239",
"0.4958239",
"0.4952662",
"0.49480578",
"0.49457884",
"0.4941138",
"0.4935588",
"0.49316093",
"0.4923595",
"0.49234474",
"0.49185002",
"0.49168321",
"0.49145362",
"0.49116406",
"0.49101537",
"0.49078166",
"0.49078104",
"0.49031815",
"0.49009627",
"0.48910713",
"0.48897702",
"0.48815763",
"0.48814708",
"0.48767263",
"0.48753583",
"0.48750332",
"0.48750094",
"0.48706684"
]
| 0.828057 | 0 |
Returns a new object of class 'Degree'. | Degree createDegree(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Degree() {\n\t\tsuper();\n\t}",
"public Builder setDegree(int value) {\n \n degree_ = value;\n onChanged();\n return this;\n }",
"int getDegree();",
"int getDegree();",
"public static Degree360 valueOf(Degree180 degree){\n\t\t\treturn new Degree360(degree.getDouble());\r\n\t}",
"public void setDegree(int degree);",
"public double getDegree() {\n return degree;\n }",
"public int getDegree(){\n return degree;\n }",
"@Override\n\t\tpublic int getDegree() {\n\t\t\treturn 0;\n\t\t}",
"public int getDegree() {\n return degree_;\n }",
"public int getDegree() {\n return degree_;\n }",
"public int getDegree()\r\n\t{\r\n\t\treturn degree;\r\n\t}",
"public void setDegree(int value) {\n\t\t\t\tthis.degree = value;\n\t\t\t}",
"public int getDegree() {\r\n\t\treturn this.degree;\r\n\t}",
"public int getDegree() {\n\t\treturn degree;\n\t}",
"public int getDegree() {\n\t\t\t\treturn degree;\n\t\t\t}",
"public static AngularVelocity newDegreePerSecondValue()\n\t{\n\t\treturn new AngularVelocity(0.0, AngularVelocityUnit.DEGREES_PER_SEC);\n\t}",
"public Degree getDegreeProgram()\n {\n return this.degree;\n }",
"public double getDegreeNum() {\r\n return degreeNum;\r\n }",
"public void setDegree(String degree) {\r\n\t\tthis.degree = degree;\r\n\t}",
"Angle createAngle();",
"public Polynomial() {\n degree = 0;\n }",
"public Builder clearDegree() {\n \n degree_ = 0;\n onChanged();\n return this;\n }",
"public String getDegreeType() {\n\t\treturn degreeType;\n\t}",
"public Position(double degrees, GeoOrientation o){\n this.degrees = degrees;\n orientation = o;\n }",
"public Direction(int degrees)\n {\n dirInDegrees = degrees % FULL_CIRCLE;\n if ( dirInDegrees < 0 )\n dirInDegrees += FULL_CIRCLE;\n }",
"public int getDegree(int v);",
"public static Angle fromDegrees(double degrees) {\n Angle angle = new Angle(degrees);\n return angle;\n }",
"public int getInDegree() {\n\t\treturn inDegree;\n\t}",
"public String getDegreeName_() {\n return degreeName_;\n }",
"public String getDegreeName() {\n\t\treturn degreeName;\n\t}",
"public static AngularVelocity newDegreePerSecondValue(Double new_val)\n\t{\n\t\treturn new AngularVelocity(new_val, AngularVelocityUnit.DEGREES_PER_SEC);\n\t}",
"java.lang.String getDegreeName();",
"public int getDegree() {\n this.polySolve();\n return this.degree;\n }",
"public Builder clearDegreeName() {\n \n degreeName_ = getDefaultInstance().getDegreeName();\n onChanged();\n return this;\n }",
"abstract int degree(int i);",
"public Degree360 add(Degree360 degree){\n\t\treturn Degree360.valueOf(this.getDouble() + degree.getDouble());\r\n\t}",
"public Builder setDegreeName(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n degreeName_ = value;\n onChanged();\n return this;\n }",
"protected void setDegreeProgram(Degree deg)\n {\n this.degree = deg;\n }",
"@Override\n\t\tpublic int getDegree(Direction direction) {\n\t\t\treturn 0;\n\t\t}",
"public void setDegreeSought(Degree d) {\r\n degreeSought = d;\r\n }",
"private void setDegreeNum(double deg) {\r\n degreeNum = deg % 360.0;\r\n }",
"Gradian createGradian();",
"@SuppressWarnings(\"unchecked\")\n public GrafoDirigido(int numVertices) {\n numV = numVertices; \n numA = 0;\n elArray = new ListaConPI[numVertices]; \n for (int i = 0; i < numV; i++) {\n elArray[i] = new LEGListaConPI<Adyacente>();\n }\n }",
"public grade(){}",
"public Clade() {}",
"EDataType getAngleDegrees();",
"Determinante createDeterminante();",
"public int updateDegree(){\r\n \r\n \tthis.degree = this.degree + this.rotSpeed;\r\n \tif (this.degree > 359) this.degree = 0;\r\n \t\r\n return this.degree;\r\n }",
"int getStartRotationDegree();",
"@Override\n\t\tpublic int getDegree(RelationshipType type, Direction direction) {\n\t\t\treturn 0;\n\t\t}",
"public java.lang.String getDegreeName() {\n java.lang.Object ref = degreeName_;\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 degreeName_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"@Override\n\t\tpublic int getDegree(RelationshipType type) {\n\t\t\treturn 0;\n\t\t}",
"public Education() {}",
"public Dynamics newDynamics(ComponentType ct) {\n\t\tDynamics ret = new Dynamics(ct);\n\t\treturn ret;\n\t}",
"public int getDegree(V vertex);",
"public java.lang.String getDegreeName() {\n java.lang.Object ref = degreeName_;\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 degreeName_ = s;\n return s;\n }\n }",
"public EvaluationsDegree findByPrimaryKey(int evaluationsDegreeId) throws EvaluationsDegreeDaoException;",
"public void setDegreeName(String degreeName) {\n\t\tthis.degreeName = degreeName;\n\t}",
"public boolean isDegreeRequired ()\r\n {\r\n return degreeRequired;\r\n }",
"public void incrementInDegree() {\n\t\tthis.inDegree++;\n\t}",
"public int getDegreesOfFreedom() {return nu;}",
"public Department(){}",
"public Loan() {\n this(2.5, 1, 1000);\n }",
"public void setDegreeType(String degreeType) {\n\t\tthis.degreeType = degreeType;\n\t}",
"public double getPolynomialDegree() {\n\treturn this.polyDegree;\n }",
"public Course() {}",
"AngleAdd createAngleAdd();",
"@Override\r\n public int getDegree() {\r\n return head.getDegree();\r\n }",
"public RotationComponent fromRadians(float radians) {\n\trotation = radians * MathUtils.radiansToDegrees;\n\n\treturn this;\n }",
"int getDegree(V v);",
"public int outDegree(Position vp) throws InvalidPositionException;",
"public void setDegrees(double degrees) {\n this.degrees = degrees;\n }",
"public Builder setDegreeNameBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n degreeName_ = value;\n onChanged();\n return this;\n }",
"public double degrees() {\n return this.degrees;\n }",
"public void setPolynomialDegree(double polyDegree) {\n\tthis.polyDegree = polyDegree;\n }",
"Elevage createElevage();",
"public Degree(String nameParam, String typeParam, String yearParam, String courseListParam, String commentParam) {\n degreeName_ = nameParam;\n degreeType_ = typeParam;\n catalogYear_ = yearParam;\n comment_ = commentParam;\n\n courseList_ = new TreeSet<>();\n Scanner sc = new Scanner(courseListParam);\n while (sc.hasNext()) {\n courseList_.add(sc.next());\n }\n }",
"public com.google.protobuf.ByteString\n getDegreeNameBytes() {\n java.lang.Object ref = degreeName_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n degreeName_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public int getDegree () {\n int size = myCoefficients.size();\n if (size <= 0) {\n return -1;\n }\n else {\n return size - 1;\n }\n }",
"Fraction () {\n this (0, 1);\n }",
"public void setDirection(float directionDegree);",
"public int getDegree() {\n return coefs.length - 1;\n }",
"AngleSmaller createAngleSmaller();",
"public Course() {\n\n\t}",
"public Comercial(String nombre ,int edad,double salario,double comision){\r\n\t\tsuper(nombre,edad,salario);\r\n\t\tthis.Comision=comision;\r\n\t}",
"public Cylinder() {\n\t\tthis(1.0);\n\t}",
"public EvaluationsDegree findByPrimaryKey(EvaluationsDegreePk pk) throws EvaluationsDegreeDaoException;",
"public com.google.protobuf.ByteString\n getDegreeNameBytes() {\n java.lang.Object ref = degreeName_;\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 degreeName_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"protected void setDegreesOfFreedom(int degrees) {\n\tnu = degrees;\n }",
"private void degrees() {\n\t\tnodesWithDegree = new TreeMap<Integer, IntOpenHashSet>();\n\n\t\t// fill the HashMap nodesWithDegree\n\t\tfor (Sommet entry : adjVertices) {\n\n\t\t\tif (entry == null)\n\t\t\t\tcontinue;\n\n\t\t\tint size = entry.listeAdjacence.size();\n\n\t\t\tif (nodesWithDegree.containsKey(size)) {\n\t\t\t\tnodesWithDegree.get(size).add(entry.numSommet);\n\t\t\t} else {\n\t\t\t\tIntOpenHashSet temp = new IntOpenHashSet();\n\t\t\t\ttemp.add(entry.numSommet);\n\t\t\t\tnodesWithDegree.put(size, temp);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"end of degree method\");\n\t}",
"public StudentFee() {\n }",
"public Direction()\n {\n dirInDegrees = 0; // default to North\n }",
"public Loyalty() {}",
"int getIndegree() {\n return indegree;\n }",
"public Course (double creditHours) {\r\n\t\tname = \"A New Course\";\r\n\t\tnumGrade = 0;\r\n\t\tcredithours = creditHours;\r\n\t\tletterGrade = \"\";\r\n\t}",
"Centimeter createCentimeter();",
"public RotationComponent add(float degrees) {\n\trotation += degrees;\n\n\treturn this;\n }",
"public static Denomination createDenomination(String denomination){\n return new Denomination(denomination);\n }",
"public Circle() {\n this( 1.0 ); \n }"
]
| [
"0.728683",
"0.69182295",
"0.6692215",
"0.6692215",
"0.6616324",
"0.659893",
"0.65489906",
"0.6533173",
"0.64930713",
"0.6480155",
"0.64739054",
"0.64407",
"0.64008135",
"0.63872486",
"0.6364624",
"0.6364309",
"0.60805595",
"0.6052506",
"0.60225165",
"0.60106635",
"0.59984225",
"0.5946384",
"0.59289026",
"0.5910219",
"0.5895206",
"0.58829",
"0.58638954",
"0.5806211",
"0.57043886",
"0.570072",
"0.5647028",
"0.5638994",
"0.562767",
"0.56185716",
"0.5562134",
"0.55518425",
"0.55272996",
"0.5521395",
"0.5515694",
"0.55119586",
"0.5456142",
"0.54337037",
"0.5419387",
"0.5362751",
"0.53617346",
"0.53572106",
"0.5344764",
"0.53402853",
"0.53187037",
"0.53022",
"0.52998745",
"0.5292073",
"0.52894175",
"0.52817136",
"0.52653253",
"0.52464706",
"0.5243554",
"0.52435136",
"0.5231519",
"0.52229923",
"0.52160704",
"0.5182709",
"0.51778245",
"0.5174731",
"0.5173966",
"0.51540995",
"0.5151299",
"0.5130453",
"0.51178277",
"0.51157236",
"0.51061124",
"0.5104042",
"0.5102214",
"0.50999063",
"0.509402",
"0.5087314",
"0.50871974",
"0.50801915",
"0.50715584",
"0.5067909",
"0.5066109",
"0.5059929",
"0.5057212",
"0.50562775",
"0.5050409",
"0.5044057",
"0.5043563",
"0.5038549",
"0.5019473",
"0.50159025",
"0.5012278",
"0.4991421",
"0.49829024",
"0.49780628",
"0.497208",
"0.49661556",
"0.49638057",
"0.49450704",
"0.4939183",
"0.4929997"
]
| 0.86074454 | 0 |
Returns a new object of class 'Turn'. | Turn createTurn(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void createTurn() {\n Turn turn = new Turn(this.getOnlinePlayers());\n this.setCurrentTurn(turn);\n }",
"TurnController createTurnController(PlayerTurn turn);",
"TurnAction createTurnAction();",
"void provideNewTurn();",
"public void myTurn();",
"public Turn newTurn() {\n int newStudentNb = formula.newStudent();\n\n this.updateCurrentEvents();\n this.currentEvents.addAll(EventManager.getEvents());\n this.reloadHires(); // Reload list of professors available for hire\n this.sortProfessors();\n\n Turn turn = new Turn(this.getWeek()+1);\n turn.newStudent = newStudentNb;\n turn.newCash = this.getIncome();\n turn.newMoral = 0;\n turn.events = University.get().getCurrentEvents();\n\n for (Event event : turn.events){\n event.getResult(AnsType.YES).setComputation(eventComputation(event, AnsType.YES));\n if (event.getType() == EventType.TWO_CHOICES){\n event.getResult(AnsType.NO).setComputation(eventComputation(event, AnsType.NO));\n }\n }\n\n // TODO WHEN APPLY\n if (basicData.getMoney()+getIncome() < 0){\n turn.resultTurn = removeBestProfessor();\n }\n return turn;\n }",
"public void newTurn() {\r\n\t\tthis.money = 0;\r\n\t\tthis.blackTurns = 1;\r\n\t\tthis.blueTurns = 0;\r\n\t\tthis.purpleTurns = 0;\r\n\t\tthis.brownTurns = 0;\r\n\t\tthis.redTurns = 0;\r\n\t}",
"Piece turn() {\n return _turn;\n }",
"Piece turn() {\r\n return _turn;\r\n }",
"public void Turn(){\r\n \r\n }",
"@Override\r\n\tpublic void startTurn() {\n\t\t\r\n\t}",
"public void yourTurn();",
"public SetPlayerTurnAction() {}",
"void setTurn(int turn);",
"protected abstract int getTurn();",
"public void beginTurn(){\n }",
"public Player getPlayerInTurn();",
"Side turn() {\n return _turn;\n }",
"int getTurn();",
"public abstract Action takeTurn();",
"public void setTurn(int turn) {\n this.turn = turn; \n }",
"public GameTurn(int playerId) {\n this.playerId = playerId;\n }",
"@Override\n\tpublic void changeTurn() {\n\t\t\n\t}",
"public void newTurn() {\n int[] playersAlive = GameEngine.playersAlive();\n if (playersAlive[0] > 0) {\n turnData.clear();\n Die dice = new Die();\n thrown = dice.main();\n turnOnePlayer();\n\n } else {\n GameEngine.theEnd(playersAlive[1]);\n }\n }",
"public GameTurn(PlayerID player){\n\t\tPreconditions.checkNotNull(player);\n\t\tthis.player = player;\n\t}",
"public void otherTurn\n (String name);",
"public Player whosTurn() {\n return turn;\n }",
"public void playTurn() {\r\n\r\n }",
"public void setTurn(int turn){\n this.turn = turn;\n }",
"public int getTurn() {\n return turn;\n }",
"TurnDegAction createTurnDegAction();",
"static public Tour makeTour() {\r\n Tour t = new Tour();\r\n t.index = null;\r\n return t;\r\n }",
"public Game getNewInstance() {\n try {\n return classObj.newInstance();\n } catch (Exception e) {\n e.printStackTrace();\n throw new RuntimeException(\"Error generating \" + this + \" game\");\n }\n }",
"@Override\n public int turn() {\n return moveOnTurn;\n }",
"public void turn()\n {\n turn(90);\n }",
"public void play(FightTurn turn);",
"public void itsYourTurn();",
"public int getTurn() {\n return this.turn; \n }",
"public int getTurn(){\n return turn;\n }",
"protected abstract void takeTurn(int player);",
"public Game createGame();",
"public Turn(int programLevel, Direction direction)\r\n\t{\r\n\t\tsuper(programLevel);\r\n\t\tthis.direction = direction;\r\n\t}",
"public static Action turn(final int direction) {\n return new Action() {\n @Override\n protected void perform(ActiveActor a) {\n a.setDirection(direction);\n }\n\n @Override\n public int getCost() {\n return 0;\n }\n\n @Override\n public boolean isExclusive() {\n return false;\n }\n\n @Override\n public Object getData() {\n return direction;\n }\n\n @Override\n public String toString() {\n return \"Turn(\" + direction + \")\";\n }\n };\n }",
"public Turn(int sleep) {\n\t\tsuper();\n\t\tthis.turn = 1;\n\t\tthis.step = STEP_VIRUS;\n\t\tthis.sleep = sleep;\n\t}",
"private MyGameState(int[][] board, int turn) {\n this.board = board;\n this.turn = turn;\n }",
"public int getTurn()\n {\n return turn;\n }",
"public PlayerColor turn() {\n return board.getTurn();\n }",
"public Move chooseMove() {\n return new Move();\n }",
"@Override\n public void toTurnPhase() {\n changePhase(new TurnPhase());\n }",
"private int getTurn() {\n\t\treturn turn;\n\t}",
"public Command createInstance() {\n\t\t\n\t\tif(name == \"Direction\")\n\t\t\treturn new Direction();\n\t\t\n\t\tif(name == \"Gear\")\n\t\t\treturn new Gear();\n\t\t\n\t\tif(name == \"Pause\")\n\t\t\treturn new Pause();\n\t\t\n\t\treturn null;\n\t\t\n\t}",
"public int getTurn()\n {\n return m_turn;\n }",
"public int getTurn() {\n\t\treturn turn;\n\t}",
"@Override\n public LocalGame createLocalGame() {\n return new LocalGameActual();\n }",
"public PlayerFighter create(GamePlayer player);",
"public void newGame() {\n\n //reset game board before initializing newgame\n clearGame();\n \n whiteplayer = new Player(\"white\", chessboard, this);\n blackplayer = new Player(\"black\", chessboard, this);\n colorsTurn = \"white\";\n gamelog.logCurrentTurn(colorsTurn);\n\n }",
"public Round createRound(Tournament tournament) {\r\n\t\tRound round = new Round(calculateNextRound(tournament));\r\n\t\tcopyAllTournamentPlayers(tournament, round);\r\n\t\treturn round;\r\n\t}",
"private PlayerType GetPlayerForTurn(int turn) {\n switch ((turn - 1) % 6) {\n case 0:\n case 4:\n case 5:\n return PlayerType.One;\n\n case 1:\n case 2:\n case 3:\n return PlayerType.Two;\n\n default:\n return PlayerType.Empty;\n }\n }",
"public AutoTurnASquare() {\n\n /**\n // Add your commands in the super() call, e.g. super(new FooCommand(), new BarCommand());\n super( new AutoDriveStraightTime(0.45, 2.0).andThen(new WaitCommand(0.4)), // go forward\n new AutoTurnToAngle(-90.0, 0.40).andThen(new WaitCommand(0.4)), // turn right\n new AutoDriveStraightTime(0.45, 2.0).andThen(new WaitCommand(0.4)), // go forward\n new AutoTurnToAngle(-90.0, 0.40).andThen(new WaitCommand(0.4)), // turn right\n new AutoDriveStraightTime(0.45, 2.0).andThen(new WaitCommand(0.4)), // go forward\n new AutoTurnToAngle(-90.0, 0.40).andThen(new WaitCommand(0.4)), // turn right\n new AutoDriveStraightTime(0.45, 2.0) // go forward to starting point\n );\n */\n\n // alternate way to do a square\n for (int i = 0; i < 4; i++) {\n addCommands(new AutoDriveStraightTime(0.45, 2.0).andThen(new WaitCommand(0.4))); // repeat 4 times\n addCommands(new AutoSpinToAngle(-90.0, 0.40).andThen(new WaitCommand(0.4)));\n }\n \n }",
"public Game copy();",
"public boolean isTurn()\n\t{\n\t\treturn isTurn;\n\t}",
"boolean isMyTurn();",
"public GameScreen newGame() {\n gameScreen = new GameScreen(this);\n return gameScreen;\n }",
"public Board twin() {\n exchangeFirstKeys(); // exchange (0,0) with (0,1)\n Board twinBoard = new Board(tiles);\n exchangeFirstKeys(); // roll it back\n return twinBoard;\n }",
"public void changeTurn(){\n // this function is used to calculate the turn of a player after every move is played\n int turn = this.turn;\n turn++;\n this.turn = turn%GameConfiguration.NUMBER_OF_PLAYERS;\n }",
"public MoveType GetMoveTypeForTurn(int turn) {\n switch ((turn - 1) % 6) {\n case 2:\n case 5:\n return MoveType.AllGrow;\n\n case 0:\n case 1:\n case 3:\n case 4:\n default:\n return MoveType.SingleGrow;\n }\n }",
"Player createPlayer();",
"public boolean isTurn() {\n\t\treturn turn;\n\t}",
"public void changeTurn()\r\n {\r\n isPlayersTurn = !isPlayersTurn;\r\n }",
"public int getTurn() {\n\t\treturn 0;\r\n\t}",
"@Override\n public Tournament newTournament() {\n String newId = Tournament.randomId();\n while(tournamentCache.containsKey(newId) || tournamentRepository.findById(newId).isPresent()){\n newId = Tournament.randomId();\n }\n Tournament newTournament = new Tournament(newId, fighterService);\n tournamentCache.put(newId, newTournament);\n return newTournament;\n }",
"void askTurn();",
"@Override\n\tpublic LightTank create() {\n\t\treturn new LightTank(GameContext.getGameContext());\n\t}",
"void onTurn();",
"public Game() {}",
"public Turn(Player player) {\n this.player = player;\n this.actionPoints = player.getFireEngines().stream()\n .collect(Collectors.toMap((f) -> f, (f) -> INITIAL_ACTION_POINTS, (l, r) -> l, HashMap::new));\n this.positionsExtinguished = new HashMap<>();\n this.stationaryEngines = new HashSet<>();\n }",
"private void changeTurn(){ \r\n\t\tif (currentTurn == 1)\r\n\t\t\tcurrentTurn = 0; \r\n\t\telse\r\n\t\t\tcurrentTurn = 1; \r\n\t}",
"int getCurrentTurn();",
"public PlayerColor getTurn() {\n return board.getTurn();\n }",
"public AccelerometerTurn(double angle) {\n\tthis(angle, 0.7);\n }",
"@Test\n\tpublic void testTurn() {\n\t\tActorWorld world = new ActorWorld();\n\t\tworld.add(new Location(5, 5), alice);\n\t\tint olddir = alice.getDirection();\n\t\talice.turn();\n\t\tassertEquals(alice.getDirection(), (olddir + Location.RIGHT) % 360);\n\t}",
"public void incrTurn(){\n this.turn++;\n }",
"User getPlayerTurn() throws RemoteException;",
"public void setTurn(int a_turn)\n {\n if(a_turn > m_numPlayers)\n {\n m_turn = 1;\n }\n else\n {\n m_turn = a_turn;\n }\n }",
"public int nextTurn(int turn) {\n\t\tif(turn == 1) {\n\t\t\tturn = 2;\n\t\t\tSystem.out.println(\"It's White's turn\");\n\t\t} else if(turn == 2){\n\t\t\tturn = 1;\n\t\t\tSystem.out.println(\"It's Black's turn\");\n\t\t}\n\t\t\n\t\treturn turn;\n\t}",
"public WarGame(int rounds, WarBoard board){\n super(rounds, board);\n }",
"public void setTurn(Boolean turn) {\n this.turn = turn;\n }",
"private void setTurn() {\n if (turn == black) {\n turn = white;\n } else {\n turn = black;\n }\n }",
"public Boolean getYourTurn() {\n return yourTurn;\n }",
"void setPlayerTurn() throws RemoteException;",
"public static Action turn(final ModifiableInteger direction) {\n return new Action() {\n @Override\n protected void perform(ActiveActor a) {\n a.setDirection(direction.getValue());\n }\n\n @Override\n public int getCost() {\n return 0;\n }\n\n @Override\n public boolean isExclusive() {\n return false;\n }\n\n @Override\n public Object getData() {\n return direction;\n }\n\n @Override\n public String toString() {\n return \"Turn(\" + (direction != null ? direction.toString() : \"null\") + \")\";\n }\n };\n }",
"public Board twin() {\n Board twin = new Board(board);\n // exchange the pairs of the same row\n int i = (iBlank+1) % dim;\n swap(twin.board, i, 0, i, 1);\n return twin;\n }",
"private Game() {}",
"public Game(){\n player = new Player(createRooms());\n parser = new Parser(); \n }",
"public TurnState step() {\n ReadOnlyHistory history = board.viewHistory();\n \n if (!isGameOver) {\n Player next = nextPlayer();\n Move move = null;\n \n try {\n final long startTime = System.currentTimeMillis();\n move = next.play(history);\n next.addTime(System.currentTimeMillis() - startTime);\n \n if (next.getTime() >= timeLimit || !board.isValid(move)){\n isGameOver = true;\n }\n else {\n board.set(move);\n }\n }\n catch (IllegalArgumentException ex) {\n System.err.println(\"Player \" + next.getName() + \": \" + ex.getMessage());\n isGameOver = true;\n }\n catch (ArrayIndexOutOfBoundsException ex) {\n System.err.println(\"Player \" + next.getName() + \": \" + ex.getMessage());\n isGameOver = true;\n }\n \n return new TurnState(next, move, isGameOver);\n }\n else {\n return new TurnState(null, null, true);\n }\n }",
"public Shoe makeShoe() {\n\treturn new Shoe();\r\n}",
"public Turn getDesiredTurn() {\n\t\treturn desiredTurn;\n\t}",
"public Game copy() {\n\t\tCMN g = new CMN();\n\t\tg.isGameNew = isGameNew;\n\t\tCMN.WINS = new ArrayList<Set<CMNMove>>(WINS);\n\t\tg.movesLeft = new TreeSet<CMNMove>(movesLeft);\n\t\tg.moves1 = new TreeSet<CMNMove>(moves1);\n\t\tg.moves2 = new TreeSet<CMNMove>(moves2);\n\t\tg.nextPlayer = nextPlayer;\n\t\tg.someoneQuit = someoneQuit;\n\t\tg.onePlayerLeft = onePlayerLeft;\n\t\tg.winningPlayer = winningPlayer;\n\t\treturn g;\n\t}",
"public WarGame() {\r\n\t\tsetGame();\r\n\t}",
"static Game newGame(Player player1, Player player2) {\n return new GameImpl(player1, player2);\n }"
]
| [
"0.759788",
"0.7201792",
"0.71927565",
"0.6902875",
"0.6544151",
"0.63960415",
"0.63210875",
"0.62772727",
"0.6237201",
"0.62357676",
"0.61863965",
"0.61514294",
"0.6150538",
"0.61492485",
"0.6144269",
"0.61333895",
"0.6123542",
"0.6118256",
"0.6055777",
"0.60494477",
"0.6028498",
"0.6012922",
"0.5913826",
"0.59067655",
"0.5893843",
"0.5892933",
"0.5871527",
"0.5850327",
"0.5848462",
"0.5836178",
"0.58028704",
"0.57928765",
"0.57909733",
"0.5785952",
"0.57826215",
"0.57823384",
"0.5746019",
"0.5737625",
"0.5731845",
"0.57288486",
"0.5722657",
"0.5716492",
"0.5708186",
"0.57050174",
"0.5703832",
"0.5701884",
"0.56969875",
"0.5642979",
"0.56327295",
"0.5589373",
"0.55796975",
"0.5571588",
"0.55606544",
"0.5552671",
"0.55459833",
"0.5536475",
"0.55343145",
"0.55294496",
"0.5528145",
"0.5523479",
"0.5520168",
"0.549077",
"0.54883116",
"0.54854846",
"0.54833823",
"0.54733425",
"0.5446167",
"0.5438948",
"0.5438306",
"0.54287994",
"0.54269826",
"0.54151154",
"0.538556",
"0.5383717",
"0.53806376",
"0.5374873",
"0.53626776",
"0.53585047",
"0.53585035",
"0.5353908",
"0.5351123",
"0.5351107",
"0.5348959",
"0.534655",
"0.5339105",
"0.53368276",
"0.53360844",
"0.5326529",
"0.53048235",
"0.5303263",
"0.52975065",
"0.52827156",
"0.5273567",
"0.5263383",
"0.52586204",
"0.5252768",
"0.5250099",
"0.52488494",
"0.52487826",
"0.524801"
]
| 0.85508925 | 0 |
Returns a new object of class 'Gradian'. | Gradian createGradian(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static Grandson getGrandson() {\n\t\treturn new Grandson();\r\n\t}",
"Gruppo getGruppo();",
"Gtr createGtr();",
"Degree createDegree();",
"@Override\n\tpublic void createGerant(Gerant g) {\n\t\t\n\t}",
"public B_NotaFiscal gera(C_Fatura fatura) {\n\t\tB_NotaFiscal nf = geraNF(fatura);\n//\t\tenviaEmail(nf);\n//\t\tsalvaNoBanco(nf);\n//\t\tnew I_EnviadorDeEmail().enviaEmail(nf);\n//\t\tnew H_NFDao().salvaNoBanco(nf);\n\t\t\n\t\treturn nf;\n\t\t//Alem disso, o eclipse tambem pode ajudar voce no refactor de extract classes\n\t}",
"public Sandwich getSandwich(){\n return new Sandwich();\n }",
"public static Gng init() {\n return new Gng();\n }",
"public Bike createCityBike() {\n Wheels cityWheels = new Wheels(559,50f,10000); //Räder des Stadtrads erstellen\n Gears cityGears = new Gears(3,1,5000); //Gangschaltung des Stadtrads erstellen\n Bike newCityBike = new Bike(cityGears, cityWheels, \"Stahl\", \"CB105\", true, true, 30000); //Stadtrad erstellen\n return newCityBike; //Stadtrad zurückgeben\n}",
"static Sbpayment newInstance() {\n return new DefaultSbpayment();\n }",
"public Grille creationGrille() {\n\t\tList<Mot> listeMots = new ArrayList<Mot>();\r\n\r\n\t\t// Init de la liste de cases\r\n\t\tList<Case> cases = new ArrayList<Case>();\r\n\r\n\t\t// Init de la grille\r\n\t\tGrille grille = new Grille();\r\n\t\tgrille.setDifficulte(Difficulte.moyen);\r\n\r\n\t\t// Creation de la liste de mots\r\n\t\tlisteMots = creerListeMots(grille);\r\n\r\n\t\t// Creation de la liste de cases avec les mots/couleurs\r\n\t\tcases = creerListeCase(listeMots, grille);\r\n\r\n\t\t// affection de la liste de cases a la grille et inverse\r\n\t\tgrille.setCases(cases);\r\n\t\tdaoGrille.save(grille);\r\n\t\tfor (Case c : cases) {\r\n\t\t\tc.setGrille(grille);\r\n\t\t\tdaoCase.save(c);\r\n\t\t}\r\n\r\n\t\treturn grille;\r\n\r\n\t}",
"Generalization createGeneralization();",
"TGG createTGG();",
"public GPS newInstace(@Nullable Bundle bundle){\n return new GPS();\n }",
"GramaticaFactory getGramaticaFactory();",
"public Degree() {\n\t\tsuper();\n\t}",
"public Egrga() {\r\n\t}",
"public static Unit fang(){\n\t\tUnit unit = new Unit(\"Fang\", \"O_S_WhiteMane\", 15, 5, 12, 14, 4);\n\t\tunit.base=2;\n\t\tunit.addWep(new Weapon(\"Greataxe\",11,4));\n\t\tunit.addActive(ActiveType.CLEAVE);\n\t\tunit.addPassive(PassiveType.TOUGH);\n\t\treturn unit;\n\t}",
"public PaymentType builder()\n {\n return new PaymentType(this);\n }",
"private Gng() {\n }",
"@Test\n public void testSetCurrency() {\n CurrencyUnit cu = Waehrung.of(\"XXX\");\n factory.setCurrency(cu);\n Geldbetrag geldbetrag = factory.create();\n assertEquals(cu, geldbetrag.getCurrency());\n }",
"public void setGamygdala(Gamygdala newGamygdala) {\n this.gamygdala = newGamygdala;\n }",
"public abstract void creationGrille();",
"public static Currency createCurrency (String country) {\n\n\t\tswitch(country.toUpperCase()) {\n\t\t\n\t\tcase \"INDIA\" : \n\t\t\treturn new Rupee(); \n\t\t\n\t\tcase \"SINGAPORE\" : \n\t\t\treturn new SGDDollar(); \n\t\t\n\t\tcase \"US\" : \n\t\t\treturn new USDollar();\n\t\t\n\t\tdefault : \n\t\t\tthrow new IllegalArgumentException(\"No such currency\");\n\t\t}\n\t}",
"public Unit<Angle> microradian() {return microradian;}",
"public Garage() {\n\t\tid = generateId();\n\t}",
"public Locale create() {\n BaseLocale base = _locbld.getBaseLocale();\n LocaleExtensions ext = _locbld.getLocaleExtensions();\n return Locale.getInstance(base.getLanguage(), base.getScript(), base.getRegion(), base.getVariant(), ext);\n }",
"@Test\n public void testSetNumber() {\n factory.setNumber(1).setCurrency(\"CHF\");\n assertEquals(Geldbetrag.valueOf(\"1 CHF\"), factory.create());\n }",
"GeneralTerm createGeneralTerm();",
"public Kreditkarte(){\n\t\n\t}",
"public Gasto() {\r\n\t}",
"SpaceInvaderTest_VaisseauAvance_DeplacerVaisseauVersLaGauche createSpaceInvaderTest_VaisseauAvance_DeplacerVaisseauVersLaGauche();",
"public Clade() {}",
"public Corrida(){\n\n }",
"public static Grafo criarGrafo() {/* Este método tem função de criar um grafo. */\r\n\t\tGrafo grafo = new Grafo();/* Aqui um grafo é criado */\r\n\t\t/*\r\n\t\t * Aqui são criados nós e em seguida adcionados a lista de nós do grafo\r\n\t\t * criado\r\n\t\t */\r\n\t\tgrafo.addNo(new No(\"n1\"));\r\n\t\tgrafo.addNo(new No(\"n2\"));\r\n\t\tgrafo.addNo(new No(\"n3\"));\r\n\t\tgrafo.addNo(new No(\"n4\"));\r\n\t\tgrafo.addNo(new No(\"n5\"));\r\n\r\n\t\t/*\r\n\t\t * Aqui as arestas são criadas e seus parâmetros para o método\r\n\t\t * construtor são passados. Os vértices que compõe cada aresta são\r\n\t\t * retiradas diretamente da lista de aresta do grafo.\r\n\t\t */\r\n\t\tAresta a1 = new Aresta(\"a1\", grafo.getNos().get(0), grafo.getNos().get(4), 1);\r\n\t\tAresta a2 = new Aresta(\"a2\",grafo.getNos().get(0), grafo.getNos().get(2), 2);\r\n\t\tAresta a3 = new Aresta(\"a3\",grafo.getNos().get(1), grafo.getNos().get(3), 4);\r\n\t\tAresta a4 = new Aresta(\"a4\",grafo.getNos().get(1), grafo.getNos().get(4), 4);\r\n\t\tAresta a5 = new Aresta(\"a5\",grafo.getNos().get(2), grafo.getNos().get(3), 3);\r\n\t\tAresta a6 = new Aresta(\"a6\",grafo.getNos().get(3), grafo.getNos().get(4), 1);\r\n\r\n\t\t/* As arestas são adcionadas a lista de arestas do grafo. */\r\n\t\tgrafo.addAresta(a1);\r\n\t\tgrafo.addAresta(a2);\r\n\t\tgrafo.addAresta(a3);\r\n\t\tgrafo.addAresta(a4);\r\n\t\tgrafo.addAresta(a5);\r\n\t\tgrafo.addAresta(a6);\r\n\r\n\t\treturn grafo;/* O grafo criado é retornado */\r\n\r\n\t}",
"public Casa() { \n \n /* Cuando se crea la casa, tambien se debe crear la puerta */\n \n laPuerta = new Puerta();\n \n /* se pone la letra F por que son de tipo float */\n laPuerta.setAncho(2.3F);\n laPuerta.setAlto(1.5F);\n \n }",
"public GantBuilder ( ) { }",
"public Grille() {\n this.grille = new HashSet<>();\n\t\tscore=0;\n }",
"public Country() {}",
"Schule createSchule();",
"public Loyalty() {}",
"private Geofence createGeofence(LatLng latLng) {\n Log.d(TAG, \"createGeofence\");\n return new Geofence.Builder()\n .setRequestId(GEOFENCE_REQ_ID)\n .setCircularRegion(latLng.latitude, latLng.longitude, AppointmentActivity.GEOFENCE_RADIUS)\n .setExpirationDuration(GEO_DURATION)\n .setTransitionTypes(Geofence.GEOFENCE_TRANSITION_ENTER\n | Geofence.GEOFENCE_TRANSITION_EXIT)\n .build();\n }",
"TGGRule createTGGRule();",
"private static Dog createGolderRetriver(){\n try {\n UtilityMethods.print(\"Creating golden retriver for you...!\"); \n DogGenerator dogGenerator = new DogGenerator();\n DogBuilder goldenRetriver = new GoldenRetriverBuilder();\n dogGenerator.setDogBuilder(goldenRetriver);\n dogGenerator.constructDog(\n \"Animal\", \n \"Male\",\n 20,\n \"Carnivores\"\n );\n Dog goldenRetriverdog = dogGenerator.getDog();\n UtilityMethods.print(\"\\n\"); \n goldenRetriverdog.eat();\n UtilityMethods.print(\"\\n\"); \n goldenRetriverdog.speak();\n UtilityMethods.print(\"\\n\"); \n goldenRetriverdog.walk();\n UtilityMethods.print(\"\\n\"); \n return goldenRetriverdog; \n } catch (Exception e) {\n UtilityMethods.print(e.getMessage()); \n }\n return null; \n }",
"private ProfitPerTariffType ()\n {\n super();\n }",
"SpaceInvaderTest_VaisseauImmobile_DeplacerVaisseauVersLaGauche createSpaceInvaderTest_VaisseauImmobile_DeplacerVaisseauVersLaGauche();",
"public Camp newEntity() { return new Camp(); }",
"public Lanceur() {\n\t}",
"private GenderDb createGenderInstance(long id, String type) {\n GenderDb genderDb = new GenderDb();\n genderDb.setId(id);\n genderDb.setTypeEn(type);\n genderDb.setTypeRu(new GenderMapper().toRu(type));\n return genderDb;\n }",
"GroupType createGroupType();",
"GroupType createGroupType();",
"Clase createClase();",
"public abstract Anuncio creaAnuncioGeneral();",
"public Aritmetica(){ }",
"public com.walgreens.rxit.ch.cda.CE addNewAdministrativeGenderCode()\n {\n synchronized (monitor())\n {\n check_orphaned();\n com.walgreens.rxit.ch.cda.CE target = null;\n target = (com.walgreens.rxit.ch.cda.CE)get_store().add_element_user(ADMINISTRATIVEGENDERCODE$10);\n return target;\n }\n }",
"public static FireFighting newInstance() {\n FireFighting fragment = new FireFighting();\n return fragment;\n }",
"private QuadradoPerfeito() {\n }",
"Schulleiter createSchulleiter();",
"Traditional createTraditional();",
"public Steganography() {}",
"private void setFactory(String factoryClass) {\n MoneyFactory moneyFactory = null;\n try {\n moneyFactory = (MoneyFactory) Class.forName(\"coinpurse.\" + factoryClass).newInstance();\n } catch (IllegalAccessException | InstantiationException | ClassNotFoundException e) {\n System.out.println(\"Cannot create Money Factory.\");\n System.exit(0);\n }\n if (moneyFactory == null) System.exit(0);\n MoneyFactory.setFactory(moneyFactory);\n this.moneyFactory = MoneyFactory.getInstance();\n if (moneyFactory.getClass().equals(ThaiMoneyFactory.class)) currency = \"Baht\";\n else if (moneyFactory.getClass().equals(MalayMoneyFactory.class)) currency = \"Ringgit\";\n }",
"protected GEDCOMType() {/* intentionally empty block */}",
"public static IHjsonDsfProvider math() { return new DsfMath(); }",
"public General(String code, Person primaryContact, String name, double airlineMiles) {\n\t\tsuper(code, primaryContact, name, airlineMiles);\n\t\tthis.type = \"G\";\n\t}",
"public Fogon (String cocineroActual){\n Cocinero = cocineroActual;\n grados = 0; \n }",
"public Giocatore(String nome, Casella c, Pedina p) {\r\n\t\tsetNome(nome);\r\n\t\tsetPedina(p);\r\n\t\tcasella = c;\r\n\t\tdado = new Dado();\r\n\t\t\r\n\t\tpunt_carta = punteggioIniziale;\r\n\t\tpunt_plastica = punteggioIniziale;\r\n\t\tpunt_vetro = punteggioIniziale;\r\n\t\tpunt_metallo = punteggioIniziale;\r\n\t\tpunt_indifferenziata = punteggioIniziale;\r\n\t\tpunt_organica = punteggioIniziale;\r\n\t}",
"ShipmentType createShipmentType();",
"public static GeoCoderInterface createGeoCoder(){\n\t\tif (Config.default_geo_api.equals(OSM)){\n\t\t\t//TODO: implement\n\t\t\tDebugger.println(\"GeoFactory - unknown GeoCoderInterface: \" + Config.default_geo_api, 1);\n\t\t\treturn null;\n\t\t}else if (Config.default_geo_api.equals(GOOGLE)){\n\t\t\treturn new GeoCoderGoogle();\n\t\t}else if (Config.default_geo_api.equals(GRAPHHOPPER)){\n\t\t\treturn new GeoCoderGraphhopper();\n\t\t}else{\n\t\t\tDebugger.println(\"GeoFactory - unknown GeoCoderInterface: \" + Config.default_geo_api, 1);\n\t\t\treturn null;\n\t\t}\n\t}",
"public Regla2(){ /*ESTE ES EL CONSTRUCTOR POR DEFECTO */\r\n\r\n /* TODAS LAS CLASES TIENE EL CONSTRUCTOR POR DEFECTO, A VECES SE CREAN AUTOMATICAMENTE, PERO\r\n PODEMOS CREARLOS NOSOTROS TAMBIEN SI NO SE HUBIERAN CREADO AUTOMATICAMENTE\r\n */\r\n \r\n }",
"NFRSoftgoal createNFRSoftgoal();",
"ShipmentBoxType createShipmentBoxType();",
"public Geltokia(int kod_geltoki, String kalea, String gel_izena, double latitudea, double longitudea) {\r\n\r\n\t\tthis.kod_geltoki = kod_geltoki;\r\n\t\tthis.kalea = kalea;\r\n\t\tthis.gel_izena = gel_izena;\r\n\t\tthis.latitudea = latitudea;\r\n\t\tthis.longitudea = longitudea;\r\n\t\tthis.disTerm = distantziaKalkulatu();\r\n\t}",
"public static Group newDeck() {\n\t\tGroup g = new Group();\n\t\tfor (Suit s : Suit.values()) {\n\t\t\tfor (Rank r : Rank.values()) {\n\t\t\t\tCard c = new Card(r,s);\n\t\t\t\tg.add(c);\n\t\t\t}\n\t\t}\n\t\treturn g;\n\t}",
"RentalObject createRentalObject();",
"public void crearPersona(){\r\n persona = new Persona();\r\n persona.setNombre(\"Jose\");\r\n persona.setCedula(12345678);\r\n }",
"License createLicense();",
"public Gamygdala getGamygdala() {\n return this.gamygdala;\n }",
"public Object clone() {\t\n\t\tGrille o = new Grille();\t\t//On créé une nouvelle grille\n\t\to.score=this.score;\n\t\tfor (Case i : this.grille){\n\t\t\tCase i2= (Case) i.clone();\t//On copie chaque case de la grille\n\t\t\ti2.setGrille(o);\n\t\t\to.grille.add(i2);\t\t\t//On les ajoute à la nouvelle grille\n\t\t}\n\t\t// on renvoie le clone\n\t\treturn o;\n\t}",
"public SimpleGeometricObject() {\r\n this.dateCreated = new java.util.Date();\r\n }",
"public a dD() {\n return new a(this.HG);\n }",
"public Kendaraan() {\n }",
"Vaisseau_abscisseLaPlusAGauche createVaisseau_abscisseLaPlusAGauche();",
"Radian createRadian();",
"SpaceInvaderTest_test_AuDebut_JeuSpaceInvaderEstVide createSpaceInvaderTest_test_AuDebut_JeuSpaceInvaderEstVide();",
"private DarthSidious(){\n }",
"public static ColaTF1 cargarCola() {\n ColaTF1 cola = new ColaTF1();\n cola.InicializarCola();\n cola.Acolar(3);\n cola.Acolar(45);\n cola.Acolar(76);\n\n return cola;\n }",
"public AoDai chooseFactory(){\n\t\treturn new ModernAoDai();\n\t}",
"private UsineJoueur() {}",
"public static GestorPersonas instanciar(){\n \n if(gestor == null){\n gestor = new GestorPersonas();\n }\n return gestor;\n }",
"public Gate(){\n\n }",
"public gov.nih.nlm.ncbi.www.SeqIdDocument.SeqId.Genbank addNewGenbank()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n gov.nih.nlm.ncbi.www.SeqIdDocument.SeqId.Genbank target = null;\r\n target = (gov.nih.nlm.ncbi.www.SeqIdDocument.SeqId.Genbank)get_store().add_element_user(GENBANK$8);\r\n return target;\r\n }\r\n }",
"@Override\n\tpublic LoanEligibility getNew() {\n\t\treturn null;\n\t}",
"private GroupFactory() {\n /*UserFactory userFactory = UserFactory.getInstance();\n \n Group gruppo1 = new Group();\n gruppo1.setNomeGruppo(\"Gruppo\");\n gruppo1.setId(0);\n gruppo1.setIscritti(userFactory.getUserById(0));\n gruppo1.setIscritti(userFactory.getUserById(1));\n gruppo1.setIscritti(userFactory.getUserById(2));\n gruppo1.setIscritti(userFactory.getUserById(3));\n \n Group gruppo2 = new Group();\n gruppo2.setNomeGruppo(\"Gruppo2\");\n gruppo2.setId(0);\n gruppo2.setIscritti(userFactory.getUserById(0));\n gruppo2.setIscritti(userFactory.getUserById(3));\n \n Group gruppo3 = new Group();\n gruppo3.setNomeGruppo(\"Gruppo3\");\n gruppo3.setId(0);\n gruppo3.setIscritti(userFactory.getUserById(2));\n gruppo3.setIscritti(userFactory.getUserById(3));\n \n Group gruppo4 = new Group();\n gruppo4.setNomeGruppo(\"Gruppo4\");\n gruppo4.setId(0);\n gruppo4.setIscritti(userFactory.getUserById(1));\n gruppo4.setIscritti(userFactory.getUserById(3));\n \n listaGruppi.add(gruppo1);\n listaGruppi.add(gruppo2);\n listaGruppi.add(gruppo3);\n listaGruppi.add(gruppo4);*/\n }",
"static Game newGame(Player player1, Player player2, String fen) {\n return new GameImpl(player1, player2, fen);\n }",
"Language create(Language language);",
"public Surgeon() {\n }",
"Country getCountry();",
"public Manusia() {}",
"OBJECT createOBJECT();",
"public Cgg_jur_anticipo(){}"
]
| [
"0.6075917",
"0.5835982",
"0.5830423",
"0.5776535",
"0.56706613",
"0.5640215",
"0.5582505",
"0.55403256",
"0.55097187",
"0.5507381",
"0.5462285",
"0.5459854",
"0.5405141",
"0.5393883",
"0.53745186",
"0.52798015",
"0.52641964",
"0.52552503",
"0.52252954",
"0.52241135",
"0.52192247",
"0.52077776",
"0.51832986",
"0.51731306",
"0.51672405",
"0.51595074",
"0.51484585",
"0.5144557",
"0.5142272",
"0.51173955",
"0.5096346",
"0.5094275",
"0.50740045",
"0.50739306",
"0.50645053",
"0.5061276",
"0.50539905",
"0.5050056",
"0.5049933",
"0.5043979",
"0.5040279",
"0.50229967",
"0.5019398",
"0.50017864",
"0.5001295",
"0.49975154",
"0.49869087",
"0.4981629",
"0.4978229",
"0.49777213",
"0.49777213",
"0.49704823",
"0.49609762",
"0.49551067",
"0.49550477",
"0.49535897",
"0.49478832",
"0.49377626",
"0.4936051",
"0.49291846",
"0.4928109",
"0.49102786",
"0.49082017",
"0.4907025",
"0.49015173",
"0.49003947",
"0.48988983",
"0.48795608",
"0.4874374",
"0.4871746",
"0.487129",
"0.48711947",
"0.4871089",
"0.48694846",
"0.48694062",
"0.48678464",
"0.48660466",
"0.48626786",
"0.4860045",
"0.4859306",
"0.48499468",
"0.4849843",
"0.4846407",
"0.48442775",
"0.48436838",
"0.4843238",
"0.48389524",
"0.48344007",
"0.48282602",
"0.48270652",
"0.48221362",
"0.48186585",
"0.48171788",
"0.4809574",
"0.48086575",
"0.48069003",
"0.48041236",
"0.47980967",
"0.4796727",
"0.4792807"
]
| 0.824915 | 0 |
Returns a new object of class 'Quantity'. | Quantity createQuantity(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Quantity getQuantity();",
"public abstract Quantity<Q> create(Number value, Unit<Q> unit);",
"public org.hl7.fhir.Integer addNewQuantity()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.hl7.fhir.Integer target = null;\n target = (org.hl7.fhir.Integer)get_store().add_element_user(QUANTITY$10);\n return target;\n }\n }",
"Quantity initQuantity(Quantity iQuantity)\n {\n iQuantity.updateElementValue(\"Quantity\");\n return iQuantity;\n }",
"BigDecimal getQuantity();",
"public ItemQuantity(Item item, int quantity) {\n this.item = item;\n this.quantity = quantity;\n }",
"public Integer getQuantity();",
"public StockItem(T product, Integer quantity) {\n this.product = product;\n this.quantity = quantity;\n }",
"MeasureType getQuantity();",
"public int getQuantity();",
"org.hl7.fhir.Quantity addNewValueQuantity();",
"long getQuantity();",
"long getQuantity();",
"int getQuantity();",
"public double getQuantity() {\n return quantity;\n }",
"public Integer getQuantity() {\n return quantity;\n }",
"public Integer getQuantity() {\n return quantity;\n }",
"public Integer getQuantity() {\n return this.quantity;\n }",
"public float getQuantity() {\n return quantity;\n }",
"public java.math.BigDecimal getQuantity() {\n return quantity;\n }",
"public Integer getQuantity() {\r\n return this.quantity;\r\n }",
"public java.math.BigDecimal getQuantity() {\r\n return quantity;\r\n }",
"public Integer getQuantity() {\n return this.quantity;\n }",
"public Long getQuantity() {\n return quantity;\n }",
"public Long getQuantity() {\r\n return quantity;\r\n }",
"public int getQuantity() {\r\n return quantity;\r\n }",
"protected Double getQuantity() {\n return quantity;\n }",
"public int getQuantity() {\r\n return quantity;\r\n }",
"public int getQuantity()\n {\n return quantity;\n }",
"public Float getQuantity() {\n return quantity;\n }",
"BigDecimal getOriginalQuantity();",
"public int getQuantity() {\n return quantity;\n }",
"public int getQuantity() {\n return quantity;\n }",
"public int getQuantity() {\n return quantity;\n }",
"public int getQuantity() {\n return quantity;\n }",
"public int getQuantity() {\n return quantity;\n }",
"public int getQuantity() {\n return quantity;\n }",
"public int getQuantity()\r\n {\r\n return _quantity;\r\n }",
"public int getQuantity() {\r\n return quantity;\r\n }",
"public long getQuantity() {\n return quantity_;\n }",
"public long getQuantity() {\n return quantity_;\n }",
"public int getQuantity(){\n\t\treturn quantity;\n\t}",
"public long getQuantity() {\n return quantity_;\n }",
"public long getQuantity() {\n return quantity_;\n }",
"public int getQuantity() \n\t{\n\t\treturn quantity;\n\t}",
"public int getQuantity() {\n return this.quantity;\n }",
"public void setQuantity(int quantity) {\r\n this.quantity = quantity;\r\n }",
"public String getQuantity() {\n return quantity;\n }",
"public void setQuantity(int quantity) {\n this.quantity = quantity;\n }",
"public void setQuantity(int quantity) {\n this.quantity = quantity;\n }",
"public void setQuantity(int value) {\n this.quantity = value;\n }",
"public void setQuantity(int value) {\n this.quantity = value;\n }",
"public void setQuantity(int value) {\n this.quantity = value;\n }",
"public void setQuantity(Integer quantity) {\n this.quantity = quantity;\n }",
"@Schema(description = \"Number of units consumed\")\n public Long getQuantity() {\n return quantity;\n }",
"public int getQuantity() {\r\n\t\treturn quantity;\r\n\t}",
"public void setQuantity(Integer quantity) {\r\n this.quantity = quantity;\r\n }",
"public void setQuantity(Integer quantity) {\n this.quantity = quantity;\n }",
"public void setQuantity(Integer quantity) {\n this.quantity = quantity;\n }",
"public org.hl7.fhir.Integer getQuantity()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.hl7.fhir.Integer target = null;\n target = (org.hl7.fhir.Integer)get_store().find_element_user(QUANTITY$10, 0);\n if (target == null)\n {\n return null;\n }\n return target;\n }\n }",
"public int getQuantity()\n {\n \treturn quantity;\n }",
"@NonNull\n public BasketItemBuilder incrementQuantity() {\n this.quantity++;\n return this;\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 }",
"public int getQuantity() {\n\t\treturn quantity;\n\t}",
"public int getQuantity() {\n\t\treturn quantity;\n\t}",
"public int getQuantity() {\n\t\treturn quantity;\n\t}",
"public int getQuantity() {\n\t\treturn quantity;\n\t}",
"public int getQuantity() {\n\t\treturn quantity;\n\t}",
"public int getQuantity() {\r\n\t\treturn this.quantity;\r\n\t}",
"org.hl7.fhir.Quantity getValueQuantity();",
"public void setQuantity(int quantity) {\r\n\t\tthis.quantity = quantity;\r\n\t}",
"public void setQuantity(String quantity) {\n this.quantity = quantity;\n }",
"public void setQuantity(java.math.BigDecimal quantity) {\r\n this.quantity = quantity;\r\n }",
"public void setQuantity(int quantity)\n\t{\n\t\tthis.quantity = quantity;\n\t}",
"public void setQuantity(java.math.BigDecimal quantity) {\n this.quantity = quantity;\n }",
"public InventoryItem(String name, int quantity) {\n\t\tthis.name = name;\n\t\tthis.quantity = quantity;\n\t}",
"String getQuantity() {\n return Integer.toString(quantity);\n }",
"public void setQuantity(int quantity) {\n\t\tthis.quantity = quantity;\n\t}",
"public Product(Name productName, int productQuantity) {\n this.productName = productName;\n this.productQuantity = productQuantity;\n }",
"public static ChangeCustomLineItemQuantityChangeBuilder of() {\n return new ChangeCustomLineItemQuantityChangeBuilder();\n }",
"@Override\r\n public void ItemQuantity(int quantity) {\n this.quantity = quantity;\r\n }",
"public static <Q extends Quantity<Q>> BaseAmount<Q> valueOf(Number value,\r\n \t\t\tUnit<Q> unit) {\r\n \t\tBaseAmount<Q> amount = new BaseAmount<Q>(value, unit);\r\n \t\treturn amount;\r\n \t}",
"public Builder setQuantity(long value) {\n \n quantity_ = value;\n onChanged();\n return this;\n }",
"public Builder setQuantity(long value) {\n \n quantity_ = value;\n onChanged();\n return this;\n }",
"Item(){\r\n\t\tthis(0, new Weight(5), new DukatAmount(0));\r\n\t}",
"public void setQuantity(int qty) {\r\n\t\tthis.quantity = qty;\r\n\t}",
"public void setQuantity(Float quantity) {\n this.quantity = quantity;\n }",
"public Builder clearQuantity() {\n \n quantity_ = 0L;\n onChanged();\n return this;\n }",
"public Builder clearQuantity() {\n \n quantity_ = 0L;\n onChanged();\n return this;\n }",
"Multiply createMultiply();",
"Items(int quantidade,Produto produto){\n\t\tqntd = quantidade;\n\t\tthis.produto = produto;\n\t\t\n\t}",
"public OrdinaryTruck(int itemQuantity)\n {\n this.itemQuantity = itemQuantity;\n }",
"public Number getQuantity() {\n return (Number) getAttributeInternal(QUANTITY);\n }",
"QuantityExtentType getQuantityExtent();",
"Quantifier createQuantifier();",
"public CustomerCartItem(Long itemId, int quantity) {\n this.id = itemId;\n this.quantity = quantity;\n }",
"public void setQuantity(float value) {\n this.quantity = value;\n }",
"private List<ProductQuantity> getQuantities() {\n List<ProductQuantity> quantities = new ArrayList<>();\n for (int i = 1; i <= QUANTITY_MAX; i++) {\n ProductQuantity q = new ProductQuantity(i, i + \"x\");\n quantities.add(q);\n }\n return quantities;\n }",
"public InventoryItem(String itemName, int sku, double price,int quantity) {\r\n this.itemName = itemName;\r\n this.sku = sku;\r\n this.setPrice(price);\r\n this.setQuantity(quantity);\r\n nItems++;\r\n }",
"public interface Force extends Quantity<Force> {\n\n}"
]
| [
"0.75038874",
"0.74175966",
"0.69654065",
"0.6963798",
"0.6860949",
"0.6823316",
"0.680567",
"0.6710089",
"0.6659851",
"0.66532916",
"0.6575774",
"0.65558285",
"0.65558285",
"0.65198505",
"0.6505917",
"0.6488366",
"0.6488366",
"0.6424487",
"0.6424174",
"0.64044535",
"0.6402014",
"0.63927937",
"0.63886935",
"0.6353434",
"0.63465035",
"0.6336776",
"0.63279766",
"0.63191956",
"0.6311912",
"0.6304079",
"0.63013554",
"0.62989444",
"0.62989444",
"0.62989444",
"0.62989444",
"0.62989444",
"0.62989444",
"0.62673306",
"0.6255581",
"0.625409",
"0.625409",
"0.623055",
"0.6226269",
"0.6226269",
"0.6207306",
"0.62069607",
"0.620051",
"0.6199131",
"0.61991113",
"0.61991113",
"0.6196111",
"0.6196111",
"0.6196111",
"0.61783755",
"0.6177392",
"0.6169426",
"0.61687714",
"0.6158461",
"0.6158461",
"0.61438",
"0.6133079",
"0.6128139",
"0.6116439",
"0.6094069",
"0.6094069",
"0.6094069",
"0.6094069",
"0.6094069",
"0.60684437",
"0.60670257",
"0.60583204",
"0.6055622",
"0.60496956",
"0.60471964",
"0.60365117",
"0.6034549",
"0.6009775",
"0.6005308",
"0.6003784",
"0.5990438",
"0.59868556",
"0.59755826",
"0.59649867",
"0.59649867",
"0.5933471",
"0.592242",
"0.58908796",
"0.58884484",
"0.58884484",
"0.58829325",
"0.5867934",
"0.5867518",
"0.585878",
"0.5839628",
"0.5837545",
"0.58322453",
"0.5824788",
"0.5820076",
"0.57975906",
"0.57887477"
]
| 0.8547962 | 0 |
Returns a new object of class 'Length'. | Length createLength(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Length initLength(Length iLength)\n {\n iLength.updateElementValue(\"Length\");\n return iLength;\n }",
"LengthAdd createLengthAdd();",
"public double getLength();",
"LengthSmaller createLengthSmaller();",
"float getLength();",
"float getLength();",
"public int getLength() {return length;}",
"public double getLength(){\r\n\t\treturn length;\r\n\t}",
"abstract double getLength();",
"LengthSubtract createLengthSubtract();",
"LengthConstraint createLengthConstraint();",
"public double getLength() {\r\n return length;\r\n }",
"public double getLength() {\n return length;\n }",
"public double getLength()\n {\n return length;\n }",
"public long getLength();",
"public long getLength();",
"public int getLength();",
"public int getLength();",
"public int getLength();",
"public double getLength() {\r\n\t\treturn length;\r\n\t}",
"LengthEquals createLengthEquals();",
"public abstract long getLength();",
"public abstract long getLength();",
"public double getLength() {\r\n\t\t\treturn length;\r\n\t\t}",
"public double getLength(){\n return length;\n }",
"public int getLength()\n {return length;}",
"public double getLength() {\n\t\treturn length;\n\t}",
"public double getLength()\n\t{\n\t\treturn length;\n\t}",
"public int getLength() { return length;\t}",
"public int getLength() {\r\n return length;\r\n }",
"public int getLength() {\r\n return length;\r\n }",
"public int getLength() {\r\n return length;\r\n }",
"public abstract int getLength();",
"public abstract int getLength();",
"public Double getLength()\n {\n return length;\n }",
"protected abstract int getLength();",
"public Integer getLength() {\n return _length;\n }",
"public Integer getLength() {\n return _length;\n }",
"public int getLength(){\n\t\treturn length;\n\t}",
"public int getLength(){\n\t\treturn length;\n\t}",
"public int getLength(){\n return length;\n }",
"public void setLength(double length){this.length=length;}",
"public int getLength()\n {\n return length;\n }",
"public int getLength() {\n return length;\n }",
"public int getLength() {\n return length;\n }",
"public int get_length();",
"public int getLength() {\n return length;\n }",
"public Duration length() {\n return getObject(Duration.class, FhirPropertyNames.PROPERTY_LENGTH);\n }",
"public void setLength(double length)\r\n {\r\n this.length = length;\r\n }",
"public int getLength() {\n return length_;\n }",
"@Override\n public Integer length() {\n return myLength;\n }",
"public long getLength() { \n return length; \n }",
"public int getLength()\n {\n\treturn length;\n }",
"public void setLength(int length)\n {\n this.length = length;\n }",
"public abstract void getLength(double length);",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"public int getLength() {\r\n\t\treturn length;\r\n\t}",
"public int getLength(){\n return this.length;\n }",
"public void setLength(int length) {\r\n this.length = length;\r\n }",
"public void setLength(int length) {\r\n this.length = length;\r\n }",
"public void setLength(double length) {\r\n this.length = length;\r\n }",
"protected int getLength() {\n return length;\n }",
"public int getLength() {\n return length_;\n }",
"public void setLength(double length) {\n this.length = length;\n }",
"public void setLength(double newLength) {\n length = newLength;\n }",
"private int length() { return length; }",
"public int getLength() {\n\t\treturn length;\n\t}",
"public int getLength() {\n\t\treturn length;\n\t}",
"public int getLength() {\n\t\treturn length;\n\t}",
"public int getLength() {\n\t\treturn length;\n\t}",
"public int getLength() {\n\t\treturn length;\n\t}",
"public int getLength() {\n\t\treturn length;\n\t}",
"public int getLength()\n\t{\n\t\treturn length;\n\t}",
"public int getLength()\n\t{\n\t\treturn length;\n\t}",
"public int getLength() {\n return this.length;\n }",
"public int getLength() {\n return this.length;\n }",
"public double getLength()\r\n {\r\n return this.lengthCapacity;\r\n }",
"public void setLength(long length);",
"public void setLength(long length);",
"public void setLength(long length) { \n this.length = length; \n }",
"public double get_length() {\n\t\treturn _length;\n\t}",
"public int getLength()\n\t{\n\t\treturn mLength;\n\t}",
"public Builder setLength(int value) {\n \n length_ = value;\n onChanged();\n return this;\n }",
"public int getLength() {\n\t\treturn this.length;\n\t}",
"public void setLength(int length) {\r\n\t\tthis.length = length;\r\n\t}",
"public int my_length();",
"public int length();",
"public int length();",
"public int length();",
"public int length();",
"public int length();"
]
| [
"0.723884",
"0.72219104",
"0.7150081",
"0.7023504",
"0.7009155",
"0.7009155",
"0.69593024",
"0.6930599",
"0.68889385",
"0.68670684",
"0.6864086",
"0.6852226",
"0.6805109",
"0.67973614",
"0.67627734",
"0.67627734",
"0.6761672",
"0.6761672",
"0.6761672",
"0.6747635",
"0.67423624",
"0.6727251",
"0.6727251",
"0.67264354",
"0.67226726",
"0.6713564",
"0.67080396",
"0.67041284",
"0.6690021",
"0.6670924",
"0.6670924",
"0.6670924",
"0.66617054",
"0.66617054",
"0.66559505",
"0.6652944",
"0.6647867",
"0.6647867",
"0.66433567",
"0.66433567",
"0.6642719",
"0.663595",
"0.6628742",
"0.6620086",
"0.6620086",
"0.660156",
"0.6582942",
"0.65698594",
"0.65625715",
"0.65581703",
"0.6558043",
"0.65542257",
"0.6517116",
"0.65104795",
"0.65029687",
"0.65023154",
"0.65023154",
"0.65023154",
"0.65023154",
"0.65023154",
"0.65023154",
"0.65023154",
"0.65023154",
"0.65023154",
"0.65023154",
"0.6499801",
"0.64910734",
"0.64871633",
"0.64871633",
"0.6485323",
"0.6481019",
"0.6477442",
"0.64764607",
"0.6472141",
"0.6465799",
"0.6454987",
"0.6454987",
"0.6454987",
"0.6454987",
"0.6454987",
"0.6454987",
"0.6441738",
"0.6441738",
"0.6438276",
"0.6438276",
"0.64162725",
"0.6414461",
"0.6414461",
"0.6401259",
"0.636961",
"0.6365259",
"0.63556707",
"0.631455",
"0.63108695",
"0.6291111",
"0.62877196",
"0.62877196",
"0.62877196",
"0.62877196",
"0.62877196"
]
| 0.83359635 | 0 |
Returns a new object of class 'Angle'. | Angle createAngle(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"AngleSmaller createAngleSmaller();",
"AngleAdd createAngleAdd();",
"public double getAngle();",
"double getAngle();",
"double getAngle();",
"AngleSubtract createAngleSubtract();",
"public AngleIF() {\n \t\t//_navx = new navx();\n \t\t//roboAccel = new RoboRioAccelerometers();\n \t}",
"public double getAngle() { return angle; }",
"public void setAngle( double a ) { angle = a; }",
"AngleEquals createAngleEquals();",
"void setAngle(double angle);",
"public float getAngle() {\n return angle;\n }",
"public int getAngle() {\r\n return angle;\r\n }",
"public double getAngle() {\n return angle;\n }",
"public double getAngle() {\n return angle;\n }",
"AngleGreater createAngleGreater();",
"public AxisAngle(float angle, float x, float y, float z) {\n this(angle, new Vector3(x,y,z));\n }",
"public double getAngle ()\n {\n return angle_;\n }",
"@Override\n public void reAngle() {\n }",
"public void setAngle(final float angle);",
"public float getAngle() {\n return angle;\n }",
"public double getAngle(){\n\t\treturn this.angle;\n\t}",
"public float getAngle() {\n return mAngle;\n }",
"void setAngle(int id, double value);",
"public AxisAngle(float angle, Vector3 axis) {\n this.angle = angle;\n this.axis = axis;\n }",
"AngleScalarMultiply createAngleScalarMultiply();",
"public int getAngle() {\r\n\t\treturn angle;\r\n\t}",
"public ImageRotator(int receivedAngle){angle = receivedAngle;}",
"public void setAngle(float angle){\n\n\t}",
"double getAngle(int id);",
"public double getAngle() {\n\t\treturn angle;\n\t}",
"public double getAngle() {\n\t\treturn angle;\n\t}",
"public static Angle fromDegrees(double degrees) {\n Angle angle = new Angle(degrees);\n return angle;\n }",
"public atan( ) {\n super(1);\n }",
"public double getStartAngle();",
"public double getAngle () {\n return super.getAngle() % 360D;\n }",
"public int getAngle(){\n\t\treturn (int)angle;\n\t}",
"EDataType getAngleDegrees();",
"AngleResource inclination();",
"void resetAngle();",
"public Flatbed(int angle){\r\n this.angle=angle;\r\n }",
"public double toAngle()\n\t{\n\t\treturn Math.toDegrees(Math.atan2(y, x));\n\t}",
"public void setAngle(double a) {\n\t\tangle= a;\n\t}",
"AngleDistinct createAngleDistinct();",
"public void setAngle(double angle) {\n this.angle = angle;\n }",
"AngleReference getAngRef();",
"public void rotate(float angle);",
"public double getMyAngle() {\n return myAngle- STARTING_ANGLE;\n }",
"public void setAngle(int angle) {\r\n\t\tthis.angle = angle;\r\n\t}",
"public double betweenAngle(Coordinates a, Coordinates b, Coordinates origin);",
"public TurnToDefaultAngle() {\n super(0, RobotContainer.m_robotDrive);\n }",
"public double getAngle() {\n\t\treturn 180 * (this.N - 2) / this.N;\n\t}",
"private double getAngle() {\n double normal= Math.sqrt(((getgAxis(ADXL345_I2C.Axes.kX))*(getgAxis(ADXL345_I2C.Axes.kX)))+((getgAxis(ADXL345_I2C.Axes.kY))*(getgAxis(ADXL345_I2C.Axes.kY))));\n\n return MathUtils.atan(normal / getgAxis(ADXL345_I2C.Axes.kZ));\n }",
"public double nextAngle()\n {\n return nextAngle();\n }",
"public double findAngle() {\n return 0d;\n }",
"@Override\n\tpublic LSystemBuilder setAngle(double angle) {\n\t\tthis.angle = angle;\n\t\treturn this;\n\t}",
"public double getAngle()\n {\n return (AngleAverage);\n }",
"public void setAngle(double angle)\n\t{\n\t\tthis.angle = angle;\n\t}",
"public double getAngle() {\n\t\treturn this.position[2];\n\t}",
"public void setAngle(double angle) {\n\t\tthis.angle = angle;\n\t}",
"public double getAngle() {\n\t\treturn navx.getAngle();\n\t}",
"public void setAngle(float angle) {\n this.angle = angle;\n cosAngle = (float) Math.cos(angle);\n sinAngle = 1 - cosAngle * cosAngle;\n }",
"Point rotate (double angle);",
"public double getAngle() {\n if (r == 0) {\n if (i == 0)\n return 0;// error?\n if (i > 0)\n return p2;\n else\n return -p2;\n }\n double d = Math.atan(i / r);\n if (r >= 0) {\n return d;\n }\n if (i >= 0)\n return Math.PI + d;\n return d + Math.PI;\n }",
"public void setAngle(float angle) {\n mAngle = angle;\n }",
"public void rotateToAngle(double angle) {\n controlState = ControlState.POSITION;\n outputPosition = -angle * TurretConstants.TICKS_PER_DEGREE;\n }",
"private double getAngle(){\n //Get a new angle measurement\n angles = imu.getAngularOrientation(AxesReference.INTRINSIC, AxesOrder.ZYX, AngleUnit.DEGREES);\n //Get the difference between current angle measurement and last angle measurement\n double deltaAngle = angles.firstAngle - lastAngles.firstAngle;\n\n //Process the angle to keep it within (-180,180)\n //(Once angle passes +180, it will rollback to -179, and vice versa)\n if (deltaAngle < -180)\n deltaAngle += 360;\n else if (deltaAngle > 180)\n deltaAngle -= 360;\n\n //Add the change in angle since last measurement (deltaAngle)\n //to the change in angle since last reset (globalAngle)\n globalAngle += deltaAngle;\n //Set last angle measurement to current angle measurement\n lastAngles = angles;\n\n return globalAngle;\n }",
"public Rotation2d getAngle() {\n // Note: This assumes the CANCoders are setup with the default feedback coefficient\n // and the sesnor value reports degrees.\n return Rotation2d.fromDegrees(canCoder.getAbsolutePosition());\n }",
"public AngleDisplay() {\n initComponents();\n\n setPreferredSize(new Dimension(size, size));\n }",
"public float getAngle () {\n\t\treturn body.getAngle();\n\t}",
"public double getAngle() {\n return Math.atan2(sinTheta, cosTheta);\n }",
"public void setAngle(float _angle) {\n\t\tthis.angle = _angle;\n\t}",
"public interface AxisAngleBasics extends AxisAngleReadOnly, Orientation3DBasics, Clearable\n{\n /**\n * Gets the reference to the axis part of this axis-angle.\n *\n * @return the reference to the axis vector.\n */\n @Override\n UnitVector3DBasics getAxis();\n\n /**\n * Sets a new angle to this axis-angle.\n *\n * @param angle the new angle.\n */\n void setAngle(double angle);\n\n /**\n * Sets a new x-component for the axis of this axis-angle.\n *\n * @param x the new axis x-component.\n */\n default void setX(double x)\n {\n getAxis().setX(x);\n }\n\n /**\n * Sets a new y-component for the axis of this axis-angle.\n *\n * @param y the new axis y-component.\n */\n default void setY(double y)\n {\n getAxis().setY(y);\n }\n\n /**\n * Sets a new z-component for the axis of this axis-angle.\n *\n * @param z the new axis z-component.\n */\n default void setZ(double z)\n {\n getAxis().setZ(z);\n }\n\n /**\n * Sets the components of this axis-angle to represent a \"zero\" rotation. After calling the axis is\n * equal to {@link Axis3D#X} and the angle to 0.\n */\n @Override\n default void setToZero()\n {\n getAxis().set(Axis3D.X);\n setAngle(0.0);\n }\n\n /**\n * Sets the components of this axis-angle to {@link Double#NaN}.\n */\n @Override\n default void setToNaN()\n {\n getAxis().setToNaN();\n setAngle(Double.NaN);\n }\n\n /**\n * Tests if this axis-angle contains a {@link Double#NaN}.\n *\n * @return {@code true} if this axis-angle contains a {@link Double#NaN}, {@code false} otherwise.\n */\n @Override\n default boolean containsNaN()\n {\n return AxisAngleReadOnly.super.containsNaN();\n }\n\n /**\n * Sets each component of this axis-angle to its absolute value.\n */\n default void absolute()\n {\n getAxis().absolute();\n setAngle(Math.abs(getAngle()));\n }\n\n /**\n * Negates each component of this axis-angle.\n */\n default void negate()\n {\n getAxis().negate();\n setAngle(-getAngle());\n }\n\n /** {@inheritDoc} */\n @Override\n default void invert()\n {\n setAngle(-getAngle());\n }\n\n /**\n * Normalizes the axis of this axis-angle such that its norm is equal to 1 after calling this method\n * and its direction remains unchanged.\n * <p>\n * Edge cases:\n * <ul>\n * <li>if this axis-angle contains {@link Double#NaN}, this method is ineffective.\n * </ul>\n * </p>\n */\n @Override\n default void normalize()\n {\n getAxis().normalize();\n }\n\n /**\n * Multiplies the angle of this axis-angle by the given {@code scale}.\n *\n * @param scale the scaling factor to apply to the angle of this axis-angle.\n */\n default void scaleAngle(double scale)\n {\n setAngle(scale * getAngle());\n }\n\n /**\n * Sets this axis-angle to represent a new rotation of axis ({@code x}, {@code y}, {@code z}) and\n * angle of {@code angle}.\n *\n * @param x x-component of the new axis.\n * @param y y-component of the new axis.\n * @param z z-component of the new axis.\n * @param angle the new angle.\n */\n default void set(double x, double y, double z, double angle)\n {\n getAxis().set(x, y, z);\n setAngle(angle);\n }\n\n /** {@inheritDoc} */\n @Override\n default void set(Orientation3DReadOnly orientation3DReadOnly)\n {\n if (orientation3DReadOnly instanceof AxisAngleReadOnly)\n set((AxisAngleReadOnly) orientation3DReadOnly);\n else\n orientation3DReadOnly.get(this);\n }\n\n /**\n * Sets the axis and the angle of this axis-angle.\n *\n * @param axis the new axis. Not modified.\n * @param angle the new angle.\n */\n default void set(Vector3DReadOnly axis, double angle)\n {\n getAxis().set(axis);\n setAngle(angle);\n }\n\n /**\n * Sets this axis-angle to the same value as the given axis-angle {@code other}.\n *\n * @param other the other axis-angle. Not modified.\n */\n default void set(AxisAngleReadOnly other)\n {\n getAxis().set(other.getAxis());\n setAngle(other.getAngle());\n }\n\n /**\n * Sets this axis-angle to {@code other} and then calls {@link #negate()}.\n *\n * @param other the other axis-angle to copy the values from. Not modified.\n */\n default void setAndNegate(AxisAngleReadOnly other)\n {\n set(other);\n negate();\n }\n\n /**\n * Copies the values in the given array into this axis-angle as follows:\n * <ul>\n * <li>{@code this.setX(axisAngleArray[0]);}\n * <li>{@code this.setY(axisAngleArray[1]);}\n * <li>{@code this.setZ(axisAngleArray[2]);}\n * <li>{@code this.setAngle(axisAngleArray[3]);}\n * </ul>\n *\n * @param axisAngleArray the array containing the new values for this axis-angle. Not modified.\n */\n default void set(double[] axisAngleArray)\n {\n set(0, axisAngleArray);\n }\n\n /**\n * Copies the values in the given array into this axis-angle as follows:\n * <ul>\n * <li>{@code this.setX(axisAngleArray[startIndex + 0]);}\n * <li>{@code this.setY(axisAngleArray[startIndex + 1]);}\n * <li>{@code this.setZ(axisAngleArray[startIndex + 2]);}\n * <li>{@code this.setAngle(axisAngleArray[startIndex + 3]);}\n * </ul>\n *\n * @param startIndex the first index to start reading from in the array.\n * @param axisAngleArray the array containing the new values for this axis-angle. Not modified.\n */\n default void set(int startIndex, double[] axisAngleArray)\n {\n setX(axisAngleArray[startIndex++]);\n setY(axisAngleArray[startIndex++]);\n setZ(axisAngleArray[startIndex++]);\n setAngle(axisAngleArray[startIndex]);\n }\n\n /**\n * Copies the values in the given array into this axis-angle as follows:\n * <ul>\n * <li>{@code this.setX(axisAngleArray[0]);}\n * <li>{@code this.setY(axisAngleArray[1]);}\n * <li>{@code this.setZ(axisAngleArray[2]);}\n * <li>{@code this.setAngle(axisAngleArray[3]);}\n * </ul>\n *\n * @param axisAngleArray the array containing the new values for this axis-angle. Not modified.\n */\n default void set(float[] axisAngleArray)\n {\n set(0, axisAngleArray);\n }\n\n /**\n * Copies the values in the given array into this axis-angle as follows:\n * <ul>\n * <li>{@code this.setX(axisAngleArray[startIndex + 0]);}\n * <li>{@code this.setY(axisAngleArray[startIndex + 1]);}\n * <li>{@code this.setZ(axisAngleArray[startIndex + 2]);}\n * <li>{@code this.setAngle(axisAngleArray[startIndex + 3]);}\n * </ul>\n *\n * @param startIndex the first index to start reading from in the array.\n * @param axisAngleArray the array containing the new values for this axis-angle. Not modified.\n */\n default void set(int startIndex, float[] axisAngleArray)\n {\n setX(axisAngleArray[startIndex++]);\n setY(axisAngleArray[startIndex++]);\n setZ(axisAngleArray[startIndex++]);\n setAngle(axisAngleArray[startIndex]);\n }\n\n /** {@inheritDoc} */\n @Override\n default void setAxisAngle(double x, double y, double z, double angle)\n {\n set(x, y, z, angle);\n }\n\n /** {@inheritDoc} */\n @Override\n default void setQuaternion(double x, double y, double z, double s)\n {\n AxisAngleConversion.convertQuaternionToAxisAngle(x, y, z, s, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void setRotationVector(double x, double y, double z)\n {\n AxisAngleConversion.convertRotationVectorToAxisAngle(x, y, z, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void setYawPitchRoll(double yaw, double pitch, double roll)\n {\n AxisAngleConversion.convertYawPitchRollToAxisAngle(yaw, pitch, roll, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void setRotationMatrix(double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22)\n {\n AxisAngleConversion.convertMatrixToAxisAngle(m00, m01, m02, m10, m11, m12, m20, m21, m22, this);\n }\n\n @Override\n default void setToYawOrientation(double yaw)\n {\n getAxis().set(Axis3D.Z);\n setAngle(yaw);\n }\n\n @Override\n default void setToPitchOrientation(double pitch)\n {\n getAxis().set(Axis3D.Y);\n setAngle(pitch);\n }\n\n @Override\n default void setToRollOrientation(double roll)\n {\n getAxis().set(Axis3D.X);\n setAngle(roll);\n }\n\n /**\n * Selects a component of this axis-angle based on {@code index} and sets it to {@code value}.\n * <p>\n * For {@code index} values of 0, 1, and 2, the corresponding components are x, y, and z,\n * respectively, while 3 corresponds to the angle.\n * </p>\n *\n * @param index the index of the component to set.\n * @param value the new value of the selected component.\n * @throws IndexOutOfBoundsException if {@code index} ∉ [0, 3].\n */\n default void setElement(int index, double value)\n {\n switch (index)\n {\n case 0:\n setX(value);\n break;\n case 1:\n setY(value);\n break;\n case 2:\n setZ(value);\n break;\n case 3:\n setAngle(value);\n break;\n default:\n throw new IndexOutOfBoundsException(Integer.toString(index));\n }\n }\n\n /**\n * Multiplies this axis-angle by {@code other}.\n * <p>\n * this = this * other\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void multiply(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiply(this, other, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void append(Orientation3DReadOnly other)\n {\n AxisAngleTools.multiply(this, false, other, false, this);\n }\n\n /**\n * Sets this axis-angle to the multiplication of {@code aa1} and {@code aa2}.\n * <p>\n * this = aa1 * aa2\n * </p>\n *\n * @param aa1 the first axis-angle in the multiplication. Not modified.\n * @param aa2 the second axis-angle in the multiplication. Not modified.\n */\n default void multiply(AxisAngleReadOnly aa1, AxisAngleReadOnly aa2)\n {\n AxisAngleTools.multiply(aa1, aa2, this);\n }\n\n /**\n * Multiplies this axis-angle by the inverse of {@code other}.\n * <p>\n * this = this * other<sup>-1</sup>\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void multiplyInvertOther(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiplyInvertRight(this, other, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void appendInvertOther(Orientation3DReadOnly orientation)\n {\n AxisAngleTools.multiply(this, false, orientation, true, this);\n }\n\n /**\n * Sets this axis-angle to the multiplication of the inverse of {@code this} and {@code other}.\n * <p>\n * this = this<sup>-1</sup> * other\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void multiplyInvertThis(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiplyInvertLeft(this, other, this);\n }\n\n /**\n * Sets this axis-angle to the multiplication of the inverse of {@code this} and the inverse of\n * {@code other}.\n * <p>\n * this = this<sup>-1</sup> * other<sup>-1</sup>\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void multiplyInvertBoth(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiplyInvertBoth(this, other, this);\n }\n\n /**\n * Appends a rotation about the z-axis to this axis-angle.\n *\n * <pre>\n * / ux = 0 \\\n * this = this * | uy = 0 |\n * | uz = 1 |\n * \\ angle = yaw /\n * </pre>\n *\n * @param yaw the angle to rotate about the z-axis.\n */\n @Override\n default void appendYawRotation(double yaw)\n {\n AxisAngleTools.appendYawRotation(this, yaw, this);\n }\n\n /**\n * Appends a rotation about the y-axis to this axis-angle.\n *\n * <pre>\n * / ux = 0 \\\n * this = this * | uy = 1 |\n * | uz = 0 |\n * \\ angle = pitch /\n * </pre>\n *\n * @param pitch the angle to rotate about the y-axis.\n */\n @Override\n default void appendPitchRotation(double pitch)\n {\n AxisAngleTools.appendPitchRotation(this, pitch, this);\n }\n\n /**\n * Appends a rotation about the x-axis to this axis-angle.\n *\n * <pre>\n * / ux = 1 \\\n * this = this * | uy = 0 |\n * | uz = 0 |\n * \\ angle = roll /\n * </pre>\n *\n * @param roll the angle to rotate about the x-axis.\n */\n @Override\n default void appendRollRotation(double roll)\n {\n AxisAngleTools.appendRollRotation(this, roll, this);\n }\n\n /**\n * Pre-multiplies this axis-angle by {@code other}.\n * <p>\n * this = other * other\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void preMultiply(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiply(other, this, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void prepend(Orientation3DReadOnly orientation)\n {\n AxisAngleTools.multiply(orientation, false, this, false, this);\n }\n\n /**\n * Sets this axis-angle to the multiplication of the inverse of {@code other} and {@code this}.\n * <p>\n * this = other<sup>-1</sup> * this\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void preMultiplyInvertOther(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiplyInvertLeft(other, this, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void prependInvertOther(Orientation3DReadOnly orientation)\n {\n AxisAngleTools.multiply(orientation, true, this, false, this);\n }\n\n /**\n * Sets this axis-angle to the multiplication of {@code other} and the inverse of {@code this}.\n * <p>\n * this = other * this<sup>-1</sup>\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void preMultiplyInvertThis(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiplyInvertRight(other, this, this);\n }\n\n /**\n * Sets this axis-angle to the multiplication of the inverse of {@code other} and the inverse of\n * {@code this}.\n * <p>\n * this = other<sup>-1</sup> * this<sup>-1</sup>\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void preMultiplyInvertBoth(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiplyInvertBoth(other, this, this);\n }\n\n /**\n * Prepends a rotation about the z-axis to this axis-angle.\n *\n * <pre>\n * / ux = 0 \\\n * this = | uy = 0 | * this\n * | uz = 1 |\n * \\ angle = yaw /\n * </pre>\n *\n * @param yaw the angle to rotate about the z-axis.\n */\n @Override\n default void prependYawRotation(double yaw)\n {\n AxisAngleTools.prependYawRotation(yaw, this, this);\n }\n\n /**\n * Prepends a rotation about the y-axis to this axis-angle.\n *\n * <pre>\n * / ux = 0 \\\n * this = | uy = 1 | * this\n * | uz = 0 |\n * \\ angle = pitch /\n * </pre>\n *\n * @param pitch the angle to rotate about the y-axis.\n */\n @Override\n default void prependPitchRotation(double pitch)\n {\n AxisAngleTools.prependPitchRotation(pitch, this, this);\n }\n\n /**\n * Prepends a rotation about the x-axis to this axis-angle.\n *\n * <pre>\n * / ux = 1 \\\n * this = | uy = 0 | * this\n * | uz = 0 |\n * \\ angle = roll /\n * </pre>\n *\n * @param roll the angle to rotate about the x-axis.\n */\n @Override\n default void prependRollRotation(double roll)\n {\n AxisAngleTools.prependRollRotation(roll, this, this);\n }\n}",
"AngleScalarDivide createAngleScalarDivide();",
"public static Direction fromAngle(double angle) {\n if (inRange(angle, 45, 135)) {\n return Direction.up;\n } else if (inRange(angle, 0, 45) || inRange(angle, 315, 360)) {\n return Direction.right;\n } else if (inRange(angle, 225, 315)) {\n return Direction.down;\n } else {\n return Direction.left;\n }\n\n }",
"public double getAngleToTarget(){\n return 0d;\n }",
"public void setAngle(float angle) {\n this.angle = angle;\n float cos = (float) Math.cos(angle);\n float sin = (float) Math.sin(angle);\n m00 = cos;\n m01 = sin;\n m10 = -sin;\n m11 = cos;\n }",
"public Vector2D(double angle)\n\t{\n\t\tx = Math.cos(Math.toRadians(angle));\n\t\ty = Math.sin(Math.toRadians(angle));\n\t}",
"@Test\r\n public void testCalculateAngle1() {\r\n System.out.println(\"calculateAngle1\");\r\n DialDraw instance = new TachometerDraw();\r\n instance.setValue(36);\r\n double expResult = Math.toRadians(115.2);\r\n double result = instance.calculateAngle();\r\n assertEquals(result, expResult, 0.0001);\r\n }",
"public double getAngleInDegrees() {\n return intakeAngle;\n }",
"Degree createDegree();",
"public double getStartAngle() {\n return startAngle;\n }",
"public int getCurrentAngle(){\n return flatbed.currentAngle;\n }",
"public AngularMeasurement(double angle) {\r\n this(angle, getDefaultUnit());\r\n }",
"public double getAngle() {\n try {\n switch(Coordinates.angleUnit()) {\n case Coordinates.RADIAN:\n\treturn Double.parseDouble(deg.getText().trim());\n case Coordinates.DEGRE:\n\treturn Math.PI * Double.parseDouble(deg.getText().trim()) / 180.0;\n case Coordinates.DEGMN:\n\tString d = deg.getText().trim();\n\tif(d.length() == 0)\n\t d = \"0\";\n\tString m = mn.getText().trim();\n\tif(m.length() == 0)\n\t m = \"0\";\n\treturn Coordinates.parseAngle(d + \"11\" + m + \"'\");\n case Coordinates.DEGMNSEC:\n\td = deg.getText().trim();\n\tif(d.length() == 0)\n\t d = \"0\";\n\tm = mn.getText().trim();\n\tif(m.length() == 0)\n\t m = \"0\";\n\tString s = sec.getText().trim();\n\tif(s.length() == 0)\n\t s = \"0\";\n\treturn Coordinates.parseAngle(d + \"11\" + m + \"'\" + s + \"\\\"\");\n }\n }\n catch(NumberFormatException e) {\n }\n return 0.0;\n }",
"private PVector angleAsVector(float theta) {\n\t\tPVector result = new PVector(0,0);\r\n\t\tresult.x = (float) Math.cos(theta);\r\n\t\tresult.y = (float) Math.sin(theta);\r\n\t\treturn result;\r\n\t}",
"public void rotateToAngle(int newAngle) {\n\t\tint diff = newAngle - getAngle();\n\t\tint diff1=Math.abs(diff-360);\n\t\tif (newAngle == getAngle()) {\n\t\t\tstopMotors();\n\t\t\treturn;\n\t\t}\n\t\twhile (Math.abs(getAngle() - newAngle) > 3&&opModeIsActive()) {\n\t\t\ttelemetry.addData(\"newangle\", newAngle);\n\t\t\ttelemetry.addData(\"getangle()\", getAngle());\n\t\t\ttelemetry.update();\n\t\t\tdiff = newAngle - getAngle();\n\t\t\tdiff1=Math.abs(getAngle() - newAngle);\n\t\t\tif ((diff > 0 && diff < 180) || (diff < 0 && Math.abs(diff) > 180)) {\n\n\t\t\t\tif(Math.abs(diff1)<13)\n\t\t\t\t\trotate(-0.06);\n\t\t\t\telse if(Math.abs(diff1)<50)\n\t\t\t\t\trotate(-0.1);\n\t\t\t\telse if(Math.abs(diff1)<160)\n\t\t\t\t\trotate(-0.5);\n\t\t\t\telse\n\t\t\t\t\trotate(-(0.00928571*Math.abs(diff1))+0.128571);\n\t\t\t} else {\n\n\t\t\t\tif(Math.abs(diff1)<13)\n\t\t\t\t\trotate(0.06);\n\t\t\t\telse if(Math.abs(diff1)<50)\n\t\t\t\t\trotate(0.1);\n\t\t\t\telse if(Math.abs(diff1)<160)\n\t\t\t\t\trotate(0.5);\n\t\t\t\telse\n\t\t\t\t\trotate((0.00928571*Math.abs(diff1))+0.128571);\n\t\t\t}\n\n\t\t}\n\t\tstopMotors();\n\n\t}",
"@Test\r\n public void testCalculateAngle2() {\r\n System.out.println(\"calculateAngle2\");\r\n DialDraw instance = new TachometerDraw();\r\n instance.setValue(0);\r\n double expResult = Math.toRadians(180);\r\n double result = instance.calculateAngle();\r\n assertEquals(result, expResult, 0.0001);\r\n }",
"public static double getAngle( GameObject one, GameObject two )\n {\n return Math.atan2( getDeltaY( one, two ), +getDeltaX( one, two ) );\n }",
"public double angle() {\n double angle = Math.toDegrees(Utilities.calculateAngle(this.dx, -this.dy));\n return angle;\n }",
"public int getOpeningAngle()\n {\n return this.openingAngle;\n }",
"public AngleWrapper2D(double value) {\r\n\t\tthis(new AngleMeasure2D(value)); \r\n\t}",
"@Test\r\n public void testCalculateAngle4() {\r\n System.out.println(\"calculateAngle4\");\r\n DialDraw instance = new TachometerDraw();\r\n instance.setValue(90);\r\n double expResult = Math.toRadians(18);\r\n double result = instance.calculateAngle();\r\n assertEquals(result, expResult, 0.0001);\r\n }",
"public double angle()\n {\n return Math.atan2(this.y, this.x);\n }",
"public int getAngle(){\n\t\tif(!resetCoordinates()&&robot.imu1.isGyroCalibrated()){\n\t\t\trobot.angles=robot.imu1.getAngularOrientation(AxesReference.INTRINSIC, AxesOrder.ZYX, AngleUnit.DEGREES);\n\t\t\tdouble currentAngle=robot.angles.firstAngle;\n\t\t\tint finalAngle= robot.startingAngle+(int)Math.round(currentAngle);\n\t\t\tif(finalAngle<0){\n\t\t\t\treturn 360+finalAngle;\n\t\t\t}\n\t\t\treturn finalAngle;\n\n\t\t}\n\t\telse if(!resetCoordinates()&&robot.imu.isGyroCalibrated()){\n\t\t\trobot.angles=robot.imu.getAngularOrientation(AxesReference.INTRINSIC, AxesOrder.YZX, AngleUnit.DEGREES);\n\t\t\tdouble currentAngle=robot.angles.firstAngle;\n\t\t\tint finalAngle= robot.startingAngle+(int)Math.round(currentAngle);\n\t\t\tif(finalAngle<0){\n\t\t\t\treturn 360+finalAngle;\n\t\t\t}\n\t\t\treturn finalAngle;\n\n\t\t}\n\t\telse if(resetCoordinates()){\n\t\t\tdouble oldAngle = robot.rotation.thirdAngle;\n\t\t\tdouble posAngle = oldAngle;\n\t\t\tint finalAngle;\n\t\t\tif (oldAngle < 0) posAngle = 360 - Math.abs(oldAngle);\n\t\t\tif((int) (Math.round(posAngle)) - 45 < 0){\n\t\t\t\tfinalAngle = 360-(int)Math.round(posAngle);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tfinalAngle = (int) (Math.round(posAngle)) - 45;\n\t\t\t}\n\t\t\treturn finalAngle;\n\t\t}\n\t\telse{\n\t\t\treturn 10000;\n\t\t}\n\t}",
"public double angle() {\n return Math.atan2(_y,_x);\n }",
"public void setStartAngle(double start) {\n startAngle = start;\n }",
"public double getAngle() {\n\treturn CVector.heading(v1, v2);\n }",
"@Test\r\n public void testCalculateAngle3() {\r\n System.out.println(\"calculateAngle3\");\r\n DialDraw instance = new TachometerDraw();\r\n instance.setValue(100);\r\n double expResult = Math.toRadians(0);\r\n double result = instance.calculateAngle();\r\n assertEquals(result, expResult, 0.0001);\r\n }",
"private float calculateAngle() {\r\n\r\n\t\tdouble angleTemp = Math.atan2(Target.getY() - y, Target.getX() - x);\r\n\t\t// I needed to use wikipedia to get this i\r\n\t\t// did not learn this in math and needed\r\n\t\t// to use a couplle youtube tutorials to\r\n\t\t// find out how to do the math in java\r\n\t\t// aswell thank fully one had the exact\r\n\t\t// way of doing this\r\n\t\treturn (float) Math.toDegrees(angleTemp) + 90;\r\n\t}"
]
| [
"0.77752703",
"0.76024324",
"0.73652387",
"0.73333806",
"0.73333806",
"0.72876364",
"0.697295",
"0.696141",
"0.6787517",
"0.6649375",
"0.66094387",
"0.6509505",
"0.6499557",
"0.64734954",
"0.64734954",
"0.6467922",
"0.64605945",
"0.64467967",
"0.64280033",
"0.64103246",
"0.64056414",
"0.6396555",
"0.6362296",
"0.6353887",
"0.63409686",
"0.63331044",
"0.63113767",
"0.6303639",
"0.62665063",
"0.62591404",
"0.62450737",
"0.62450737",
"0.6240621",
"0.623913",
"0.6214203",
"0.6208208",
"0.6198888",
"0.61667407",
"0.6127332",
"0.6084084",
"0.6064181",
"0.6056331",
"0.60210156",
"0.5988705",
"0.59844345",
"0.5977172",
"0.593284",
"0.59149724",
"0.5890195",
"0.58748984",
"0.5873871",
"0.5853142",
"0.584368",
"0.582915",
"0.5826125",
"0.58015996",
"0.57948923",
"0.5792938",
"0.57882434",
"0.57566476",
"0.57469386",
"0.5746378",
"0.57455695",
"0.5734052",
"0.5732281",
"0.5721744",
"0.57196635",
"0.5714667",
"0.5708938",
"0.5697671",
"0.5695283",
"0.5684428",
"0.56753683",
"0.56539",
"0.5631447",
"0.56221926",
"0.5596282",
"0.5591321",
"0.55813724",
"0.55800486",
"0.55555373",
"0.5555282",
"0.55493754",
"0.5548489",
"0.55423844",
"0.5530842",
"0.55237395",
"0.5522189",
"0.5515158",
"0.5484643",
"0.5478143",
"0.5474738",
"0.54692423",
"0.54466116",
"0.5444688",
"0.543926",
"0.54386884",
"0.5431006",
"0.54281706",
"0.54146016"
]
| 0.86753035 | 0 |
Returns a new object of class 'Length Add'. | LengthAdd createLengthAdd(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Length createLength();",
"LengthSubtract createLengthSubtract();",
"Length initLength(Length iLength)\n {\n iLength.updateElementValue(\"Length\");\n return iLength;\n }",
"LengthSmaller createLengthSmaller();",
"LengthScalarMultiply createLengthScalarMultiply();",
"LengthEquals createLengthEquals();",
"public void addLength(int num) {\r\n this.length += num;\r\n }",
"LengthConstraint createLengthConstraint();",
"public double getLength();",
"public void setLength(double length){this.length=length;}",
"public int getLength() {return length;}",
"float getLength();",
"float getLength();",
"public void addLength( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.add(this.model, this.getResource(), LENGTH, value);\r\n\t}",
"public void setLength(double newLength) {\n length = newLength;\n }",
"public double addLength(Length l1, Length l2) {\n return Double.sum(l1.value*l1.unit.baseUnitConversion, l2.value*l2.unit.baseUnitConversion);\n }",
"abstract double getLength();",
"public int getLength() { return length;\t}",
"public int getLength();",
"public int getLength();",
"public int getLength();",
"public double getLength(){\r\n\t\treturn length;\r\n\t}",
"public int getLength()\n {return length;}",
"protected abstract int getLength();",
"public abstract int getLength();",
"public abstract int getLength();",
"public abstract long getLength();",
"public abstract long getLength();",
"public void addLength(java.lang.String value) {\r\n\t\tBase.add(this.model, this.getResource(), LENGTH, value);\r\n\t}",
"public double getLength(){\n return length;\n }",
"public long getLength();",
"public long getLength();",
"public int get_length();",
"@Override\n public Integer length() {\n return myLength;\n }",
"public int getLength(){\n return length;\n }",
"public void setLength(int length)\n {\n this.length = length;\n }",
"public double getLength() {\r\n return length;\r\n }",
"public void addLength() {\n\t\tBodyPart b1 = snake.getBodyPart(snake.getSize()-1), b2 = snake.getBodyPart(snake.getSize()-2);\n\t\tif(b1.getX() > b2.getX())\n\t\t\tsnake.addBodyPart(b1.getX()+GameObject.SIZE, b1.getY());\n\t\telse if(b1.getX() < b2.getX())\n\t\t\tsnake.addBodyPart(b1.getX()-GameObject.SIZE, b1.getY());\n\t\telse if(b1.getY() >= b2.getY())\n\t\t\tsnake.addBodyPart(b1.getX(), b1.getY()+GameObject.SIZE);\n\t\telse if(b1.getY() >= b2.getY())\n\t\t\tsnake.addBodyPart(b1.getX(), b1.getY()-GameObject.SIZE);\n\t}",
"public int getLength(){\n return this.length;\n }",
"public void setLength(long length);",
"public void setLength(long length);",
"public double getLength()\n {\n return length;\n }",
"public void setLength(double length)\r\n {\r\n this.length = length;\r\n }",
"public void setLength(long length) { \n this.length = length; \n }",
"public int getLength(){\n\t\treturn length;\n\t}",
"public int getLength(){\n\t\treturn length;\n\t}",
"private int length() { return length; }",
"public void setLength(int length) {\r\n this.length = length;\r\n }",
"public void setLength(int length) {\r\n this.length = length;\r\n }",
"public int getLength() {\r\n return length;\r\n }",
"public int getLength() {\r\n return length;\r\n }",
"public int getLength() {\r\n return length;\r\n }",
"public void setLength( int length ) { setCapacity( length ); this.length = length; }",
"void setLength(int length);",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"public int getLength()\n {\n return length;\n }",
"public double getLength() {\n return length;\n }",
"public int my_length();",
"public abstract void getLength(double length);",
"public void setLength(Double newlength)\n {\n length = newlength;\n }",
"public void setLength(double length) {\r\n this.length = length;\r\n }",
"public int getLength() {\n return length;\n }",
"public int getLength() {\n return length;\n }",
"public void setLength(double length) {\n this.length = length;\n }",
"public long getLength() { \n return length; \n }",
"public int getLength()\n {\n\treturn length;\n }",
"public double getLength() {\r\n\t\t\treturn length;\r\n\t\t}",
"public double getLength() {\r\n\t\treturn length;\r\n\t}",
"public int getLength() {\n return length;\n }",
"public double getLength()\n\t{\n\t\treturn length;\n\t}",
"public int getLength() {\n return length_;\n }",
"public Double getLength()\n {\n return length;\n }",
"public double getLength() {\n\t\treturn length;\n\t}",
"LengthGreater createLengthGreater();",
"@Override\n\tpublic void setLength(int length) {\n\t\t\n\t}",
"public int getLength() {\n return this.length;\n }",
"public int getLength() {\n return this.length;\n }",
"public RADIUSAttribute setLength(final byte length) {\n this.length = length;\n return this;\n }",
"LengthDistinct createLengthDistinct();",
"public Integer getLength() {\n return _length;\n }",
"public Integer getLength() {\n return _length;\n }",
"@Test\n public void getLengthVector2d(){\n Vector2d newVec = new Vector2d(0,1);\n vector.add(newVec);\n\n assertTrue(newVec.getLength() == 1);\n }",
"public Builder setLength(int value) {\n \n length_ = value;\n onChanged();\n return this;\n }",
"void setLength( long length );",
"public void setLength(int length) {\r\n\t\tthis.length = length;\r\n\t}",
"public int getLength() {\r\n\t\treturn length;\r\n\t}",
"public static void addLength( Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.add(model, instanceResource, LENGTH, value);\r\n\t}",
"public ParseResult prefixOfLength (Object input, int length, int peel)\n {\n ParseResult r = prefixInternal(input, peel + 1);\n assertTrue(r.matchSize == length, peel + 1,\n () -> r.toString(map, onlyRulesInCallStacks));\n clearLocals();\n return r;\n }",
"public A3Add(){}",
"public int getLength()\n\t{\n\t\treturn length;\n\t}",
"public int getLength()\n\t{\n\t\treturn length;\n\t}"
]
| [
"0.756241",
"0.7375513",
"0.66233826",
"0.65855765",
"0.6527031",
"0.62847984",
"0.623761",
"0.6234026",
"0.6198268",
"0.61612695",
"0.6140415",
"0.612654",
"0.612654",
"0.6125553",
"0.6037686",
"0.6011032",
"0.5983828",
"0.5944096",
"0.5933496",
"0.5933496",
"0.5933496",
"0.59191436",
"0.5915028",
"0.5892942",
"0.58749676",
"0.58749676",
"0.5845844",
"0.5845844",
"0.58372587",
"0.5822281",
"0.5822105",
"0.5822105",
"0.58144534",
"0.5805776",
"0.58053946",
"0.58040583",
"0.57946694",
"0.5791049",
"0.5779906",
"0.5778751",
"0.5778751",
"0.57786757",
"0.57765585",
"0.5771845",
"0.57519305",
"0.57519305",
"0.57507014",
"0.57478064",
"0.57478064",
"0.5741789",
"0.5741789",
"0.5741789",
"0.5738056",
"0.57358444",
"0.5733813",
"0.5733813",
"0.5733813",
"0.5733813",
"0.5733813",
"0.5733813",
"0.5733813",
"0.5733813",
"0.5733813",
"0.5733813",
"0.5733374",
"0.57177746",
"0.571748",
"0.57038957",
"0.5694107",
"0.5683389",
"0.567199",
"0.567199",
"0.5671239",
"0.56640697",
"0.56635606",
"0.5657685",
"0.56567025",
"0.5655405",
"0.56468046",
"0.56302404",
"0.5628487",
"0.56197494",
"0.5617901",
"0.5617658",
"0.56149906",
"0.56149906",
"0.560832",
"0.5585943",
"0.5581828",
"0.5581828",
"0.55813015",
"0.55766314",
"0.55764455",
"0.55690527",
"0.5563905",
"0.5552352",
"0.5549347",
"0.5543402",
"0.5540125",
"0.5540125"
]
| 0.875192 | 0 |
Returns a new object of class 'Length Subtract'. | LengthSubtract createLengthSubtract(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Length createLength();",
"LengthAdd createLengthAdd();",
"LengthSmaller createLengthSmaller();",
"float getLength();",
"float getLength();",
"public double getLength();",
"abstract double getLength();",
"public double getLength() {\n\treturn CVector.subtract(v2, v1).getMag();\n }",
"LengthEquals createLengthEquals();",
"Length initLength(Length iLength)\n {\n iLength.updateElementValue(\"Length\");\n return iLength;\n }",
"LengthScalarMultiply createLengthScalarMultiply();",
"public double getLength(){\r\n\t\treturn length;\r\n\t}",
"public void setLength(double length){this.length=length;}",
"public abstract void getLength(double length);",
"public double getLength(){\n return length;\n }",
"LengthGreater createLengthGreater();",
"public int getLength() {return length;}",
"public double getLength() {\r\n return length;\r\n }",
"public double getLength()\n {\n return length;\n }",
"LengthConstraint createLengthConstraint();",
"public void subtract() {\n\t\t\n\t}",
"public int getLength();",
"public int getLength();",
"public int getLength();",
"public double getLength() {\n return length;\n }",
"public void setLength(double newLength) {\n length = newLength;\n }",
"public abstract long getLength();",
"public abstract long getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"public long getLength();",
"public long getLength();",
"protected abstract int getLength();",
"public abstract int getLength();",
"public abstract int getLength();",
"public double getLength() {\r\n\t\treturn length;\r\n\t}",
"public int getLength()\n {return length;}",
"public Duration length() {\n return getObject(Duration.class, FhirPropertyNames.PROPERTY_LENGTH);\n }",
"public Double getLength()\n {\n return length;\n }",
"public double getLength() {\r\n\t\t\treturn length;\r\n\t\t}",
"public double getLength()\n\t{\n\t\treturn length;\n\t}",
"public static OperationMBean getSubtractOperationMBean()\n {\n return new Operation(\"subtract\");\n }",
"Minus createMinus();",
"Minus createMinus();",
"Minus createMinus();",
"public double getLength() {\n\t\treturn length;\n\t}",
"public int getLength() { return length;\t}",
"public short lengthDiff() {\n \tshort total = computeLength();\n \treturn (short)(total - (short)MINIMUM_LENGTH + alignment(total, 0));\n }",
"public int get_length();",
"public Length getUnit() {\n return unit;\n }",
"public int getLength(){\n return length;\n }",
"public vec3 minus(vec3 arg) {\r\n\t\tvec3 tmp = new vec3();\r\n\t\ttmp.sub(this, arg);\r\n\t\treturn tmp;\r\n\t}",
"public double getLength() {\n return hi - lo;\n }",
"public long getLength() { \n return length; \n }",
"LengthScalarDivide createLengthScalarDivide();",
"public void setLength(double length)\r\n {\r\n this.length = length;\r\n }",
"public vec3 minus(float arg) {\r\n\t\tvec3 tmp = new vec3();\r\n\t\ttmp.sub(this, arg);\r\n\t\treturn tmp;\r\n\t}",
"public double getLength() {\n return VectorXZ.distance(p1, p2);\n }",
"public int getLength() {\r\n return length;\r\n }",
"public int getLength() {\r\n return length;\r\n }",
"public int getLength() {\r\n return length;\r\n }",
"public int getLength(){\n\t\treturn length;\n\t}",
"public int getLength(){\n\t\treturn length;\n\t}",
"public int getLength(){\n return this.length;\n }",
"public int getLength()\n {\n return length;\n }",
"public abstract long getLength() throws VlException;",
"public void setLength(Double newlength)\n {\n length = newlength;\n }",
"public Integer getLength() {\n return _length;\n }",
"public Integer getLength() {\n return _length;\n }",
"private LengthResult(long length, int format) {\n\t\t\tthis.length = length;\n\t\t\tthis.format = format;\n\t\t}",
"BaseNumber subtract(BaseNumber operand);",
"public int getLength() {\n return length;\n }",
"public int getLength() {\n return length;\n }",
"public double getLength()\r\n {\r\n return this.lengthCapacity;\r\n }",
"@Override\n\tpublic double subtract(double in1, double in2) {\n\t\treturn 0;\n\t}",
"public int getLength()\n {\n\treturn length;\n }",
"public T subtract(T measure);",
"public void setLength(double length) {\r\n this.length = length;\r\n }",
"public void setLength(double length) {\n this.length = length;\n }",
"public static Vector subtract(Vector v1, Vector v2) {\r\n Vector w = new Vector(v1);\r\n w.subtract(v2);\r\n return w;\r\n }",
"@Override\n public Integer length() {\n return myLength;\n }",
"public double LengthA(){\n\t\treturn Math.abs(x2 - x1);\n\t}",
"public int getLength(){ // getter method\n return length; // return the value of the class attribute radius\n }",
"public int my_length();",
"public HugeUInt subtract(HugeUInt arg) {\r\n //We only subtract smaller numbers\r\n HugeUInt result = new HugeUInt(this);\r\n int cur = 0;\r\n for (int i = 0; i < arg.getSize(); i++) {\r\n cur = cur + 10 + result.array[i] - arg.array[i];\r\n result.array[i] = cur % 10;\r\n cur = cur < 10 ? -1 : 0;\r\n }\r\n for (int i = arg.getSize(); i < getSize(); i++) {\r\n cur = cur + 10 + result.array[i];\r\n result.array[i] = cur % 10;\r\n cur = cur < 10 ? -1 : 0;\r\n }\r\n result.trim();\r\n return result;\r\n }",
"public Vlen_t() {}",
"public void setLength(long length);",
"public void setLength(long length);",
"AngleSubtract createAngleSubtract();",
"public int getLength() {\n return length;\n }",
"public void setLength(long length) { \n this.length = length; \n }",
"private int length() { return length; }"
]
| [
"0.72346056",
"0.672248",
"0.65959024",
"0.6371799",
"0.6371799",
"0.6296809",
"0.6162293",
"0.61089796",
"0.59944683",
"0.59783554",
"0.59422714",
"0.5881743",
"0.58530945",
"0.58309704",
"0.58187175",
"0.57711154",
"0.57625145",
"0.57385796",
"0.5727553",
"0.5715703",
"0.56770253",
"0.5671097",
"0.5671097",
"0.5671097",
"0.5664504",
"0.5664051",
"0.5640032",
"0.5640032",
"0.5630883",
"0.5630883",
"0.5630883",
"0.5630883",
"0.5630883",
"0.5630883",
"0.5630883",
"0.5630883",
"0.5630883",
"0.5630883",
"0.5624687",
"0.5624687",
"0.56118745",
"0.5593838",
"0.5593838",
"0.55827487",
"0.5580114",
"0.5579341",
"0.5574994",
"0.55723363",
"0.5567309",
"0.55669874",
"0.55390227",
"0.55390227",
"0.55390227",
"0.5533719",
"0.55281514",
"0.5517499",
"0.5513096",
"0.5512911",
"0.5507563",
"0.5507349",
"0.5455903",
"0.54547215",
"0.5418723",
"0.5396221",
"0.5386824",
"0.5384685",
"0.5380865",
"0.5380865",
"0.5380865",
"0.5375132",
"0.5375132",
"0.5370585",
"0.53648156",
"0.53597754",
"0.53472215",
"0.5330973",
"0.5330973",
"0.53111994",
"0.5305777",
"0.53041905",
"0.53041905",
"0.5304051",
"0.53037274",
"0.52999455",
"0.52957183",
"0.52906865",
"0.5285592",
"0.5282954",
"0.5273267",
"0.52704537",
"0.5266698",
"0.52625626",
"0.5261294",
"0.5260381",
"0.5257003",
"0.5257003",
"0.5255518",
"0.524975",
"0.5245493",
"0.52387875"
]
| 0.8907759 | 0 |
Returns a new object of class 'Length Scalar Multiply'. | LengthScalarMultiply createLengthScalarMultiply(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Multiply createMultiply();",
"LengthScalarDivide createLengthScalarDivide();",
"public Vector<T> multiply(T aScalar);",
"public void multiply() {\n\t\t\n\t}",
"Length createLength();",
"@Override\r\n\tpublic int mul() {\n\t\treturn 0;\r\n\t}",
"private void mul() {\n\n\t}",
"LengthAdd createLengthAdd();",
"public LMUL() {\n super(InstructionOpCodes.LMUL, 1);\n }",
"public JTensor mul(JType value) {\n JTensor r = new JTensor();\n TH.THTensor_(mul)(r, this, value);\n return r;\n }",
"public static OperationMBean getMultiplyOperationMBean()\n {\n return new Operation(\"multiply\");\n }",
"LengthSubtract createLengthSubtract();",
"public Parameter multiplyParameter(Parameter otherPram);",
"@Override\n\tpublic IVector scalarMultiply(double number){\n\t\tfor(int i=this.getDimension()-1; i>=0; i--){\n\t\t\tthis.set(i, this.get(i)*number);\n\t\t}\n\t\treturn this;\n\t}",
"public Scalar mul(Scalar s) {\n\t\treturn new RealScalar(getValue() * ((RealScalar)s).getValue());\n\t}",
"abstract void mulS();",
"public String multiply()\r\n {\r\n\r\n return First.multiply(Second).stripTrailingZeros().toString();\r\n }",
"MulOrDiv createMulOrDiv();",
"public T mul(T first, T second);",
"BaseNumber multiply(BaseNumber operand);",
"public int getProduct() {\n int a = 5;\n int b = 14;\n int c = a * b;\n return c;\n }",
"public double getProduct()\n {\n return first * second;\n }",
"public AncientEgyptianMultiplication( ) {\r\n }",
"Multiplication createRandomMultiplication();",
"Multiplication createRandomMultiplication();",
"@Override\npublic void mul(int a, int b) {\n\t\n}",
"@Override\n\tpublic float multiplicar(float op1, float op2) {\n\t\treturn op1 * op2;\n\t}",
"public long product() {\n\t\tlong result = 1;\n\t\tfor (int i=0; i<numElements; i++) {\n\t\t\tresult *= theElements[i];\n\t\t}\n\t\treturn result;\n\t}",
"public void mul_(JType value) {\n TH.THTensor_(mul)(this, this, value);\n }",
"public static <T extends Vector> T Multiply(T a, T b,T result){\n if(Match(a,b)) {\n for (int i = 0; i < result.axis.length; i++) {\n result.axis[i] = a.axis[i] * b.axis[i];\n }\n return result;\n }\n return result;\n }",
"@Override\n\tpublic double multiply(double in1, double in2) {\n\t\treturn 0;\n\t}",
"public Vector tensorProduct( final Vector a);",
"public void multiply(Object mulValue) {\r\n\r\n\t\tNumberOperation operator = new NumberOperation(this.value, mulValue) {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic Number doAnOperation() {\r\n\t\t\t\tTypeEnum typeOfResult = getFinalType();\r\n\t\t\t\tif(typeOfResult == TypeEnum.TYPE_INTEGER) {\r\n\t\t\t\t\treturn getO1().intValue() * getO2().intValue();\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\treturn getO1().doubleValue() * getO2().doubleValue();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\tthis.value = operator.doAnOperation();\r\n\t}",
"public void mul() {\n //TODO: Fill in this method, then remove the RuntimeException\n throw new RuntimeException(\"RatPolyStack->mul() unimplemented!\\n\");\n }",
"public Vector3 mult(float scalar){\r\n\t\tthis.x *= scalar;\r\n\t\tthis.y *= scalar;\r\n\t\tthis.z *= scalar;\r\n\t\treturn this;\r\n\t}",
"public int producto(){\r\n return x*y;\r\n }",
"public static JTensor addcmul(JTensor t, JType a, JTensor s1, JTensor s2) {\n JTensor r = new JTensor();\n TH.THTensor_(addcmul)(r, t, a, s1, s2);\n return r;\n }",
"AngleScalarMultiply createAngleScalarMultiply();",
"@SuppressWarnings(\"unchecked\")\n @Override\n public Expression asExpression(Rule rule, Deque<Value<Expression>> args) {\n if (args.size() == 1) {\n // a single term is not a product\n return args.pollFirst().getTarget();\n } else {\n // assume x to be *x, because the product will start by 1*x\n Term<Multiplicative> factor = new Term<>(Multiplicative.MULT, args.removeFirst().getTarget());\n List<Term<Multiplicative>> arguments = new LinkedList<>();\n arguments.add(factor);\n args.stream()\n // next arguments are all Term<Multiplicative>\n .map(v -> (Term<Multiplicative>) v.getTarget())\n .forEachOrdered(arguments::add);\n return new Product(arguments);\n }\n }",
"@Override\n\tpublic double multiply(double a, double b) {\n\t\treturn (a*b);\n\t}",
"@Override\r\n\tpublic void mul(int x, int y) {\n\t\t\r\n\t}",
"abstract int multiplication(int num1, int num2);",
"@Override\n\tpublic IVector nScalarMultiply(double number){\n\t\treturn this.copy().scalarMultiply(number);\n\t}",
"public void mul()\n\t{\n\t\t\n\t\tSystem.out.println(\"Hey I am in base class********** and addition is 2500\");\n\t}",
"@ZenCodeType.Operator(ZenCodeType.OperatorType.MUL)\n default IData mul(IData other) {\n \n return notSupportedOperator(OperatorType.MUL);\n }",
"abstract double getLength();",
"public Mult(Expression left, Expression right) {\n super(left, right);\n }",
"public Mult(Expression left, Expression right) {\n super(left, right);\n }",
"abstract double getLengthSquared();",
"public int multiply(int a,int b) throws RemoteException;",
"public BinMltLinExpr multiply(double constant) {\n\t\tBinMltLinExpr result = new BinMltLinExpr();\n\t\tfor (int i = 0; i < coefficients.size(); i++) {\n\t\t\tresult.coefficients.add(coefficients.get(i) * constant);\n\t\t\tresult.termVars.add(termVars.get(i));\n\t\t}\n\t\tresult.constant = this.constant * constant;\n\t\treturn result;\n\t}",
"public static double scalarProduct(Vector v1, Vector v2){\r\n\t\treturn v1.getX()*v2.getX() + v1.getY()*v2.getY();\r\n\t\t\r\n\t}",
"IVec3 mult(IVec3 v);",
"public static int multiply(int lafoot,int lapaki){\n\treturn 0;\n}",
"public Vector2d mul(double s) {\n\t\treturn new Vector2d(x*s, y*s);\n\t}",
"final public Vector3 mul(double c){\n return new Vector3(x*c, y*c, z*c);\n }",
"public Vector2D scalarMult(double scalar)\n {\n return new Vector2D(scalar * this.x, scalar * this.y);\n }",
"public vec2 mul( vec2 o){\n vec2 R = new vec2 ();\n R.x += this._M[ 0 ] * o.x ;\n R.x += this._M[ 1 ] * o.y ;\n R.y += this._M[ 4 ] * o.x ;\n R.y += this._M[ 5 ] * o.y ;\n return R;\n }",
"public void calculate(){\n\t\tint temp = new Random().nextInt();\r\n\t\tint width = temp;\r\n\t\twidth++;\r\n\t\tclass Inner {\r\n\t\t\tpublic void multiply(){\r\n\t\t\t\tSystem.out.println(length* width);\r\n\t\t\t}\r\n\t\t}\r\n\t\tInner inner = new Inner();\r\n\t\tinner.multiply();\r\n\t}",
"public int product() {\n // You'll need to replace this code with something\n // else to make product() work; this is just to make\n // things compile while you work on sum()\n return 1;\n }",
"private static native double mul(int n);",
"public static Rational multiply(Rational num1, Rational num2){\r\n Rational product = new Rational();\r\n \r\n // multiply throughout\r\n product.denominator = num1.getDenominator() * num2.getDenominator();\r\n product.numerator = num1.getNumerator() * num2.getNumerator();\r\n \r\n product.reduce();\r\n return product;\r\n }",
"@Override\r\n\tpublic int mul(int a,int b) {\n\t\treturn a*b;\r\n\t}",
"public float sizeMultiplier();",
"Sum getMultiplier();",
"public double getLength();",
"public Vector2D mul(double a)\n\t{\n\t\treturn new Vector2D(a*x, a*y);\n\t}",
"public Composite multiply(Composite comp) {\n\t\tif(comp.isUnit()){\n\t\t\treturn this;\n\t\t}\n\t\tif(this.isUnit()){\n\t\t\treturn comp;\n\t\t}\n\t\tNode head = comp.head;\n\t\tNode current_node = this.head;\n\t\t//long product = 1;\n\t\tBigInteger product = BigInteger.ONE;\n\t\twhile (current_node != null){\n\t\t\tlong factor = (long) Math.pow(current_node.factor, current_node.power);\n\t\t\tproduct = product.multiply(BigInteger.valueOf(factor));\n\t\t\tcurrent_node = current_node.next;\n\t\t}\n\t\twhile (comp.head != null){\n\t\t\tlong factor = (long)Math.pow(comp.head.factor, comp.head.power);\n\t\t\tproduct = product.multiply(BigInteger.valueOf(factor));\n\t\t\tcomp.head = comp.head.next;\n\t\t}\n\t\tComposite p = new Composite();\n\t\tNode n = new Node(product.longValue(), 1);\n\t\tp.head = n;\n\t\tcomp.head = head;\n\t\treturn p;\n\t}",
"public int mult()\r\n\t{\r\n\t\tint a=10;\r\n\t\tint b=20;\r\n\t\tint c = a*b;\r\n\t\treturn(c);\r\n\t}",
"public Polynomial operate(){\n Polynomial result = a.multiplyPolynomial(b);\n return result;\n }",
"@Override\r\n\tpublic int multi(int x, int y) {\n\t\treturn x * y;\r\n\t}",
"public static UnitP Multiplication(UnitP first, UnitP second)\n {\n return OperationsPublic.PerformUnitOperation\n (\n first, second, Operations.Multiplication,\n OperationsOther.GetOperationString(first, second, Operations.Multiplication) \n );\n }",
"@Override\n\tpublic void mul(double dx, double dy) {\n\t\t\n\t}",
"public BinMltLinExpr multiply(BinLinExpr expr) {\n\t\t\n\t\tBinMltLinExpr result = new BinMltLinExpr();\n\t\t\n\t\t// Multiply variables together\n\t\tfor (int i = 0; i < expr.vars.size(); i++) {\n\t\t\tfor (int j = 0; j < termVars.size(); j++) {\n\t\t\t\t\n\t\t\t\tdouble newCoeff = expr.coefficients.get(i) * coefficients.get(j);\n\t\t\t\tList<BinVar> newVars = new ArrayList<BinVar>();\n\t\t\t\tnewVars.add(expr.vars.get(i));\n\t\t\t\tnewVars.addAll(termVars.get(j));\n\t\t\t\t\n\t\t\t\tresult.addTerm(newCoeff, newVars);\n\t\t\t}\n\t\t}\n\n\t\t// Multiply variables with constants\n\t\tfor (int i = 0; i < termVars.size(); i++) {\n\t\t\tdouble newCoeff = coefficients.get(i) * expr.constant;\n\t\t\tresult.addTerm(newCoeff, termVars.get(i));\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < expr.vars.size(); i++) {\n\t\t\tdouble newCoeff = expr.coefficients.get(i) * constant;\n\t\t\tresult.addTerm(newCoeff, expr.vars.get(i));\n\t\t}\n\t\t\n\t\tresult.addConstant(constant*expr.constant);\n\t\t\n\t\treturn result;\n\t}",
"public void multiply()\r\n {\r\n resultDoubles = Operations.multiply(leftOperand, rightOperand);\r\n resultResetHelper();\r\n }",
"public interface IMul {\n Var mul(Var var);\n\n}",
"public float lengthSquared ( );",
"public Rational multiply(Rational other)\n\t{\n\t\tint multNumer = (getNumer() * other.getNumer());\n\t\tint multDenom = (getDenom() * other.getDenom());\n\n\t\tRational product = new Rational(multNumer, multDenom);\n\t\tproduct.normalize();\n\t\treturn product;\n\t}",
"public static VectorIntf componentProduct(VectorIntf x, VectorIntf y) {\r\n if (x==null) throw new IllegalArgumentException(\"1st arg is null\");\r\n if (y==null) throw new IllegalArgumentException(\"2nd arg is null\");\r\n final int n = x.getNumCoords();\r\n if (n!=y.getNumCoords())\r\n throw new IllegalArgumentException(\"dimensions don't match\");\r\n VectorIntf z = x.newInstance(); // x.newCopy();\r\n try {\r\n for (int i = 0; i < n; i++) {\r\n z.setCoord(i, x.getCoord(i) * y.getCoord(i));\r\n }\r\n }\r\n catch (parallel.ParallelException e) {\r\n e.printStackTrace(); // can never get here\r\n }\r\n return z;\r\n }",
"@Override\n public Polynomial multiply(Polynomial q) {\n if (q == null)\n throw new NullPointerException(\"cannot multiply null polynomials\");\n\n return multSparse(this, toSparsePolynomial(q));\n }",
"public Square(Color emission, Material material,\n Point3D P1, Vector v1,\n Vector v2, double length) {\n super(emission, material, P1, v1.crossProduct(v2));\n if (v1.dotProduct(v2) != 0)\n throw new IllegalArgumentException(\"the vectors are not orthogonal\");\n v1 = v1.rescale(length);\n v2 = v2.rescale(length);\n p2 = p1.add(v1);\n p4 = p1.add(v2);\n p3 = p4.add(v1);\n }",
"public DVec multiply(DVec arg0) {\n\t\tDVec vec = new DVec(arg0.rowCount());\n\t\tfor (int i = 0; i < rowCount(); i++)\n\t\t\tfor (int j = 0; j < columnCount(); j++)\n\t\t\t\tvec.set(i, get(i, j) * arg0.get(i));\n\t\treturn vec;\n\t}",
"public <V extends Number> FluentExp<V> times (SQLExpression<V> expr)\n {\n return new Mul<V>(this, expr);\n }",
"public Transformation mult(Transformation a) {\n\t\tTransformation result = new Transformation();\n\t\tsuper.mult(a, result);\n\t\treturn result;\n\t}",
"public BinMltLinExpr multiply(BinMltLinExpr expr) {\n\t\t\n\t\tBinMltLinExpr result = new BinMltLinExpr();\n\t\t\n\t\t// Multiply variables together\n\t\tfor (int i = 0; i < expr.termVars.size(); i++) {\n\t\t\tfor (int j = 0; j < termVars.size(); j++) {\n\t\t\t\t\n\t\t\t\tdouble newCoeff = expr.coefficients.get(i) * coefficients.get(j);\n\t\t\t\tList<BinVar> newVars = new ArrayList<BinVar>();\n\t\t\t\tnewVars.addAll(expr.termVars.get(i));\n\t\t\t\tnewVars.addAll(termVars.get(j));\n\t\t\t\t\n\t\t\t\tresult.addTerm(newCoeff, newVars);\n\t\t\t}\n\t\t}\n\n\t\t// Multiply variables with constants\n\t\tfor (int i = 0; i < termVars.size(); i++) {\n\t\t\tdouble newCoeff = coefficients.get(i) * expr.constant;\n\t\t\tresult.addTerm(newCoeff, termVars.get(i));\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < expr.termVars.size(); i++) {\n\t\t\tdouble newCoeff = expr.coefficients.get(i) * constant;\n\t\t\tresult.addTerm(newCoeff, expr.termVars.get(i));\n\t\t}\n\t\t\n\t\tresult.addConstant(constant*expr.constant);\n\t\t\n\t\treturn result;\n\t}",
"public T elementMult( T b ) {\n convertType.specify(this, b);\n T A = convertType.convert(this);\n b = convertType.convert(b);\n\n T c = A.createLike();\n A.ops.elementMult(A.mat, b.mat, c.mat);\n return c;\n }",
"@Override\n\tpublic String toString() {\n\t\treturn \"MULT\";\n\t}",
"LengthEquals createLengthEquals();",
"public Matrix multiply(double scalar) {\n Matrix result = new Matrix(this.rows, this.cols);\n for (int i = 0; i < this.rows; i++) {\n for (int j = 0; j < this.cols; j++) {\n result.data[i][j] = this.data[i][j] * scalar;\n }\n }\n\n return result;\n }",
"Expression multExpression() throws SyntaxException {\r\n\t\tToken first = t;\r\n\t\tExpression e0 = powerExpression();\r\n\t\twhile(isKind(OP_TIMES, OP_DIV, OP_MOD)) {\r\n\t\t\tToken op = consume();\r\n\t\t\tExpression e1 = powerExpression();\r\n\t\t\te0 = new ExpressionBinary(first,e0,op,e1);\r\n\t\t}\r\n\t\treturn e0;\r\n\t}",
"public Mult(Expression left, double right) {\n super(left, right);\n }",
"laptop(int length, int weight, int height, int width) {\r\n this.length = length;\r\n this.weight = weight;\r\n this.height = height;\r\n this.width = width;\r\n }",
"public Square(Color emission, int Shininess,\n double _Kd, double _Ks, double _Kr, double _Kt,\n Point3D P1, Vector v1,\n Vector v2, double length) {\n super(emission, Shininess, _Kd, _Ks, _Kr, _Kt, P1, v1.crossProduct(v2));\n if (v1.dotProduct(v2) != 0)\n throw new IllegalArgumentException(\"the vectors are not orthogonal\");\n v1 = v1.rescale(length);\n v2 = v2.rescale(length);\n p2 = p1.add(v1);\n p4 = p1.add(v2);\n p3 = p4.add(v1);\n }",
"public LorentzVector multiply(double factor) {\n\t\tLorentzVector newVector = new LorentzVector(this);\n\t\tthis.fact(factor);\n\t\treturn newVector;\n\t}",
"public PolyTerm mul(PolyTerm pt) {\n\t\tScalar coeffi=this.coefficient.mul(pt.coefficient);\n\t\tint expon= pt.exponent + this.exponent;\n\t\treturn new PolyTerm(coeffi, expon);\n\t}",
"public interface VectorOperations extends MatrixOperations\n{\n /**\n * \n * Multiplies the vectors in a specific way, not sure of the term\n * \n * @param a\n * @param b\n * @return\n */\n public static Vector tensorProduct( final Vector a , final Vector b)\n {\n return a.tensorProduct(b);\n }\n \n /**\n * \n * Makes the tensor product of this and a\n * \n * @param a\n * @return\n */\n public Vector tensorProduct( final Vector a);\n \n /**\n * \n * Pretty much like List.sublist\n * \n * @param indexFrom\n * @param indexTo\n * @return\n */\n public Vector get( final int indexFrom, final int indexTo );\n \n /**\n * \n * @return size of the vector\n */\n public int size();\n}",
"private RealMatrix scalarMultiplication(RealMatrix matrix1, RealMatrix matrix2) {\n\t\tdouble a = matrix1.getEntry(0, 0);\n\t\tdouble b = matrix1.getEntry(1, 0);\n\t\tdouble c = matrix1.getEntry(2, 0);\n\t\tdouble d = matrix1.getEntry(3, 0);\n\t\t\n\t\tdouble[][] result = new double[matrix2.getRowDimension()][matrix2.getColumnDimension()];\n\t\t\n\t\tfor (int i=0; i < matrix2.getRowDimension(); i++) {\n\t\t\tfor (int j=0; j < matrix2.getColumnDimension(); j++) {\n\t\t\t\tif (i == 0) result[i][j] = a * matrix2.getEntry(i, j);\n\t\t\t\tif (i == 1) result[i][j] = b * matrix2.getEntry(i, j);\n\t\t\t\tif (i == 2) result[i][j] = c * matrix2.getEntry(i, j);\n\t\t\t\tif (i == 3) result[i][j] = d * matrix2.getEntry(i, j);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn MatrixUtils.createRealMatrix(result);\n\t}",
"public Multiplication(Expression l, Expression r) {\n\tleft = l;\n\tright = r;\n }",
"public Cube(String shapeName, double sideLength){\n super(shapeName, sideLength, sideLength, sideLength);\n }",
"public static double scalarProduct(ThreeVector v1,ThreeVector v2) {\r\n\t\treturn v1.x * v2.x + v1.y * v2.y + v1.z * v2.z;\r\n\t}"
]
| [
"0.73811984",
"0.6799287",
"0.64400804",
"0.6404485",
"0.6200977",
"0.6152397",
"0.6124747",
"0.6059167",
"0.596396",
"0.59445566",
"0.59106743",
"0.58918035",
"0.5881914",
"0.5835582",
"0.5830503",
"0.57981706",
"0.5746918",
"0.57362753",
"0.57259005",
"0.5718628",
"0.5686156",
"0.56758225",
"0.56203294",
"0.5609048",
"0.5609048",
"0.56022257",
"0.55913156",
"0.55712676",
"0.5568722",
"0.5559181",
"0.55569893",
"0.5548371",
"0.55472386",
"0.55421",
"0.550995",
"0.5508974",
"0.55058444",
"0.5505756",
"0.5487783",
"0.5478269",
"0.54749525",
"0.5474154",
"0.54738265",
"0.5458972",
"0.54448885",
"0.5431644",
"0.5395932",
"0.5395932",
"0.53934306",
"0.5391369",
"0.5382582",
"0.53774595",
"0.53687805",
"0.5366329",
"0.5359109",
"0.5356248",
"0.5335269",
"0.53338975",
"0.5322335",
"0.5322136",
"0.5321167",
"0.53194827",
"0.5305109",
"0.5302441",
"0.52994955",
"0.5297758",
"0.5296206",
"0.52953416",
"0.529264",
"0.5291878",
"0.5283272",
"0.5277619",
"0.52752686",
"0.52743316",
"0.5272933",
"0.52697736",
"0.526523",
"0.5259498",
"0.5252015",
"0.52450687",
"0.52369994",
"0.52343255",
"0.52326435",
"0.5230843",
"0.5229365",
"0.5224625",
"0.5216642",
"0.521574",
"0.5209552",
"0.5208111",
"0.5193608",
"0.5184501",
"0.51788247",
"0.51768076",
"0.51708555",
"0.5169002",
"0.5167246",
"0.5165193",
"0.51599103",
"0.5159407"
]
| 0.8904832 | 0 |
Returns a new object of class 'Length Scalar Divide'. | LengthScalarDivide createLengthScalarDivide(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"LengthScalarMultiply createLengthScalarMultiply();",
"AngleScalarDivide createAngleScalarDivide();",
"public Divide(){\n }",
"public Vector<T> divide(T aScalar);",
"@Override\n\tpublic Operation createOperate() {\n\t\treturn new OperationDiv();\n\t}",
"public void divide() {\n\t\t\n\t}",
"@Test\n\tpublic void divisionTest() {\n\t\tMathOperation division = new Division();\n\n\t\tassertEquals(0, division.operator(ZERO, FIVE).intValue());\n\t\tassertEquals(4, division.operator(TWENTY, FIVE).intValue());\n\t}",
"public JTensor div(JType value) {\n JTensor r = new JTensor();\n TH.THTensor_(div)(r, this, value);\n return r;\n }",
"Length createLength();",
"public abstract String division();",
"LengthSubtract createLengthSubtract();",
"Length getWidth();",
"public static <T extends Vector> T Divide(T a, T b,T result){\n if(Match(a,b)) {\n for (int i = 0; i < result.axis.length; i++) {\n result.axis[i] = a.axis[i] / b.axis[i];\n }\n return result;\n }\n return result;\n }",
"public <V extends Number> FluentExp<V> div (V value)\n {\n return new Div<V>(this, value);\n }",
"abstract double getLength();",
"public Divide(Node l, Node r) {\r\n\t\tsuper(l, r);\r\n\t}",
"public static OperationMBean getDivideOperationMBean()\n {\n return new Operation(\"divide\");\n }",
"IVec3 div(IVec3 v);",
"float getLength();",
"float getLength();",
"public <V extends Number> FluentExp<V> div (SQLExpression<V> expr)\n {\n return new Div<V>(this, expr);\n }",
"public DataSetDivide( )\n {\n super( \"Divide by a DataSet\" );\n }",
"public String toString(){ return \"DIV\";}",
"public static ObjectInstance getDivideOperationObjectInstance()\n {\n ObjectName o = null;\n try\n {\n Hashtable<String, String> properties = new Hashtable<String, String>(\n 4);\n properties.put(\"name\", StringMangler\n .EncodeForJmx(getDivideOperationMBean().getName()));\n properties.put(\"jmxType\", new Operation().getJmxType());\n o = new ObjectName(_domain, properties);\n\n }\n catch (Exception e)\n {\n Assert\n .fail(\"'Divide' Operation ObjectInstance could not be created. \"\n + e.getMessage());\n }\n return new ObjectInstance(o, new Operation().getClass().getName());\n }",
"@Override\n public InterpreterValue div(InterpreterValue v) {\n\n // If the given value is a IntegerValue create a new DoubleValue from\n // the division-result\n if(v instanceof IntegerValue) return new DoubleValue(getValue() / ((IntegerValue) v).getValue());\n\n // If the given value is a DoubleValue create a new DoubleValue from\n // the division-result\n if(v instanceof DoubleValue) return new DoubleValue(getValue() / ((DoubleValue) v).getValue());\n\n // In other case just throw an error\n throw new Error(\"Operator '/' is not defined for type double and \" + v.getName());\n\n }",
"BaseNumber divide(BaseNumber operand);",
"public double getLength();",
"public void div_(JType value) {\n TH.THTensor_(div)(this, this, value);\n }",
"public Complex DivideBy (Complex z) {\n\ndouble rz = z.Magnitude();\n\nreturn new Complex((u*z.u+v*z.v)/(rz*rz),(v*z.u-u*z.v)/(rz*rz));\n\n}",
"@Override\n\tpublic void\n\tscalarDiv( double value )\n\t{\n\t\tdata[0] /= value;\n\t\tdata[1] /= value;\n\t\tdata[2] /= value;\n\t}",
"@Override\r\n\tpublic int div() {\n\t\treturn 0;\r\n\t}",
"public T divide( double val ) {\n T ret = createLike();\n ops.divide(mat, val, ret.getMatrix());\n return ret;\n }",
"MulOrDiv createMulOrDiv();",
"public abstract void getLength(double length);",
"public static <T extends Vector> T Divide(T a, float val,T result){\n for (int i = 0; i < result.axis.length; i++) {\n result.axis[i] = a.axis[i] / val;\n }\n return result;\n }",
"public Vector2f div(float scalar) {\n return div(new Vector2f(scalar, scalar));\n }",
"public Fraccion division() {\r\n Fraccion division = new Fraccion(operador1.getNumerador()*operador2.getDenominador() , operador1.getDenominador()*operador2.getNumerador());\r\n return simplify(division);\r\n }",
"public Fraction divide( Fraction divisor ) {\n // Division ist genau wie multiplication aber in Kreuz\n // also, wir tauschen den numerator und den denomitanor aus, und\n // multiplizieren wie üblich\n Fraction upsideDown = new Fraction( divisor.denominator, divisor.numerator );\n Fraction result = this.multiply( upsideDown );\n\n return result;\n }",
"public final void mDIV() throws RecognitionException\n\t{\n\t\ttry\n\t\t{\n\t\t\tfinal int _type = AshvmLexer.DIV;\n\t\t\tfinal int _channel = BaseRecognizer.DEFAULT_TOKEN_CHANNEL;\n\t\t\t// D:\\\\Programmieren\\\\projects\\\\ashvm\\\\Ashvm.g:714:5: ( 'div' )\n\t\t\t// D:\\\\Programmieren\\\\projects\\\\ashvm\\\\Ashvm.g:714:7: 'div'\n\t\t\t{\n\t\t\t\tthis.match(\"div\");\n\n\t\t\t}\n\n\t\t\tthis.state.type = _type;\n\t\t\tthis.state.channel = _channel;\n\t\t}\n\t\tfinally\n\t\t{\n\t\t}\n\t}",
"public T elementDiv( T b ) {\n convertType.specify(this, b);\n T A = convertType.convert(this);\n b = convertType.convert(b);\n\n T c = A.createLike();\n A.ops.elementDiv(A.mat, b.mat, c.mat);\n return c;\n }",
"public Division() {\n\t\tthis(\"division\", null);\n\t}",
"public T div(T first, T second);",
"public Divide(Expression a) {\n super(Expression.X_COMES_AFTER);\n this.a = a;\n }",
"public abstract Vector4fc div(float x, float y, float z, float w);",
"public void divide(Object divValue) {\r\n\r\n\t\tNumberOperation operator = new NumberOperation(this.value, divValue) {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic Number doAnOperation() {\r\n\t\t\t\tTypeEnum typeOfResult = getFinalType();\r\n\t\t\t\tif(typeOfResult == TypeEnum.TYPE_INTEGER) {\r\n\t\t\t\t\treturn getO1().intValue() / getO2().intValue();\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\treturn getO1().doubleValue() / getO2().doubleValue();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\tthis.value = operator.doAnOperation();\r\n\t}",
"public double Dividir(double operador_1, double operador_2){\n return DivisionC(operador_1, operador_2);\n }",
"LengthUnit(double metres) {\n/* 24 */ this.metres = metres;\n/* 25 */ this.dx = new Dx(1.0D, this);\n/* */ }",
"public Vector6f divI(float scalar)\n\t{\n\t\tx[0] /= scalar; \n\t\tx[1] /= scalar; \n\t\tx[2] /= scalar; \n\t\tx[3] /= scalar; \n\t\tx[4] /= scalar; \n\t\tx[5] /= scalar;\n\t\treturn this;\n\t}",
"public Vector div(double d){\n return new Vector(this.getX()/d, this.getY()/d, this.getZ()/d);\n }",
"@Override\n\tpublic float dividir(float op1, float op2) {\n\t\treturn op1 / op2;\n\t}",
"public Complex divide(Complex c) {\n return Complex.fromMagnitudeAndAngle(this.getMagnitude() / c.getMagnitude(), this.getAngle() - c.getAngle());\n }",
"Division createDivision();",
"int division(int num1, int num2) {\n System.out.print(\"\\nIn Child Class : \");\n return num1 / num2;\n }",
"public abstract double getBaseWidth();",
"abstract double getLengthSquared();",
"public double divisao (double numero1, double numero2){\n\t}",
"LengthSmaller createLengthSmaller();",
"public static BinaryExpression divide(Expression expression0, Expression expression1) { throw Extensions.todo(); }",
"public void enfoncerDiv() {\n\t\ttry {\n\t\t\tthis.op = new Div();\n\t\t\tif (!raz) {\n\t\t\t\tthis.pile.push(valC);\n\t\t\t}\n\t\t\tint a = this.pile.pop(); int b = this.pile.pop();\n\t\t\tthis.valC = this.op.eval(b,a);\n\t\t\tthis.pile.push(this.valC);\n\t\t\tthis.raz = true;\n\t\t}\n\t\tcatch (ArithmeticException e) {\n\t\t\tSystem.out.println(\"Erreur : Division par zero !\");\n\t\t}\n\t\tcatch (EmptyStackException e) {\n\t\t\tSystem.out.println(\"Erreur de syntaxe : Saisir deux operandes avant de saisir un operateur\");\n\t\t}\n\t}",
"@Override\n\tpublic double divide(double in1, double in2) {\n\t\treturn 0;\n\t}",
"public static Volume do_calc() {\n\t\treturn new Volume();\n\t}",
"public Divide(Expression a, Expression b) {\n super(Expression.X_IS_UNDEFINED);\n this.a = a;\n this.b = b;\n }",
"public final void mDIV() throws RecognitionException {\n try {\n int _type = DIV;\n // /Users/benjamincoe/HackWars/C.g:212:12: ( '/' )\n // /Users/benjamincoe/HackWars/C.g:212:14: '/'\n {\n match('/'); \n\n }\n\n this.type = _type;\n }\n finally {\n }\n }",
"public float lengthSquared ( );",
"private static double MdUllah(double length, double height, double width) {\n\t\treturn length*height*width;\n\t}",
"@Test\n public void testParseDiv() {\n System.out.println(\"testParseDiv\");\n\n byte[] expected = {\n Instruction.LIT.getId(), 0, 1,\n Instruction.LIT.getId(), 0, 2,\n Instruction.DIV.getId(),\n Instruction.LV.getId(), 0, 0, 32,\n Instruction.DIV.getId()\n };\n\n TermParser p = TermParserTestSetup.getDivTermSetup();\n assertEquals(\"Parse\", true, p.parse());\n AssemblerCodeChecker.assertCodeEquals(\"Code \", expected, TermParserTestSetup.getByteCode());\n }",
"public SwerveDriveCalculator(double baseWidth, double baseLength) {\n setBase(baseWidth, baseLength);\n }",
"public static RuntimeValue divide(RuntimeValue left, RuntimeValue right) throws RuntimeException {\n if (isDiscreteIntSamples(left, right)) {\n return new RuntimeValue(\n RuntimeValue.Type.DISCRETE_INT_SAMPLE,\n Operators.divideIntegers(left.getDiscreteIntSample(), right.getDiscreteIntSample())\n );\n }\n\n if (isDiscreteFloatSamples(left, right)) {\n return new RuntimeValue(\n RuntimeValue.Type.DISCRETE_FLOAT_SAMPLE,\n Operators.divideFloats(left.getDiscreteFloatSample(), right.getDiscreteFloatSample())\n );\n }\n\n if (isDiscreteFloatSample(left) && hasSingleValue(left.getDiscreteFloatSample()) && isContinuousSample(right)) {\n return new RuntimeValue(\n RuntimeValue.Type.CONTINUOUS_SAMPLE,\n right.getContinuousSample().multiply(1 / left.getDiscreteFloatSample().single())\n );\n }\n\n if (isDiscreteFloatSample(right) && hasSingleValue(right.getDiscreteFloatSample()) && isContinuousSample(left)) {\n return new RuntimeValue(\n RuntimeValue.Type.CONTINUOUS_SAMPLE,\n left.getContinuousSample().multiply(1 / right.getDiscreteFloatSample().single())\n );\n }\n\n throw new RuntimeException(\"Dividing incompatible types\");\n }",
"public static Vector2 DivideScalar(Vector2 a, float scalar){\n return new Vector2(a.x / scalar, a.y / scalar);\n }",
"public LogicUnit(int width) {\n super(\"LogicUnit\", width);\n }",
"@Override\n\tpublic double DivideOperation(double dividend, double divisor) {\n\t\treturn 0;\n\t}",
"public Point divide(double divisor)\n {\n return new Point(this.x / divisor, this.y / divisor);\n }",
"@Override\r\n\tpublic vec3 div(float var) {\n\t\treturn null;\r\n\t}",
"public void setLength(double length){this.length=length;}",
"@Override\n\tpublic double divide(double a, double b) {\n\t\treturn (a/b);\n\t}",
"LengthAdd createLengthAdd();",
"public SVGLength getWidth() {\n return width;\n }",
"public static NodeValue numDivide(NodeValue nv1, NodeValue nv2) {\n switch (classifyNumeric(\"divide\", nv1, nv2)) {\n case OP_INTEGER : {\n // Note: result is a decimal\n BigDecimal d1 = new BigDecimal(nv1.getInteger()) ;\n BigDecimal d2 = new BigDecimal(nv2.getInteger()) ;\n return decimalDivide(d1, d2) ;\n }\n case OP_DECIMAL : {\n BigDecimal d1 = nv1.getDecimal() ;\n BigDecimal d2 = nv2.getDecimal() ;\n return decimalDivide(d1, d2) ;\n }\n case OP_FLOAT :\n // No need to check for divide by zero\n return NodeValue.makeFloat(nv1.getFloat() / nv2.getFloat()) ;\n case OP_DOUBLE :\n // No need to check for divide by zero\n return NodeValue.makeDouble(nv1.getDouble() / nv2.getDouble()) ;\n default :\n throw new ARQInternalErrorException(\"Unrecognized numeric operation : (\" + nv1 + \" ,\" + nv2 + \")\") ;\n }\n }",
"public Point3D divide(double divisor) {\n\t\treturn new Point3D(x / divisor, y / divisor, z / divisor);\n\t}",
"public final void mDIV() throws RecognitionException {\n try {\n int _type = DIV;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // /Users/cbinnig/Workspace/DHBW_FirstDB_Loesung3/src/de/dhbw/db2/firstdb/sql/FirstSQL.g:23:5: ( '/' )\n // /Users/cbinnig/Workspace/DHBW_FirstDB_Loesung3/src/de/dhbw/db2/firstdb/sql/FirstSQL.g:23:7: '/'\n {\n match('/'); \n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }",
"public Vector2f normalize() {\n return div(length());\n }",
"@Override\npublic void div(int a, int b) {\n\t\n}",
"Rational divide(Rational p){\n Rational firstarg=new Rational();\n firstarg.numerator=numerator;\n firstarg.denominator=denominator;\n\n\n firstarg.numerator=firstarg.numerator*p.denominator;\n firstarg.denominator=p.numerator*firstarg.denominator;\n return firstarg;\n }",
"@Test\r\n public void testRectangleVolumeCalc() throws JadeExceptionClass {\r\n System.out.println(\"Test Case #1\");\r\n double length = 23.0;\r\n double width = 8.0;\r\n double height = 4.0;\r\n rectangleControl instance = new rectangleControl();\r\n double expResult = 736.0;\r\n double result = instance.rectangleVolumeCalc(length, width, height);\r\n assertEquals(expResult, result, 1.0);\r\n System.out.println(\"Test Case #2\");\r\n length = 0;\r\n width = 43;\r\n height = 28;\r\n expResult = -1;\r\n result = instance.rectangleVolumeCalc(length, width, height);\r\n assertEquals(expResult, result, 1.0);\r\n System.out.println(\"Test Case #3\");\r\n length = -10;\r\n width = 50;\r\n height = 9;\r\n expResult = -1;\r\n result = instance.rectangleVolumeCalc(length, width, height);\r\n assertEquals(expResult, result, 1.0);\r\n System.out.println(\"Test Case #4\");\r\n length = 1100;\r\n width = 5;\r\n height = 6;\r\n expResult = -1;\r\n result = instance.rectangleVolumeCalc(length, width, height);\r\n assertEquals(expResult, result, 1.0);\r\n System.out.println(\"Test Case #5\");\r\n length = 50;\r\n width = 50;\r\n height = 1;\r\n expResult = 2500;\r\n result = instance.rectangleVolumeCalc(length, width, height);\r\n assertEquals(expResult, result, 1.0);\r\n System.out.println(\"Test Case #6\");\r\n length = 1;\r\n width = 50;\r\n height = 50;\r\n expResult = 2500;\r\n result = instance.rectangleVolumeCalc(length, width, height);\r\n assertEquals(expResult, result, 1.0);\r\n System.out.println(\"Test Case #7\");\r\n length = 50;\r\n width = 1;\r\n height = 50;\r\n expResult = 2500;\r\n result = instance.rectangleVolumeCalc(length, width, height);\r\n assertEquals(expResult, result, 1.0);\r\n }",
"public Double getLength()\n {\n return length;\n }",
"public abstract Vector4fc normalize(float length);",
"public Bounds[] subdivide() {\n return new Bounds[] {\n getSubdivision(0, 0, 0), getSubdivision(1, 0, 0), getSubdivision(0, 0, 1), getSubdivision(1, 0, 1),\n getSubdivision(0, 1, 0), getSubdivision(1, 1, 0), getSubdivision(0, 1, 1), getSubdivision(1, 1, 1)\n };\n }",
"public static UnitP Division(UnitP first, UnitP second)\n {\n return OperationsPublic.PerformUnitOperation\n (\n first, second, Operations.Division,\n OperationsOther.GetOperationString(first, second, Operations.Division) \n );\n }",
"public Number getDivisor() {\n\t\treturn divisor;\n\t}",
"public <I extends Image<?, I>> I divide(I in1, I in2) {\n\t\tCLQueue queue = context.createDefaultQueue();\n\t\t\n\t\tCLImage2D clin1 = CLImageConversion.convert(context, in1);\n\t\tCLImage2D clin2 = CLImageConversion.convert(context, in2);\n\t\tCLImage2D clout = context.createImage2D(CLMem.Usage.Output, clin1.getFormat(), clin1.getWidth(), clin1.getHeight());\n\t\t\n\t\tCLEvent evt = process(divideImage, queue, clin1, clin2, clout);\n\t\t\n\t\tI out = CLImageConversion.convert(queue, evt, clout, in1.newInstance(in1.getWidth(), in1.getHeight()));\n\t\t\n\t\tclin1.release();\n\t\tclin2.release();\n\t\tclout.release();\n\t\tqueue.release();\n\t\t\n\t\treturn out;\n\t}",
"public Vector normalized(){\r\n\t\tfloat len = this.length();\r\n\t\tif( len != 0.0f && len != 1.0f ){\r\n\t\t\treturn new Vector( this.x / len, this.y / len, this.z / len );\r\n\t\t}\r\n\t\treturn this;\r\n\t}",
"public final void mDIV() throws RecognitionException {\n try {\n int _type = DIV;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // /Users/dannluciano/Sources/MyLanguage/expr.g:183:5: ( '/' )\n // /Users/dannluciano/Sources/MyLanguage/expr.g:183:7: '/'\n {\n match('/'); \n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }",
"public DataSetDivide( DataSet ds,\n DataSet ds_to_divide,\n boolean make_new_ds )\n {\n this(); // do the default constructor, then set\n // the parameter value(s) by altering a\n // reference to each of the parameters\n\n IParameter parameter = getParameter( 0 );\n parameter.setValue( ds_to_divide );\n\n parameter = getParameter( 1 );\n parameter.setValue( new Boolean( make_new_ds ) );\n\n setDataSet( ds ); // record reference to the DataSet that\n // this operator should operate on\n }",
"public abstract Vector4fc div(IVector4f v);",
"public static BinaryExpression divide(Expression expression0, Expression expression1, Method method) { throw Extensions.todo(); }",
"public double getLength(){\n return length;\n }",
"@Test\n\tvoid divide() {\n\t\tfloat result = calculator.divide(12, 4);\n\t\tassertEquals(3,result);\n\t}",
"public Cos(String exp) {\n super(exp);\n }",
"static String division (String s1, String s2) {\r\n if (s2==null || s2.length()==0) return s1;\r\n return product (s1, invert(s2));\r\n }",
"public Cos(Expression exp) {\n super(exp);\n }"
]
| [
"0.70654285",
"0.7053007",
"0.6829572",
"0.67129797",
"0.6140329",
"0.6041817",
"0.59763616",
"0.59733224",
"0.5958533",
"0.59516203",
"0.5926786",
"0.5909633",
"0.5908227",
"0.5907088",
"0.58373547",
"0.5827793",
"0.5824348",
"0.575818",
"0.57053435",
"0.57053435",
"0.5694514",
"0.56624216",
"0.56379735",
"0.56196404",
"0.5610887",
"0.55868423",
"0.5583531",
"0.5582948",
"0.55782664",
"0.55719817",
"0.5559647",
"0.55301964",
"0.5502496",
"0.54914457",
"0.5477963",
"0.54652005",
"0.5455566",
"0.5421787",
"0.54020363",
"0.53844833",
"0.53844106",
"0.5382475",
"0.53495973",
"0.53474057",
"0.53370905",
"0.53295404",
"0.53108644",
"0.5310702",
"0.5285457",
"0.52834433",
"0.52827007",
"0.52815497",
"0.5279929",
"0.52671385",
"0.5260428",
"0.5256108",
"0.52559686",
"0.5245561",
"0.52223957",
"0.5212123",
"0.5210928",
"0.52082944",
"0.51987725",
"0.51974636",
"0.519177",
"0.5178357",
"0.51777166",
"0.5173164",
"0.5170845",
"0.51593447",
"0.51548177",
"0.5153434",
"0.51512945",
"0.51310664",
"0.51231074",
"0.51204413",
"0.51155496",
"0.51117265",
"0.5104196",
"0.5101279",
"0.5098417",
"0.5097328",
"0.50812984",
"0.50775015",
"0.50608504",
"0.5055774",
"0.50482184",
"0.5047239",
"0.5046782",
"0.5041994",
"0.50366145",
"0.5033885",
"0.5027591",
"0.50213575",
"0.5020285",
"0.50199044",
"0.501862",
"0.50137913",
"0.5010049",
"0.50091225"
]
| 0.89354175 | 0 |
Returns a new object of class 'Length Equals'. | LengthEquals createLengthEquals(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Length createLength();",
"LengthSmaller createLengthSmaller();",
"LengthDistinct createLengthDistinct();",
"LengthAdd createLengthAdd();",
"LengthGreater createLengthGreater();",
"LengthSubtract createLengthSubtract();",
"@Test\n\tpublic void testLength()throws Exception {\n\n\t\t\t SET setarray= new SET( new int[]{6,7,8,10});\n\t\t\t int returnedValue =setarray.Size(); \n\t\t\t int expectedValue = 4;\n\t\t\t Assert.assertEquals( expectedValue, returnedValue );\n\t}",
"public long getLength();",
"public long getLength();",
"LengthConstraint createLengthConstraint();",
"public int getLength() {return length;}",
"public abstract long getLength();",
"public abstract long getLength();",
"@DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:55:06.836 -0500\", hash_original_method = \"9921BFF09FACC23B6D23BD0D026EB023\", hash_generated_method = \"4C8E8780FA3C7A09AF94E1277F10CB12\")\n \npublic boolean match(Object other) {\n if (other instanceof ContentLength)\n return true;\n else\n return false;\n }",
"public int getLength();",
"public int getLength();",
"public int getLength();",
"public void testLength()\n {\n LinearSearch ls = new LinearSearch();\n\n assertFalse(ls.validLength(int [15] haystack));\n }",
"protected abstract int getLength();",
"public int get_length();",
"public int my_length();",
"@Test\n public void runTest1() {\n rope1.length = 2;\n rope2.length = 8;\n System.out.println(rope1.length);\n }",
"public abstract int getLength();",
"public abstract int getLength();",
"public void setLength(double newLength) {\n length = newLength;\n }",
"public ParseResult prefixOfLength (Object input, int length, int peel)\n {\n ParseResult r = prefixInternal(input, peel + 1);\n assertTrue(r.matchSize == length, peel + 1,\n () -> r.toString(map, onlyRulesInCallStacks));\n clearLocals();\n return r;\n }",
"public abstract int length();",
"public abstract int length();",
"public int length();",
"public int length();",
"public int length();",
"public int length();",
"public int length();",
"private int length() { return length; }",
"public int getLength()\n {return length;}",
"public double getLength();",
"public int getLength(){\n return this.length;\n }",
"public void setLength( int length ) { setCapacity( length ); this.length = length; }",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"public int getLength() { return length;\t}",
"public int getLength()\n {\n return length;\n }",
"public void setLength(long length);",
"public void setLength(long length);",
"public RADIUSAttribute setLength(final byte length) {\n this.length = length;\n return this;\n }",
"public int getLength(){\n return length;\n }",
"public void setLength(long length) { \n this.length = length; \n }",
"public long getLength() { \n return length; \n }",
"BigInteger getLength();",
"public void setLength(int length)\n {\n this.length = length;\n }",
"@Override\n public Integer length() {\n return myLength;\n }",
"public int getLength() {\r\n return length;\r\n }",
"public int getLength() {\r\n return length;\r\n }",
"public int getLength() {\r\n return length;\r\n }",
"public int getLength() {\n return length;\n }",
"public int getLength() {\n return length;\n }",
"public Size(Size toDuplicate)\r\n {\r\n assert(true);\r\n \tamount = toDuplicate.amount;\r\n type = toDuplicate.type;\r\n }",
"public int getLength(){\n\t\treturn length;\n\t}",
"public int getLength(){\n\t\treturn length;\n\t}",
"public boolean setLength(double Length);",
"Length initLength(Length iLength)\n {\n iLength.updateElementValue(\"Length\");\n return iLength;\n }",
"@Test\n public void testGetLength() {\n System.out.println(\"getLength\");\n Vector instance = null;\n int expResult = 0;\n int result = instance.getLength();\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }",
"public int getLength() {\n return this.length;\n }",
"public int getLength() {\n return this.length;\n }",
"public void testLength() {\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n test1.insert(new Buffer(3, rec));\n assertEquals(6, test1.length());\n }",
"public void setLength(int length) {\r\n this.length = length;\r\n }",
"public void setLength(int length) {\r\n this.length = length;\r\n }",
"@Test\n public void testBLength() {\n LOGGER.info(\"testBLength\");\n final int actual = new AtomString().bLength();\n final int expected = 2;\n assertEquals(expected, actual);\n }",
"public int getLength() {\n return length;\n }",
"abstract double getLength();",
"public int getLength() {\n return length_;\n }",
"protected int getLength() {\n return length;\n }",
"@Test\n public void testSize() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n int expResult = 4;\n\n instance.add(1);\n instance.add(2);\n instance.add(3);\n instance.add(4);\n\n long result = instance.size();\n assertEquals(expResult, result);\n }",
"public T caseExprLength(ExprLength object)\n {\n return null;\n }",
"public double getLength()\r\n {\r\n return this.lengthCapacity;\r\n }",
"public abstract long getLength() throws VlException;",
"public Integer getLength() {\n return _length;\n }",
"public Integer getLength() {\n return _length;\n }",
"public int getLength()\n {\n\treturn length;\n }",
"@Test\r\n public void test_setContentLength_Accuracy() {\r\n instance.setContentLength(2);\r\n assertEquals(\"incorrect value after setting\", 2, instance.getContentLength());\r\n }",
"MapBuilder<K,V> hashSize(long size);",
"public int getLength() {\r\n\t\treturn length;\r\n\t}",
"public void setLength(int length){\n\t\tif(length > 0){\n\t\t\tthis.length = length; //this.length is the length were in right now. and = length is the length the object is given\n\t\t}\n\t\t\n\t\t\n\t}",
"public org.python.types.Int __len__();",
"public double getLength(){\r\n\t\treturn length;\r\n\t}",
"@Override\n\tpublic void setLength(int length) {\n\t\t\n\t}",
"public void setLength(long length) {\r\n\t\tthis.length = length;\r\n\t}",
"void setLength(int length);",
"synchronized void setLength(int length) {\n this.length = length;\n }",
"public int getLength()\n\t{\n\t\treturn length;\n\t}",
"public int getLength()\n\t{\n\t\treturn length;\n\t}",
"@Contract(pure = true)\r\n public int getLength() {\r\n return length;\r\n }"
]
| [
"0.6655552",
"0.66435766",
"0.604037",
"0.6013628",
"0.58905596",
"0.5875304",
"0.57544434",
"0.5737835",
"0.5737835",
"0.5715796",
"0.5670251",
"0.5665076",
"0.5665076",
"0.56588143",
"0.5622879",
"0.5622879",
"0.5622879",
"0.56171703",
"0.5565112",
"0.5561976",
"0.55385196",
"0.55267656",
"0.5510765",
"0.5510765",
"0.5459905",
"0.54591024",
"0.5449604",
"0.5449604",
"0.54482824",
"0.54482824",
"0.54482824",
"0.54482824",
"0.54482824",
"0.5441311",
"0.5424977",
"0.540132",
"0.53671515",
"0.5356585",
"0.53525066",
"0.53525066",
"0.53525066",
"0.53525066",
"0.53525066",
"0.53525066",
"0.53525066",
"0.53525066",
"0.53525066",
"0.53525066",
"0.5324418",
"0.5299647",
"0.5293803",
"0.5293803",
"0.52851987",
"0.52831644",
"0.52828723",
"0.52697253",
"0.5265292",
"0.52618563",
"0.5260227",
"0.52585644",
"0.52585644",
"0.52585644",
"0.5252581",
"0.5252581",
"0.5243537",
"0.5236468",
"0.5236468",
"0.52333033",
"0.52272135",
"0.5223081",
"0.5220163",
"0.5220163",
"0.5214388",
"0.520416",
"0.520416",
"0.51957655",
"0.51955134",
"0.51887304",
"0.51805604",
"0.5176007",
"0.5174448",
"0.51672727",
"0.5155623",
"0.5124115",
"0.51234025",
"0.51234025",
"0.50976306",
"0.50930583",
"0.5090005",
"0.50812185",
"0.50778633",
"0.50771576",
"0.5074445",
"0.5067593",
"0.5064461",
"0.5063469",
"0.50580347",
"0.50572205",
"0.50572205",
"0.50561094"
]
| 0.88135576 | 0 |
Returns a new object of class 'Length Distinct'. | LengthDistinct createLengthDistinct(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"LengthSmaller createLengthSmaller();",
"Length createLength();",
"LengthEquals createLengthEquals();",
"LengthAdd createLengthAdd();",
"public DistinctValues()\n {\n super();\n }",
"public WordSet<String> newWordSetByWordLength(int length) {\n Node<String> currentNode = list.getFirst();\n LinkedList<String> newSet = new LinkedList<String>();\n\n while (currentNode != null) {\n String currentWord = (String) currentNode.getValue();\n\n if (currentWord.length() == length) {\n newSet.add(currentWord);\n }\n\n currentNode = currentNode.getNext();\n }\n\n WordSet<String> newWordSet = new WordSet<String>(newSet);\n\n return newWordSet;\n }",
"private UniqueChromosomeReconstructor() { }",
"Length initLength(Length iLength)\n {\n iLength.updateElementValue(\"Length\");\n return iLength;\n }",
"public int getLength() {return length;}",
"LengthConstraint createLengthConstraint();",
"LengthSubtract createLengthSubtract();",
"public PriorityQueue(final int theLength) {\r\n super(theLength);\r\n }",
"public Range(int length) {\n assert (length != 0);\n this.name = null;\n this.first = 0;\n this.last = length - 1;\n this.stride = 1;\n this.length = length;\n }",
"public int getLength();",
"public int getLength();",
"public int getLength();",
"LengthGreater createLengthGreater();",
"public int get_length();",
"public int my_length();",
"public ZYArraySet(int initLength){\n if(initLength<0)\n throw new IllegalArgumentException(\"The length cannot be nagative\");\n elements = (ElementType[])new Object[initLength];\n }",
"public long getLength();",
"public long getLength();",
"private RunLengthEncoder() {\r\n }",
"protected abstract int getLength();",
"public double getLength();",
"public HashSet(int bucketsLength)\n {\n buckets = new Node[bucketsLength];\n currentSize = 0;\n }",
"public int length();",
"public int length();",
"public int length();",
"public int length();",
"public int length();",
"public ReactorResult<java.lang.String> getAllLength_as() {\r\n\t\treturn Base.getAll_as(this.model, this.getResource(), LENGTH, java.lang.String.class);\r\n\t}",
"@DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:55:06.822 -0500\", hash_original_method = \"2D2F8FB9FD0DE4D4C70B238FD2D4C88B\", hash_generated_method = \"CFB81A0992BCD18B37272999971C8572\")\n \npublic ContentLength(int length) {\n super(NAME);\n this.contentLength = Integer.valueOf(length);\n }",
"public int getLength(){\n return length;\n }",
"public abstract long getLength();",
"public abstract long getLength();",
"public static void main(String[] args) {\n NumDistinct a = new NumDistinct();\n System.out.println(a.numDistinct(\"rabbbit\", \"rabbit\"));\n System.out.println(a.numDistinct(\"babgbag\", \"bag\"));\n }",
"public RandomizedSet() {\n map = new HashMap<Integer, Integer>();\n set = new ArrayList<Integer>();\n int validLength = 0;\n }",
"public int getLength()\n {return length;}",
"public abstract int getLength();",
"public abstract int getLength();",
"private WordCounting() {\r\n }",
"private int length() { return length; }",
"public static void main(String[] args) {\n\t\tString S = \"deccdbebedabedecedebeccdebbaddddecacdbdeaabebcbaaccaaeabcccccadbeaaecaecacdbebeeedbeeecedebcbeaaaaaecbbcdebeacabccabddadeecbacbcebbbceacddbbaccebabbadebebcaaececbccac\";\n\t\tString T = \"bbbdedc\";\n\t\tSolution s = new Solution();\n\t\tSystem.out.println(S.length());\n\t\tSystem.out.print(s.numDistinct(S, T));\n\n\t}",
"private Cloudlet cloneCloudlet(final Cloudlet source, final long length) {\n final Cloudlet clone\n = new CloudletSimple(length, (int) source.getNumberOfPes());\n /*It' not required to set an ID for the clone.\n It is being set here just to make it easy to\n relate the ID of the cloudlet to its clone,\n since the clone ID will be 10 times the id of its\n source cloudlet.*/\n clone.setId(source.getId() * 10);\n clone\n .setUtilizationModelBw(source.getUtilizationModelBw())\n .setUtilizationModelCpu(source.getUtilizationModelCpu())\n .setUtilizationModelRam(source.getUtilizationModelRam());\n return clone;\n }",
"public void setLength(long length) { \n this.length = length; \n }",
"public WordCount() {\n }",
"public LinkedHashSet() {\n this(10);\n }",
"private Distance(){}",
"public void setLength( int length ) { setCapacity( length ); this.length = length; }",
"private Count() {}",
"private Count() {}",
"public void setLength(int length)\n {\n this.length = length;\n }",
"public int getLength(){\n return this.length;\n }",
"public ExtractedSummarySentence setLength(int length) {\n this.length = length;\n return this;\n }",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"@Override\n public Integer length() {\n return myLength;\n }",
"public ReadLengthReadFilter() {}",
"public Builder clearLength() {\n \n length_ = 0;\n onChanged();\n return this;\n }",
"public abstract int length();",
"public abstract int length();",
"public int getLength(){\n\t\treturn length;\n\t}",
"public int getLength(){\n\t\treturn length;\n\t}",
"public int getLength()\n {\n return length;\n }",
"public double getLength() {\n return count;\n }",
"protected Word(int length) {\n\t\t// check if the length of is reasonable\n\t\tif(length > 0) {\n\t\t\t// initial the instance variables\n\t\t\tthis.length = length;\n\t\t\tthis.unrevealedSlots = this.length;\n\t\t\tthis.mask = new boolean[this.length];\n\t\t\t//each slots in the mask should be true (masked) by default\n\t\t\tfor (int i = 0; i < this.length; i++) {\n\t\t\t\tthis.mask[i] = true;\n\t\t\t}\n\t\t}else {\n\t\t\t// throw a exception if the length is not allowed\n\t\t\tthrow new RuntimeException(\"Non-positive value is unacceptable.\");\n\t\t}\n\t}",
"public int getLength() {\n return length_;\n }",
"@Test\n\tpublic void testLength()throws Exception {\n\n\t\t\t SET setarray= new SET( new int[]{6,7,8,10});\n\t\t\t int returnedValue =setarray.Size(); \n\t\t\t int expectedValue = 4;\n\t\t\t Assert.assertEquals( expectedValue, returnedValue );\n\t}",
"public int getLength() { return length;\t}",
"public int vecLength();",
"@Override protected List<String> initialize(int size){\n container.clear();\n container.addAll(Arrays.asList(Generated.array(String.class, new RandomGenerator.String(), size)));\n return container;\n }",
"public HashSet(){\n this(17);\n }",
"public double getLength(){\r\n\t\treturn length;\r\n\t}",
"public ReactorResult<org.ontoware.rdf2go.model.node.Node> getAllLength_asNode_() {\r\n\t\treturn Base.getAll_as(this.model, this.getResource(), LENGTH, org.ontoware.rdf2go.model.node.Node.class);\r\n\t}",
"public void setLength(int length) {\r\n this.length = length;\r\n }",
"public void setLength(int length) {\r\n this.length = length;\r\n }",
"public int getLength() {\r\n return length;\r\n }",
"public int getLength() {\r\n return length;\r\n }",
"public int getLength() {\r\n return length;\r\n }",
"public Scores(int length) {\n list = new int[length];\n }",
"public int getLength() {\n return length;\n }",
"public int getLength() {\n return length;\n }",
"public StudentGroup(int length) {\r\n\t\tthis.students = new Student[length];\r\n\t}",
"public long getLength() { \n return length; \n }",
"public StudentGroup(int length) {\n\t\tthis.students = new Student[length];\n\t}",
"public IntegerGenotype create() \r\n\t{\n\t\tIntegerGenotype genotype = new IntegerGenotype(1,3);\r\n\t\tgenotype.init(new Random(), Data.numeroCuardillas); \r\n\t\t\r\n\t\treturn genotype;\r\n\t}",
"public double getLength(){\n return length;\n }",
"public Integer getLength() {\n return _length;\n }",
"public Integer getLength() {\n return _length;\n }",
"public CountMultipleCreations() {\r\n\t\tmultiples = new HashSet<String>();\r\n\t}",
"public int size(){\n return length;\n }"
]
| [
"0.6351377",
"0.62811506",
"0.6002781",
"0.58166313",
"0.55925095",
"0.55273336",
"0.5396676",
"0.5387986",
"0.5249517",
"0.5228397",
"0.5209537",
"0.5162437",
"0.5157003",
"0.51490283",
"0.51490283",
"0.51490283",
"0.5108582",
"0.5088219",
"0.5063882",
"0.50581646",
"0.50552857",
"0.50552857",
"0.5049137",
"0.504436",
"0.5042041",
"0.5034413",
"0.5033799",
"0.5033799",
"0.5033799",
"0.5033799",
"0.5033799",
"0.50269717",
"0.5021589",
"0.5019287",
"0.5010994",
"0.5010994",
"0.5009728",
"0.5003685",
"0.50034726",
"0.5001992",
"0.5001992",
"0.49994037",
"0.49974418",
"0.49875882",
"0.4987424",
"0.49630088",
"0.49593502",
"0.49536064",
"0.4947154",
"0.4945451",
"0.494404",
"0.494404",
"0.49373904",
"0.49369726",
"0.49305683",
"0.49270576",
"0.49270576",
"0.49270576",
"0.49270576",
"0.49270576",
"0.49270576",
"0.49270576",
"0.49270576",
"0.49270576",
"0.49270576",
"0.49251646",
"0.49250975",
"0.4916094",
"0.49111834",
"0.49111834",
"0.49091473",
"0.49091473",
"0.49049366",
"0.4900716",
"0.48940727",
"0.4889061",
"0.48841864",
"0.48789126",
"0.48740134",
"0.48638427",
"0.48609048",
"0.48581764",
"0.485727",
"0.48566857",
"0.48566857",
"0.48482233",
"0.48482233",
"0.48482233",
"0.4847274",
"0.48358864",
"0.48358864",
"0.48342738",
"0.48335394",
"0.4820038",
"0.4818988",
"0.48100182",
"0.48079532",
"0.48079532",
"0.48048636",
"0.479747"
]
| 0.8542818 | 0 |
Returns a new object of class 'Length Smaller'. | LengthSmaller createLengthSmaller(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Length createLength();",
"LengthEquals createLengthEquals();",
"LengthGreater createLengthGreater();",
"LengthAdd createLengthAdd();",
"LengthSubtract createLengthSubtract();",
"LengthDistinct createLengthDistinct();",
"public void setLength(double length){this.length=length;}",
"LengthConstraint createLengthConstraint();",
"public double getLength();",
"float getLength();",
"float getLength();",
"abstract double getLength();",
"public void setLength(double newLength) {\n length = newLength;\n }",
"Length initLength(Length iLength)\n {\n iLength.updateElementValue(\"Length\");\n return iLength;\n }",
"protected abstract int getLength();",
"public abstract long getLength();",
"public abstract long getLength();",
"public void setLength(long length);",
"public void setLength(long length);",
"public long getLength();",
"public long getLength();",
"public abstract int getLength();",
"public abstract int getLength();",
"public int get_length();",
"public int getLength();",
"public int getLength();",
"public int getLength();",
"Length getWidth();",
"public void setLength(long length) { \n this.length = length; \n }",
"public void setLength( int length ) { setCapacity( length ); this.length = length; }",
"public godot.wire.Wire.Vector2.Builder getSizeBuilder() {\n \n onChanged();\n return getSizeFieldBuilder().getBuilder();\n }",
"public int getLength() {return length;}",
"public LongStorage newSizeOf() {\n return new LongStorage(\n TH.THTensor_(newSizeOf)(this)\n );\n }",
"double getNewWidth();",
"void setLength(int length);",
"public void setLength(double length)\r\n {\r\n this.length = length;\r\n }",
"public godot.wire.Wire.Vector3.Builder getSizeBuilder() {\n \n onChanged();\n return getSizeFieldBuilder().getBuilder();\n }",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"public void setLength(Double newlength)\n {\n length = newlength;\n }",
"public abstract void getLength(double length);",
"LengthScalarMultiply createLengthScalarMultiply();",
"public void setLength(int length)\n {\n this.length = length;\n }",
"public double getLength(){\r\n\t\treturn length;\r\n\t}",
"public int my_length();",
"public void setLength(int length) {\r\n this.length = length;\r\n }",
"public void setLength(int length) {\r\n this.length = length;\r\n }",
"public void setLength(double length) {\r\n this.length = length;\r\n }",
"public Builder setLength(int value) {\n \n length_ = value;\n onChanged();\n return this;\n }",
"public void setLength(double length) {\n this.length = length;\n }",
"public double getLength()\r\n {\r\n return this.lengthCapacity;\r\n }",
"public ParseResult prefixOfLength (Object input, int length, int peel)\n {\n ParseResult r = prefixInternal(input, peel + 1);\n assertTrue(r.matchSize == length, peel + 1,\n () -> r.toString(map, onlyRulesInCallStacks));\n clearLocals();\n return r;\n }",
"public double getLength(){\n return length;\n }",
"void setLength( long length );",
"public int getLength()\n {return length;}",
"int fixedSize();",
"@Override\n\tpublic void setLength(int length) {\n\t\t\n\t}",
"public void addLength() {\n\t\tBodyPart b1 = snake.getBodyPart(snake.getSize()-1), b2 = snake.getBodyPart(snake.getSize()-2);\n\t\tif(b1.getX() > b2.getX())\n\t\t\tsnake.addBodyPart(b1.getX()+GameObject.SIZE, b1.getY());\n\t\telse if(b1.getX() < b2.getX())\n\t\t\tsnake.addBodyPart(b1.getX()-GameObject.SIZE, b1.getY());\n\t\telse if(b1.getY() >= b2.getY())\n\t\t\tsnake.addBodyPart(b1.getX(), b1.getY()+GameObject.SIZE);\n\t\telse if(b1.getY() >= b2.getY())\n\t\t\tsnake.addBodyPart(b1.getX(), b1.getY()-GameObject.SIZE);\n\t}",
"public double getLength()\n {\n return length;\n }",
"public boolean setLength(double Length);",
"private int length() { return length; }",
"public double getLength() {\r\n return length;\r\n }",
"@Override\n public Integer length() {\n return myLength;\n }",
"public void setLength(int length) {\r\n\t\tthis.length = length;\r\n\t}",
"public int getLength(){\n return length;\n }",
"@Override\r\n\tpublic void shorter() {\n\t\tsuper.shorter();\r\n\t\twordSize = (int) Math.max((Math.abs(x2 - x1) + Math.abs(y2 - y1)) / 3, 2);\r\n\t}",
"public int getLength(){\n return this.length;\n }",
"public void setLength(int length){\n\t\tif(length > 0){\n\t\t\tthis.length = length; //this.length is the length were in right now. and = length is the length the object is given\n\t\t}\n\t\t\n\t\t\n\t}",
"int getTribeSize();",
"BigInteger getLength();",
"public double getLength() {\n return length;\n }",
"public Towers() {\n\t\tthis(DEFAULT_SIZE);\n\t}",
"public float sizeMultiplier();",
"public Rectangle(int length, int width) {\n }",
"public abstract double getBaseWidth();",
"public void setLength(long length) {\r\n\t\tthis.length = length;\r\n\t}",
"public int getLength() { return length;\t}",
"public Double getLength()\n {\n return length;\n }",
"synchronized void setLength(int length) {\n this.length = length;\n }",
"public abstract int getPuzzleLengthSize();",
"public abstract int length();",
"public abstract int length();",
"public long getLength() { \n return length; \n }",
"public double getLength() {\r\n\t\treturn length;\r\n\t}",
"protected int getLength() {\n return length;\n }",
"public void setLength(double length) {\n\t\tthis.length = length;\n\t}",
"int minLength();",
"public double getLength() {\r\n\t\t\treturn length;\r\n\t\t}",
"public Integer getLength() {\n return _length;\n }",
"public Integer getLength() {\n return _length;\n }",
"public void setLength(int length) {\n\t\tthis.length = length;\n\t}",
"public void setLength(int length) {\n\t\tthis.length = length;\n\t}"
]
| [
"0.7067559",
"0.681733",
"0.67466724",
"0.65086997",
"0.6353992",
"0.62772864",
"0.6183584",
"0.6139682",
"0.6107535",
"0.60501224",
"0.60501224",
"0.60377216",
"0.6004147",
"0.5954987",
"0.5916907",
"0.59025055",
"0.59025055",
"0.58439267",
"0.58439267",
"0.58278567",
"0.58278567",
"0.5826994",
"0.5826994",
"0.58252186",
"0.5814215",
"0.5814215",
"0.5814215",
"0.58050853",
"0.5797146",
"0.57669604",
"0.5724244",
"0.57241064",
"0.56844515",
"0.56739306",
"0.566973",
"0.5666855",
"0.5640495",
"0.5635633",
"0.5635633",
"0.5635633",
"0.5635633",
"0.5635633",
"0.5635633",
"0.5635633",
"0.5635633",
"0.5635633",
"0.5635633",
"0.5635623",
"0.563354",
"0.5633115",
"0.5632146",
"0.56075245",
"0.5593624",
"0.5565887",
"0.5565887",
"0.55442387",
"0.5542672",
"0.5528189",
"0.55193543",
"0.5516495",
"0.5500509",
"0.5483194",
"0.5481094",
"0.5455106",
"0.5450703",
"0.544899",
"0.5441023",
"0.5434031",
"0.5423509",
"0.541622",
"0.54037744",
"0.53991896",
"0.53893656",
"0.538127",
"0.53738743",
"0.53711855",
"0.53693277",
"0.5367367",
"0.53649807",
"0.53600514",
"0.5356694",
"0.53489614",
"0.53464955",
"0.53463703",
"0.53448826",
"0.53377056",
"0.5325494",
"0.53218573",
"0.53217024",
"0.53217024",
"0.5318033",
"0.5316343",
"0.53100836",
"0.5289404",
"0.5288954",
"0.5287803",
"0.5287799",
"0.5287799",
"0.5284412",
"0.5284412"
]
| 0.86184955 | 0 |
Returns a new object of class 'Length Greater'. | LengthGreater createLengthGreater(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"LengthSmaller createLengthSmaller();",
"Length createLength();",
"LengthSubtract createLengthSubtract();",
"LengthEquals createLengthEquals();",
"LengthConstraint createLengthConstraint();",
"public GreaterThanTest(String name) {\n\t\tsuper(name);\n\t}",
"String getGreater();",
"LengthAdd createLengthAdd();",
"AngleGreater createAngleGreater();",
"public void setLength(double length){this.length=length;}",
"@Override\n public final int length() {\n return upper - lower;\n }",
"public abstract int getMaxLength();",
"public void setLength(double newLength) {\n length = newLength;\n }",
"public int get_length();",
"public int getLength() {return length;}",
"abstract double getLength();",
"public double getLength();",
"public LengthCheck(int maxLength) {\n this.maxLength = maxLength;\n }",
"float getLength();",
"float getLength();",
"public abstract long getLength();",
"public abstract long getLength();",
"public void setLength(long length);",
"public void setLength(long length);",
"protected abstract int getLength();",
"public boolean setLength(double Length);",
"public abstract int getLength();",
"public abstract int getLength();",
"public void setLength(int length)\n {\n this.length = length;\n }",
"public int getLength();",
"public int getLength();",
"public int getLength();",
"public void setLength(Double newlength)\n {\n length = newlength;\n }",
"Length initLength(Length iLength)\n {\n iLength.updateElementValue(\"Length\");\n return iLength;\n }",
"public Builder setLength(int value) {\n \n length_ = value;\n onChanged();\n return this;\n }",
"public void setLength(double length)\r\n {\r\n this.length = length;\r\n }",
"public void setLength(int length) {\r\n this.length = length;\r\n }",
"public void setLength(int length) {\r\n this.length = length;\r\n }",
"public long getLength();",
"public long getLength();",
"public void setLength(long length) { \n this.length = length; \n }",
"public int getLength()\n {return length;}",
"public ColumnMetadataBuilder length(int length) {\n this.length = length;\n return this;\n }",
"public int my_length();",
"public int getMaxLength();",
"public double getLength(){\r\n\t\treturn length;\r\n\t}",
"public InequalityTerm getGreaterTerm() {\n\t\treturn _greaterTerm;\n\t}",
"public void setLength(double length) {\n this.length = length;\n }",
"public void setLength(double length) {\r\n this.length = length;\r\n }",
"public abstract void getLength(double length);",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"int getLength();",
"public double getLength() {\n return hi - lo;\n }",
"public IntegerDt getMaxLengthElement() { \n\t\tif (myMaxLength == null) {\n\t\t\tmyMaxLength = new IntegerDt();\n\t\t}\n\t\treturn myMaxLength;\n\t}",
"public void setLength(int length) {\r\n\t\tthis.length = length;\r\n\t}",
"@Override\n public Integer length() {\n return myLength;\n }",
"public int getLength() { return length;\t}",
"@Override\n\tprotected GreaterThan getFixture() {\n\t\treturn (GreaterThan)fixture;\n\t}",
"public int getLength(){\n return length;\n }",
"public void setLength(int length){\n\t\tif(length > 0){\n\t\t\tthis.length = length; //this.length is the length were in right now. and = length is the length the object is given\n\t\t}\n\t\t\n\t\t\n\t}",
"void setLength(int length);",
"public void setLength( int length ) { setCapacity( length ); this.length = length; }",
"public double getLength()\n {\n return length;\n }",
"public double getLength(){\n return length;\n }",
"public static BinaryExpression greaterThan(Expression expression0, Expression expression1) { throw Extensions.todo(); }",
"public void setLength(int length) {\n\t\tthis.length = length;\n\t}",
"public void setLength(int length) {\n\t\tthis.length = length;\n\t}",
"public void setLength(int length) {\n\t\tthis.length = length;\n\t}",
"@UsesAdsUtilities({AdsUtility.SELECTOR_BUILDER})\n SelectorBuilderInterface<SelectorT> greaterThan(String field, long propertyValue);",
"public LimitedStringValueDriver(int length) {\n this.length = length;\n }",
"public int getLength(){\n\t\treturn length;\n\t}",
"public int getLength(){\n\t\treturn length;\n\t}",
"public double getLength()\r\n {\r\n return this.lengthCapacity;\r\n }",
"public double getLength() {\r\n return length;\r\n }",
"public Integer getLength() {\n return _length;\n }",
"public Integer getLength() {\n return _length;\n }",
"public int getLength()\n {\n return length;\n }",
"public void setLength(double length) {\n\t\tthis.length = length;\n\t}",
"public double getLength() {\n return length;\n }",
"public int getLength(){\n return this.length;\n }",
"public int getLength() {\r\n return length;\r\n }",
"public int getLength() {\r\n return length;\r\n }",
"public int getLength() {\r\n return length;\r\n }",
"public double getLength() {\r\n\t\treturn length;\r\n\t}",
"public godot.wire.Wire.Vector2.Builder getSizeBuilder() {\n \n onChanged();\n return getSizeFieldBuilder().getBuilder();\n }",
"public Double getLength()\n {\n return length;\n }",
"public Unit<Length> foot() {return foot;}",
"@Override\n\tpublic void setLength(int length) {\n\t\t\n\t}",
"protected int getLength() {\n return length;\n }",
"public void setLength(long length) {\r\n\t\tthis.length = length;\r\n\t}",
"public godot.wire.Wire.Vector3.Builder getSizeBuilder() {\n \n onChanged();\n return getSizeFieldBuilder().getBuilder();\n }",
"public int getLength() {\n return length;\n }"
]
| [
"0.67818123",
"0.65203536",
"0.6245363",
"0.6152672",
"0.600931",
"0.5959839",
"0.5738462",
"0.56517166",
"0.5529556",
"0.55087316",
"0.5426604",
"0.5424142",
"0.5415972",
"0.5415086",
"0.5386219",
"0.5372949",
"0.53580284",
"0.5353324",
"0.53259474",
"0.53259474",
"0.5304371",
"0.5304371",
"0.53030413",
"0.53030413",
"0.5297922",
"0.5297219",
"0.5293454",
"0.5293454",
"0.5288459",
"0.5261133",
"0.5261133",
"0.5261133",
"0.525383",
"0.52529365",
"0.5233381",
"0.52231866",
"0.522043",
"0.522043",
"0.5219812",
"0.5219812",
"0.5219115",
"0.520892",
"0.52073216",
"0.5205827",
"0.51868784",
"0.51848716",
"0.5174633",
"0.5153186",
"0.51525784",
"0.51471657",
"0.51299685",
"0.51299685",
"0.51299685",
"0.51299685",
"0.51299685",
"0.51299685",
"0.51299685",
"0.51299685",
"0.51299685",
"0.51299685",
"0.51286733",
"0.51271665",
"0.51221526",
"0.51171124",
"0.5110612",
"0.51060826",
"0.50889236",
"0.50809044",
"0.5069771",
"0.5069402",
"0.50639075",
"0.50615484",
"0.5056872",
"0.50539213",
"0.50539213",
"0.50539213",
"0.50486314",
"0.5045629",
"0.50449085",
"0.50449085",
"0.5044468",
"0.5037715",
"0.50340587",
"0.50340587",
"0.50132084",
"0.50118214",
"0.50094527",
"0.5006532",
"0.5006152",
"0.5006152",
"0.5006152",
"0.49950746",
"0.49930146",
"0.4986381",
"0.4984219",
"0.4981028",
"0.49800396",
"0.49768585",
"0.49740568",
"0.49726874"
]
| 0.8580182 | 0 |
Returns a new object of class 'Angle Add'. | AngleAdd createAngleAdd(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Angle createAngle();",
"AngleSubtract createAngleSubtract();",
"AngleSmaller createAngleSmaller();",
"public A3Add(){}",
"AngleScalarMultiply createAngleScalarMultiply();",
"public RotationComponent add(float degrees) {\n\trotation += degrees;\n\n\treturn this;\n }",
"double getAngle();",
"double getAngle();",
"public double getAngle();",
"public Dial addPosition(int angle) {\n if (!dialPositions.contains(angle)) {\n this.dialPositions.add(angle);\n if (dialPosition == -1) {\n dialPosition = 0;\n }\n repaint();\n }\n return this;\n }",
"public atan( ) {\n super(1);\n }",
"AngleEquals createAngleEquals();",
"public AxisAngle(float angle, float x, float y, float z) {\n this(angle, new Vector3(x,y,z));\n }",
"@Test\n public void getAngleVector2d(){\n Vector2d newVec = new Vector2d(0,1);\n vector.add(newVec);\n\n assertTrue(newVec.getAngle() == 90);\n }",
"public void setAngle( double a ) { angle = a; }",
"@Override\n public void reAngle() {\n }",
"public AngleIF() {\n \t\t//_navx = new navx();\n \t\t//roboAccel = new RoboRioAccelerometers();\n \t}",
"AngleDistinct createAngleDistinct();",
"AngleGreater createAngleGreater();",
"public double getAngle() { return angle; }",
"void setAngle(double angle);",
"private Add() {}",
"private Add() {}",
"Plus createPlus();",
"Plus createPlus();",
"Plus createPlus();",
"public AxisAngle(float angle, Vector3 axis) {\n this.angle = angle;\n this.axis = axis;\n }",
"void setAngle(int id, double value);",
"public static native int OpenMM_AmoebaAngleForce_addAngle(PointerByReference target, int particle1, int particle2, int particle3, double length, double quadraticK);",
"void add(Shape aShape);",
"public ImageRotator(int receivedAngle){angle = receivedAngle;}",
"public static native int OpenMM_AmoebaInPlaneAngleForce_addAngle(PointerByReference target, int particle1, int particle2, int particle3, int particle4, double length, double quadraticK);",
"public Vector3 addAndCreate(Vector3 addition) {\n\t\treturn new Vector3(addition.x + this.x, addition.y + this.y, addition.z + this.z);\n\t}",
"public AngleDisplay() {\n initComponents();\n\n setPreferredSize(new Dimension(size, size));\n }",
"public void add(double angle) {\n GyroReading gyroReading = new GyroReading(angle, System.currentTimeMillis());\n\n add(gyroReading);\n }",
"double getAngle(int id);",
"AngleScalarDivide createAngleScalarDivide();",
"public JacobObject() {\n\t\tROT.addObject(this);\n\t}",
"AngleResource inclination();",
"public void setAngle(float angle){\n\n\t}",
"public Shape add(double x, double y) {\n\t\tShape c = new Shape(x, y);\n\t\tadd(c);\n\t\treturn c;\n\t}",
"public Degree360 add(Degree360 degree){\n\t\treturn Degree360.valueOf(this.getDouble() + degree.getDouble());\r\n\t}",
"public Shape add(ShapeType t, double x, double y) {\n\t\tShape c = new Shape(x, y);\n\t\tc.setType(t);\n\t\tadd(c);\n\t\treturn c;\n\t}",
"@Override\n\tpublic void addArc(A arc) throws UnvalidArc {\n\t\t\n\t}",
"public void setAngle(final float angle);",
"public double getStartAngle();",
"LengthAdd createLengthAdd();",
"public void add();",
"public static Heading add(Heading a1, Heading a2) {\r\n return new Heading(HeadingType.DEGREES, a1.degreeNum + a2.degreeNum);\r\n }",
"private PVector angleAsVector(float theta) {\n\t\tPVector result = new PVector(0,0);\r\n\t\tresult.x = (float) Math.cos(theta);\r\n\t\tresult.y = (float) Math.sin(theta);\r\n\t\treturn result;\r\n\t}",
"public float getAngle() {\n return angle;\n }",
"public double getAngle(){\n\t\treturn this.angle;\n\t}",
"public void create(Alien a1) {\n\t\t\r\n\t\taliens.add(a1);\r\n\t}",
"public vec3 plus(vec3 arg) {\r\n\t\tvec3 tmp = new vec3();\r\n\t\ttmp.add(this, arg);\r\n\t\treturn tmp;\r\n\t}",
"public int getAngle() {\r\n return angle;\r\n }",
"@Override\n\tpublic void add(double dx, double dy) {\n\t\t\n\t}",
"public abstract LinearMor add(Mor m, R r);",
"public vec3 plus(float arg) {\r\n\t\tvec3 tmp = new vec3();\r\n\t\ttmp.add(this, arg);\r\n\t\treturn tmp;\r\n\t}",
"public double getAngle() {\n return angle;\n }",
"public double getAngle() {\n return angle;\n }",
"void increaseAngle() {\n this.strokeAngle += 3;\n this.updateAcc();\n this.updateStick();\n }",
"public double getAngle ()\n {\n return angle_;\n }",
"public interface AxisAngleBasics extends AxisAngleReadOnly, Orientation3DBasics, Clearable\n{\n /**\n * Gets the reference to the axis part of this axis-angle.\n *\n * @return the reference to the axis vector.\n */\n @Override\n UnitVector3DBasics getAxis();\n\n /**\n * Sets a new angle to this axis-angle.\n *\n * @param angle the new angle.\n */\n void setAngle(double angle);\n\n /**\n * Sets a new x-component for the axis of this axis-angle.\n *\n * @param x the new axis x-component.\n */\n default void setX(double x)\n {\n getAxis().setX(x);\n }\n\n /**\n * Sets a new y-component for the axis of this axis-angle.\n *\n * @param y the new axis y-component.\n */\n default void setY(double y)\n {\n getAxis().setY(y);\n }\n\n /**\n * Sets a new z-component for the axis of this axis-angle.\n *\n * @param z the new axis z-component.\n */\n default void setZ(double z)\n {\n getAxis().setZ(z);\n }\n\n /**\n * Sets the components of this axis-angle to represent a \"zero\" rotation. After calling the axis is\n * equal to {@link Axis3D#X} and the angle to 0.\n */\n @Override\n default void setToZero()\n {\n getAxis().set(Axis3D.X);\n setAngle(0.0);\n }\n\n /**\n * Sets the components of this axis-angle to {@link Double#NaN}.\n */\n @Override\n default void setToNaN()\n {\n getAxis().setToNaN();\n setAngle(Double.NaN);\n }\n\n /**\n * Tests if this axis-angle contains a {@link Double#NaN}.\n *\n * @return {@code true} if this axis-angle contains a {@link Double#NaN}, {@code false} otherwise.\n */\n @Override\n default boolean containsNaN()\n {\n return AxisAngleReadOnly.super.containsNaN();\n }\n\n /**\n * Sets each component of this axis-angle to its absolute value.\n */\n default void absolute()\n {\n getAxis().absolute();\n setAngle(Math.abs(getAngle()));\n }\n\n /**\n * Negates each component of this axis-angle.\n */\n default void negate()\n {\n getAxis().negate();\n setAngle(-getAngle());\n }\n\n /** {@inheritDoc} */\n @Override\n default void invert()\n {\n setAngle(-getAngle());\n }\n\n /**\n * Normalizes the axis of this axis-angle such that its norm is equal to 1 after calling this method\n * and its direction remains unchanged.\n * <p>\n * Edge cases:\n * <ul>\n * <li>if this axis-angle contains {@link Double#NaN}, this method is ineffective.\n * </ul>\n * </p>\n */\n @Override\n default void normalize()\n {\n getAxis().normalize();\n }\n\n /**\n * Multiplies the angle of this axis-angle by the given {@code scale}.\n *\n * @param scale the scaling factor to apply to the angle of this axis-angle.\n */\n default void scaleAngle(double scale)\n {\n setAngle(scale * getAngle());\n }\n\n /**\n * Sets this axis-angle to represent a new rotation of axis ({@code x}, {@code y}, {@code z}) and\n * angle of {@code angle}.\n *\n * @param x x-component of the new axis.\n * @param y y-component of the new axis.\n * @param z z-component of the new axis.\n * @param angle the new angle.\n */\n default void set(double x, double y, double z, double angle)\n {\n getAxis().set(x, y, z);\n setAngle(angle);\n }\n\n /** {@inheritDoc} */\n @Override\n default void set(Orientation3DReadOnly orientation3DReadOnly)\n {\n if (orientation3DReadOnly instanceof AxisAngleReadOnly)\n set((AxisAngleReadOnly) orientation3DReadOnly);\n else\n orientation3DReadOnly.get(this);\n }\n\n /**\n * Sets the axis and the angle of this axis-angle.\n *\n * @param axis the new axis. Not modified.\n * @param angle the new angle.\n */\n default void set(Vector3DReadOnly axis, double angle)\n {\n getAxis().set(axis);\n setAngle(angle);\n }\n\n /**\n * Sets this axis-angle to the same value as the given axis-angle {@code other}.\n *\n * @param other the other axis-angle. Not modified.\n */\n default void set(AxisAngleReadOnly other)\n {\n getAxis().set(other.getAxis());\n setAngle(other.getAngle());\n }\n\n /**\n * Sets this axis-angle to {@code other} and then calls {@link #negate()}.\n *\n * @param other the other axis-angle to copy the values from. Not modified.\n */\n default void setAndNegate(AxisAngleReadOnly other)\n {\n set(other);\n negate();\n }\n\n /**\n * Copies the values in the given array into this axis-angle as follows:\n * <ul>\n * <li>{@code this.setX(axisAngleArray[0]);}\n * <li>{@code this.setY(axisAngleArray[1]);}\n * <li>{@code this.setZ(axisAngleArray[2]);}\n * <li>{@code this.setAngle(axisAngleArray[3]);}\n * </ul>\n *\n * @param axisAngleArray the array containing the new values for this axis-angle. Not modified.\n */\n default void set(double[] axisAngleArray)\n {\n set(0, axisAngleArray);\n }\n\n /**\n * Copies the values in the given array into this axis-angle as follows:\n * <ul>\n * <li>{@code this.setX(axisAngleArray[startIndex + 0]);}\n * <li>{@code this.setY(axisAngleArray[startIndex + 1]);}\n * <li>{@code this.setZ(axisAngleArray[startIndex + 2]);}\n * <li>{@code this.setAngle(axisAngleArray[startIndex + 3]);}\n * </ul>\n *\n * @param startIndex the first index to start reading from in the array.\n * @param axisAngleArray the array containing the new values for this axis-angle. Not modified.\n */\n default void set(int startIndex, double[] axisAngleArray)\n {\n setX(axisAngleArray[startIndex++]);\n setY(axisAngleArray[startIndex++]);\n setZ(axisAngleArray[startIndex++]);\n setAngle(axisAngleArray[startIndex]);\n }\n\n /**\n * Copies the values in the given array into this axis-angle as follows:\n * <ul>\n * <li>{@code this.setX(axisAngleArray[0]);}\n * <li>{@code this.setY(axisAngleArray[1]);}\n * <li>{@code this.setZ(axisAngleArray[2]);}\n * <li>{@code this.setAngle(axisAngleArray[3]);}\n * </ul>\n *\n * @param axisAngleArray the array containing the new values for this axis-angle. Not modified.\n */\n default void set(float[] axisAngleArray)\n {\n set(0, axisAngleArray);\n }\n\n /**\n * Copies the values in the given array into this axis-angle as follows:\n * <ul>\n * <li>{@code this.setX(axisAngleArray[startIndex + 0]);}\n * <li>{@code this.setY(axisAngleArray[startIndex + 1]);}\n * <li>{@code this.setZ(axisAngleArray[startIndex + 2]);}\n * <li>{@code this.setAngle(axisAngleArray[startIndex + 3]);}\n * </ul>\n *\n * @param startIndex the first index to start reading from in the array.\n * @param axisAngleArray the array containing the new values for this axis-angle. Not modified.\n */\n default void set(int startIndex, float[] axisAngleArray)\n {\n setX(axisAngleArray[startIndex++]);\n setY(axisAngleArray[startIndex++]);\n setZ(axisAngleArray[startIndex++]);\n setAngle(axisAngleArray[startIndex]);\n }\n\n /** {@inheritDoc} */\n @Override\n default void setAxisAngle(double x, double y, double z, double angle)\n {\n set(x, y, z, angle);\n }\n\n /** {@inheritDoc} */\n @Override\n default void setQuaternion(double x, double y, double z, double s)\n {\n AxisAngleConversion.convertQuaternionToAxisAngle(x, y, z, s, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void setRotationVector(double x, double y, double z)\n {\n AxisAngleConversion.convertRotationVectorToAxisAngle(x, y, z, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void setYawPitchRoll(double yaw, double pitch, double roll)\n {\n AxisAngleConversion.convertYawPitchRollToAxisAngle(yaw, pitch, roll, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void setRotationMatrix(double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22)\n {\n AxisAngleConversion.convertMatrixToAxisAngle(m00, m01, m02, m10, m11, m12, m20, m21, m22, this);\n }\n\n @Override\n default void setToYawOrientation(double yaw)\n {\n getAxis().set(Axis3D.Z);\n setAngle(yaw);\n }\n\n @Override\n default void setToPitchOrientation(double pitch)\n {\n getAxis().set(Axis3D.Y);\n setAngle(pitch);\n }\n\n @Override\n default void setToRollOrientation(double roll)\n {\n getAxis().set(Axis3D.X);\n setAngle(roll);\n }\n\n /**\n * Selects a component of this axis-angle based on {@code index} and sets it to {@code value}.\n * <p>\n * For {@code index} values of 0, 1, and 2, the corresponding components are x, y, and z,\n * respectively, while 3 corresponds to the angle.\n * </p>\n *\n * @param index the index of the component to set.\n * @param value the new value of the selected component.\n * @throws IndexOutOfBoundsException if {@code index} ∉ [0, 3].\n */\n default void setElement(int index, double value)\n {\n switch (index)\n {\n case 0:\n setX(value);\n break;\n case 1:\n setY(value);\n break;\n case 2:\n setZ(value);\n break;\n case 3:\n setAngle(value);\n break;\n default:\n throw new IndexOutOfBoundsException(Integer.toString(index));\n }\n }\n\n /**\n * Multiplies this axis-angle by {@code other}.\n * <p>\n * this = this * other\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void multiply(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiply(this, other, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void append(Orientation3DReadOnly other)\n {\n AxisAngleTools.multiply(this, false, other, false, this);\n }\n\n /**\n * Sets this axis-angle to the multiplication of {@code aa1} and {@code aa2}.\n * <p>\n * this = aa1 * aa2\n * </p>\n *\n * @param aa1 the first axis-angle in the multiplication. Not modified.\n * @param aa2 the second axis-angle in the multiplication. Not modified.\n */\n default void multiply(AxisAngleReadOnly aa1, AxisAngleReadOnly aa2)\n {\n AxisAngleTools.multiply(aa1, aa2, this);\n }\n\n /**\n * Multiplies this axis-angle by the inverse of {@code other}.\n * <p>\n * this = this * other<sup>-1</sup>\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void multiplyInvertOther(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiplyInvertRight(this, other, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void appendInvertOther(Orientation3DReadOnly orientation)\n {\n AxisAngleTools.multiply(this, false, orientation, true, this);\n }\n\n /**\n * Sets this axis-angle to the multiplication of the inverse of {@code this} and {@code other}.\n * <p>\n * this = this<sup>-1</sup> * other\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void multiplyInvertThis(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiplyInvertLeft(this, other, this);\n }\n\n /**\n * Sets this axis-angle to the multiplication of the inverse of {@code this} and the inverse of\n * {@code other}.\n * <p>\n * this = this<sup>-1</sup> * other<sup>-1</sup>\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void multiplyInvertBoth(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiplyInvertBoth(this, other, this);\n }\n\n /**\n * Appends a rotation about the z-axis to this axis-angle.\n *\n * <pre>\n * / ux = 0 \\\n * this = this * | uy = 0 |\n * | uz = 1 |\n * \\ angle = yaw /\n * </pre>\n *\n * @param yaw the angle to rotate about the z-axis.\n */\n @Override\n default void appendYawRotation(double yaw)\n {\n AxisAngleTools.appendYawRotation(this, yaw, this);\n }\n\n /**\n * Appends a rotation about the y-axis to this axis-angle.\n *\n * <pre>\n * / ux = 0 \\\n * this = this * | uy = 1 |\n * | uz = 0 |\n * \\ angle = pitch /\n * </pre>\n *\n * @param pitch the angle to rotate about the y-axis.\n */\n @Override\n default void appendPitchRotation(double pitch)\n {\n AxisAngleTools.appendPitchRotation(this, pitch, this);\n }\n\n /**\n * Appends a rotation about the x-axis to this axis-angle.\n *\n * <pre>\n * / ux = 1 \\\n * this = this * | uy = 0 |\n * | uz = 0 |\n * \\ angle = roll /\n * </pre>\n *\n * @param roll the angle to rotate about the x-axis.\n */\n @Override\n default void appendRollRotation(double roll)\n {\n AxisAngleTools.appendRollRotation(this, roll, this);\n }\n\n /**\n * Pre-multiplies this axis-angle by {@code other}.\n * <p>\n * this = other * other\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void preMultiply(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiply(other, this, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void prepend(Orientation3DReadOnly orientation)\n {\n AxisAngleTools.multiply(orientation, false, this, false, this);\n }\n\n /**\n * Sets this axis-angle to the multiplication of the inverse of {@code other} and {@code this}.\n * <p>\n * this = other<sup>-1</sup> * this\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void preMultiplyInvertOther(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiplyInvertLeft(other, this, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void prependInvertOther(Orientation3DReadOnly orientation)\n {\n AxisAngleTools.multiply(orientation, true, this, false, this);\n }\n\n /**\n * Sets this axis-angle to the multiplication of {@code other} and the inverse of {@code this}.\n * <p>\n * this = other * this<sup>-1</sup>\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void preMultiplyInvertThis(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiplyInvertRight(other, this, this);\n }\n\n /**\n * Sets this axis-angle to the multiplication of the inverse of {@code other} and the inverse of\n * {@code this}.\n * <p>\n * this = other<sup>-1</sup> * this<sup>-1</sup>\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void preMultiplyInvertBoth(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiplyInvertBoth(other, this, this);\n }\n\n /**\n * Prepends a rotation about the z-axis to this axis-angle.\n *\n * <pre>\n * / ux = 0 \\\n * this = | uy = 0 | * this\n * | uz = 1 |\n * \\ angle = yaw /\n * </pre>\n *\n * @param yaw the angle to rotate about the z-axis.\n */\n @Override\n default void prependYawRotation(double yaw)\n {\n AxisAngleTools.prependYawRotation(yaw, this, this);\n }\n\n /**\n * Prepends a rotation about the y-axis to this axis-angle.\n *\n * <pre>\n * / ux = 0 \\\n * this = | uy = 1 | * this\n * | uz = 0 |\n * \\ angle = pitch /\n * </pre>\n *\n * @param pitch the angle to rotate about the y-axis.\n */\n @Override\n default void prependPitchRotation(double pitch)\n {\n AxisAngleTools.prependPitchRotation(pitch, this, this);\n }\n\n /**\n * Prepends a rotation about the x-axis to this axis-angle.\n *\n * <pre>\n * / ux = 1 \\\n * this = | uy = 0 | * this\n * | uz = 0 |\n * \\ angle = roll /\n * </pre>\n *\n * @param roll the angle to rotate about the x-axis.\n */\n @Override\n default void prependRollRotation(double roll)\n {\n AxisAngleTools.prependRollRotation(roll, this, this);\n }\n}",
"public AdaDelta() {\n this(0.95,1e-6);\n }",
"public double nextAngle()\n {\n return nextAngle();\n }",
"public float getAngle() {\n return angle;\n }",
"public Flatbed(int angle){\r\n this.angle=angle;\r\n }",
"Point add (double x, double y);",
"public float getAngle() {\n return mAngle;\n }",
"public Circle() {\n this( 1.0 ); \n }",
"private ArrowPoint create(double xBeg, double yBeg, double xEnd, double yEnd){\n ArrowPoint b = new ArrowPoint(xBeg, yBeg);\n ArrowPoint e = new ArrowPoint(xEnd, yEnd);\n ArrowLine l = new ArrowLine(b, e);\n e.rotateProperty().bind(l.rotateProperty());\n a.addLine(b, e, l);\n return e;\n }",
"public Vector2 addRotation(double rotation) {\n return withRotation(getRotation() + rotation);\n }",
"public Curstomers_add() {\n\t\tsuper();\n\t}",
"private void add() {\n\n\t}",
"public static Vector3 add(Vector3 a, Vector3 b){return new Vector3(a.x + b.x, a.y + b.y, a.z + b.z);}",
"public NewShape() {\r\n\t\tsuper();\r\n\t}",
"public PolyTerm add(PolyTerm pt) {\n\t\tScalar coeffi=this.coefficient.add(pt.coefficient);\n\t\tint expon=pt.exponent;\n\t\treturn new PolyTerm(coeffi, expon);\n\t}",
"public VectorA add(VectorA v)\n {\n return new VectorA(this.x+v.x, this.y+v.y);\n }",
"public static Fraction add(Fraction f1, Fraction f2)// to construct a new object of the same class and store the value of the sum in that object and then return the object\n\t{\n\t\tint num1= f1.numerator*f2.denominator + f2.numerator*f1.denominator;\n\t\tint den1= f1.denominator*f2.denominator;\n\t\tFraction f3= new Fraction(num1,den1);\n\t\treturn f3;\n\t\n}",
"SomePlus createSomePlus();",
"public final Shape rotate(Vector fromPoint, Vector toPoint, Vector anchorPoint) {\n\t\treturn transform(new Rotation(fromPoint, toPoint, anchorPoint));\n\t}",
"public JAngle(double angle) {\n GridBagLayout layout = new GridBagLayout();\n GridBagConstraints c = new GridBagConstraints();\n c.anchor = GridBagConstraints.EAST;\n c.fill = GridBagConstraints.BOTH;\n setLayout(layout);\n c.gridy = 0;\n\n JLabel ldeg = null;\n int unit = Coordinates.angleUnit();\n double d;\n switch(unit) {\n case Coordinates.RADIAN:\n deg = new JTextField(12);\n ldeg = new JLabel(\"rad\");\n deg.setText(String.valueOf(Math.round(angle * 10000000000.0) /\n\t\t 10000000000.0));\n break;\n case Coordinates.DEGRE:\n deg = new JTextField(14);\n ldeg = new JLabel(\"aa\");\n deg.setText(String.valueOf(Math.round(180.0 * angle / Math.PI *\n\t\t\t\t\t 10000000000.0) / 10000000000.0));\n break;\n case Coordinates.DEGMN:\n case Coordinates.DEGMNSEC:\n deg = new JTextField(3);\n String sgn = \"\";\n if(angle < 0.0) {\n\tangle = -angle;\n\tsgn = \"-\";\n }\n angle = 180.0 * angle / Math.PI;\n deg.setText(sgn + String.valueOf((int) angle));\n deg.setHorizontalAlignment(JTextField.RIGHT);\n ldeg = new JLabel(\"aa\");\n break;\n }\n c.gridx = 0;\n c.weightx = 0.0;\n\n layout.setConstraints(deg, c);\n add(deg);\n c.gridx = 1;\n c.weightx = 0.0;\n layout.setConstraints(ldeg, c);\n add(ldeg);\n\n if(unit == Coordinates.DEGMN || unit == Coordinates.DEGMNSEC) {\n mn = new JTextField((unit == Coordinates.DEGMN) ? 8 : 2);\n mn.setHorizontalAlignment(JTextField.RIGHT);\n c.gridx = 2;\n c.weightx = 0.0;\n layout.setConstraints(mn, c);\n add(mn);\n JLabel lmn = new JLabel(\"'\");\n c.gridx = 3;\n c.weightx = 0.0;\n layout.setConstraints(lmn, c);\n add(lmn);\n angle -= (int) angle;\n angle *= 60.0;\n \n if(unit == Coordinates.DEGMNSEC) {\n\tmn.setText(String.valueOf((int) angle));\n\tangle -= (int) angle;\n\tangle *= 60.0;\n\tsec = new JTextField((unit == Coordinates.DEGMN) ? 5 : 6);\n\tsec.setHorizontalAlignment(JTextField.RIGHT);\n\tc.gridx = 4;\n\tc.weightx = 0.0;\n\tlayout.setConstraints(sec, c);\n\tadd(sec);\n\tJLabel lsec = new JLabel(\"\\\"\");\n\tc.gridx = 5;\n\tc.weightx = 0.0;\n\tlayout.setConstraints(lsec, c);\n\tadd(lsec);\n\tsec.setText(String.valueOf(Math.round(angle * 10000.0) / 10000.0));\n }\n else {\n\tmn.setText(String.valueOf(Math.round(angle * 1000000.0) / 1000000.0));\n }\n }\n }",
"Degree createDegree();",
"public Circle() {\n this(0, 0, 1);\n }",
"ArithmeticDependency createArithmeticDependency();",
"public void rotate(float angle);",
"private static Complex fromMagnitudeAndAngle(double magnitude, double angle) {\n return new Complex(magnitude * Math.cos(angle), magnitude * Math.sin(angle));\n }",
"public Poly(double a1, double b1, double c1, double d1, double y1) {\n this.a = a1;\n this.b = b1;\n this.c = c1;\n this.d = d1;\n this.y = y1;\n this.aorg = a1;\n this.borg = b1;\n this.corg = c1;\n this.dorg = d1;\n this.yorg = y1;\n this.aadd = 0;\n this.asub = 0;\n this.badd = 0;\n this.bsub = 0;\n this.cadd = 0;\n this.csub = 0;\n this.dadd = 0;\n this.dsub = 0;\n this.yadd = 0;\n this.ysub = 0;\n\n }",
"@Override\n\tpublic LSystemBuilder setAngle(double angle) {\n\t\tthis.angle = angle;\n\t\treturn this;\n\t}",
"public void setAngle(double a) {\n\t\tangle= a;\n\t}",
"public void add() {\n }",
"public Triangle() {\n\t\tsuper.addPoint(new java.awt.Point(0,1));\n\t\tsuper.addPoint(new java.awt.Point(1,0));\n\t\tsuper.addPoint(new java.awt.Point(2,1));\n\t}",
"void resetAngle();",
"public AntelopePanel() {\n this( null, null, true );\n }",
"public Angulo(double grados) {\n this(grados, GRADOS);\n }",
"public Circle(double r)\n {\n setRad(r);\n\n }",
"public Articulo(){\r\n\t\t\r\n\t}",
"public Vector4d add(Vector4d o) {\n\t\tx += o.x; y += o.y; z += o.z; w += o.w;\n\t\treturn this;\n\t}",
"void add(Lugar lugar);",
"abstract void add();"
]
| [
"0.7657985",
"0.7220481",
"0.6861093",
"0.6665849",
"0.65062433",
"0.6320681",
"0.61428726",
"0.61428726",
"0.6095512",
"0.6053321",
"0.5951635",
"0.5937759",
"0.5900674",
"0.585482",
"0.5837906",
"0.58199656",
"0.5804262",
"0.57609165",
"0.5754681",
"0.5707305",
"0.57071453",
"0.56894207",
"0.56894207",
"0.5632723",
"0.5632723",
"0.5632723",
"0.56245315",
"0.5600545",
"0.556974",
"0.55566317",
"0.55524635",
"0.5521702",
"0.5488903",
"0.54733187",
"0.5435486",
"0.54218775",
"0.53859824",
"0.5370941",
"0.53704214",
"0.5366421",
"0.5364987",
"0.53606063",
"0.53563863",
"0.53284264",
"0.53238654",
"0.5293717",
"0.52763444",
"0.52741265",
"0.5267081",
"0.52635986",
"0.52273685",
"0.5221725",
"0.5209955",
"0.5205071",
"0.51971555",
"0.5192904",
"0.51893955",
"0.51885885",
"0.5181416",
"0.5181416",
"0.5178799",
"0.517627",
"0.51643527",
"0.516434",
"0.5154615",
"0.51485837",
"0.51466984",
"0.51402587",
"0.51398367",
"0.5137852",
"0.512816",
"0.5126535",
"0.5122998",
"0.512131",
"0.51197994",
"0.5117501",
"0.5112462",
"0.5112012",
"0.5104733",
"0.50949275",
"0.50879824",
"0.5081774",
"0.5080887",
"0.50802577",
"0.5070703",
"0.5062025",
"0.50480187",
"0.5033682",
"0.5029468",
"0.502886",
"0.5028701",
"0.502552",
"0.5021521",
"0.50188255",
"0.5016951",
"0.5016893",
"0.50120026",
"0.50114495",
"0.50067616",
"0.5000051"
]
| 0.8950151 | 0 |
Returns a new object of class 'Angle Subtract'. | AngleSubtract createAngleSubtract(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Angle createAngle();",
"AngleSmaller createAngleSmaller();",
"AngleAdd createAngleAdd();",
"double getAngle();",
"double getAngle();",
"public double getAngle();",
"AngleScalarMultiply createAngleScalarMultiply();",
"AngleGreater createAngleGreater();",
"AngleResource inclination();",
"@Override\n public void reAngle() {\n }",
"public double getAngle() { return angle; }",
"LengthSubtract createLengthSubtract();",
"AngleEquals createAngleEquals();",
"public atan( ) {\n super(1);\n }",
"public ImageRotator(int receivedAngle){angle = receivedAngle;}",
"void resetAngle();",
"public double betweenAngle(Coordinates a, Coordinates b, Coordinates origin);",
"public void setAngle( double a ) { angle = a; }",
"AngleScalarDivide createAngleScalarDivide();",
"double getAngle(int id);",
"Minus createMinus();",
"Minus createMinus();",
"Minus createMinus();",
"public double getAngle () {\n return super.getAngle() % 360D;\n }",
"public AngleIF() {\n \t\t//_navx = new navx();\n \t\t//roboAccel = new RoboRioAccelerometers();\n \t}",
"public int getAngle() {\r\n return angle;\r\n }",
"AngleDistinct createAngleDistinct();",
"public double getAngleToTarget(){\n return 0d;\n }",
"public double toAngle()\n\t{\n\t\treturn Math.toDegrees(Math.atan2(y, x));\n\t}",
"public float getAngle() {\n return angle;\n }",
"public void rotate(float angle);",
"void setAngle(double angle);",
"EDataType getAngleDegrees();",
"public double getAngle(){\n\t\treturn this.angle;\n\t}",
"public double getMyAngle() {\n return myAngle- STARTING_ANGLE;\n }",
"public double getStartAngle();",
"public T negative() {\n T A = copy();\n ops.changeSign(A.mat);\n return A;\n }",
"public vec3 minus(float arg) {\r\n\t\tvec3 tmp = new vec3();\r\n\t\ttmp.sub(this, arg);\r\n\t\treturn tmp;\r\n\t}",
"public double getAngle ()\n {\n return angle_;\n }",
"public double getAngle() {\n return angle;\n }",
"public double getAngle() {\n return angle;\n }",
"public void rotateToAngle(int newAngle) {\n\t\tint diff = newAngle - getAngle();\n\t\tint diff1=Math.abs(diff-360);\n\t\tif (newAngle == getAngle()) {\n\t\t\tstopMotors();\n\t\t\treturn;\n\t\t}\n\t\twhile (Math.abs(getAngle() - newAngle) > 3&&opModeIsActive()) {\n\t\t\ttelemetry.addData(\"newangle\", newAngle);\n\t\t\ttelemetry.addData(\"getangle()\", getAngle());\n\t\t\ttelemetry.update();\n\t\t\tdiff = newAngle - getAngle();\n\t\t\tdiff1=Math.abs(getAngle() - newAngle);\n\t\t\tif ((diff > 0 && diff < 180) || (diff < 0 && Math.abs(diff) > 180)) {\n\n\t\t\t\tif(Math.abs(diff1)<13)\n\t\t\t\t\trotate(-0.06);\n\t\t\t\telse if(Math.abs(diff1)<50)\n\t\t\t\t\trotate(-0.1);\n\t\t\t\telse if(Math.abs(diff1)<160)\n\t\t\t\t\trotate(-0.5);\n\t\t\t\telse\n\t\t\t\t\trotate(-(0.00928571*Math.abs(diff1))+0.128571);\n\t\t\t} else {\n\n\t\t\t\tif(Math.abs(diff1)<13)\n\t\t\t\t\trotate(0.06);\n\t\t\t\telse if(Math.abs(diff1)<50)\n\t\t\t\t\trotate(0.1);\n\t\t\t\telse if(Math.abs(diff1)<160)\n\t\t\t\t\trotate(0.5);\n\t\t\t\telse\n\t\t\t\t\trotate((0.00928571*Math.abs(diff1))+0.128571);\n\t\t\t}\n\n\t\t}\n\t\tstopMotors();\n\n\t}",
"public float getAngle() {\n return angle;\n }",
"default void negate()\n {\n getAxis().negate();\n setAngle(-getAngle());\n }",
"public float getAngle() {\n return mAngle;\n }",
"public AxisAngle(float angle, float x, float y, float z) {\n this(angle, new Vector3(x,y,z));\n }",
"public static double getAngle( GameObject one, GameObject two )\n {\n return Math.atan2( getDeltaY( one, two ), +getDeltaX( one, two ) );\n }",
"Point rotate (double angle);",
"public vec3 minus(vec3 arg) {\r\n\t\tvec3 tmp = new vec3();\r\n\t\ttmp.sub(this, arg);\r\n\t\treturn tmp;\r\n\t}",
"Point rotate (double angle, Point result);",
"SomeMinus createSomeMinus();",
"public abstract Vector4fc rotateY(float angle);",
"private static Complex fromMagnitudeAndAngle(double magnitude, double angle) {\n return new Complex(magnitude * Math.cos(angle), magnitude * Math.sin(angle));\n }",
"private float calculateAngle() {\r\n\r\n\t\tdouble angleTemp = Math.atan2(Target.getY() - y, Target.getX() - x);\r\n\t\t// I needed to use wikipedia to get this i\r\n\t\t// did not learn this in math and needed\r\n\t\t// to use a couplle youtube tutorials to\r\n\t\t// find out how to do the math in java\r\n\t\t// aswell thank fully one had the exact\r\n\t\t// way of doing this\r\n\t\treturn (float) Math.toDegrees(angleTemp) + 90;\r\n\t}",
"public int getAngle() {\r\n\t\treturn angle;\r\n\t}",
"public AxisAngle(float angle, Vector3 axis) {\n this.angle = angle;\n this.axis = axis;\n }",
"public Flatbed(int angle){\r\n this.angle=angle;\r\n }",
"public double translateAngle( Figure f, double angle, double dir);",
"void decreaseAngle() {\n this.strokeAngle -= 3;\n this.updateAcc();\n this.updateStick();\n }",
"public double getAngle() {\n\treturn CVector.heading(v1, v2);\n }",
"@Test\r\n public void testCalculateAngle2() {\r\n System.out.println(\"calculateAngle2\");\r\n DialDraw instance = new TachometerDraw();\r\n instance.setValue(0);\r\n double expResult = Math.toRadians(180);\r\n double result = instance.calculateAngle();\r\n assertEquals(result, expResult, 0.0001);\r\n }",
"public void setAngle(final float angle);",
"public static NewRotateLeft create(AnimatableModelInstance originObject, float ex, float ey, int duration) {\n\n\t\tVector3 posO = originObject.transState.position.cpy();\t\n\t\t//Vector3 posO = new Vector3();\n\t\t//originObject.transform.getTranslation(posO);\n\t\t\n\t\tQuaternion rotation = originObject.transState.rotation.cpy();\t\n\t\t//Quaternion rotation = new Quaternion();\n\t\t//originObject.transform.getRotation(rotation,true); //existing rotation\n\t\t\n\t\t Vector3 axisVec = new Vector3();\n\t float existingangle = (float) (rotation.getAxisAngle(axisVec) * axisVec.nor().z);\n\t existingangle = existingangle < 0 ? existingangle + 360 : existingangle; //convert <0 values\n\t\t\n\t\tGdx.app.log(logstag,\"_____________________________________existing angle=\"+existingangle); //relative to x axis pointing left anticlockwise\n\t\n\t\t//float scalex = originObject.transform.getScaleX(); //get how much the object has been scaled\n\t\t//float scaley = originObject.transform.getScaleY();\n\t\t\n\t\tVector2 fromPoint = new Vector2(posO.x,posO.y); //we need to scale them down due to how the positions might have been scaled up if the matrix is scaled (I hate how matrixs work :-/ Just cant get it in my head)\n\t\tVector2 tooPoint = new Vector2(ex,ey);\n\n\t\tfromPoint.sub(tooPoint); \n\n\t\t//Log.info(\"length=\"+corner2.len());\n\n\t\tfloat angle = 180+fromPoint.angle(); //absolute angle between the two objects\n\t\tGdx.app.log(logstag,\"________target angle=\"+angle); //should point towards ex/ey \n\t\t\n\t//\tfloat distance = fromPoint.len();\n\n\t\t\n\t\t//difference between this angle and existing one\n\t\tangle = angle - existingangle;\n\t\t\n\t\tNewRotateLeft rot = new NewRotateLeft(angle,500);\n\t\t//NewForward forward = new NewForward(distance,duration-500);\n\t\t\t\t\n\t\treturn rot;\n\t}",
"public double getAngle() {\n\t\treturn 180 * (this.N - 2) / this.N;\n\t}",
"public int getAngle(){\n\t\treturn (int)angle;\n\t}",
"public double betweenAngle(Coordinates vectorA, Coordinates vectorB);",
"public void setAngle(float angle){\n\n\t}",
"@Test\r\n public void testCalculateAngle1() {\r\n System.out.println(\"calculateAngle1\");\r\n DialDraw instance = new TachometerDraw();\r\n instance.setValue(36);\r\n double expResult = Math.toRadians(115.2);\r\n double result = instance.calculateAngle();\r\n assertEquals(result, expResult, 0.0001);\r\n }",
"private double getAngle(){\n //Get a new angle measurement\n angles = imu.getAngularOrientation(AxesReference.INTRINSIC, AxesOrder.ZYX, AngleUnit.DEGREES);\n //Get the difference between current angle measurement and last angle measurement\n double deltaAngle = angles.firstAngle - lastAngles.firstAngle;\n\n //Process the angle to keep it within (-180,180)\n //(Once angle passes +180, it will rollback to -179, and vice versa)\n if (deltaAngle < -180)\n deltaAngle += 360;\n else if (deltaAngle > 180)\n deltaAngle -= 360;\n\n //Add the change in angle since last measurement (deltaAngle)\n //to the change in angle since last reset (globalAngle)\n globalAngle += deltaAngle;\n //Set last angle measurement to current angle measurement\n lastAngles = angles;\n\n return globalAngle;\n }",
"public Percentage minus(Percentage other) {\n return new Percentage(amount.minus(other.amount));\n }",
"public double getAngle() {\n\t\treturn angle;\n\t}",
"public double getAngle() {\n\t\treturn angle;\n\t}",
"public Rotation2d getAngle() {\n // Note: This assumes the CANCoders are setup with the default feedback coefficient\n // and the sesnor value reports degrees.\n return Rotation2d.fromDegrees(canCoder.getAbsolutePosition());\n }",
"public Vector3 rotate(float angle, Vector3 axis)\n {\n return Vector3.translateMatrix(Vector3.getRotationMatrix(angle, axis), this.clone());\n }",
"public static double rotation()\r\n\t{\r\n\t\treturn -(mxp.getAngle()/45);\r\n\t}",
"public Function subtract(Function f) {\r\n Function diff = new Function();\r\n for (int i = 0; i < this.cindex; i++){\r\n diff.addTerm(this.co[i],this.degree[i]); \r\n }\r\n for (int i = 0; i < f.cindex; i++){\r\n diff.addTerm(-1*f.co[i],f.degree[i]); \r\n }\r\n for (int i = 0; i < this.sinindex; i++){\r\n diff.addTerm(this.sinc[i],\"sin\",this.sind[i]); \r\n } \r\n for (int i = 0; i < f.sinindex; i++){\r\n diff.addTerm(-1*f.sinc[i],\"sin\",f.sind[i]); \r\n }\r\n for (int i = 0; i < this.cosindex; i++){\r\n diff.addTerm(this.cosc[i],\"cos\",this.cosd[i]); \r\n }\r\n for (int i = 0; i < f.cosindex; i++){\r\n diff.addTerm(-1*f.cosc[i],\"cos\",f.cosd[i]); \r\n }\r\n for (int i = 0; i < this.tanindex; i++){\r\n diff.addTerm(this.tanc[i],\"tan\",this.tand[i]); \r\n }\r\n for (int i = 0; i < f.tanindex; i++){\r\n diff.addTerm(-1*f.tanc[i],\"tan\",f.tand[i]); \r\n }\r\n return diff; \r\n\t}",
"public void resetAngle() {\n\t\t//this.angle = (this.orientation % 4 + 4) * (90);\n\t\tthis.angle = this.orientation * 90*-1;\n\t\tthis.tweenAngle.setCurrentValue(this.angle);\n\t\tthis.tweenAngle.setTargetValue(this.angle);\n\t}",
"public Vector subtract(Vector other){\n\t\treturn new Vector(x-other.x, y-other.y, z-other.z);\n\t}",
"void setAngle(int id, double value);",
"public double getAngle() {\n if (r == 0) {\n if (i == 0)\n return 0;// error?\n if (i > 0)\n return p2;\n else\n return -p2;\n }\n double d = Math.atan(i / r);\n if (r >= 0) {\n return d;\n }\n if (i >= 0)\n return Math.PI + d;\n return d + Math.PI;\n }",
"private double getAngle() {\n double normal= Math.sqrt(((getgAxis(ADXL345_I2C.Axes.kX))*(getgAxis(ADXL345_I2C.Axes.kX)))+((getgAxis(ADXL345_I2C.Axes.kY))*(getgAxis(ADXL345_I2C.Axes.kY))));\n\n return MathUtils.atan(normal / getgAxis(ADXL345_I2C.Axes.kZ));\n }",
"public void subtract() {\n\t\t\n\t}",
"@Override\n\tpublic Rotation3 GetRotation() {\n\t\treturn new Rotation3(0f);\n\t}",
"public double getAngle()\n {\n return (AngleAverage);\n }",
"public double getRotation();",
"@Test\n public void getAngleVector2d(){\n Vector2d newVec = new Vector2d(0,1);\n vector.add(newVec);\n\n assertTrue(newVec.getAngle() == 90);\n }",
"public Vector3 differenceAndCreate(Vector3 subtrahend) {\n\t\treturn new Vector3(this.x - subtrahend.x, this.y - subtrahend.y, this.z - subtrahend.z);\n\t}",
"public interface AxisAngleBasics extends AxisAngleReadOnly, Orientation3DBasics, Clearable\n{\n /**\n * Gets the reference to the axis part of this axis-angle.\n *\n * @return the reference to the axis vector.\n */\n @Override\n UnitVector3DBasics getAxis();\n\n /**\n * Sets a new angle to this axis-angle.\n *\n * @param angle the new angle.\n */\n void setAngle(double angle);\n\n /**\n * Sets a new x-component for the axis of this axis-angle.\n *\n * @param x the new axis x-component.\n */\n default void setX(double x)\n {\n getAxis().setX(x);\n }\n\n /**\n * Sets a new y-component for the axis of this axis-angle.\n *\n * @param y the new axis y-component.\n */\n default void setY(double y)\n {\n getAxis().setY(y);\n }\n\n /**\n * Sets a new z-component for the axis of this axis-angle.\n *\n * @param z the new axis z-component.\n */\n default void setZ(double z)\n {\n getAxis().setZ(z);\n }\n\n /**\n * Sets the components of this axis-angle to represent a \"zero\" rotation. After calling the axis is\n * equal to {@link Axis3D#X} and the angle to 0.\n */\n @Override\n default void setToZero()\n {\n getAxis().set(Axis3D.X);\n setAngle(0.0);\n }\n\n /**\n * Sets the components of this axis-angle to {@link Double#NaN}.\n */\n @Override\n default void setToNaN()\n {\n getAxis().setToNaN();\n setAngle(Double.NaN);\n }\n\n /**\n * Tests if this axis-angle contains a {@link Double#NaN}.\n *\n * @return {@code true} if this axis-angle contains a {@link Double#NaN}, {@code false} otherwise.\n */\n @Override\n default boolean containsNaN()\n {\n return AxisAngleReadOnly.super.containsNaN();\n }\n\n /**\n * Sets each component of this axis-angle to its absolute value.\n */\n default void absolute()\n {\n getAxis().absolute();\n setAngle(Math.abs(getAngle()));\n }\n\n /**\n * Negates each component of this axis-angle.\n */\n default void negate()\n {\n getAxis().negate();\n setAngle(-getAngle());\n }\n\n /** {@inheritDoc} */\n @Override\n default void invert()\n {\n setAngle(-getAngle());\n }\n\n /**\n * Normalizes the axis of this axis-angle such that its norm is equal to 1 after calling this method\n * and its direction remains unchanged.\n * <p>\n * Edge cases:\n * <ul>\n * <li>if this axis-angle contains {@link Double#NaN}, this method is ineffective.\n * </ul>\n * </p>\n */\n @Override\n default void normalize()\n {\n getAxis().normalize();\n }\n\n /**\n * Multiplies the angle of this axis-angle by the given {@code scale}.\n *\n * @param scale the scaling factor to apply to the angle of this axis-angle.\n */\n default void scaleAngle(double scale)\n {\n setAngle(scale * getAngle());\n }\n\n /**\n * Sets this axis-angle to represent a new rotation of axis ({@code x}, {@code y}, {@code z}) and\n * angle of {@code angle}.\n *\n * @param x x-component of the new axis.\n * @param y y-component of the new axis.\n * @param z z-component of the new axis.\n * @param angle the new angle.\n */\n default void set(double x, double y, double z, double angle)\n {\n getAxis().set(x, y, z);\n setAngle(angle);\n }\n\n /** {@inheritDoc} */\n @Override\n default void set(Orientation3DReadOnly orientation3DReadOnly)\n {\n if (orientation3DReadOnly instanceof AxisAngleReadOnly)\n set((AxisAngleReadOnly) orientation3DReadOnly);\n else\n orientation3DReadOnly.get(this);\n }\n\n /**\n * Sets the axis and the angle of this axis-angle.\n *\n * @param axis the new axis. Not modified.\n * @param angle the new angle.\n */\n default void set(Vector3DReadOnly axis, double angle)\n {\n getAxis().set(axis);\n setAngle(angle);\n }\n\n /**\n * Sets this axis-angle to the same value as the given axis-angle {@code other}.\n *\n * @param other the other axis-angle. Not modified.\n */\n default void set(AxisAngleReadOnly other)\n {\n getAxis().set(other.getAxis());\n setAngle(other.getAngle());\n }\n\n /**\n * Sets this axis-angle to {@code other} and then calls {@link #negate()}.\n *\n * @param other the other axis-angle to copy the values from. Not modified.\n */\n default void setAndNegate(AxisAngleReadOnly other)\n {\n set(other);\n negate();\n }\n\n /**\n * Copies the values in the given array into this axis-angle as follows:\n * <ul>\n * <li>{@code this.setX(axisAngleArray[0]);}\n * <li>{@code this.setY(axisAngleArray[1]);}\n * <li>{@code this.setZ(axisAngleArray[2]);}\n * <li>{@code this.setAngle(axisAngleArray[3]);}\n * </ul>\n *\n * @param axisAngleArray the array containing the new values for this axis-angle. Not modified.\n */\n default void set(double[] axisAngleArray)\n {\n set(0, axisAngleArray);\n }\n\n /**\n * Copies the values in the given array into this axis-angle as follows:\n * <ul>\n * <li>{@code this.setX(axisAngleArray[startIndex + 0]);}\n * <li>{@code this.setY(axisAngleArray[startIndex + 1]);}\n * <li>{@code this.setZ(axisAngleArray[startIndex + 2]);}\n * <li>{@code this.setAngle(axisAngleArray[startIndex + 3]);}\n * </ul>\n *\n * @param startIndex the first index to start reading from in the array.\n * @param axisAngleArray the array containing the new values for this axis-angle. Not modified.\n */\n default void set(int startIndex, double[] axisAngleArray)\n {\n setX(axisAngleArray[startIndex++]);\n setY(axisAngleArray[startIndex++]);\n setZ(axisAngleArray[startIndex++]);\n setAngle(axisAngleArray[startIndex]);\n }\n\n /**\n * Copies the values in the given array into this axis-angle as follows:\n * <ul>\n * <li>{@code this.setX(axisAngleArray[0]);}\n * <li>{@code this.setY(axisAngleArray[1]);}\n * <li>{@code this.setZ(axisAngleArray[2]);}\n * <li>{@code this.setAngle(axisAngleArray[3]);}\n * </ul>\n *\n * @param axisAngleArray the array containing the new values for this axis-angle. Not modified.\n */\n default void set(float[] axisAngleArray)\n {\n set(0, axisAngleArray);\n }\n\n /**\n * Copies the values in the given array into this axis-angle as follows:\n * <ul>\n * <li>{@code this.setX(axisAngleArray[startIndex + 0]);}\n * <li>{@code this.setY(axisAngleArray[startIndex + 1]);}\n * <li>{@code this.setZ(axisAngleArray[startIndex + 2]);}\n * <li>{@code this.setAngle(axisAngleArray[startIndex + 3]);}\n * </ul>\n *\n * @param startIndex the first index to start reading from in the array.\n * @param axisAngleArray the array containing the new values for this axis-angle. Not modified.\n */\n default void set(int startIndex, float[] axisAngleArray)\n {\n setX(axisAngleArray[startIndex++]);\n setY(axisAngleArray[startIndex++]);\n setZ(axisAngleArray[startIndex++]);\n setAngle(axisAngleArray[startIndex]);\n }\n\n /** {@inheritDoc} */\n @Override\n default void setAxisAngle(double x, double y, double z, double angle)\n {\n set(x, y, z, angle);\n }\n\n /** {@inheritDoc} */\n @Override\n default void setQuaternion(double x, double y, double z, double s)\n {\n AxisAngleConversion.convertQuaternionToAxisAngle(x, y, z, s, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void setRotationVector(double x, double y, double z)\n {\n AxisAngleConversion.convertRotationVectorToAxisAngle(x, y, z, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void setYawPitchRoll(double yaw, double pitch, double roll)\n {\n AxisAngleConversion.convertYawPitchRollToAxisAngle(yaw, pitch, roll, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void setRotationMatrix(double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22)\n {\n AxisAngleConversion.convertMatrixToAxisAngle(m00, m01, m02, m10, m11, m12, m20, m21, m22, this);\n }\n\n @Override\n default void setToYawOrientation(double yaw)\n {\n getAxis().set(Axis3D.Z);\n setAngle(yaw);\n }\n\n @Override\n default void setToPitchOrientation(double pitch)\n {\n getAxis().set(Axis3D.Y);\n setAngle(pitch);\n }\n\n @Override\n default void setToRollOrientation(double roll)\n {\n getAxis().set(Axis3D.X);\n setAngle(roll);\n }\n\n /**\n * Selects a component of this axis-angle based on {@code index} and sets it to {@code value}.\n * <p>\n * For {@code index} values of 0, 1, and 2, the corresponding components are x, y, and z,\n * respectively, while 3 corresponds to the angle.\n * </p>\n *\n * @param index the index of the component to set.\n * @param value the new value of the selected component.\n * @throws IndexOutOfBoundsException if {@code index} ∉ [0, 3].\n */\n default void setElement(int index, double value)\n {\n switch (index)\n {\n case 0:\n setX(value);\n break;\n case 1:\n setY(value);\n break;\n case 2:\n setZ(value);\n break;\n case 3:\n setAngle(value);\n break;\n default:\n throw new IndexOutOfBoundsException(Integer.toString(index));\n }\n }\n\n /**\n * Multiplies this axis-angle by {@code other}.\n * <p>\n * this = this * other\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void multiply(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiply(this, other, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void append(Orientation3DReadOnly other)\n {\n AxisAngleTools.multiply(this, false, other, false, this);\n }\n\n /**\n * Sets this axis-angle to the multiplication of {@code aa1} and {@code aa2}.\n * <p>\n * this = aa1 * aa2\n * </p>\n *\n * @param aa1 the first axis-angle in the multiplication. Not modified.\n * @param aa2 the second axis-angle in the multiplication. Not modified.\n */\n default void multiply(AxisAngleReadOnly aa1, AxisAngleReadOnly aa2)\n {\n AxisAngleTools.multiply(aa1, aa2, this);\n }\n\n /**\n * Multiplies this axis-angle by the inverse of {@code other}.\n * <p>\n * this = this * other<sup>-1</sup>\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void multiplyInvertOther(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiplyInvertRight(this, other, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void appendInvertOther(Orientation3DReadOnly orientation)\n {\n AxisAngleTools.multiply(this, false, orientation, true, this);\n }\n\n /**\n * Sets this axis-angle to the multiplication of the inverse of {@code this} and {@code other}.\n * <p>\n * this = this<sup>-1</sup> * other\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void multiplyInvertThis(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiplyInvertLeft(this, other, this);\n }\n\n /**\n * Sets this axis-angle to the multiplication of the inverse of {@code this} and the inverse of\n * {@code other}.\n * <p>\n * this = this<sup>-1</sup> * other<sup>-1</sup>\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void multiplyInvertBoth(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiplyInvertBoth(this, other, this);\n }\n\n /**\n * Appends a rotation about the z-axis to this axis-angle.\n *\n * <pre>\n * / ux = 0 \\\n * this = this * | uy = 0 |\n * | uz = 1 |\n * \\ angle = yaw /\n * </pre>\n *\n * @param yaw the angle to rotate about the z-axis.\n */\n @Override\n default void appendYawRotation(double yaw)\n {\n AxisAngleTools.appendYawRotation(this, yaw, this);\n }\n\n /**\n * Appends a rotation about the y-axis to this axis-angle.\n *\n * <pre>\n * / ux = 0 \\\n * this = this * | uy = 1 |\n * | uz = 0 |\n * \\ angle = pitch /\n * </pre>\n *\n * @param pitch the angle to rotate about the y-axis.\n */\n @Override\n default void appendPitchRotation(double pitch)\n {\n AxisAngleTools.appendPitchRotation(this, pitch, this);\n }\n\n /**\n * Appends a rotation about the x-axis to this axis-angle.\n *\n * <pre>\n * / ux = 1 \\\n * this = this * | uy = 0 |\n * | uz = 0 |\n * \\ angle = roll /\n * </pre>\n *\n * @param roll the angle to rotate about the x-axis.\n */\n @Override\n default void appendRollRotation(double roll)\n {\n AxisAngleTools.appendRollRotation(this, roll, this);\n }\n\n /**\n * Pre-multiplies this axis-angle by {@code other}.\n * <p>\n * this = other * other\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void preMultiply(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiply(other, this, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void prepend(Orientation3DReadOnly orientation)\n {\n AxisAngleTools.multiply(orientation, false, this, false, this);\n }\n\n /**\n * Sets this axis-angle to the multiplication of the inverse of {@code other} and {@code this}.\n * <p>\n * this = other<sup>-1</sup> * this\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void preMultiplyInvertOther(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiplyInvertLeft(other, this, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void prependInvertOther(Orientation3DReadOnly orientation)\n {\n AxisAngleTools.multiply(orientation, true, this, false, this);\n }\n\n /**\n * Sets this axis-angle to the multiplication of {@code other} and the inverse of {@code this}.\n * <p>\n * this = other * this<sup>-1</sup>\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void preMultiplyInvertThis(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiplyInvertRight(other, this, this);\n }\n\n /**\n * Sets this axis-angle to the multiplication of the inverse of {@code other} and the inverse of\n * {@code this}.\n * <p>\n * this = other<sup>-1</sup> * this<sup>-1</sup>\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void preMultiplyInvertBoth(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiplyInvertBoth(other, this, this);\n }\n\n /**\n * Prepends a rotation about the z-axis to this axis-angle.\n *\n * <pre>\n * / ux = 0 \\\n * this = | uy = 0 | * this\n * | uz = 1 |\n * \\ angle = yaw /\n * </pre>\n *\n * @param yaw the angle to rotate about the z-axis.\n */\n @Override\n default void prependYawRotation(double yaw)\n {\n AxisAngleTools.prependYawRotation(yaw, this, this);\n }\n\n /**\n * Prepends a rotation about the y-axis to this axis-angle.\n *\n * <pre>\n * / ux = 0 \\\n * this = | uy = 1 | * this\n * | uz = 0 |\n * \\ angle = pitch /\n * </pre>\n *\n * @param pitch the angle to rotate about the y-axis.\n */\n @Override\n default void prependPitchRotation(double pitch)\n {\n AxisAngleTools.prependPitchRotation(pitch, this, this);\n }\n\n /**\n * Prepends a rotation about the x-axis to this axis-angle.\n *\n * <pre>\n * / ux = 1 \\\n * this = | uy = 0 | * this\n * | uz = 0 |\n * \\ angle = roll /\n * </pre>\n *\n * @param roll the angle to rotate about the x-axis.\n */\n @Override\n default void prependRollRotation(double roll)\n {\n AxisAngleTools.prependRollRotation(roll, this, this);\n }\n}",
"private PVector angleAsVector(float theta) {\n\t\tPVector result = new PVector(0,0);\r\n\t\tresult.x = (float) Math.cos(theta);\r\n\t\tresult.y = (float) Math.sin(theta);\r\n\t\treturn result;\r\n\t}",
"public double findAngle() {\n return 0d;\n }",
"@Test\r\n public void testCalculateAngle3() {\r\n System.out.println(\"calculateAngle3\");\r\n DialDraw instance = new TachometerDraw();\r\n instance.setValue(100);\r\n double expResult = Math.toRadians(0);\r\n double result = instance.calculateAngle();\r\n assertEquals(result, expResult, 0.0001);\r\n }",
"public void rotateToAngle(double angle) {\n controlState = ControlState.POSITION;\n outputPosition = -angle * TurretConstants.TICKS_PER_DEGREE;\n }",
"public double getAngle() {\n return Math.atan2(sinTheta, cosTheta);\n }",
"@Deprecated\n public static Vector3 subtract(Vector3 par1, Vector3 par2)\n {\n return new Vector3(par1.x - par2.x, par1.y - par2.y, par1.z - par2.z);\n }",
"public TurnToDefaultAngle() {\n super(0, RobotContainer.m_robotDrive);\n }",
"public Vector subtract(Vector other) {\n\t\treturn new Vector(x - other.x, y - other.y);\n\t}",
"public double getAngle() {\n\t\treturn this.position[2];\n\t}",
"public Rotation to(Bearing target) {\n int diff = ((target.getValue() - this.getValue() + 8) % 8);\n switch (diff) {\n case 0:\n return Rotation.NONE;\n case 2:\n return Rotation.R90;\n case 4:\n return Rotation.R180;\n case 6:\n return Rotation.L90;\n default:\n throw new RuntimeException();\n// throw new RuntimeException(\"Not implemented...\");\n }\n }",
"public static double reverseAngle(double angle) {\n return 180 - angle;\n }",
"@Test\r\n public void testCalculateAngle4() {\r\n System.out.println(\"calculateAngle4\");\r\n DialDraw instance = new TachometerDraw();\r\n instance.setValue(90);\r\n double expResult = Math.toRadians(18);\r\n double result = instance.calculateAngle();\r\n assertEquals(result, expResult, 0.0001);\r\n }"
]
| [
"0.76748806",
"0.73609495",
"0.70861226",
"0.65999085",
"0.65999085",
"0.65719646",
"0.6385176",
"0.6357924",
"0.62551785",
"0.6139673",
"0.6110524",
"0.60993016",
"0.6056867",
"0.5994942",
"0.59515804",
"0.5880166",
"0.58289164",
"0.58164173",
"0.5806661",
"0.57293254",
"0.5724165",
"0.5724165",
"0.5724165",
"0.5720967",
"0.57179916",
"0.5641587",
"0.5633171",
"0.5622517",
"0.5619376",
"0.56192386",
"0.5588577",
"0.5584214",
"0.55684036",
"0.5567903",
"0.5565558",
"0.5564033",
"0.5562258",
"0.55486405",
"0.5546652",
"0.5546393",
"0.5546393",
"0.55448616",
"0.55220145",
"0.5504382",
"0.5503133",
"0.54795384",
"0.54784566",
"0.54447556",
"0.54424274",
"0.54091215",
"0.540409",
"0.5399434",
"0.5398481",
"0.5397181",
"0.53929186",
"0.53848296",
"0.5384416",
"0.53779733",
"0.53753275",
"0.5368847",
"0.53655773",
"0.5364018",
"0.53494567",
"0.53448486",
"0.53346485",
"0.5310381",
"0.5301887",
"0.52951235",
"0.52939224",
"0.5291296",
"0.52890486",
"0.52890486",
"0.52840644",
"0.52635765",
"0.52457166",
"0.52384925",
"0.5229548",
"0.5220421",
"0.52089816",
"0.520519",
"0.5186691",
"0.5183909",
"0.51759034",
"0.51719165",
"0.5163396",
"0.51590157",
"0.51540434",
"0.5152973",
"0.5149081",
"0.5141356",
"0.51384425",
"0.51384336",
"0.5136235",
"0.51356554",
"0.51204216",
"0.51065135",
"0.5086444",
"0.50825",
"0.5082332",
"0.5082097"
]
| 0.8979382 | 0 |
Returns a new object of class 'Angle Scalar Multiply'. | AngleScalarMultiply createAngleScalarMultiply(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Multiply createMultiply();",
"AngleScalarDivide createAngleScalarDivide();",
"Angle createAngle();",
"LengthScalarMultiply createLengthScalarMultiply();",
"AngleAdd createAngleAdd();",
"AngleSubtract createAngleSubtract();",
"AngleSmaller createAngleSmaller();",
"public AncientEgyptianMultiplication( ) {\r\n }",
"public Cartesiana polar_cartesiano (float radio, float angulo) {\n return new Cartesiana (radio * (float)Math.cos(angulo),radio * (float)Math.sin(angulo)); \n}",
"public Vector<T> multiply(T aScalar);",
"public void multiply() {\n\t\t\n\t}",
"public Parameter multiplyParameter(Parameter otherPram);",
"AngleEquals createAngleEquals();",
"public atan( ) {\n super(1);\n }",
"private void mul() {\n\n\t}",
"public Math2()\r\n {\r\n \r\n }",
"public Vector3 mult(float scalar){\r\n\t\tthis.x *= scalar;\r\n\t\tthis.y *= scalar;\r\n\t\tthis.z *= scalar;\r\n\t\treturn this;\r\n\t}",
"public Transformation mult(Transformation a) {\n\t\tTransformation result = new Transformation();\n\t\tsuper.mult(a, result);\n\t\treturn result;\n\t}",
"public static OperationMBean getMultiplyOperationMBean()\n {\n return new Operation(\"multiply\");\n }",
"public Polynomial operate(){\n Polynomial result = a.multiplyPolynomial(b);\n return result;\n }",
"Rational multiply(Rational p){\n Rational firstarg=new Rational();\n firstarg.numerator=numerator;\n firstarg.denominator=denominator;\n\n firstarg.numerator=p.numerator*firstarg.numerator;\n firstarg.denominator=p.denominator*firstarg.denominator;\n return firstarg;\n }",
"IVec3 mult(IVec3 v);",
"@Override\r\n\tpublic int mul() {\n\t\treturn 0;\r\n\t}",
"public vec2 mul( vec2 o){\n vec2 R = new vec2 ();\n R.x += this._M[ 0 ] * o.x ;\n R.x += this._M[ 1 ] * o.y ;\n R.y += this._M[ 4 ] * o.x ;\n R.y += this._M[ 5 ] * o.y ;\n return R;\n }",
"public Vector2D mul(double a)\n\t{\n\t\treturn new Vector2D(a*x, a*y);\n\t}",
"public double getAngle();",
"public JTensor mul(JType value) {\n JTensor r = new JTensor();\n TH.THTensor_(mul)(r, this, value);\n return r;\n }",
"double getAngle();",
"double getAngle();",
"AngleGreater createAngleGreater();",
"public Square(Color emission, Material material,\n Point3D P1, Vector v1,\n Vector v2, double length) {\n super(emission, material, P1, v1.crossProduct(v2));\n if (v1.dotProduct(v2) != 0)\n throw new IllegalArgumentException(\"the vectors are not orthogonal\");\n v1 = v1.rescale(length);\n v2 = v2.rescale(length);\n p2 = p1.add(v1);\n p4 = p1.add(v2);\n p3 = p4.add(v1);\n }",
"private MyMath() {\n }",
"AngleDistinct createAngleDistinct();",
"public MComplex() {\r\n\t\ta = b = r = phi = 0;\r\n\t\tcartesian = polar = true;\r\n\t}",
"final public Vector3 mul(double c){\n return new Vector3(x*c, y*c, z*c);\n }",
"@Override\n\tpublic float multiplicar(float op1, float op2) {\n\t\treturn op1 * op2;\n\t}",
"@Override\n\tpublic void mul(double dx, double dy) {\n\t\t\n\t}",
"AngleResource inclination();",
"@Override\npublic void mul(int a, int b) {\n\t\n}",
"public Math() {\n initComponents();\n }",
"public void mul() {\n //TODO: Fill in this method, then remove the RuntimeException\n throw new RuntimeException(\"RatPolyStack->mul() unimplemented!\\n\");\n }",
"Multiplication createRandomMultiplication();",
"Multiplication createRandomMultiplication();",
"public Vector3 times(Vector3 multiplicand) {\n\t\treturn new Vector3(multiplicand.x * this.x, multiplicand.y * this.y, multiplicand.z * this.z);\n\t}",
"@Override\r\n\tpublic void mul(int x, int y) {\n\t\t\r\n\t}",
"public Rational multiply(Rational other)\n\t{\n\t\tint multNumer = (getNumer() * other.getNumer());\n\t\tint multDenom = (getDenom() * other.getDenom());\n\n\t\tRational product = new Rational(multNumer, multDenom);\n\t\tproduct.normalize();\n\t\treturn product;\n\t}",
"public Square(Color emission, int Shininess,\n double _Kd, double _Ks, double _Kr, double _Kt,\n Point3D P1, Vector v1,\n Vector v2, double length) {\n super(emission, Shininess, _Kd, _Ks, _Kr, _Kt, P1, v1.crossProduct(v2));\n if (v1.dotProduct(v2) != 0)\n throw new IllegalArgumentException(\"the vectors are not orthogonal\");\n v1 = v1.rescale(length);\n v2 = v2.rescale(length);\n p2 = p1.add(v1);\n p4 = p1.add(v2);\n p3 = p4.add(v1);\n }",
"public double getProduct()\n {\n return first * second;\n }",
"Matrix( Vector a, Vector b )\n {\n x = b.times(a.x);\n y = b.times(a.y);\n z = b.times(a.z);\n }",
"public LMUL() {\n super(InstructionOpCodes.LMUL, 1);\n }",
"public static <T extends Vector> T Multiply(T a, T b,T result){\n if(Match(a,b)) {\n for (int i = 0; i < result.axis.length; i++) {\n result.axis[i] = a.axis[i] * b.axis[i];\n }\n return result;\n }\n return result;\n }",
"public CmdPolar(Kernel kernel) {\n\t\tsuper(kernel);\n\t}",
"private XMath()\n {\n \n }",
"public Unit<Angle> microradian() {return microradian;}",
"BaseNumber multiply(BaseNumber operand);",
"public void setAngle( double a ) { angle = a; }",
"abstract void mulS();",
"@SuppressWarnings(\"unchecked\")\n @Override\n public Expression asExpression(Rule rule, Deque<Value<Expression>> args) {\n if (args.size() == 1) {\n // a single term is not a product\n return args.pollFirst().getTarget();\n } else {\n // assume x to be *x, because the product will start by 1*x\n Term<Multiplicative> factor = new Term<>(Multiplicative.MULT, args.removeFirst().getTarget());\n List<Term<Multiplicative>> arguments = new LinkedList<>();\n arguments.add(factor);\n args.stream()\n // next arguments are all Term<Multiplicative>\n .map(v -> (Term<Multiplicative>) v.getTarget())\n .forEachOrdered(arguments::add);\n return new Product(arguments);\n }\n }",
"public PolyTerm mul(PolyTerm pt) {\n\t\tScalar coeffi=this.coefficient.mul(pt.coefficient);\n\t\tint expon= pt.exponent + this.exponent;\n\t\treturn new PolyTerm(coeffi, expon);\n\t}",
"public Rational() {\n\t\tthis(1,1);\n\t}",
"public Complex multiply(Complex c) {\n return Complex.fromMagnitudeAndAngle(this.getMagnitude() * c.getMagnitude(), this.getAngle() + c.getAngle());\n }",
"public abstract Vector4fc mul(float x, float y, float z, float w);",
"LengthScalarDivide createLengthScalarDivide();",
"public Quaternion mul(final Quaternion rhs)\n {\n final float newW = w * rhs.w - x * rhs.x - y * rhs.y - z * rhs.z;\n final float newX = x * rhs.w + w * rhs.x + y * rhs.z - z * rhs.y;\n final float newY = y * rhs.w + w * rhs.y + z * rhs.x - x * rhs.z;\n final float newZ = z * rhs.w + w * rhs.z + x * rhs.y - y * rhs.x;\n\n return new Quaternion(newX, newY, newZ, newW);\n }",
"public Vector tensorProduct( final Vector a);",
"public static JTensor addcmul(JTensor t, JType a, JTensor s1, JTensor s2) {\n JTensor r = new JTensor();\n TH.THTensor_(addcmul)(r, t, a, s1, s2);\n return r;\n }",
"MulOrDiv createMulOrDiv();",
"public static Rational multiply(Rational num1, Rational num2){\r\n Rational product = new Rational();\r\n \r\n // multiply throughout\r\n product.denominator = num1.getDenominator() * num2.getDenominator();\r\n product.numerator = num1.getNumerator() * num2.getNumerator();\r\n \r\n product.reduce();\r\n return product;\r\n }",
"public static void main(String[] args) {\n\t\tVector3 i = new Vector3(1, 0, 0);\n\t\tVector3 j = new Vector3(0, 1, 0);\n\t\tVector3 k = i.cross(j);\n\t\t\n\t\tVector3 l = k.add(j).scale(5);\n\t\t\n\t\tVector3 m = l.normalized();\n\t\t\n\t\tSystem.out.println(i);\n\t\tSystem.out.println(j);\n\t\tSystem.out.println(k);\n\t\tSystem.out.println(l);\n\t\tSystem.out.println(l.norm());\n\t\tSystem.out.println(m);\n\t\tSystem.out.println(l.dot(j));\n\t\tSystem.out.println(i.add(new Vector3(0, 1, 0)).cosAngle(l));\n\t}",
"public Point mult(Point a) {\n\t\tPoint result = new Point();\n\t\tsuper.mult(a, result);\n\t\treturn result;\n\t}",
"public int producto(){\r\n return x*y;\r\n }",
"@Override\n\tpublic double multiply(double in1, double in2) {\n\t\treturn 0;\n\t}",
"public mathMethods() {\n initComponents();\n }",
"public static MathNode create(List<MathNode> nodes) {\n return new PowerNode(nodes);\n }",
"public R3Mult(int rdIndex, int rsIndex, int id) {\n\n }",
"public static Vector2 MultScalar(Vector2 a, float scalar){\n return new Vector2(a.x * scalar, a.y * scalar);\n }",
"public double componentProduct()\n {\n return this.x * this.y;\n }",
"@Override\n\tpublic double multiply(double a, double b) {\n\t\treturn (a*b);\n\t}",
"public Vec4 addMul(final Vec4 o, final double s) {\n return new Vec4(x + o.x * s, y + o.y * s, z + o.z * s, w + o.w * s);\n }",
"public Cylinder() {\n\t\tthis(1.0);\n\t}",
"public Scalar mul(Scalar s) {\n\t\treturn new RealScalar(getValue() * ((RealScalar)s).getValue());\n\t}",
"public static Transform newXRotation(float th){\n float sinth = (float) Math.sin(th);\n float costh = (float) Math.cos(th);\n return new Transform(new float[][]{\n {1.0f, 0.0f, 0.0f, 0.0f},\n {0.0f, costh, -sinth, 0.0f},\n {0.0f, sinth, costh, 0.0f},\n {0.0f, 0.0f, 0.0f, 1.0f}\n });\n }",
"public ImageRotator(int receivedAngle){angle = receivedAngle;}",
"void setAngle(int id, double value);",
"Point mult (double s);",
"private MatrixMultiplication() {\n throw new UnsupportedOperationException(\n \"Error @ new MatrixMultiplication() :: MatrixMultiplication is noninstantiable static class\");\n }",
"public double betweenAngle(Coordinates a, Coordinates b, Coordinates origin);",
"public Color4 getEffectColorMul();",
"private PVector angleAsVector(float theta) {\n\t\tPVector result = new PVector(0,0);\r\n\t\tresult.x = (float) Math.cos(theta);\r\n\t\tresult.y = (float) Math.sin(theta);\r\n\t\treturn result;\r\n\t}",
"@Override\n public Expression create(Expression a, Expression b) {\n return new Minus(a, b);\n }",
"public interface IMul {\n Var mul(Var var);\n\n}",
"public void multiply(double amount) {\n x *= amount;\n y *= amount;\n }",
"public Vector2d mul(double s) {\n\t\treturn new Vector2d(x*s, y*s);\n\t}",
"@ZenCodeType.Operator(ZenCodeType.OperatorType.MUL)\n default IData mul(IData other) {\n \n return notSupportedOperator(OperatorType.MUL);\n }",
"public T mul(T first, T second);",
"public Function(double a, double b, double c) {\r\n\t //y = a*(x*x) + b*x + c;\r\n co[0]= c;\r\n co[1]= b;\r\n co[2]= a;\r\n degree[0] = 0;\r\n degree[1] = 1;\r\n degree[2] = 2;\r\n cindex = 3;\r\n\t}",
"public static Transform newYRotation(float th){\n float sinth = (float) Math.sin(th);\n float costh = (float) Math.cos(th);\n return new Transform(new float[][]{\n {costh, 0.0f, sinth, 0.0f},\n {0.0f, 1.0f, 0.0f, 0.0f},\n {-sinth, 0.0f, costh, 0.0f},\n {0.0f, 0.0f, 0.0f, 1.0f}\n });\n }",
"public Circle() {\n this( 1.0 ); \n }",
"public String multiply()\r\n {\r\n\r\n return First.multiply(Second).stripTrailingZeros().toString();\r\n }",
"public void multiply(Object mulValue) {\r\n\r\n\t\tNumberOperation operator = new NumberOperation(this.value, mulValue) {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic Number doAnOperation() {\r\n\t\t\t\tTypeEnum typeOfResult = getFinalType();\r\n\t\t\t\tif(typeOfResult == TypeEnum.TYPE_INTEGER) {\r\n\t\t\t\t\treturn getO1().intValue() * getO2().intValue();\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\treturn getO1().doubleValue() * getO2().doubleValue();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\tthis.value = operator.doAnOperation();\r\n\t}"
]
| [
"0.690688",
"0.67525524",
"0.6607744",
"0.65977913",
"0.64972925",
"0.6429657",
"0.62287444",
"0.56171584",
"0.55799586",
"0.55782115",
"0.55759263",
"0.554073",
"0.5533742",
"0.5494694",
"0.53849304",
"0.5377805",
"0.53705895",
"0.5366155",
"0.5306037",
"0.5284608",
"0.525936",
"0.5258698",
"0.5256022",
"0.5240588",
"0.5231402",
"0.522118",
"0.5220079",
"0.52192575",
"0.52192575",
"0.5213324",
"0.51972735",
"0.5185784",
"0.51821935",
"0.5173003",
"0.5147799",
"0.51315224",
"0.5125769",
"0.511711",
"0.5113251",
"0.5111972",
"0.5110793",
"0.5106296",
"0.5106296",
"0.5097912",
"0.5096996",
"0.50838673",
"0.5081377",
"0.5054386",
"0.5046806",
"0.50454426",
"0.50437677",
"0.504205",
"0.503414",
"0.5028514",
"0.50200576",
"0.5017103",
"0.50125074",
"0.50061995",
"0.49969348",
"0.49923113",
"0.49722043",
"0.49716443",
"0.49609017",
"0.49606687",
"0.49601668",
"0.49584994",
"0.49561998",
"0.4954737",
"0.49531025",
"0.49415877",
"0.49315563",
"0.4923798",
"0.49231762",
"0.49135616",
"0.49097157",
"0.490798",
"0.49030116",
"0.4897562",
"0.48924673",
"0.48909986",
"0.4890869",
"0.48860523",
"0.4883702",
"0.48820788",
"0.48808995",
"0.48802543",
"0.48801345",
"0.48794988",
"0.48786503",
"0.48761678",
"0.48732457",
"0.48648974",
"0.4863979",
"0.48553807",
"0.48482823",
"0.48463276",
"0.4840192",
"0.4837845",
"0.4837445",
"0.4832979"
]
| 0.8622261 | 0 |
Returns a new object of class 'Angle Scalar Divide'. | AngleScalarDivide createAngleScalarDivide(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"LengthScalarDivide createLengthScalarDivide();",
"AngleScalarMultiply createAngleScalarMultiply();",
"public Divide(){\n }",
"Angle createAngle();",
"AngleSmaller createAngleSmaller();",
"AngleSubtract createAngleSubtract();",
"public Vector<T> divide(T aScalar);",
"AngleAdd createAngleAdd();",
"@Override\n\tpublic Operation createOperate() {\n\t\treturn new OperationDiv();\n\t}",
"public abstract String division();",
"IVec3 div(IVec3 v);",
"public static <T extends Vector> T Divide(T a, T b,T result){\n if(Match(a,b)) {\n for (int i = 0; i < result.axis.length; i++) {\n result.axis[i] = a.axis[i] / b.axis[i];\n }\n return result;\n }\n return result;\n }",
"public Divide(Expression a) {\n super(Expression.X_COMES_AFTER);\n this.a = a;\n }",
"public Fraccion division() {\r\n Fraccion division = new Fraccion(operador1.getNumerador()*operador2.getDenominador() , operador1.getDenominador()*operador2.getNumerador());\r\n return simplify(division);\r\n }",
"double getAngle();",
"double getAngle();",
"public void divide() {\n\t\t\n\t}",
"public double getAngle();",
"AngleGreater createAngleGreater();",
"public Complex DivideBy (Complex z) {\n\ndouble rz = z.Magnitude();\n\nreturn new Complex((u*z.u+v*z.v)/(rz*rz),(v*z.u-u*z.v)/(rz*rz));\n\n}",
"public abstract Vector4fc div(float x, float y, float z, float w);",
"Division createDivision();",
"Rational divide(Rational p){\n Rational firstarg=new Rational();\n firstarg.numerator=numerator;\n firstarg.denominator=denominator;\n\n\n firstarg.numerator=firstarg.numerator*p.denominator;\n firstarg.denominator=p.numerator*firstarg.denominator;\n return firstarg;\n }",
"@Test\n\tpublic void divisionTest() {\n\t\tMathOperation division = new Division();\n\n\t\tassertEquals(0, division.operator(ZERO, FIVE).intValue());\n\t\tassertEquals(4, division.operator(TWENTY, FIVE).intValue());\n\t}",
"public Complex divide(Complex c) {\n return Complex.fromMagnitudeAndAngle(this.getMagnitude() / c.getMagnitude(), this.getAngle() - c.getAngle());\n }",
"public Point3D divide(double divisor) {\n\t\treturn new Point3D(x / divisor, y / divisor, z / divisor);\n\t}",
"public Division() {\n\t\tthis(\"division\", null);\n\t}",
"AngleEquals createAngleEquals();",
"AngleDistinct createAngleDistinct();",
"public static ObjectInstance getDivideOperationObjectInstance()\n {\n ObjectName o = null;\n try\n {\n Hashtable<String, String> properties = new Hashtable<String, String>(\n 4);\n properties.put(\"name\", StringMangler\n .EncodeForJmx(getDivideOperationMBean().getName()));\n properties.put(\"jmxType\", new Operation().getJmxType());\n o = new ObjectName(_domain, properties);\n\n }\n catch (Exception e)\n {\n Assert\n .fail(\"'Divide' Operation ObjectInstance could not be created. \"\n + e.getMessage());\n }\n return new ObjectInstance(o, new Operation().getClass().getName());\n }",
"public JTensor div(JType value) {\n JTensor r = new JTensor();\n TH.THTensor_(div)(r, this, value);\n return r;\n }",
"public static OperationMBean getDivideOperationMBean()\n {\n return new Operation(\"divide\");\n }",
"public String toString(){ return \"DIV\";}",
"public static <T extends Vector> T Divide(T a, float val,T result){\n for (int i = 0; i < result.axis.length; i++) {\n result.axis[i] = a.axis[i] / val;\n }\n return result;\n }",
"@Override\n public InterpreterValue div(InterpreterValue v) {\n\n // If the given value is a IntegerValue create a new DoubleValue from\n // the division-result\n if(v instanceof IntegerValue) return new DoubleValue(getValue() / ((IntegerValue) v).getValue());\n\n // If the given value is a DoubleValue create a new DoubleValue from\n // the division-result\n if(v instanceof DoubleValue) return new DoubleValue(getValue() / ((DoubleValue) v).getValue());\n\n // In other case just throw an error\n throw new Error(\"Operator '/' is not defined for type double and \" + v.getName());\n\n }",
"LengthScalarMultiply createLengthScalarMultiply();",
"public Fraction divide(Fraction divisor)\n {\n Fraction flipDivisor = divisor.reciprocal();\n Fraction newFraction = new Fraction();\n newFraction = this.multiply(flipDivisor);\n return newFraction;\n }",
"protected RMShape createDivideShapeRemainder(byte anEdge) { return clone(); }",
"public double getStartAngle();",
"public DataSetDivide( )\n {\n super( \"Divide by a DataSet\" );\n }",
"BaseNumber divide(BaseNumber operand);",
"public Divide(Expression a, Expression b) {\n super(Expression.X_IS_UNDEFINED);\n this.a = a;\n this.b = b;\n }",
"public Point divide(double divisor)\n {\n return new Point(this.x / divisor, this.y / divisor);\n }",
"public RMShape divideShapeFromEdge(double anAmount, byte anEdge, RMShape aNewShape)\n{\n // Get NewShape (if aNewShape is null, create one)\n RMShape newShape = aNewShape!=null? aNewShape : createDivideShapeRemainder(anEdge);\n\n // Get bounds for this shape and remainder bounds (divide bounds by amount from edge)\n RMRect bounds = getFrame();\n RMRect remainder = bounds.divideRect(anAmount, anEdge);\n \n // Set this shape's new bounds and NewShape bounds as remainder\n setFrame(bounds);\n newShape.setFrame(remainder);\n return newShape;\n}",
"public Fraction divide( Fraction divisor ) {\n // Division ist genau wie multiplication aber in Kreuz\n // also, wir tauschen den numerator und den denomitanor aus, und\n // multiplizieren wie üblich\n Fraction upsideDown = new Fraction( divisor.denominator, divisor.numerator );\n Fraction result = this.multiply( upsideDown );\n\n return result;\n }",
"Fraction () {\n this (0, 1);\n }",
"public static Vector2 DivideScalar(Vector2 a, float scalar){\n return new Vector2(a.x / scalar, a.y / scalar);\n }",
"AngleResource inclination();",
"public Cos(String exp) {\n super(exp);\n }",
"public Divide(Node l, Node r) {\r\n\t\tsuper(l, r);\r\n\t}",
"public Cos(Expression exp) {\n super(exp);\n }",
"public Divide(Expression a, String flag) {\n super(flag);\n this.a = a;\n }",
"public double betweenAngle(Coordinates a, Coordinates b, Coordinates origin);",
"public Vector6f divI(float scalar)\n\t{\n\t\tx[0] /= scalar; \n\t\tx[1] /= scalar; \n\t\tx[2] /= scalar; \n\t\tx[3] /= scalar; \n\t\tx[4] /= scalar; \n\t\tx[5] /= scalar;\n\t\treturn this;\n\t}",
"Triangle(){\n side1 = 1.0;\n side2 = 1.0;\n side3 = 1.0;\n }",
"Subdivision create(Subdivision subdivision);",
"public final void mDIV() throws RecognitionException\n\t{\n\t\ttry\n\t\t{\n\t\t\tfinal int _type = AshvmLexer.DIV;\n\t\t\tfinal int _channel = BaseRecognizer.DEFAULT_TOKEN_CHANNEL;\n\t\t\t// D:\\\\Programmieren\\\\projects\\\\ashvm\\\\Ashvm.g:714:5: ( 'div' )\n\t\t\t// D:\\\\Programmieren\\\\projects\\\\ashvm\\\\Ashvm.g:714:7: 'div'\n\t\t\t{\n\t\t\t\tthis.match(\"div\");\n\n\t\t\t}\n\n\t\t\tthis.state.type = _type;\n\t\t\tthis.state.channel = _channel;\n\t\t}\n\t\tfinally\n\t\t{\n\t\t}\n\t}",
"Centimeter createCentimeter();",
"@Override\n\tpublic float dividir(float op1, float op2) {\n\t\treturn op1 / op2;\n\t}",
"public T cos(T value);",
"public double SolidAngle() {\n return OCCwrapJavaJNI.Units_Dimensions_SolidAngle(swigCPtr, this);\n }",
"public abstract Vector4fc div(IVector4f v);",
"public Fraction(){\n numerator = 0;\n denominator = 1;\n }",
"public T divide( double val ) {\n T ret = createLike();\n ops.divide(mat, val, ret.getMatrix());\n return ret;\n }",
"public <V extends Number> FluentExp<V> div (V value)\n {\n return new Div<V>(this, value);\n }",
"public Fraction divide(Fraction f){\n return new Fraction(this.numerator * f.denominator, this.denominator * f.numerator);\n }",
"public void setAngle( double a ) { angle = a; }",
"public static BinaryExpression divide(Expression expression0, Expression expression1) { throw Extensions.todo(); }",
"public static Volume do_calc() {\n\t\treturn new Volume();\n\t}",
"public Polynomial divisionHorner(int position, String a_value) {\n\n // under equals the parsed value of a_value (\"under the fraction bar\")\n double under;\n\n // value stores the result\n double value;\n\n // parsing \",\" to \".\" to avoid NumberFormatExceptions\n for (int i = 0; i < a_value.length(); i++) {\n if (a_value.charAt(i) == ',')\n a_value = a_value.substring(0, i) + \".\" + a_value.substring(i + 1);\n }\n // parsing a_value to double\n try {\n // -- = +\n if(a_value.length() > 1) {\n if (a_value.substring(0, 2).equals(\"--\"))\n a_value = a_value.substring(2);\n }\n under = Double.parseDouble(a_value);\n } catch (NumberFormatException e) {\n if (a_value.equals(\"\"))\n under = 0;\n else\n return new Polynomial(1);\n }\n\n // making a = -a\n\n under = under * -1;\n\n int start = 0;\n\n // finding the first not empty field to start with\n for (int i = collection.get(position).getLength() - 1; i >= 0; i--) {\n if (collection.get(position).getValue(i) != 0) {\n start = i;\n break;\n }\n }\n Polynomial polynomial = new Polynomial(start);\n if (start == 0) {\n polynomial = new Polynomial(1);\n polynomial.setValue(0, 0);\n polynomial.setRemainder(collection.get(position).getValue(0), under * -1);\n return polynomial;\n }\n\n // horner-algorithm: ((first factor * (-a) + second factor) * (-a) + third factor)...\n value = collection.get(position).getValue(start);\n polynomial.setValue(polynomial.getLength() - 1, value);\n start--;\n\n for (int i = start; i > 0; i--) {\n // caused by the power-reduction the value is stored one field \"deeper\"\n value = value * under + collection.get(position).getValue(i);\n polynomial.setValue(i - 1, value);\n\n }\n\n // the last value equals the remainder\n value = value * under + collection.get(position).getValue(0);\n\n // remainder is stored in the corresponding polynomial\n polynomial.setRemainder(value, under * -1);\n return polynomial;\n }",
"public T elementDiv( T b ) {\n convertType.specify(this, b);\n T A = convertType.convert(this);\n b = convertType.convert(b);\n\n T c = A.createLike();\n A.ops.elementDiv(A.mat, b.mat, c.mat);\n return c;\n }",
"public Vector div(double d){\n return new Vector(this.getX()/d, this.getY()/d, this.getZ()/d);\n }",
"public Cos(Expression expression) {\n super(\"cos(%s)\", expression);\n }",
"public Point3D divide(double f) {\n\t\tPoint3D copy = new Point3D(this);\n\t\tcopy.homogenize();\n\t\tcopy.x = copy.x / f;\n\t\tcopy.y = copy.y / f;\n\t\tcopy.z = copy.z / f;\n\t\treturn copy;\n\t}",
"public Circle() {\n this( 1.0 ); \n }",
"public interface AxisAngleBasics extends AxisAngleReadOnly, Orientation3DBasics, Clearable\n{\n /**\n * Gets the reference to the axis part of this axis-angle.\n *\n * @return the reference to the axis vector.\n */\n @Override\n UnitVector3DBasics getAxis();\n\n /**\n * Sets a new angle to this axis-angle.\n *\n * @param angle the new angle.\n */\n void setAngle(double angle);\n\n /**\n * Sets a new x-component for the axis of this axis-angle.\n *\n * @param x the new axis x-component.\n */\n default void setX(double x)\n {\n getAxis().setX(x);\n }\n\n /**\n * Sets a new y-component for the axis of this axis-angle.\n *\n * @param y the new axis y-component.\n */\n default void setY(double y)\n {\n getAxis().setY(y);\n }\n\n /**\n * Sets a new z-component for the axis of this axis-angle.\n *\n * @param z the new axis z-component.\n */\n default void setZ(double z)\n {\n getAxis().setZ(z);\n }\n\n /**\n * Sets the components of this axis-angle to represent a \"zero\" rotation. After calling the axis is\n * equal to {@link Axis3D#X} and the angle to 0.\n */\n @Override\n default void setToZero()\n {\n getAxis().set(Axis3D.X);\n setAngle(0.0);\n }\n\n /**\n * Sets the components of this axis-angle to {@link Double#NaN}.\n */\n @Override\n default void setToNaN()\n {\n getAxis().setToNaN();\n setAngle(Double.NaN);\n }\n\n /**\n * Tests if this axis-angle contains a {@link Double#NaN}.\n *\n * @return {@code true} if this axis-angle contains a {@link Double#NaN}, {@code false} otherwise.\n */\n @Override\n default boolean containsNaN()\n {\n return AxisAngleReadOnly.super.containsNaN();\n }\n\n /**\n * Sets each component of this axis-angle to its absolute value.\n */\n default void absolute()\n {\n getAxis().absolute();\n setAngle(Math.abs(getAngle()));\n }\n\n /**\n * Negates each component of this axis-angle.\n */\n default void negate()\n {\n getAxis().negate();\n setAngle(-getAngle());\n }\n\n /** {@inheritDoc} */\n @Override\n default void invert()\n {\n setAngle(-getAngle());\n }\n\n /**\n * Normalizes the axis of this axis-angle such that its norm is equal to 1 after calling this method\n * and its direction remains unchanged.\n * <p>\n * Edge cases:\n * <ul>\n * <li>if this axis-angle contains {@link Double#NaN}, this method is ineffective.\n * </ul>\n * </p>\n */\n @Override\n default void normalize()\n {\n getAxis().normalize();\n }\n\n /**\n * Multiplies the angle of this axis-angle by the given {@code scale}.\n *\n * @param scale the scaling factor to apply to the angle of this axis-angle.\n */\n default void scaleAngle(double scale)\n {\n setAngle(scale * getAngle());\n }\n\n /**\n * Sets this axis-angle to represent a new rotation of axis ({@code x}, {@code y}, {@code z}) and\n * angle of {@code angle}.\n *\n * @param x x-component of the new axis.\n * @param y y-component of the new axis.\n * @param z z-component of the new axis.\n * @param angle the new angle.\n */\n default void set(double x, double y, double z, double angle)\n {\n getAxis().set(x, y, z);\n setAngle(angle);\n }\n\n /** {@inheritDoc} */\n @Override\n default void set(Orientation3DReadOnly orientation3DReadOnly)\n {\n if (orientation3DReadOnly instanceof AxisAngleReadOnly)\n set((AxisAngleReadOnly) orientation3DReadOnly);\n else\n orientation3DReadOnly.get(this);\n }\n\n /**\n * Sets the axis and the angle of this axis-angle.\n *\n * @param axis the new axis. Not modified.\n * @param angle the new angle.\n */\n default void set(Vector3DReadOnly axis, double angle)\n {\n getAxis().set(axis);\n setAngle(angle);\n }\n\n /**\n * Sets this axis-angle to the same value as the given axis-angle {@code other}.\n *\n * @param other the other axis-angle. Not modified.\n */\n default void set(AxisAngleReadOnly other)\n {\n getAxis().set(other.getAxis());\n setAngle(other.getAngle());\n }\n\n /**\n * Sets this axis-angle to {@code other} and then calls {@link #negate()}.\n *\n * @param other the other axis-angle to copy the values from. Not modified.\n */\n default void setAndNegate(AxisAngleReadOnly other)\n {\n set(other);\n negate();\n }\n\n /**\n * Copies the values in the given array into this axis-angle as follows:\n * <ul>\n * <li>{@code this.setX(axisAngleArray[0]);}\n * <li>{@code this.setY(axisAngleArray[1]);}\n * <li>{@code this.setZ(axisAngleArray[2]);}\n * <li>{@code this.setAngle(axisAngleArray[3]);}\n * </ul>\n *\n * @param axisAngleArray the array containing the new values for this axis-angle. Not modified.\n */\n default void set(double[] axisAngleArray)\n {\n set(0, axisAngleArray);\n }\n\n /**\n * Copies the values in the given array into this axis-angle as follows:\n * <ul>\n * <li>{@code this.setX(axisAngleArray[startIndex + 0]);}\n * <li>{@code this.setY(axisAngleArray[startIndex + 1]);}\n * <li>{@code this.setZ(axisAngleArray[startIndex + 2]);}\n * <li>{@code this.setAngle(axisAngleArray[startIndex + 3]);}\n * </ul>\n *\n * @param startIndex the first index to start reading from in the array.\n * @param axisAngleArray the array containing the new values for this axis-angle. Not modified.\n */\n default void set(int startIndex, double[] axisAngleArray)\n {\n setX(axisAngleArray[startIndex++]);\n setY(axisAngleArray[startIndex++]);\n setZ(axisAngleArray[startIndex++]);\n setAngle(axisAngleArray[startIndex]);\n }\n\n /**\n * Copies the values in the given array into this axis-angle as follows:\n * <ul>\n * <li>{@code this.setX(axisAngleArray[0]);}\n * <li>{@code this.setY(axisAngleArray[1]);}\n * <li>{@code this.setZ(axisAngleArray[2]);}\n * <li>{@code this.setAngle(axisAngleArray[3]);}\n * </ul>\n *\n * @param axisAngleArray the array containing the new values for this axis-angle. Not modified.\n */\n default void set(float[] axisAngleArray)\n {\n set(0, axisAngleArray);\n }\n\n /**\n * Copies the values in the given array into this axis-angle as follows:\n * <ul>\n * <li>{@code this.setX(axisAngleArray[startIndex + 0]);}\n * <li>{@code this.setY(axisAngleArray[startIndex + 1]);}\n * <li>{@code this.setZ(axisAngleArray[startIndex + 2]);}\n * <li>{@code this.setAngle(axisAngleArray[startIndex + 3]);}\n * </ul>\n *\n * @param startIndex the first index to start reading from in the array.\n * @param axisAngleArray the array containing the new values for this axis-angle. Not modified.\n */\n default void set(int startIndex, float[] axisAngleArray)\n {\n setX(axisAngleArray[startIndex++]);\n setY(axisAngleArray[startIndex++]);\n setZ(axisAngleArray[startIndex++]);\n setAngle(axisAngleArray[startIndex]);\n }\n\n /** {@inheritDoc} */\n @Override\n default void setAxisAngle(double x, double y, double z, double angle)\n {\n set(x, y, z, angle);\n }\n\n /** {@inheritDoc} */\n @Override\n default void setQuaternion(double x, double y, double z, double s)\n {\n AxisAngleConversion.convertQuaternionToAxisAngle(x, y, z, s, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void setRotationVector(double x, double y, double z)\n {\n AxisAngleConversion.convertRotationVectorToAxisAngle(x, y, z, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void setYawPitchRoll(double yaw, double pitch, double roll)\n {\n AxisAngleConversion.convertYawPitchRollToAxisAngle(yaw, pitch, roll, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void setRotationMatrix(double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22)\n {\n AxisAngleConversion.convertMatrixToAxisAngle(m00, m01, m02, m10, m11, m12, m20, m21, m22, this);\n }\n\n @Override\n default void setToYawOrientation(double yaw)\n {\n getAxis().set(Axis3D.Z);\n setAngle(yaw);\n }\n\n @Override\n default void setToPitchOrientation(double pitch)\n {\n getAxis().set(Axis3D.Y);\n setAngle(pitch);\n }\n\n @Override\n default void setToRollOrientation(double roll)\n {\n getAxis().set(Axis3D.X);\n setAngle(roll);\n }\n\n /**\n * Selects a component of this axis-angle based on {@code index} and sets it to {@code value}.\n * <p>\n * For {@code index} values of 0, 1, and 2, the corresponding components are x, y, and z,\n * respectively, while 3 corresponds to the angle.\n * </p>\n *\n * @param index the index of the component to set.\n * @param value the new value of the selected component.\n * @throws IndexOutOfBoundsException if {@code index} ∉ [0, 3].\n */\n default void setElement(int index, double value)\n {\n switch (index)\n {\n case 0:\n setX(value);\n break;\n case 1:\n setY(value);\n break;\n case 2:\n setZ(value);\n break;\n case 3:\n setAngle(value);\n break;\n default:\n throw new IndexOutOfBoundsException(Integer.toString(index));\n }\n }\n\n /**\n * Multiplies this axis-angle by {@code other}.\n * <p>\n * this = this * other\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void multiply(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiply(this, other, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void append(Orientation3DReadOnly other)\n {\n AxisAngleTools.multiply(this, false, other, false, this);\n }\n\n /**\n * Sets this axis-angle to the multiplication of {@code aa1} and {@code aa2}.\n * <p>\n * this = aa1 * aa2\n * </p>\n *\n * @param aa1 the first axis-angle in the multiplication. Not modified.\n * @param aa2 the second axis-angle in the multiplication. Not modified.\n */\n default void multiply(AxisAngleReadOnly aa1, AxisAngleReadOnly aa2)\n {\n AxisAngleTools.multiply(aa1, aa2, this);\n }\n\n /**\n * Multiplies this axis-angle by the inverse of {@code other}.\n * <p>\n * this = this * other<sup>-1</sup>\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void multiplyInvertOther(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiplyInvertRight(this, other, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void appendInvertOther(Orientation3DReadOnly orientation)\n {\n AxisAngleTools.multiply(this, false, orientation, true, this);\n }\n\n /**\n * Sets this axis-angle to the multiplication of the inverse of {@code this} and {@code other}.\n * <p>\n * this = this<sup>-1</sup> * other\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void multiplyInvertThis(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiplyInvertLeft(this, other, this);\n }\n\n /**\n * Sets this axis-angle to the multiplication of the inverse of {@code this} and the inverse of\n * {@code other}.\n * <p>\n * this = this<sup>-1</sup> * other<sup>-1</sup>\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void multiplyInvertBoth(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiplyInvertBoth(this, other, this);\n }\n\n /**\n * Appends a rotation about the z-axis to this axis-angle.\n *\n * <pre>\n * / ux = 0 \\\n * this = this * | uy = 0 |\n * | uz = 1 |\n * \\ angle = yaw /\n * </pre>\n *\n * @param yaw the angle to rotate about the z-axis.\n */\n @Override\n default void appendYawRotation(double yaw)\n {\n AxisAngleTools.appendYawRotation(this, yaw, this);\n }\n\n /**\n * Appends a rotation about the y-axis to this axis-angle.\n *\n * <pre>\n * / ux = 0 \\\n * this = this * | uy = 1 |\n * | uz = 0 |\n * \\ angle = pitch /\n * </pre>\n *\n * @param pitch the angle to rotate about the y-axis.\n */\n @Override\n default void appendPitchRotation(double pitch)\n {\n AxisAngleTools.appendPitchRotation(this, pitch, this);\n }\n\n /**\n * Appends a rotation about the x-axis to this axis-angle.\n *\n * <pre>\n * / ux = 1 \\\n * this = this * | uy = 0 |\n * | uz = 0 |\n * \\ angle = roll /\n * </pre>\n *\n * @param roll the angle to rotate about the x-axis.\n */\n @Override\n default void appendRollRotation(double roll)\n {\n AxisAngleTools.appendRollRotation(this, roll, this);\n }\n\n /**\n * Pre-multiplies this axis-angle by {@code other}.\n * <p>\n * this = other * other\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void preMultiply(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiply(other, this, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void prepend(Orientation3DReadOnly orientation)\n {\n AxisAngleTools.multiply(orientation, false, this, false, this);\n }\n\n /**\n * Sets this axis-angle to the multiplication of the inverse of {@code other} and {@code this}.\n * <p>\n * this = other<sup>-1</sup> * this\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void preMultiplyInvertOther(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiplyInvertLeft(other, this, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void prependInvertOther(Orientation3DReadOnly orientation)\n {\n AxisAngleTools.multiply(orientation, true, this, false, this);\n }\n\n /**\n * Sets this axis-angle to the multiplication of {@code other} and the inverse of {@code this}.\n * <p>\n * this = other * this<sup>-1</sup>\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void preMultiplyInvertThis(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiplyInvertRight(other, this, this);\n }\n\n /**\n * Sets this axis-angle to the multiplication of the inverse of {@code other} and the inverse of\n * {@code this}.\n * <p>\n * this = other<sup>-1</sup> * this<sup>-1</sup>\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void preMultiplyInvertBoth(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiplyInvertBoth(other, this, this);\n }\n\n /**\n * Prepends a rotation about the z-axis to this axis-angle.\n *\n * <pre>\n * / ux = 0 \\\n * this = | uy = 0 | * this\n * | uz = 1 |\n * \\ angle = yaw /\n * </pre>\n *\n * @param yaw the angle to rotate about the z-axis.\n */\n @Override\n default void prependYawRotation(double yaw)\n {\n AxisAngleTools.prependYawRotation(yaw, this, this);\n }\n\n /**\n * Prepends a rotation about the y-axis to this axis-angle.\n *\n * <pre>\n * / ux = 0 \\\n * this = | uy = 1 | * this\n * | uz = 0 |\n * \\ angle = pitch /\n * </pre>\n *\n * @param pitch the angle to rotate about the y-axis.\n */\n @Override\n default void prependPitchRotation(double pitch)\n {\n AxisAngleTools.prependPitchRotation(pitch, this, this);\n }\n\n /**\n * Prepends a rotation about the x-axis to this axis-angle.\n *\n * <pre>\n * / ux = 1 \\\n * this = | uy = 0 | * this\n * | uz = 0 |\n * \\ angle = roll /\n * </pre>\n *\n * @param roll the angle to rotate about the x-axis.\n */\n @Override\n default void prependRollRotation(double roll)\n {\n AxisAngleTools.prependRollRotation(roll, this, this);\n }\n}",
"double getAngle(int id);",
"public double Dividir(double operador_1, double operador_2){\n return DivisionC(operador_1, operador_2);\n }",
"public Complex div(double d) {\n return new Complex(r / d, i / d);\n }",
"public DivisionJSP() {\r\n\t\tsetBackground(Color.WHITE);\r\n\t\tsetOrientation(JSplitPane.VERTICAL_SPLIT);\r\n\t\tsetDividerLocation(SPLIT_POSITION);\r\n\t\tsetElements();\r\n\t}",
"public static BinaryExpression divide(Expression expression0, Expression expression1, Method method) { throw Extensions.todo(); }",
"public Vector2f div(float scalar) {\n return div(new Vector2f(scalar, scalar));\n }",
"public double getAngle() { return angle; }",
"public void enfoncerDiv() {\n\t\ttry {\n\t\t\tthis.op = new Div();\n\t\t\tif (!raz) {\n\t\t\t\tthis.pile.push(valC);\n\t\t\t}\n\t\t\tint a = this.pile.pop(); int b = this.pile.pop();\n\t\t\tthis.valC = this.op.eval(b,a);\n\t\t\tthis.pile.push(this.valC);\n\t\t\tthis.raz = true;\n\t\t}\n\t\tcatch (ArithmeticException e) {\n\t\t\tSystem.out.println(\"Erreur : Division par zero !\");\n\t\t}\n\t\tcatch (EmptyStackException e) {\n\t\t\tSystem.out.println(\"Erreur de syntaxe : Saisir deux operandes avant de saisir un operateur\");\n\t\t}\n\t}",
"public final void mDIV() throws RecognitionException {\n try {\n int _type = DIV;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // /Users/dannluciano/Sources/MyLanguage/expr.g:183:5: ( '/' )\n // /Users/dannluciano/Sources/MyLanguage/expr.g:183:7: '/'\n {\n match('/'); \n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }",
"public Cos(double exp) {\n super(exp);\n }",
"public AngleIF() {\n \t\t//_navx = new navx();\n \t\t//roboAccel = new RoboRioAccelerometers();\n \t}",
"public Unit<Angle> radian() {return radian;}",
"public final void mDIV() throws RecognitionException {\n\t\ttry {\n\t\t\tint _type = DIV;\n\t\t\tint _channel = DEFAULT_TOKEN_CHANNEL;\n\t\t\t// src/VSLLexer.g:45:11: ( '/' )\n\t\t\t// src/VSLLexer.g:45:13: '/'\n\t\t\t{\n\t\t\tmatch('/'); \n\t\t\t}\n\n\t\t\tstate.type = _type;\n\t\t\tstate.channel = _channel;\n\t\t}\n\t\tfinally {\n\t\t\t// do for sure before leaving\n\t\t}\n\t}",
"public ahr(aqu paramaqu, xm paramxm)\r\n/* 35: */ {\r\n/* 36: 50 */ super(paramaqu);\r\n/* 37: 51 */ this.g = paramxm;\r\n/* 38: */ \r\n/* 39: 53 */ a(0.25F, 0.25F);\r\n/* 40: */ \r\n/* 41: 55 */ b(paramxm.s, paramxm.t + paramxm.aR(), paramxm.u, paramxm.y, paramxm.z);\r\n/* 42: */ \r\n/* 43: 57 */ this.s -= uv.b(this.y / 180.0F * 3.141593F) * 0.16F;\r\n/* 44: 58 */ this.t -= 0.1000000014901161D;\r\n/* 45: 59 */ this.u -= uv.a(this.y / 180.0F * 3.141593F) * 0.16F;\r\n/* 46: 60 */ b(this.s, this.t, this.u);\r\n/* 47: */ \r\n/* 48: 62 */ float f1 = 0.4F;\r\n/* 49: 63 */ this.v = (-uv.a(this.y / 180.0F * 3.141593F) * uv.b(this.z / 180.0F * 3.141593F) * f1);\r\n/* 50: 64 */ this.x = (uv.b(this.y / 180.0F * 3.141593F) * uv.b(this.z / 180.0F * 3.141593F) * f1);\r\n/* 51: 65 */ this.w = (-uv.a((this.z + l()) / 180.0F * 3.141593F) * f1);\r\n/* 52: */ \r\n/* 53: 67 */ c(this.v, this.w, this.x, j(), 1.0F);\r\n/* 54: */ }",
"public final void mDIV() throws RecognitionException {\n try {\n int _type = DIV;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // /Users/cbinnig/Workspace/DHBW_FirstDB_Loesung3/src/de/dhbw/db2/firstdb/sql/FirstSQL.g:23:5: ( '/' )\n // /Users/cbinnig/Workspace/DHBW_FirstDB_Loesung3/src/de/dhbw/db2/firstdb/sql/FirstSQL.g:23:7: '/'\n {\n match('/'); \n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }",
"public Rational divide(Rational other)\n\t{\n\t\tint divNumer = (getNumer() * other.getDenom());\n\t\tint divDenom = (getDenom() * other.getNumer());\n\n\t\tRational quotient = new Rational(divNumer, divDenom);\n\t\tquotient.normalize();\n\t\treturn quotient;\n\t}",
"public double cos(double number);",
"public Astrocylinders() {\r\n\t\tsuper(CompartmentType.ASTROCYLINDERS.numParams);\r\n\t}",
"public void divide(Object divValue) {\r\n\r\n\t\tNumberOperation operator = new NumberOperation(this.value, divValue) {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic Number doAnOperation() {\r\n\t\t\t\tTypeEnum typeOfResult = getFinalType();\r\n\t\t\t\tif(typeOfResult == TypeEnum.TYPE_INTEGER) {\r\n\t\t\t\t\treturn getO1().intValue() / getO2().intValue();\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\treturn getO1().doubleValue() / getO2().doubleValue();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\tthis.value = operator.doAnOperation();\r\n\t}",
"@Override\r\n\tpublic vec3 div(float var) {\n\t\treturn null;\r\n\t}",
"public ADSR()\n\t{\n\t\tthis(1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f);\n\t}",
"private MyMath() {\n }",
"public <V extends Number> FluentExp<V> div (SQLExpression<V> expr)\n {\n return new Div<V>(this, expr);\n }",
"@Override\n\tpublic double divide(double a, double b) {\n\t\treturn (a/b);\n\t}"
]
| [
"0.7324093",
"0.6855056",
"0.6585308",
"0.649536",
"0.64515704",
"0.6356151",
"0.6097897",
"0.5952933",
"0.594439",
"0.57373595",
"0.5715451",
"0.55533314",
"0.5540036",
"0.54615074",
"0.5424452",
"0.5424452",
"0.5410277",
"0.540975",
"0.5389172",
"0.5348699",
"0.53406703",
"0.5340485",
"0.53157324",
"0.53132427",
"0.5308824",
"0.52864194",
"0.5281009",
"0.5272269",
"0.5255445",
"0.52550966",
"0.52127314",
"0.5210577",
"0.51960504",
"0.51757675",
"0.5169219",
"0.5167089",
"0.51379085",
"0.5132254",
"0.5109006",
"0.5108261",
"0.510034",
"0.5098481",
"0.5097227",
"0.5091691",
"0.508111",
"0.50775766",
"0.50696796",
"0.5066439",
"0.50634634",
"0.5054994",
"0.50523025",
"0.50293034",
"0.50153583",
"0.500446",
"0.500342",
"0.49978253",
"0.49902534",
"0.49901003",
"0.49894077",
"0.49859634",
"0.4985948",
"0.4976939",
"0.4967228",
"0.4965299",
"0.4956754",
"0.49422067",
"0.49328315",
"0.49273846",
"0.49252",
"0.49246815",
"0.4922679",
"0.4920315",
"0.4918548",
"0.49120083",
"0.4891055",
"0.4890764",
"0.48863935",
"0.48827672",
"0.48785242",
"0.48616976",
"0.48576897",
"0.48565552",
"0.48559868",
"0.48533377",
"0.4841317",
"0.48373386",
"0.4830354",
"0.48233333",
"0.4815276",
"0.48120394",
"0.48118964",
"0.48015592",
"0.479738",
"0.47964245",
"0.47927344",
"0.47853714",
"0.478365",
"0.4782134",
"0.47814992",
"0.4778167"
]
| 0.88553065 | 0 |
Returns a new object of class 'Angle Equals'. | AngleEquals createAngleEquals(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"AngleSmaller createAngleSmaller();",
"Angle createAngle();",
"public void testEquals() {\r\n\t\t// direct circle\r\n\t\tCircleArc2D arc0 = new CircleArc2D();\r\n\t\tCircle2D circle = new Circle2D(0, 0, 1, true);\r\n\t\tCircleArc2D arc1 = new CircleArc2D(circle, 0, PI/2);\r\n\t\tCircleArc2D arc2 = new CircleArc2D(circle, 0, PI/2, true);\r\n\t\tCircleArc2D arc3 = new CircleArc2D(0, 0, 1, 0, PI/2);\r\n\t\tCircleArc2D arc4 = new CircleArc2D(0, 0, 1, 0, PI/2, true);\r\n\t\tassertTrue(arc1.equals(arc0));\r\n\t\tassertTrue(arc1.equals(arc2));\r\n\t\tassertTrue(arc1.equals(arc3));\r\n\t\tassertTrue(arc1.equals(arc4));\r\n\r\n\t\t// direct circle, with different angles\r\n\t\tcircle = new Circle2D(0, 0, 1, true);\r\n\t\tarc1 = new CircleArc2D(circle, PI/2, PI/2);\r\n\t\tarc2 = new CircleArc2D(circle, PI/2, PI, true);\r\n\t\tarc3 = new CircleArc2D(0, 0, 1, PI/2, PI/2);\r\n\t\tarc4 = new CircleArc2D(0, 0, 1, PI/2, PI, true);\r\n\t\tassertTrue(arc1.equals(arc2));\r\n\t\tassertTrue(arc1.equals(arc3));\r\n\t\tassertTrue(arc1.equals(arc4));\r\n\t\t\r\n\t\t// indirect circle, with different angles\r\n\t\tcircle = new Circle2D(0, 0, 1, true);\r\n\t\tarc1 = new CircleArc2D(circle, PI/2, -PI/2);\r\n\t\tarc2 = new CircleArc2D(circle, PI/2, 2*PI, false);\r\n\t\tarc3 = new CircleArc2D(0, 0, 1, PI/2, -PI/2);\r\n\t\tarc4 = new CircleArc2D(0, 0, 1, PI/2, 2*PI, false);\r\n\t\tassertTrue(arc1.equals(arc2));\r\n\t\tassertTrue(arc1.equals(arc3));\r\n\t\tassertTrue(arc1.equals(arc4));\r\n\t}",
"@Override\n public boolean equals(Object obj) {\n //Cast other side.\n Angle other = (Angle) obj;\n\n //Compare values.\n if (this.degrees() == other.degrees()) {\n return true;\n } else {\n return false;\n }\n }",
"Equality createEquality();",
"AngleAdd createAngleAdd();",
"AngleDistinct createAngleDistinct();",
"AngleSubtract createAngleSubtract();",
"AngleGreater createAngleGreater();",
"private Equals() {}",
"public double getAngle();",
"double getAngle();",
"double getAngle();",
"public atan( ) {\n super(1);\n }",
"public double getAngle() { return angle; }",
"@Test\n public void getAngleVector2d(){\n Vector2d newVec = new Vector2d(0,1);\n vector.add(newVec);\n\n assertTrue(newVec.getAngle() == 90);\n }",
"@Test\r\n public void testCalculateAngle1() {\r\n System.out.println(\"calculateAngle1\");\r\n DialDraw instance = new TachometerDraw();\r\n instance.setValue(36);\r\n double expResult = Math.toRadians(115.2);\r\n double result = instance.calculateAngle();\r\n assertEquals(result, expResult, 0.0001);\r\n }",
"public void setAngle( double a ) { angle = a; }",
"@Test\r\n public void testCalculateAngle2() {\r\n System.out.println(\"calculateAngle2\");\r\n DialDraw instance = new TachometerDraw();\r\n instance.setValue(0);\r\n double expResult = Math.toRadians(180);\r\n double result = instance.calculateAngle();\r\n assertEquals(result, expResult, 0.0001);\r\n }",
"public AngleIF() {\n \t\t//_navx = new navx();\n \t\t//roboAccel = new RoboRioAccelerometers();\n \t}",
"@Test\r\n public void testCalculateAngle4() {\r\n System.out.println(\"calculateAngle4\");\r\n DialDraw instance = new TachometerDraw();\r\n instance.setValue(90);\r\n double expResult = Math.toRadians(18);\r\n double result = instance.calculateAngle();\r\n assertEquals(result, expResult, 0.0001);\r\n }",
"AngleScalarMultiply createAngleScalarMultiply();",
"public double betweenAngle(Coordinates a, Coordinates b, Coordinates origin);",
"@Test\r\n public void testCalculateAngle5() {\r\n System.out.println(\"calculateAngle5\");\r\n DialDraw instance = new TachometerDraw();\r\n instance.setValue(50);\r\n double expResult = Math.toRadians(90);\r\n double result = instance.calculateAngle();\r\n assertEquals(result, expResult, 0.0001);\r\n }",
"@Test\n public void equals() {\n Grade mathsCopy = new GradeBuilder(MATHS_GRADE).build();\n assertTrue(MATHS_GRADE.equals(mathsCopy));\n\n // same object -> returns true\n assertTrue(MATHS_GRADE.equals(MATHS_GRADE));\n\n // null -> returns false\n assertFalse(MATHS_GRADE.equals(null));\n\n // different type -> returns false\n assertFalse(MATHS_GRADE.equals(5));\n\n // different person -> returns false\n assertFalse(MATHS_GRADE.equals(SCIENCE_GRADE));\n\n // different subject name -> returns false\n Grade editedMaths = new GradeBuilder(MATHS_GRADE)\n .withSubject(VALID_SUBJECT_NAME_SCIENCE).build();\n assertFalse(MATHS_GRADE.equals(editedMaths));\n\n // different graded item -> returns false\n editedMaths = new GradeBuilder(MATHS_GRADE)\n .withGradedItem(VALID_GRADED_ITEM_SCIENCE).build();\n assertFalse(MATHS_GRADE.equals(editedMaths));\n\n // different grade -> returns false\n editedMaths = new GradeBuilder(MATHS_GRADE)\n .withGrade(VALID_GRADE_SCIENCE).build();\n assertFalse(MATHS_GRADE.equals(editedMaths));\n }",
"@Override\n public void reAngle() {\n }",
"@Test\n public void testEquals() {\n Term t1 = structure(\"abc\", atom(\"a\"), atom(\"b\"), atom(\"c\"));\n Term t2 = structure(\"abc\", integerNumber(), decimalFraction(), variable());\n PredicateKey k1 = PredicateKey.createForTerm(t1);\n PredicateKey k2 = PredicateKey.createForTerm(t2);\n testEquals(k1, k2);\n }",
"void resetAngle();",
"public double toAngle()\n\t{\n\t\treturn Math.toDegrees(Math.atan2(y, x));\n\t}",
"void setAngle(double angle);",
"@Test\r\n public void testCalculateAngle3() {\r\n System.out.println(\"calculateAngle3\");\r\n DialDraw instance = new TachometerDraw();\r\n instance.setValue(100);\r\n double expResult = Math.toRadians(0);\r\n double result = instance.calculateAngle();\r\n assertEquals(result, expResult, 0.0001);\r\n }",
"public void testEquals() {\n assertTrue(RectangleAnchor.TOP.equals(RectangleAnchor.TOP));\n }",
"@Test\n public void equals() {\n CsvAdaptedPatient alice = new CsvAdaptedPatient(ALICE);\n CsvAdaptedPatient aliceCopy = new CsvAdaptedPatient(new PatientBuilder(ALICE).build());\n\n assertTrue(alice.equals(aliceCopy));\n\n // same object -> returns true\n assertTrue(alice.equals(alice));\n\n // null -> returns false\n assertFalse(alice.equals(null));\n\n // different type -> returns false\n assertFalse(alice.equals(5));\n\n // different patient -> returns false\n assertFalse(alice.equals(new CsvAdaptedPatient(BOB)));\n\n // different name -> returns false\n Patient editedAlice = new PatientBuilder(ALICE).withName(VALID_NAME_BOB).build();\n assertFalse(alice.equals(new CsvAdaptedPatient(editedAlice)));\n\n // different phone -> returns false\n editedAlice = new PatientBuilder(ALICE).withPhone(VALID_PHONE_BOB).build();\n assertFalse(alice.equals(new CsvAdaptedPatient(editedAlice)));\n\n // different address -> returns false\n editedAlice = new PatientBuilder(ALICE).withAddress(VALID_ADDRESS_BOB).build();\n assertFalse(alice.equals(new CsvAdaptedPatient(editedAlice)));\n\n // different remark -> returns false\n editedAlice = new PatientBuilder(ALICE).withRemark(VALID_REMARK_BOB).build();\n assertFalse(alice.equals(new CsvAdaptedPatient(editedAlice)));\n }",
"Eq createEq();",
"@Test\n\tpublic void testEquals1() {\n\t\tDistance d1 = new Distance(0, 0);\n\t\tDistance d2 = new Distance();\n\t\tassertEquals(false, d1.equals(d2));\n\t}",
"public double getAngle() {\n return angle;\n }",
"public double getAngle() {\n return angle;\n }",
"@Test\n public void testEqualsMethodDifferentObjects() {\n String name = \"A modifier\";\n int cost = 12;\n\n Modifier m1 = new Modifier(name, cost) {\n @Override\n public int getValue() {\n return 0;\n }\n };\n\n assertFalse(m1.equals(new Object()));\n }",
"LengthEquals createLengthEquals();",
"@Test\n public void testEquals() {\n System.out.println(\"Animal.equals\");\n Animal newAnimal = new Animal(252, \"Candid Chandelier\", 10, \"Cheetah\", 202);\n assertTrue(animal1.equals(newAnimal));\n assertFalse(animal2.equals(newAnimal));\n }",
"@Test\n public void testEqualsMethodEqualObjects() {\n String name = \"A modifier\";\n int cost = 12;\n\n Modifier m1 = new Modifier(name, cost) {\n @Override\n public int getValue() {\n return 0;\n }\n };\n Modifier m2 = new Modifier(name, cost) {\n @Override\n public int getValue() {\n return 0;\n }\n };\n\n assertTrue(m1.equals(m2));\n }",
"public double getAngle ()\n {\n return angle_;\n }",
"public double getAngle(){\n\t\treturn this.angle;\n\t}",
"@Override\n public boolean equals(Object o) {\n if (!(o instanceof Arrow)) return false;\n\n Arrow a = (Arrow) o;\n return from.equals(a.from) && to.equals(a.to) && color.equals(a.color);\n }",
"@Test\n public void testEqualsTrue() {\n Rectangle r5 = new Rectangle(7, 4, new Color(255, 0, 0), new Position2D(50, 75));\n Rectangle r6 = new Rectangle(0, 4, new Color(255, 255, 255),\n new Position2D(-50, 75));\n Rectangle r7 = new Rectangle(7, 0, new Color(255, 255, 0), new Position2D(50, -75));\n Rectangle r8 = new Rectangle(0, 0, new Color(200, 150, 133),\n new Position2D(-50, -75));\n\n assertEquals(r1, r5);\n assertEquals(r2, r6);\n assertEquals(r3, r7);\n assertEquals(r4, r8);\n }",
"@Test\r\n public void testEquals() {\r\n Articulo art = new Articulo();\r\n articuloPrueba.setCodigo(1212);\r\n art.setCodigo(1212);\r\n boolean expResult = true;\r\n boolean result = articuloPrueba.equals(art);\r\n assertEquals(expResult, result);\r\n }",
"public int angleOX() {\n if (B.getY() == A.getY()) {\r\n return 0;\r\n } else if (A.getX() == B.getX()) {\r\n return 90;\r\n }\r\n else {\r\n float fi = ((float) (B.getY() - A.getY()) / (B.getX() - A.getX()));\r\n if (fi<0){\r\n return (int)(fi*(-1));\r\n }\r\n else return (int)(fi);\r\n }\r\n }",
"public float getAngle() {\n return angle;\n }",
"public float getAngle() {\n return angle;\n }",
"public AxisAngle(float angle, float x, float y, float z) {\n this(angle, new Vector3(x,y,z));\n }",
"public static double getAngle( GameObject one, GameObject two )\n {\n return Math.atan2( getDeltaY( one, two ), +getDeltaX( one, two ) );\n }",
"public int getAngle() {\r\n return angle;\r\n }",
"public AxisAngle(float angle, Vector3 axis) {\n this.angle = angle;\n this.axis = axis;\n }",
"AngleResource inclination();",
"public double getAngle() {\n\t\treturn angle;\n\t}",
"public double getAngle() {\n\t\treturn angle;\n\t}",
"@Test\n\tpublic void testEquals2() {\n\t\tDistance d2 = new Distance();\n\t\tDistance d4 = new Distance(1, 1);\n\t\tassertEquals(true, d2.equals(d4));\n\t}",
"public void testEquals() {\n XIntervalDataItem item1 = new XIntervalDataItem(1.0, 2.0, 3.0, 4.0);\n XIntervalDataItem item2 = new XIntervalDataItem(1.0, 2.0, 3.0, 4.0);\n item1 = new XIntervalDataItem(1.1, 2.0, 3.0, 4.0);\n item2 = new XIntervalDataItem(1.1, 2.0, 3.0, 4.0);\n item1 = new XIntervalDataItem(1.1, 2.2, 3.0, 4.0);\n item2 = new XIntervalDataItem(1.1, 2.2, 3.0, 4.0);\n item1 = new XIntervalDataItem(1.1, 2.2, 3.3, 4.0);\n item2 = new XIntervalDataItem(1.1, 2.2, 3.3, 4.0);\n item1 = new XIntervalDataItem(1.1, 2.2, 3.3, 4.4);\n item2 = new XIntervalDataItem(1.1, 2.2, 3.3, 4.4);\n }",
"void setAngle(int id, double value);",
"public void testEquals() {\n StandardXYBarPainter p1 = new StandardXYBarPainter();\n StandardXYBarPainter p2 = new StandardXYBarPainter();\n }",
"Comparison createComparison();",
"Comparison createComparison();",
"double getAngle(int id);",
"@Test\n public void testEquals() {\n System.out.println(\"equals\");\n Commissioner instance = new Commissioner();\n Commissioner instance2 = new Commissioner();\n instance.setLogin(\"genie\");\n instance2.setLogin(\"genie\");\n boolean expResult = true;\n boolean result = instance.equals(instance2);\n assertEquals(expResult, result);\n }",
"boolean needToAim(double angle);",
"public float getAngle() {\n return mAngle;\n }",
"public void setAngle(final float angle);",
"@Override\n public boolean equals(Object other) {\n if (!(other instanceof Acquirente)) return false;\n return this.equalKeys(other) && ((Acquirente)other).equalKeys(this);\n }",
"@Test\n public void testEqualsMethodDifferentName() {\n String name1 = \"A modifier\";\n String name2 = \"Another modifier\";\n int cost = 12;\n\n Modifier m1 = new Modifier(name1, cost) {\n @Override\n public int getValue() {\n return 0;\n }\n };\n Modifier m2 = new Modifier(name2, cost) {\n @Override\n public int getValue() {\n return 0;\n }\n };\n\n assertFalse(m1.equals(m2));\n }",
"public void setAngle(double a) {\n\t\tangle= a;\n\t}",
"EDataType getAngleDegrees();",
"@Test\n public void testEquals_1() {\n LOGGER.info(\"testEquals_1\");\n final AtomString atomString = new AtomString(\"Hello\");\n final Atom atom = new AtomString(\"Hello\");\n final boolean actual = atomString.equals(atom);\n assertTrue(actual);\n }",
"public double getAngle() {\n return Math.atan2(sinTheta, cosTheta);\n }",
"public double betweenAngle(Coordinates vectorA, Coordinates vectorB);",
"public int getAngle() {\r\n\t\treturn angle;\r\n\t}",
"@Test\n public void testEquals() {\n System.out.println(\"equals\");\n Receta instance = new Receta();\n instance.setNombre(\"nom1\");\n Receta instance2 = new Receta();\n instance.setNombre(\"nom2\");\n boolean expResult = false;\n boolean result = instance.equals(instance2);\n assertEquals(expResult, result);\n }",
"@Test\r\n public void testEquals() {\r\n System.out.println(\"equals\");\r\n Object object = null;\r\n Integrante instance = new Integrante();\r\n boolean expResult = false;\r\n boolean result = instance.equals(object);\r\n assertEquals(expResult, result);\r\n // TODO review the generated test code and remove the default call to fail.\r\n fail(\"The test case is a prototype.\");\r\n }",
"public double getAngle () {\n return super.getAngle() % 360D;\n }",
"public Cartesiana polar_cartesiano (float radio, float angulo) {\n return new Cartesiana (radio * (float)Math.cos(angulo),radio * (float)Math.sin(angulo)); \n}",
"@Test\n\tpublic void testSampleEquals() {\n\n\t\tassertTrue(square.equals(squareRotate));\n\t\t\n\t\tassertTrue(pyr1.equals(pyr5));\n\t\t\n\t\tassertTrue(s.equals(sInitial));\n\t\tassertFalse(stick.equals(stickRotated));\n\t\tassertFalse(s.equals(sRotated));\n\n\n\t}",
"public double findAngle() {\n return 0d;\n }",
"@Test\n public void equals() {\n Plan aliceCopy = new PersonBuilder(ALICE).build();\n assertTrue(ALICE.equals(aliceCopy));\n\n // same object -> returns true\n assertTrue(ALICE.equals(ALICE));\n\n // null -> returns false\n assertFalse(ALICE.equals(null));\n\n // different type -> returns false\n assertFalse(ALICE.equals(5));\n\n // different plan -> returns false\n assertFalse(ALICE.equals(BOB));\n\n // different name -> returns false\n Plan editedAlice = new PersonBuilder(ALICE).withName(VALID_NAME_BOB).build();\n assertFalse(ALICE.equals(editedAlice));\n\n // different address -> returns false\n editedAlice = new PersonBuilder(ALICE).withAddress(VALID_ADDRESS_BOB).build();\n assertFalse(ALICE.equals(editedAlice));\n\n // different tags -> returns false\n editedAlice = new PersonBuilder(ALICE).withTags(VALID_TAG_HUSBAND).build();\n assertFalse(ALICE.equals(editedAlice));\n }",
"private double getAngle() {\n double normal= Math.sqrt(((getgAxis(ADXL345_I2C.Axes.kX))*(getgAxis(ADXL345_I2C.Axes.kX)))+((getgAxis(ADXL345_I2C.Axes.kY))*(getgAxis(ADXL345_I2C.Axes.kY))));\n\n return MathUtils.atan(normal / getgAxis(ADXL345_I2C.Axes.kZ));\n }",
"@Test\n public void testEquals() {\n System.out.println(\"equals\");\n Object outroObjecto = new RegistoExposicoes();\n RegistoExposicoes instance = new RegistoExposicoes();\n assertTrue(instance.equals(outroObjecto));\n }",
"public interface AxisAngleBasics extends AxisAngleReadOnly, Orientation3DBasics, Clearable\n{\n /**\n * Gets the reference to the axis part of this axis-angle.\n *\n * @return the reference to the axis vector.\n */\n @Override\n UnitVector3DBasics getAxis();\n\n /**\n * Sets a new angle to this axis-angle.\n *\n * @param angle the new angle.\n */\n void setAngle(double angle);\n\n /**\n * Sets a new x-component for the axis of this axis-angle.\n *\n * @param x the new axis x-component.\n */\n default void setX(double x)\n {\n getAxis().setX(x);\n }\n\n /**\n * Sets a new y-component for the axis of this axis-angle.\n *\n * @param y the new axis y-component.\n */\n default void setY(double y)\n {\n getAxis().setY(y);\n }\n\n /**\n * Sets a new z-component for the axis of this axis-angle.\n *\n * @param z the new axis z-component.\n */\n default void setZ(double z)\n {\n getAxis().setZ(z);\n }\n\n /**\n * Sets the components of this axis-angle to represent a \"zero\" rotation. After calling the axis is\n * equal to {@link Axis3D#X} and the angle to 0.\n */\n @Override\n default void setToZero()\n {\n getAxis().set(Axis3D.X);\n setAngle(0.0);\n }\n\n /**\n * Sets the components of this axis-angle to {@link Double#NaN}.\n */\n @Override\n default void setToNaN()\n {\n getAxis().setToNaN();\n setAngle(Double.NaN);\n }\n\n /**\n * Tests if this axis-angle contains a {@link Double#NaN}.\n *\n * @return {@code true} if this axis-angle contains a {@link Double#NaN}, {@code false} otherwise.\n */\n @Override\n default boolean containsNaN()\n {\n return AxisAngleReadOnly.super.containsNaN();\n }\n\n /**\n * Sets each component of this axis-angle to its absolute value.\n */\n default void absolute()\n {\n getAxis().absolute();\n setAngle(Math.abs(getAngle()));\n }\n\n /**\n * Negates each component of this axis-angle.\n */\n default void negate()\n {\n getAxis().negate();\n setAngle(-getAngle());\n }\n\n /** {@inheritDoc} */\n @Override\n default void invert()\n {\n setAngle(-getAngle());\n }\n\n /**\n * Normalizes the axis of this axis-angle such that its norm is equal to 1 after calling this method\n * and its direction remains unchanged.\n * <p>\n * Edge cases:\n * <ul>\n * <li>if this axis-angle contains {@link Double#NaN}, this method is ineffective.\n * </ul>\n * </p>\n */\n @Override\n default void normalize()\n {\n getAxis().normalize();\n }\n\n /**\n * Multiplies the angle of this axis-angle by the given {@code scale}.\n *\n * @param scale the scaling factor to apply to the angle of this axis-angle.\n */\n default void scaleAngle(double scale)\n {\n setAngle(scale * getAngle());\n }\n\n /**\n * Sets this axis-angle to represent a new rotation of axis ({@code x}, {@code y}, {@code z}) and\n * angle of {@code angle}.\n *\n * @param x x-component of the new axis.\n * @param y y-component of the new axis.\n * @param z z-component of the new axis.\n * @param angle the new angle.\n */\n default void set(double x, double y, double z, double angle)\n {\n getAxis().set(x, y, z);\n setAngle(angle);\n }\n\n /** {@inheritDoc} */\n @Override\n default void set(Orientation3DReadOnly orientation3DReadOnly)\n {\n if (orientation3DReadOnly instanceof AxisAngleReadOnly)\n set((AxisAngleReadOnly) orientation3DReadOnly);\n else\n orientation3DReadOnly.get(this);\n }\n\n /**\n * Sets the axis and the angle of this axis-angle.\n *\n * @param axis the new axis. Not modified.\n * @param angle the new angle.\n */\n default void set(Vector3DReadOnly axis, double angle)\n {\n getAxis().set(axis);\n setAngle(angle);\n }\n\n /**\n * Sets this axis-angle to the same value as the given axis-angle {@code other}.\n *\n * @param other the other axis-angle. Not modified.\n */\n default void set(AxisAngleReadOnly other)\n {\n getAxis().set(other.getAxis());\n setAngle(other.getAngle());\n }\n\n /**\n * Sets this axis-angle to {@code other} and then calls {@link #negate()}.\n *\n * @param other the other axis-angle to copy the values from. Not modified.\n */\n default void setAndNegate(AxisAngleReadOnly other)\n {\n set(other);\n negate();\n }\n\n /**\n * Copies the values in the given array into this axis-angle as follows:\n * <ul>\n * <li>{@code this.setX(axisAngleArray[0]);}\n * <li>{@code this.setY(axisAngleArray[1]);}\n * <li>{@code this.setZ(axisAngleArray[2]);}\n * <li>{@code this.setAngle(axisAngleArray[3]);}\n * </ul>\n *\n * @param axisAngleArray the array containing the new values for this axis-angle. Not modified.\n */\n default void set(double[] axisAngleArray)\n {\n set(0, axisAngleArray);\n }\n\n /**\n * Copies the values in the given array into this axis-angle as follows:\n * <ul>\n * <li>{@code this.setX(axisAngleArray[startIndex + 0]);}\n * <li>{@code this.setY(axisAngleArray[startIndex + 1]);}\n * <li>{@code this.setZ(axisAngleArray[startIndex + 2]);}\n * <li>{@code this.setAngle(axisAngleArray[startIndex + 3]);}\n * </ul>\n *\n * @param startIndex the first index to start reading from in the array.\n * @param axisAngleArray the array containing the new values for this axis-angle. Not modified.\n */\n default void set(int startIndex, double[] axisAngleArray)\n {\n setX(axisAngleArray[startIndex++]);\n setY(axisAngleArray[startIndex++]);\n setZ(axisAngleArray[startIndex++]);\n setAngle(axisAngleArray[startIndex]);\n }\n\n /**\n * Copies the values in the given array into this axis-angle as follows:\n * <ul>\n * <li>{@code this.setX(axisAngleArray[0]);}\n * <li>{@code this.setY(axisAngleArray[1]);}\n * <li>{@code this.setZ(axisAngleArray[2]);}\n * <li>{@code this.setAngle(axisAngleArray[3]);}\n * </ul>\n *\n * @param axisAngleArray the array containing the new values for this axis-angle. Not modified.\n */\n default void set(float[] axisAngleArray)\n {\n set(0, axisAngleArray);\n }\n\n /**\n * Copies the values in the given array into this axis-angle as follows:\n * <ul>\n * <li>{@code this.setX(axisAngleArray[startIndex + 0]);}\n * <li>{@code this.setY(axisAngleArray[startIndex + 1]);}\n * <li>{@code this.setZ(axisAngleArray[startIndex + 2]);}\n * <li>{@code this.setAngle(axisAngleArray[startIndex + 3]);}\n * </ul>\n *\n * @param startIndex the first index to start reading from in the array.\n * @param axisAngleArray the array containing the new values for this axis-angle. Not modified.\n */\n default void set(int startIndex, float[] axisAngleArray)\n {\n setX(axisAngleArray[startIndex++]);\n setY(axisAngleArray[startIndex++]);\n setZ(axisAngleArray[startIndex++]);\n setAngle(axisAngleArray[startIndex]);\n }\n\n /** {@inheritDoc} */\n @Override\n default void setAxisAngle(double x, double y, double z, double angle)\n {\n set(x, y, z, angle);\n }\n\n /** {@inheritDoc} */\n @Override\n default void setQuaternion(double x, double y, double z, double s)\n {\n AxisAngleConversion.convertQuaternionToAxisAngle(x, y, z, s, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void setRotationVector(double x, double y, double z)\n {\n AxisAngleConversion.convertRotationVectorToAxisAngle(x, y, z, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void setYawPitchRoll(double yaw, double pitch, double roll)\n {\n AxisAngleConversion.convertYawPitchRollToAxisAngle(yaw, pitch, roll, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void setRotationMatrix(double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22)\n {\n AxisAngleConversion.convertMatrixToAxisAngle(m00, m01, m02, m10, m11, m12, m20, m21, m22, this);\n }\n\n @Override\n default void setToYawOrientation(double yaw)\n {\n getAxis().set(Axis3D.Z);\n setAngle(yaw);\n }\n\n @Override\n default void setToPitchOrientation(double pitch)\n {\n getAxis().set(Axis3D.Y);\n setAngle(pitch);\n }\n\n @Override\n default void setToRollOrientation(double roll)\n {\n getAxis().set(Axis3D.X);\n setAngle(roll);\n }\n\n /**\n * Selects a component of this axis-angle based on {@code index} and sets it to {@code value}.\n * <p>\n * For {@code index} values of 0, 1, and 2, the corresponding components are x, y, and z,\n * respectively, while 3 corresponds to the angle.\n * </p>\n *\n * @param index the index of the component to set.\n * @param value the new value of the selected component.\n * @throws IndexOutOfBoundsException if {@code index} ∉ [0, 3].\n */\n default void setElement(int index, double value)\n {\n switch (index)\n {\n case 0:\n setX(value);\n break;\n case 1:\n setY(value);\n break;\n case 2:\n setZ(value);\n break;\n case 3:\n setAngle(value);\n break;\n default:\n throw new IndexOutOfBoundsException(Integer.toString(index));\n }\n }\n\n /**\n * Multiplies this axis-angle by {@code other}.\n * <p>\n * this = this * other\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void multiply(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiply(this, other, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void append(Orientation3DReadOnly other)\n {\n AxisAngleTools.multiply(this, false, other, false, this);\n }\n\n /**\n * Sets this axis-angle to the multiplication of {@code aa1} and {@code aa2}.\n * <p>\n * this = aa1 * aa2\n * </p>\n *\n * @param aa1 the first axis-angle in the multiplication. Not modified.\n * @param aa2 the second axis-angle in the multiplication. Not modified.\n */\n default void multiply(AxisAngleReadOnly aa1, AxisAngleReadOnly aa2)\n {\n AxisAngleTools.multiply(aa1, aa2, this);\n }\n\n /**\n * Multiplies this axis-angle by the inverse of {@code other}.\n * <p>\n * this = this * other<sup>-1</sup>\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void multiplyInvertOther(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiplyInvertRight(this, other, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void appendInvertOther(Orientation3DReadOnly orientation)\n {\n AxisAngleTools.multiply(this, false, orientation, true, this);\n }\n\n /**\n * Sets this axis-angle to the multiplication of the inverse of {@code this} and {@code other}.\n * <p>\n * this = this<sup>-1</sup> * other\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void multiplyInvertThis(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiplyInvertLeft(this, other, this);\n }\n\n /**\n * Sets this axis-angle to the multiplication of the inverse of {@code this} and the inverse of\n * {@code other}.\n * <p>\n * this = this<sup>-1</sup> * other<sup>-1</sup>\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void multiplyInvertBoth(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiplyInvertBoth(this, other, this);\n }\n\n /**\n * Appends a rotation about the z-axis to this axis-angle.\n *\n * <pre>\n * / ux = 0 \\\n * this = this * | uy = 0 |\n * | uz = 1 |\n * \\ angle = yaw /\n * </pre>\n *\n * @param yaw the angle to rotate about the z-axis.\n */\n @Override\n default void appendYawRotation(double yaw)\n {\n AxisAngleTools.appendYawRotation(this, yaw, this);\n }\n\n /**\n * Appends a rotation about the y-axis to this axis-angle.\n *\n * <pre>\n * / ux = 0 \\\n * this = this * | uy = 1 |\n * | uz = 0 |\n * \\ angle = pitch /\n * </pre>\n *\n * @param pitch the angle to rotate about the y-axis.\n */\n @Override\n default void appendPitchRotation(double pitch)\n {\n AxisAngleTools.appendPitchRotation(this, pitch, this);\n }\n\n /**\n * Appends a rotation about the x-axis to this axis-angle.\n *\n * <pre>\n * / ux = 1 \\\n * this = this * | uy = 0 |\n * | uz = 0 |\n * \\ angle = roll /\n * </pre>\n *\n * @param roll the angle to rotate about the x-axis.\n */\n @Override\n default void appendRollRotation(double roll)\n {\n AxisAngleTools.appendRollRotation(this, roll, this);\n }\n\n /**\n * Pre-multiplies this axis-angle by {@code other}.\n * <p>\n * this = other * other\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void preMultiply(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiply(other, this, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void prepend(Orientation3DReadOnly orientation)\n {\n AxisAngleTools.multiply(orientation, false, this, false, this);\n }\n\n /**\n * Sets this axis-angle to the multiplication of the inverse of {@code other} and {@code this}.\n * <p>\n * this = other<sup>-1</sup> * this\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void preMultiplyInvertOther(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiplyInvertLeft(other, this, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void prependInvertOther(Orientation3DReadOnly orientation)\n {\n AxisAngleTools.multiply(orientation, true, this, false, this);\n }\n\n /**\n * Sets this axis-angle to the multiplication of {@code other} and the inverse of {@code this}.\n * <p>\n * this = other * this<sup>-1</sup>\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void preMultiplyInvertThis(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiplyInvertRight(other, this, this);\n }\n\n /**\n * Sets this axis-angle to the multiplication of the inverse of {@code other} and the inverse of\n * {@code this}.\n * <p>\n * this = other<sup>-1</sup> * this<sup>-1</sup>\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void preMultiplyInvertBoth(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiplyInvertBoth(other, this, this);\n }\n\n /**\n * Prepends a rotation about the z-axis to this axis-angle.\n *\n * <pre>\n * / ux = 0 \\\n * this = | uy = 0 | * this\n * | uz = 1 |\n * \\ angle = yaw /\n * </pre>\n *\n * @param yaw the angle to rotate about the z-axis.\n */\n @Override\n default void prependYawRotation(double yaw)\n {\n AxisAngleTools.prependYawRotation(yaw, this, this);\n }\n\n /**\n * Prepends a rotation about the y-axis to this axis-angle.\n *\n * <pre>\n * / ux = 0 \\\n * this = | uy = 1 | * this\n * | uz = 0 |\n * \\ angle = pitch /\n * </pre>\n *\n * @param pitch the angle to rotate about the y-axis.\n */\n @Override\n default void prependPitchRotation(double pitch)\n {\n AxisAngleTools.prependPitchRotation(pitch, this, this);\n }\n\n /**\n * Prepends a rotation about the x-axis to this axis-angle.\n *\n * <pre>\n * / ux = 1 \\\n * this = | uy = 0 | * this\n * | uz = 0 |\n * \\ angle = roll /\n * </pre>\n *\n * @param roll the angle to rotate about the x-axis.\n */\n @Override\n default void prependRollRotation(double roll)\n {\n AxisAngleTools.prependRollRotation(roll, this, this);\n }\n}",
"public void setAngle(float angle){\n\n\t}",
"@Test\n public void testEquals() {\n Coctail c1 = new Coctail(\"coctail\", new Ingredient[]{ \n new Ingredient(\"ing1\"), new Ingredient(\"ing2\")});\n Coctail c2 = new Coctail(\"coctail\", new Ingredient[]{ \n new Ingredient(\"ing1\"), new Ingredient(\"ing2\")});\n assertEquals(c1, c2);\n }",
"public abstract boolean equals(Object other);",
"public final void testDifferentClassEquals() {\n final Account test = new Account(\"Test\");\n assertFalse(testTransaction1.equals(test));\n // pmd doesn't like either way\n }",
"@Test\n public void testEqualTo() {\n System.out.println(\"AbsolutePathNode - testEqualTo\");\n final AbsolutePathNode instance1 = new AbsolutePathNode();\n final AbsolutePathNode instance2 = new AbsolutePathNode();\n final TestNode testInstance = TestNode.instance;\n assertTrue(instance1.equalTo(instance2));\n assertFalse(instance1.equalTo(testInstance));\n }",
"public Flatbed(int angle){\r\n this.angle=angle;\r\n }",
"public Matrix4 setToRotation(Vector3 axis, float angle) {\n if (angle != 0.0f) {\n return set(quat.set(axis, angle));\n }\n idt();\n return this;\n }",
"public double angle()\n {\n return Math.atan2(this.y, this.x);\n }",
"public double getStartAngle();",
"public String polarRotation(double angle, double newAngle)\n {\n angle = angle + newAngle;\n \n String str = \"Rotated polar point:\" + angle;\n return str;\n }",
"@Test\n public void testGetRotationMatrix() {\n \n AxisRotation rotation = new AxisRotation(0, 0, 1, 54);\n Mat3D rotationMatrix1 = rotation.getRotationMatrix();\n \n AxisRotation rotation2 = new AxisRotation(0, 0, 1, 324);\n Mat3D rotationMatrix2 = rotation2.getRotationMatrix();\n \n System.out.println(\"test\");\n }",
"@Override\n\tpublic boolean equals(Object other) {\n\t\tif (other == null) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (this.getClass() != other.getClass()) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tCircle otherObject = (Circle) other;\n\t\treturn approx(this.radius, otherObject.radius) && \n\t\t\t\tthis.color.equals(otherObject.color) &&\n\t\t\t\tthis.position.equals(otherObject.position) &&\n\t\t\t\tthis.filled == otherObject.filled;\n\t\t\n\t}",
"public void equals() {\r\n // todo Implement this java.lang.Object method\r\n throw new UnsupportedOperationException(\"Method equals() not yet implemented.\");\r\n }",
"protected abstract NativeSQLStatement createNativeEqualsStatement(Geometry geom);",
"@Test\r\n\tpublic void testEqualsEU() {\r\n\t\tExternUnit externu2 = externu1.clone();\r\n\t\tassertTrue(externu1.equals(externu2));\r\n\t}"
]
| [
"0.6909711",
"0.6732606",
"0.6490651",
"0.64851904",
"0.62021834",
"0.6127318",
"0.61054254",
"0.60049355",
"0.59925365",
"0.5860167",
"0.5807628",
"0.5676811",
"0.5676811",
"0.5551169",
"0.54679435",
"0.5397287",
"0.53861666",
"0.5379165",
"0.5349753",
"0.534952",
"0.529429",
"0.5276636",
"0.5271323",
"0.52571636",
"0.52493936",
"0.52471334",
"0.51679355",
"0.5140614",
"0.5136795",
"0.51344544",
"0.513139",
"0.51195514",
"0.5116375",
"0.51148397",
"0.51089007",
"0.5093173",
"0.5093173",
"0.5088335",
"0.5075474",
"0.5065953",
"0.5044297",
"0.50324017",
"0.49918848",
"0.49901646",
"0.49776053",
"0.49758935",
"0.49757686",
"0.49674246",
"0.4943224",
"0.49395686",
"0.492775",
"0.4913834",
"0.490803",
"0.49043486",
"0.48988587",
"0.48988587",
"0.4893129",
"0.48913231",
"0.4885675",
"0.48729858",
"0.4861064",
"0.4861064",
"0.4853317",
"0.48505345",
"0.48463848",
"0.48379132",
"0.48346484",
"0.48135793",
"0.48049563",
"0.47949287",
"0.4792504",
"0.47684902",
"0.4767038",
"0.47651532",
"0.47641414",
"0.4760203",
"0.4758331",
"0.47519106",
"0.47459608",
"0.47378775",
"0.47376105",
"0.47339976",
"0.47310287",
"0.47174597",
"0.4708755",
"0.47044873",
"0.46903774",
"0.4689023",
"0.4688311",
"0.46871847",
"0.46809882",
"0.4678751",
"0.4675231",
"0.467074",
"0.46693516",
"0.46623006",
"0.46512568",
"0.46439838",
"0.4642696",
"0.46418706"
]
| 0.8883898 | 0 |
Returns a new object of class 'Angle Distinct'. | AngleDistinct createAngleDistinct(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"AngleSmaller createAngleSmaller();",
"LengthDistinct createLengthDistinct();",
"public Aggregate DISTINCT() {\r\n\t\tReturnExpression rx = (ReturnExpression)this.astNode;\r\n\t\tReturnAggregate ra = (ReturnAggregate) rx.getReturnValue();\r\n\t\tra.setDistinct();\r\n\t\tAggregate ret = new Aggregate(rx);\r\n\t\treturn ret;\r\n\t}",
"public DistinctValues()\n {\n super();\n }",
"Angle createAngle();",
"AngleAdd createAngleAdd();",
"private IdentifiableComparator() {\n\t\t// This class is not intended to create own objects from it.\n\t}",
"AngleEquals createAngleEquals();",
"private UniqueChromosomeReconstructor() { }",
"public static Corridor genCorridor() {\n Intersection int1 = new Intersection(100, 50, 60, 0, 0, 0);\n int1.setRef(true);\n Intersection int2 = new Intersection(100, 60, 40, 0, 0, 4200);\n Intersection int3 = new Intersection(100, 60, 40, 0, 0, 5600);\n Intersection int4 = new Intersection(100, 50, 60, 10, 30, 7000);\n ArrayList<Intersection> intersections = new ArrayList<>(Arrays.asList(int1, int2, int3, int4));\n Corridor corr = new Corridor(intersections);\n corr.setSpeed(GlobalVariables.speedLim.get());\n return corr;\n }",
"private SimplexComparator() {}",
"@Override\n\tpublic DAOPedido crearDAOPedidoAlmacen() {\n\t\treturn new DAOPedido();\n\t}",
"public DistinctOperator getDistinct(){\n for(Operator op:_operators){\n if (op instanceof DistinctOperator) return (DistinctOperator) op;\n }\n return null;\n }",
"AngleSubtract createAngleSubtract();",
"public final SelectImpl distinct() {\n selectDistinct = true;\n return this;\n }",
"public Object clone() {\n AggregateSymbol copy = new AggregateSymbol(getName(), getAggregateFunction(), isDistinct(), LanguageObject.Util.deepClone(getArgs()));\n if (orderBy != null) {\n copy.setOrderBy(orderBy.clone());\n }\n if (condition != null) {\n copy.setCondition((Expression) condition.clone());\n }\n copy.isWindowed = this.isWindowed;\n copy.type = this.type;\n copy.setFunctionDescriptor(getFunctionDescriptor());\n return copy;\n }",
"public Triangle copy()\r\n {\r\n return new Triangle (v1.getX(),v1.getY(),v2.getX(),v2.getY(),v3.getX(),v3.getY());\r\n }",
"public UniqueDataPoint(double value) {\r\n\t\tsuper(value);\r\n\t\tthis.uniqueId = uniqueIdCount++;\r\n\t}",
"public a dD() {\n return new a(this.HG);\n }",
"private DisjointSet() {\n throw new UnsupportedOperationException(\"Creating an empty Disjoint Set\");\n }",
"@Override\n public Tuple next() {\n return nonDistinctNext();\n }",
"public double getAngle();",
"public Chord duplicate ()\r\n {\r\n // Beams are not copied\r\n Chord clone = new Chord(getMeasure(), slot);\r\n clone.stem = stem;\r\n stem.addTranslation(clone);\r\n\r\n // Notes (we make a deep copy of each note)\r\n List<TreeNode> notesCopy = new ArrayList<>();\r\n notesCopy.addAll(getNotes());\r\n\r\n for (TreeNode node : notesCopy) {\r\n Note note = (Note) node;\r\n new Note(clone, note);\r\n }\r\n\r\n clone.tupletFactor = tupletFactor;\r\n\r\n clone.dotsNumber = dotsNumber;\r\n clone.flagsNumber = flagsNumber; // Not sure TODO\r\n\r\n // Insure correct ordering of chords within their container\r\n ///Collections.sort(getParent().getChildren(), chordComparator);\r\n\r\n return clone;\r\n }",
"public DistinctTokensAnalyzer() {\n\n distinctTokens = new TreeSet<String>();\n\n }",
"public DistinctValues(String sMethod)\n {\n super(sMethod);\n }",
"<T> T unique();",
"public RandomizedSet() {\n }",
"public RandomNetworkGenerator copy()\n\t{\n\t\t\n\t\treturn new DegreePreservingNetworkRandomizer(mOriginal, mDirected, mIterations); \n\t}",
"public RandomizedSet() {\n // public RandomizedSet1() {\n lst = new ArrayList<>();\n rand = new Random();\n map = new HashMap<>();\n }",
"public PTreeCredalSet getInstance(Vector vars){\n return new PTreeCredalSet(vars);\n }",
"public Aliases( ) {\n\t}",
"AngleGreater createAngleGreater();",
"public Cartesiana polar_cartesiano (float radio, float angulo) {\n return new Cartesiana (radio * (float)Math.cos(angulo),radio * (float)Math.sin(angulo)); \n}",
"private PSUniqueObjectGenerator()\n {\n }",
"@Override\n public AbstractRelic makeCopy() {\n return new Compendium();\n }",
"private Combined() {}",
"double getAngle();",
"double getAngle();",
"double getAngle(int id);",
"public RandomizedSet() {\n list = new HashSet<>();\n\n }",
"private Tuples() {\n // prevent instantiation.\n }",
"public RandomIA() {\n\t\trandom = new Random();\n\t}",
"public boolean isDistinct() {\n return distinct;\n }",
"public RandomizedSet() {\n data = new ArrayList<>();\n val2Index = new HashMap<>();\n }",
"AngleScalarMultiply createAngleScalarMultiply();",
"private Topography()\n\t{\n\t\tthrow new IllegalStateException(\"This is an utility class, it can not be instantiated\");\n\t}",
"protected AggregateSymbol(String name, Type aggregateFunction, boolean isDistinct, Expression[] args) {\n super(name, args);\n this.aggregate = aggregateFunction;\n this.distinct = isDistinct;\n }",
"public RandomizedSet() {\r\n set = new HashSet<>();\r\n }",
"protected Shingle copy() {\n return new Shingle(this);\n }",
"static Tour sequence() {\r\n\t\tTour tr = new Tour();\r\n\t\tfor (int i = 0; i < tr.length(); i++) {\r\n\t\t\ttr.index[i] = i;\r\n\t\t}\r\n\t\ttr.distance = tr.distance();\r\n\t\treturn tr;\r\n\t}",
"public RandomizedSet() {\n m = new HashMap<>();\n l = new ArrayList<>();\n }",
"CritPair createCritPair();",
"public RandomizedSet() {\n list = new ArrayList<>();\n map = new HashMap<>();\n }",
"public Circle(){}",
"private Tuples() {}",
"String findAllAggrGroupByDistinct();",
"public RandomizedSet() {\n this.valueToIndex = new HashMap<>();\n this.values = new ArrayList<>();\n this.random = new Random();\n }",
"private Distance(){}",
"List<T> getAllDistinct();",
"public double getAngle() { return angle; }",
"Oracion createOracion();",
"public AngleIF() {\n \t\t//_navx = new navx();\n \t\t//roboAccel = new RoboRioAccelerometers();\n \t}",
"public Clade() {}",
"public Puerto()\n {\n alquileres = new ArrayList<>();\n }",
"public RandomizedCollection() {\n\n }",
"public RandomizedCollection() {\n map = new HashMap<>();\n arr = new ArrayList<>();\n }",
"Composite() {\n\n\t}",
"public boolean isDistinct() {\r\n return distinct;\r\n }",
"public boolean isDistinct() {\r\n return distinct;\r\n }",
"public boolean isDistinct() {\r\n return distinct;\r\n }",
"public boolean isDistinct() {\r\n return distinct;\r\n }",
"public boolean isDistinct() {\r\n return distinct;\r\n }",
"public boolean isDistinct() {\r\n return distinct;\r\n }",
"public boolean isDistinct() {\r\n return distinct;\r\n }",
"public boolean isDistinct() {\r\n return distinct;\r\n }",
"public boolean isDistinct() {\r\n return distinct;\r\n }",
"public boolean isDistinct() {\r\n return distinct;\r\n }",
"public boolean isDistinct() {\r\n return distinct;\r\n }",
"public boolean isDistinct() {\r\n return distinct;\r\n }",
"public boolean isDistinct() {\r\n return distinct;\r\n }",
"public boolean isDistinct() {\r\n return distinct;\r\n }",
"public boolean isDistinct() {\r\n return distinct;\r\n }",
"public boolean isDistinct() {\r\n return distinct;\r\n }",
"public static void main(String[] args) {\n System.out.print(unique(new int[]{100, 11, 34, 11, 52, 61, 1, 34}));\n // should print: `[1, 11, 34, 52, 61]`\n\n\n }",
"public DisjointSet() {}",
"public RandomizedSet() {\n set = new HashMap<>();\n list = new ArrayList<>();\n }",
"public GestoreAule() {\n this.aule = new HashSet<>();\n }",
"public RandomizedSet() {\n data=new ArrayList<>();\n valueIndex=new HashMap<>();\n random=new Random();\n }",
"public boolean isDistinct() {\n return distinct;\n }",
"public boolean isDistinct() {\n return distinct;\n }",
"public boolean isDistinct() {\n return distinct;\n }",
"public boolean isDistinct() {\n return distinct;\n }",
"public boolean isDistinct() {\n return distinct;\n }",
"public boolean isDistinct() {\n return distinct;\n }",
"public boolean isDistinct() {\n return distinct;\n }",
"public boolean isDistinct() {\n return distinct;\n }",
"public boolean isDistinct() {\n return distinct;\n }",
"public boolean isDistinct() {\n return distinct;\n }",
"public boolean isDistinct() {\n return distinct;\n }",
"public boolean isDistinct() {\n return distinct;\n }"
]
| [
"0.60731673",
"0.58697534",
"0.57846934",
"0.5759518",
"0.5624505",
"0.56167984",
"0.5276922",
"0.5262146",
"0.5080182",
"0.5051553",
"0.4981785",
"0.49701786",
"0.49562234",
"0.49461904",
"0.4924561",
"0.48868245",
"0.4875489",
"0.48688942",
"0.48553732",
"0.48512813",
"0.4840539",
"0.48259747",
"0.48228782",
"0.48177925",
"0.47970468",
"0.47829208",
"0.475987",
"0.47431222",
"0.4738834",
"0.4736727",
"0.47344214",
"0.47316685",
"0.47201005",
"0.4715954",
"0.4712699",
"0.47126907",
"0.47067395",
"0.47067395",
"0.46923384",
"0.46853912",
"0.4684074",
"0.46839598",
"0.4681396",
"0.46783683",
"0.46752298",
"0.46748802",
"0.46650785",
"0.466383",
"0.4660363",
"0.4658959",
"0.4655434",
"0.46539888",
"0.46302956",
"0.46244413",
"0.46223953",
"0.46178192",
"0.46132833",
"0.4610023",
"0.45861095",
"0.4584486",
"0.45829177",
"0.45781857",
"0.45717496",
"0.45717442",
"0.4568378",
"0.45628202",
"0.4552775",
"0.4548374",
"0.4548374",
"0.4548374",
"0.4548374",
"0.4548374",
"0.4548374",
"0.4548374",
"0.4548374",
"0.4548374",
"0.4548374",
"0.4548374",
"0.4548374",
"0.4548374",
"0.4548374",
"0.4548374",
"0.4548374",
"0.4542893",
"0.45405105",
"0.45390004",
"0.45387757",
"0.45376644",
"0.45321894",
"0.45321894",
"0.45321894",
"0.45321894",
"0.45321894",
"0.45321894",
"0.45321894",
"0.45321894",
"0.45321894",
"0.45321894",
"0.45321894",
"0.45321894"
]
| 0.85448575 | 0 |
Returns a new object of class 'Angle Smaller'. | AngleSmaller createAngleSmaller(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Angle createAngle();",
"AngleGreater createAngleGreater();",
"AngleAdd createAngleAdd();",
"AngleSubtract createAngleSubtract();",
"AngleDistinct createAngleDistinct();",
"AngleEquals createAngleEquals();",
"AngleResource inclination();",
"public AngleIF() {\n \t\t//_navx = new navx();\n \t\t//roboAccel = new RoboRioAccelerometers();\n \t}",
"public double getAngle();",
"AngleScalarMultiply createAngleScalarMultiply();",
"@Override\n public void reAngle() {\n }",
"double getAngle();",
"double getAngle();",
"public void setAngle( double a ) { angle = a; }",
"public Flatbed(int angle){\r\n this.angle=angle;\r\n }",
"public SmallAsteroid(int angle, int x, int y,FloatBuffer vertexBuffer)\n {\n super(angle, x, y,vertexBuffer);\n this.index = 16;\n this.radius /= 4;\n this.width = 13;\n this.height = 13;\n }",
"public ImageRotator(int receivedAngle){angle = receivedAngle;}",
"public double getAngle() { return angle; }",
"public double getStartAngle();",
"public atan( ) {\n super(1);\n }",
"void resetAngle();",
"void setAngle(double angle);",
"AngleScalarDivide createAngleScalarDivide();",
"public double getAngleToTarget(){\n return 0d;\n }",
"@Override\n public Shape getCelkoveHranice() {\n return new Rectangle2D.Double(super.getX() + 22, super.getY() + 45, 45, 45);\n }",
"public DistanceBearing() {\r\n }",
"public TurnToDefaultAngle() {\n super(0, RobotContainer.m_robotDrive);\n }",
"public Cartesiana polar_cartesiano (float radio, float angulo) {\n return new Cartesiana (radio * (float)Math.cos(angulo),radio * (float)Math.sin(angulo)); \n}",
"public double getAngle () {\n return super.getAngle() % 360D;\n }",
"public DistanceScalingArc() {\n\t\tsuper();\n\t\tthis.highGear = true;\n\t\tcenterProfile = new SrxMotionProfile(centerPoints.length, centerPoints);\n\t}",
"public AngleWrapper2D(double value) {\r\n\t\tthis(new AngleMeasure2D(value)); \r\n\t}",
"public Asteroid makeAsteroid() {\r\n\t\tAsteroid asteroid = new AsteroidImpl(startBounds.x, random(startBounds.y,startBounds.height)\r\n\t\t\t\t\t\t\t\t\t\t\t, random(10,40), random(10,40)\r\n\t\t\t\t\t\t\t\t\t\t\t, random(1,4));\r\n\t\treturn asteroid;\r\n\t}",
"void setAngle(int id, double value);",
"public void setAngle(float angle){\n\n\t}",
"public JAngle(double angle) {\n GridBagLayout layout = new GridBagLayout();\n GridBagConstraints c = new GridBagConstraints();\n c.anchor = GridBagConstraints.EAST;\n c.fill = GridBagConstraints.BOTH;\n setLayout(layout);\n c.gridy = 0;\n\n JLabel ldeg = null;\n int unit = Coordinates.angleUnit();\n double d;\n switch(unit) {\n case Coordinates.RADIAN:\n deg = new JTextField(12);\n ldeg = new JLabel(\"rad\");\n deg.setText(String.valueOf(Math.round(angle * 10000000000.0) /\n\t\t 10000000000.0));\n break;\n case Coordinates.DEGRE:\n deg = new JTextField(14);\n ldeg = new JLabel(\"aa\");\n deg.setText(String.valueOf(Math.round(180.0 * angle / Math.PI *\n\t\t\t\t\t 10000000000.0) / 10000000000.0));\n break;\n case Coordinates.DEGMN:\n case Coordinates.DEGMNSEC:\n deg = new JTextField(3);\n String sgn = \"\";\n if(angle < 0.0) {\n\tangle = -angle;\n\tsgn = \"-\";\n }\n angle = 180.0 * angle / Math.PI;\n deg.setText(sgn + String.valueOf((int) angle));\n deg.setHorizontalAlignment(JTextField.RIGHT);\n ldeg = new JLabel(\"aa\");\n break;\n }\n c.gridx = 0;\n c.weightx = 0.0;\n\n layout.setConstraints(deg, c);\n add(deg);\n c.gridx = 1;\n c.weightx = 0.0;\n layout.setConstraints(ldeg, c);\n add(ldeg);\n\n if(unit == Coordinates.DEGMN || unit == Coordinates.DEGMNSEC) {\n mn = new JTextField((unit == Coordinates.DEGMN) ? 8 : 2);\n mn.setHorizontalAlignment(JTextField.RIGHT);\n c.gridx = 2;\n c.weightx = 0.0;\n layout.setConstraints(mn, c);\n add(mn);\n JLabel lmn = new JLabel(\"'\");\n c.gridx = 3;\n c.weightx = 0.0;\n layout.setConstraints(lmn, c);\n add(lmn);\n angle -= (int) angle;\n angle *= 60.0;\n \n if(unit == Coordinates.DEGMNSEC) {\n\tmn.setText(String.valueOf((int) angle));\n\tangle -= (int) angle;\n\tangle *= 60.0;\n\tsec = new JTextField((unit == Coordinates.DEGMN) ? 5 : 6);\n\tsec.setHorizontalAlignment(JTextField.RIGHT);\n\tc.gridx = 4;\n\tc.weightx = 0.0;\n\tlayout.setConstraints(sec, c);\n\tadd(sec);\n\tJLabel lsec = new JLabel(\"\\\"\");\n\tc.gridx = 5;\n\tc.weightx = 0.0;\n\tlayout.setConstraints(lsec, c);\n\tadd(lsec);\n\tsec.setText(String.valueOf(Math.round(angle * 10000.0) / 10000.0));\n }\n else {\n\tmn.setText(String.valueOf(Math.round(angle * 1000000.0) / 1000000.0));\n }\n }\n }",
"public AngleDisplay() {\n initComponents();\n\n setPreferredSize(new Dimension(size, size));\n }",
"public Angle getSmallDiameter() {\n\n return smallDiameter;\n\n }",
"public double betweenAngle(Coordinates a, Coordinates b, Coordinates origin);",
"public void setAngle(float angle) {\n this.angle = angle;\n float cos = (float) Math.cos(angle);\n float sin = (float) Math.sin(angle);\n m00 = cos;\n m01 = sin;\n m10 = -sin;\n m11 = cos;\n }",
"public static NewRotateLeft create(AnimatableModelInstance originObject, float ex, float ey, int duration) {\n\n\t\tVector3 posO = originObject.transState.position.cpy();\t\n\t\t//Vector3 posO = new Vector3();\n\t\t//originObject.transform.getTranslation(posO);\n\t\t\n\t\tQuaternion rotation = originObject.transState.rotation.cpy();\t\n\t\t//Quaternion rotation = new Quaternion();\n\t\t//originObject.transform.getRotation(rotation,true); //existing rotation\n\t\t\n\t\t Vector3 axisVec = new Vector3();\n\t float existingangle = (float) (rotation.getAxisAngle(axisVec) * axisVec.nor().z);\n\t existingangle = existingangle < 0 ? existingangle + 360 : existingangle; //convert <0 values\n\t\t\n\t\tGdx.app.log(logstag,\"_____________________________________existing angle=\"+existingangle); //relative to x axis pointing left anticlockwise\n\t\n\t\t//float scalex = originObject.transform.getScaleX(); //get how much the object has been scaled\n\t\t//float scaley = originObject.transform.getScaleY();\n\t\t\n\t\tVector2 fromPoint = new Vector2(posO.x,posO.y); //we need to scale them down due to how the positions might have been scaled up if the matrix is scaled (I hate how matrixs work :-/ Just cant get it in my head)\n\t\tVector2 tooPoint = new Vector2(ex,ey);\n\n\t\tfromPoint.sub(tooPoint); \n\n\t\t//Log.info(\"length=\"+corner2.len());\n\n\t\tfloat angle = 180+fromPoint.angle(); //absolute angle between the two objects\n\t\tGdx.app.log(logstag,\"________target angle=\"+angle); //should point towards ex/ey \n\t\t\n\t//\tfloat distance = fromPoint.len();\n\n\t\t\n\t\t//difference between this angle and existing one\n\t\tangle = angle - existingangle;\n\t\t\n\t\tNewRotateLeft rot = new NewRotateLeft(angle,500);\n\t\t//NewForward forward = new NewForward(distance,duration-500);\n\t\t\t\t\n\t\treturn rot;\n\t}",
"public Asteroid()\r\n\t{\r\n\t\tsuper.setDirection(rn.nextInt(360));\r\n\t\tsuper.setSpeed(rn.nextInt(100));\r\n\t\tsuper.setLocalX(rn.nextFloat() * 1024);\r\n\t\tsuper.setLocalY(rn.nextFloat() * 786);\r\n\t\tsuper.setColor(250);\r\n\t\tsize = rn.nextInt(10);\r\n\t\t\r\n\t}",
"double getAngle(int id);",
"public double getAngle ()\n {\n return angle_;\n }",
"public Pencil(double x, double y, double width, double height)\n {\n\n\t//outline of the pencil\n GeneralPath body = new GeneralPath();\n\t\n body.moveTo(200,400);\n body.lineTo(150,350);\n\tbody.lineTo(200,300);\n\tbody.lineTo(600,300);\n\tbody.lineTo(600,400);\n\tbody.lineTo(200,400);\n\tbody.closePath();\n\n\t//vertical line that outlines the lead tip of the pencil\n\tGeneralPath leadLine = new GeneralPath();\n\n\tleadLine.moveTo(162, 362);\n\tleadLine.lineTo(162, 338);\n\n\t//vertical line that separates the tip of the pencil from the rest of the body\n\tGeneralPath tipLine = new GeneralPath();\n\ttipLine.moveTo(200, 400);\n\ttipLine.lineTo(200, 300);\n\t\n\t//vertical line that outlines the eraser\n\tShape eraser = ShapeTransforms.translatedCopyOf(tipLine, 350, 0.0);\n \n // now we put the whole thing together ino a single path.\n GeneralPath wholePencil = new GeneralPath ();\n wholePencil.append(body, false);\n\twholePencil.append(leadLine, false);\n wholePencil.append(tipLine, false);\n\twholePencil.append(eraser, false);\n \n // translate to the origin by subtracting the original upper left x and y\n // then translate to (x,y) by adding x and y\n \n Shape s = ShapeTransforms.translatedCopyOf(wholePencil, -ORIG_ULX + x, -ORIG_ULY + y);\n \n\t// scale to correct height and width\n s = ShapeTransforms.scaledCopyOf(s,\n\t\t\t\t\t width/ORIG_WIDTH,\n\t\t\t\t\t height/ORIG_HEIGHT) ;\n\t \n\t// Use the GeneralPath constructor that takes a shape and returns\n\t// it as a general path to set our instance variable cup\n \n\tthis.set(new GeneralPath(s));\n \n }",
"public int getAngle() {\r\n return angle;\r\n }",
"void increaseAngle() {\n this.strokeAngle += 3;\n this.updateAcc();\n this.updateStick();\n }",
"public float getAngle() {\n return angle;\n }",
"public Boleto() {\n this(3.0);\n }",
"public Cylinder() {\n\t\tthis(1.0);\n\t}",
"public BruceWayne()\n {\n GeneralPath leftSide = new GeneralPath();\n\tleftSide.moveTo(195,200);\n\tleftSide.lineTo(195,230);//neck\n\tleftSide.lineTo(150,230);//shoulder\n\tleftSide.lineTo(140,250);//shoulder slant\n\tleftSide.lineTo(140,340);//armleft\n\tleftSide.lineTo(165,340);//armbottom\n\tleftSide.lineTo(160,260);//armright\n\tleftSide.lineTo(170,270);//armpit\n\tleftSide.lineTo(170,350);//chest\n\tleftSide.lineTo(160,510);//legleft\n\tleftSide.lineTo(185,510);//legbottom\n\tleftSide.lineTo(200,360);//legright\n\tleftSide.lineTo(220,360);//middle\n\n Shape rightSide = ShapeTransforms.horizontallyFlippedCopyOf(leftSide);\n rightSide = ShapeTransforms.translatedCopyOf(rightSide, 140.0, 0.0);\n\tCircle head = new Circle(210,170,35);\n \n\twholeFigure = new GeneralPath();\n\twholeFigure.append(head,false);\n wholeFigure.append(leftSide, false);\n wholeFigure.append(rightSide, false);\n }",
"public Circle() {\n this( 1.0 ); \n }",
"public Unit<Angle> microradian() {return microradian;}",
"public double getAngle() {\n return angle;\n }",
"public double getAngle() {\n return angle;\n }",
"public Square(double sideIn)\r\n {\r\n super(sideIn, sideIn);\r\n }",
"@Override\n public void generateShape() {\n AffineTransform tx = new AffineTransform();\n tx.rotate(-this.getRotation(), this.getX(), this.getY());\n this.shape = tx.createTransformedShape(new Ellipse2D.Double(\n this.getX() + this.getWidth() / 2 - D / 2,\n this.getY() + this.getHeight() / 2 - D / 2,\n D, D));\n }",
"public static Transform newXRotation(float th){\n float sinth = (float) Math.sin(th);\n float costh = (float) Math.cos(th);\n return new Transform(new float[][]{\n {1.0f, 0.0f, 0.0f, 0.0f},\n {0.0f, costh, -sinth, 0.0f},\n {0.0f, sinth, costh, 0.0f},\n {0.0f, 0.0f, 0.0f, 1.0f}\n });\n }",
"public Asteroid() {\n\t\t// create, seed random number\n\t\trandomNumber = new Random();\n\n\t\t// random location\n\t\tlocation = new Tuple(\n\t\t\t\t(randomNumber.nextDouble() - 0.5) * FIELD_SIZE, \n\t\t\t\t(randomNumber.nextDouble() - 0.5) * FIELD_SIZE, \n\t\t\t\t(randomNumber.nextDouble() - 0.5) * FIELD_SIZE);\n\n\t\t// random movement vector\n\t\tmovement = new Tuple(\n\t\t\t\t(randomNumber.nextDouble() - 0.5) * MAX_SPEED,\n\t\t\t\t(randomNumber.nextDouble() - 0.5) * MAX_SPEED, \n\t\t\t\t(randomNumber.nextDouble() - 0.5) * MAX_SPEED);\n\t\t\n\t\t// random radius\n\t\tsize = randomNumber.nextInt() % 20 + 1;\n\t\t\n\t\t// create Sphere\n\t\tsphere = new Sphere(size, location);\n\n\t}",
"public double getMyAngle() {\n return myAngle- STARTING_ANGLE;\n }",
"public double nextAngle()\n {\n return nextAngle();\n }",
"public double getAngle(){\n\t\treturn this.angle;\n\t}",
"public abstract void steer(double angle);",
"@Override\n\tpublic LSystemBuilder setAngle(double angle) {\n\t\tthis.angle = angle;\n\t\treturn this;\n\t}",
"public Sheet() {\n gearRatio = 4;\n }",
"public Shape rotateLeft() \n\t{\n\t\tif (detailShape == Tetromino.SQUARE)\n\t\t{\n\t\t\treturn this;\n\t\t}\n\t\t\n\t\tvar result = new Shape();\n\t\tresult.detailShape = detailShape;\n\t\t\n\t\tfor (int i=0; i<4; i++)\n\t\t{\n\t\t\tresult.setX(i, y(i));\n\t\t\tresult.setY(i, -x(i));\n\t\t}\n\t\t\n\t\treturn result;\n\t}",
"public static double rotation()\r\n\t{\r\n\t\treturn -(mxp.getAngle()/45);\r\n\t}",
"public float getAngle() {\n return angle;\n }",
"public Pose() {\n x = 0;\n y = 0;\n heading = 90;\n originalHeading = 90;\n }",
"public void setAngle(final float angle);",
"LengthSmaller createLengthSmaller();",
"public Unit<Angle> radian() {return radian;}",
"public void resetAngle() {\n\t\t//this.angle = (this.orientation % 4 + 4) * (90);\n\t\tthis.angle = this.orientation * 90*-1;\n\t\tthis.tweenAngle.setCurrentValue(this.angle);\n\t\tthis.tweenAngle.setTargetValue(this.angle);\n\t}",
"public Asteroid() {\n setShape(new Polygon(astx, asty, astx.length));\n setAlive(true);\n setColor(new Color(160, 82, 45));\n }",
"public static Angle fromDegrees(double degrees) {\n Angle angle = new Angle(degrees);\n return angle;\n }",
"public PXRadialGradient() {\n center = new PointF();\n }",
"public a mo8520o() {\n return new a();\n }",
"void decreaseAngle() {\n this.strokeAngle -= 3;\n this.updateAcc();\n this.updateStick();\n }",
"public float getAngle() {\n return mAngle;\n }",
"public double findAngle() {\n return 0d;\n }",
"public Vector2D(double angle)\n\t{\n\t\tx = Math.cos(Math.toRadians(angle));\n\t\ty = Math.sin(Math.toRadians(angle));\n\t}",
"public void setAngle(double a) {\n\t\tangle= a;\n\t}",
"public double getFirstAngle(){\r\n\t\treturn Math.atan( \r\n\t\t\t\t(\r\n\t\t\t\t\t\tthis.getFirstObject().getCenterY()\r\n\t\t\t\t\t\t- this.getSecondObject().getCenterY()\r\n\t\t\t\t)\r\n\t\t\t\t/ (\r\n\t\t\t\t\t\tthis.getFirstObject().getCenterX()\r\n\t\t\t\t\t\t- this.getSecondObject().getCenterX()\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t}",
"public Light(){\n this(0.0, 0.0, 0.0);\n }",
"public void setAngle(float angle) {\n this.angle = angle;\n cosAngle = (float) Math.cos(angle);\n sinAngle = 1 - cosAngle * cosAngle;\n }",
"public Path2D asAwtShape() {\n\t\t// creates the awt path\n\t\tPath2D.Double path = new Path2D.Double();\n\t\t\n\t\t// iterate on the path segments\n\t\tfor (Segment seg : this.segments) {\n\t\t\tseg.updatePath(path);\n\t\t}\n\t\t\n\t\t// returns the updated path\n\t\treturn path;\n\t}",
"int getMinRotation();",
"public Circle() {\n this(0, 0, 1);\n }",
"public Loan() {\n this(2.5, 1, 1000);\n }",
"public double SolidAngle() {\n return OCCwrapJavaJNI.Units_Dimensions_SolidAngle(swigCPtr, this);\n }",
"TwoDShape5(double x) {\n width = height = x;\n }",
"EDataType getAngleDegrees();",
"@Test\r\n public void testCalculateAngle5() {\r\n System.out.println(\"calculateAngle5\");\r\n DialDraw instance = new TachometerDraw();\r\n instance.setValue(50);\r\n double expResult = Math.toRadians(90);\r\n double result = instance.calculateAngle();\r\n assertEquals(result, expResult, 0.0001);\r\n }",
"public void rotateToAngle(int newAngle) {\n\t\tint diff = newAngle - getAngle();\n\t\tint diff1=Math.abs(diff-360);\n\t\tif (newAngle == getAngle()) {\n\t\t\tstopMotors();\n\t\t\treturn;\n\t\t}\n\t\twhile (Math.abs(getAngle() - newAngle) > 3&&opModeIsActive()) {\n\t\t\ttelemetry.addData(\"newangle\", newAngle);\n\t\t\ttelemetry.addData(\"getangle()\", getAngle());\n\t\t\ttelemetry.update();\n\t\t\tdiff = newAngle - getAngle();\n\t\t\tdiff1=Math.abs(getAngle() - newAngle);\n\t\t\tif ((diff > 0 && diff < 180) || (diff < 0 && Math.abs(diff) > 180)) {\n\n\t\t\t\tif(Math.abs(diff1)<13)\n\t\t\t\t\trotate(-0.06);\n\t\t\t\telse if(Math.abs(diff1)<50)\n\t\t\t\t\trotate(-0.1);\n\t\t\t\telse if(Math.abs(diff1)<160)\n\t\t\t\t\trotate(-0.5);\n\t\t\t\telse\n\t\t\t\t\trotate(-(0.00928571*Math.abs(diff1))+0.128571);\n\t\t\t} else {\n\n\t\t\t\tif(Math.abs(diff1)<13)\n\t\t\t\t\trotate(0.06);\n\t\t\t\telse if(Math.abs(diff1)<50)\n\t\t\t\t\trotate(0.1);\n\t\t\t\telse if(Math.abs(diff1)<160)\n\t\t\t\t\trotate(0.5);\n\t\t\t\telse\n\t\t\t\t\trotate((0.00928571*Math.abs(diff1))+0.128571);\n\t\t\t}\n\n\t\t}\n\t\tstopMotors();\n\n\t}",
"@Test\r\n public void testCalculateAngle4() {\r\n System.out.println(\"calculateAngle4\");\r\n DialDraw instance = new TachometerDraw();\r\n instance.setValue(90);\r\n double expResult = Math.toRadians(18);\r\n double result = instance.calculateAngle();\r\n assertEquals(result, expResult, 0.0001);\r\n }",
"public double getAngle()\n {\n return (AngleAverage);\n }",
"private static Complex fromMagnitudeAndAngle(double magnitude, double angle) {\n return new Complex(magnitude * Math.cos(angle), magnitude * Math.sin(angle));\n }",
"@Test\r\n public void testCalculateAngle1() {\r\n System.out.println(\"calculateAngle1\");\r\n DialDraw instance = new TachometerDraw();\r\n instance.setValue(36);\r\n double expResult = Math.toRadians(115.2);\r\n double result = instance.calculateAngle();\r\n assertEquals(result, expResult, 0.0001);\r\n }",
"Degree createDegree();",
"static Shape concaveArrow(double size) {\n \t\tPath2D path = new Path2D.Double();\n \t\tpath.moveTo(-size, 0.0);\n \t\tpath.lineTo(-size*1.7, -size/2.0);\n \t\tpath.lineTo(0.0, 0.0);\n \t\tpath.lineTo(-size*1.7,size/2.0);\n \t\tpath.closePath();\n \t\treturn path;\n \t}",
"public double getAngle() {\n\t\treturn 180 * (this.N - 2) / this.N;\n\t}"
]
| [
"0.724358",
"0.6709881",
"0.6653751",
"0.6530396",
"0.65010506",
"0.63329774",
"0.6120795",
"0.5975241",
"0.59660393",
"0.59492344",
"0.592903",
"0.5904767",
"0.5904767",
"0.5861691",
"0.5843675",
"0.5718069",
"0.5714016",
"0.5700477",
"0.55948406",
"0.55233425",
"0.5485941",
"0.54834086",
"0.54414374",
"0.54375124",
"0.53997767",
"0.5373019",
"0.5344294",
"0.5329782",
"0.5310456",
"0.5282407",
"0.526359",
"0.52518475",
"0.5247781",
"0.5239296",
"0.5236514",
"0.51873416",
"0.5182034",
"0.51770324",
"0.5173659",
"0.5164561",
"0.51644826",
"0.51498806",
"0.51384884",
"0.51342076",
"0.5115015",
"0.51114434",
"0.51000243",
"0.5098657",
"0.50964975",
"0.50891644",
"0.50834674",
"0.50756764",
"0.5074956",
"0.5074956",
"0.50700206",
"0.5061104",
"0.505773",
"0.50543404",
"0.5050246",
"0.50395834",
"0.5039106",
"0.5036727",
"0.5011848",
"0.50085557",
"0.5008315",
"0.50046194",
"0.50009817",
"0.49995854",
"0.49937257",
"0.49907497",
"0.49790195",
"0.49677077",
"0.49573284",
"0.49547046",
"0.49484223",
"0.49231035",
"0.4920232",
"0.49141076",
"0.49138463",
"0.49128556",
"0.49124798",
"0.49107465",
"0.49031934",
"0.4899984",
"0.4894429",
"0.48901558",
"0.48872593",
"0.48859364",
"0.48829725",
"0.48768052",
"0.48757577",
"0.4874214",
"0.48708332",
"0.48681757",
"0.48660105",
"0.4865276",
"0.48646742",
"0.4859669",
"0.48534676",
"0.4848179"
]
| 0.86679137 | 0 |
Returns a new object of class 'Angle Greater'. | AngleGreater createAngleGreater(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"AngleSmaller createAngleSmaller();",
"Angle createAngle();",
"AngleSubtract createAngleSubtract();",
"AngleEquals createAngleEquals();",
"AngleAdd createAngleAdd();",
"double getAngle();",
"double getAngle();",
"public double getAngle();",
"public double getAngle() { return angle; }",
"LengthGreater createLengthGreater();",
"public GreaterThanTest(String name) {\n\t\tsuper(name);\n\t}",
"public Flatbed(int angle){\r\n this.angle=angle;\r\n }",
"public AngleIF() {\n \t\t//_navx = new navx();\n \t\t//roboAccel = new RoboRioAccelerometers();\n \t}",
"public int getAngle() {\r\n return angle;\r\n }",
"public void setAngle( double a ) { angle = a; }",
"public float getAngle() {\n return angle;\n }",
"public double getAngle() {\n return angle;\n }",
"public double getAngle() {\n return angle;\n }",
"@Override\n public void reAngle() {\n }",
"public double getAngle(){\n\t\treturn this.angle;\n\t}",
"public double getAngle ()\n {\n return angle_;\n }",
"String getGreater();",
"public float getAngle() {\n return angle;\n }",
"public int getAngle() {\r\n\t\treturn angle;\r\n\t}",
"public double getAngle () {\n return super.getAngle() % 360D;\n }",
"public void rotateToAngle(int newAngle) {\n\t\tint diff = newAngle - getAngle();\n\t\tint diff1=Math.abs(diff-360);\n\t\tif (newAngle == getAngle()) {\n\t\t\tstopMotors();\n\t\t\treturn;\n\t\t}\n\t\twhile (Math.abs(getAngle() - newAngle) > 3&&opModeIsActive()) {\n\t\t\ttelemetry.addData(\"newangle\", newAngle);\n\t\t\ttelemetry.addData(\"getangle()\", getAngle());\n\t\t\ttelemetry.update();\n\t\t\tdiff = newAngle - getAngle();\n\t\t\tdiff1=Math.abs(getAngle() - newAngle);\n\t\t\tif ((diff > 0 && diff < 180) || (diff < 0 && Math.abs(diff) > 180)) {\n\n\t\t\t\tif(Math.abs(diff1)<13)\n\t\t\t\t\trotate(-0.06);\n\t\t\t\telse if(Math.abs(diff1)<50)\n\t\t\t\t\trotate(-0.1);\n\t\t\t\telse if(Math.abs(diff1)<160)\n\t\t\t\t\trotate(-0.5);\n\t\t\t\telse\n\t\t\t\t\trotate(-(0.00928571*Math.abs(diff1))+0.128571);\n\t\t\t} else {\n\n\t\t\t\tif(Math.abs(diff1)<13)\n\t\t\t\t\trotate(0.06);\n\t\t\t\telse if(Math.abs(diff1)<50)\n\t\t\t\t\trotate(0.1);\n\t\t\t\telse if(Math.abs(diff1)<160)\n\t\t\t\t\trotate(0.5);\n\t\t\t\telse\n\t\t\t\t\trotate((0.00928571*Math.abs(diff1))+0.128571);\n\t\t\t}\n\n\t\t}\n\t\tstopMotors();\n\n\t}",
"void decreaseAngle() {\n this.strokeAngle -= 3;\n this.updateAcc();\n this.updateStick();\n }",
"public int getAngle(){\n\t\treturn (int)angle;\n\t}",
"public InequalityTerm getGreaterTerm() {\n\t\treturn _greaterTerm;\n\t}",
"public double getMyAngle() {\n return myAngle- STARTING_ANGLE;\n }",
"public float getAngle() {\n return mAngle;\n }",
"public double getAngle() {\n\t\treturn angle;\n\t}",
"public double getAngle() {\n\t\treturn angle;\n\t}",
"public final void mGREATER() throws RecognitionException {\n\t\ttry {\n\t\t\tint _type = GREATER;\n\t\t\tint _channel = DEFAULT_TOKEN_CHANNEL;\n\t\t\t// /Users/Sarah/Projects/ontop/obdalib-core/src/main/java/it/unibz/krdb/obda/parser/Datalog.g:438:8: ( '>' )\n\t\t\t// /Users/Sarah/Projects/ontop/obdalib-core/src/main/java/it/unibz/krdb/obda/parser/Datalog.g:438:16: '>'\n\t\t\t{\n\t\t\tmatch('>'); \n\t\t\t}\n\n\t\t\tstate.type = _type;\n\t\t\tstate.channel = _channel;\n\t\t}\n\t\tfinally {\n\t\t\t// do for sure before leaving\n\t\t}\n\t}",
"public FloatColumn getAngleOutOfPlane() {\n return (FloatColumn) (isText ? textFields.computeIfAbsent(\"angle_out_of_plane\", FloatColumn::new) :\n getBinaryColumn(\"angle_out_of_plane\"));\n }",
"AngleResource inclination();",
"public double getGryoAngle() {\n\n\t\t// Normalize the angle\n\t\tdouble angle = gyro.getAngle() % 360;\n\n\t\tif (angle < 0) {\n\t\t\tangle = angle + 360;\n\t\t}\n\n\t\treturn angle;\n\t}",
"@JsonCreator\n public GreaterThanEquals(\n @JsonProperty(JSON_KEY_LEFT_OPERAND) final Fragment left,\n @JsonProperty(JSON_KEY_RIGHT_OPERAND)final Fragment right)\n throws InvalidArgumentException {\n\n if(left == null) {\n throw\n new InvalidArgumentException(\n \"The left operand is missing.\");\n }\n if(! (left instanceof Terminal)) {\n throw\n new InvalidArgumentException(\n \"The left operand is not a terminal value.\");\n }\n if(right == null) {\n throw\n new InvalidArgumentException(\n \"The right operand is missing.\");\n }\n if(! (right instanceof Terminal)) {\n throw\n new InvalidArgumentException(\n \"The right operand is not a terminal value.\");\n }\n\n this.left = (Terminal) left;\n this.right = (Terminal) right;\n }",
"public void setAngle(float angle){\n\n\t}",
"Comparison createComparison();",
"Comparison createComparison();",
"public void testGreaterThanElement() {\n\t // fail(\"testGreaterThanElement\");\n \tCircuit circuit = new Circuit();\n \tDouble x1 = 0.5;\n \tAnd and = (And) circuit.getFactory().getGate(Gate.AND);\n\t\tNot not = (Not) circuit.getFactory().getGate(Gate.NOT);\n\t\tGte gte1 = (Gte) circuit.getFactory().getGate(Gate.GTE);\n \tand.setLeftInput(x1);\n \tnot.setInput(x1);\n \tnot.eval();\n \tand.setRightInput(not.getOutput());\n\t\tand.eval();\n \tgte1.setLeftInput(and.getOutput());\n\t\tgte1.setRightInput(x1);\n \tassertEquals( new Double(0.0), gte1.eval());\n }",
"public final EObject ruleGreaterThanOperator() throws RecognitionException {\r\n EObject current = null;\r\n\r\n Token otherlv_1=null;\r\n\r\n enterRule(); \r\n \r\n try {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4643:28: ( ( () otherlv_1= '>' ) )\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4644:1: ( () otherlv_1= '>' )\r\n {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4644:1: ( () otherlv_1= '>' )\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4644:2: () otherlv_1= '>'\r\n {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4644:2: ()\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:4645:5: \r\n {\r\n if ( state.backtracking==0 ) {\r\n\r\n current = forceCreateModelElement(\r\n grammarAccess.getGreaterThanOperatorAccess().getGreaterThanOperatorAction_0(),\r\n current);\r\n \r\n }\r\n\r\n }\r\n\r\n otherlv_1=(Token)match(input,60,FOLLOW_60_in_ruleGreaterThanOperator10289); if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n\r\n \tnewLeafNode(otherlv_1, grammarAccess.getGreaterThanOperatorAccess().getGreaterThanSignKeyword_1());\r\n \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n leaveRule(); \r\n }\r\n }\r\n \r\n catch (RecognitionException re) { \r\n recover(input,re); \r\n appendSkippedTokens();\r\n } \r\n finally {\r\n }\r\n return current;\r\n }",
"void setAngle(double angle);",
"public int angleOX() {\n if (B.getY() == A.getY()) {\r\n return 0;\r\n } else if (A.getX() == B.getX()) {\r\n return 90;\r\n }\r\n else {\r\n float fi = ((float) (B.getY() - A.getY()) / (B.getX() - A.getX()));\r\n if (fi<0){\r\n return (int)(fi*(-1));\r\n }\r\n else return (int)(fi);\r\n }\r\n }",
"public int getOpeningAngle()\n {\n return this.openingAngle;\n }",
"public double getAngle() {\n\t\treturn 180 * (this.N - 2) / this.N;\n\t}",
"public static double rotation()\r\n\t{\r\n\t\treturn -(mxp.getAngle()/45);\r\n\t}",
"public static Direction fromAngle(double angle) {\n if (inRange(angle, 45, 135)) {\n return Direction.up;\n } else if (inRange(angle, 0, 45) || inRange(angle, 315, 360)) {\n return Direction.right;\n } else if (inRange(angle, 225, 315)) {\n return Direction.down;\n } else {\n return Direction.left;\n }\n\n }",
"AngleReference getAngRef();",
"public void setAngle(final float angle);",
"public Unit<Angle> microradian() {return microradian;}",
"public int getCurrentAngle(){\n return flatbed.currentAngle;\n }",
"public double getAngle()\n {\n return (AngleAverage);\n }",
"public Bearing reverse() {\n return Bearing.get( (this.bearing + 4) % 8);\n }",
"public double nextAngle()\n {\n return nextAngle();\n }",
"public float getAngle () {\n\t\treturn body.getAngle();\n\t}",
"@Test\r\n public void testCalculateAngle5() {\r\n System.out.println(\"calculateAngle5\");\r\n DialDraw instance = new TachometerDraw();\r\n instance.setValue(50);\r\n double expResult = Math.toRadians(90);\r\n double result = instance.calculateAngle();\r\n assertEquals(result, expResult, 0.0001);\r\n }",
"public double getAngleToTarget(){\n return 0d;\n }",
"public ImageRotator(int receivedAngle){angle = receivedAngle;}",
"@Test\r\n public void testCalculateAngle2() {\r\n System.out.println(\"calculateAngle2\");\r\n DialDraw instance = new TachometerDraw();\r\n instance.setValue(0);\r\n double expResult = Math.toRadians(180);\r\n double result = instance.calculateAngle();\r\n assertEquals(result, expResult, 0.0001);\r\n }",
"EDataType getAngleDegrees();",
"public final void mRANGLE() throws RecognitionException {\n try {\n int _type = RANGLE;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // C:\\\\Documents and Settings\\\\D043530\\\\runtime-workspace\\\\com.sap.ap.cts.editor\\\\generated\\\\generated\\\\Binding.g:2739:3: ( '>' )\n // C:\\\\Documents and Settings\\\\D043530\\\\runtime-workspace\\\\com.sap.ap.cts.editor\\\\generated\\\\generated\\\\Binding.g:2740:3: '>'\n {\n match('>'); if (state.failed) return ;\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }",
"AngleDistinct createAngleDistinct();",
"public interface AxisAngleBasics extends AxisAngleReadOnly, Orientation3DBasics, Clearable\n{\n /**\n * Gets the reference to the axis part of this axis-angle.\n *\n * @return the reference to the axis vector.\n */\n @Override\n UnitVector3DBasics getAxis();\n\n /**\n * Sets a new angle to this axis-angle.\n *\n * @param angle the new angle.\n */\n void setAngle(double angle);\n\n /**\n * Sets a new x-component for the axis of this axis-angle.\n *\n * @param x the new axis x-component.\n */\n default void setX(double x)\n {\n getAxis().setX(x);\n }\n\n /**\n * Sets a new y-component for the axis of this axis-angle.\n *\n * @param y the new axis y-component.\n */\n default void setY(double y)\n {\n getAxis().setY(y);\n }\n\n /**\n * Sets a new z-component for the axis of this axis-angle.\n *\n * @param z the new axis z-component.\n */\n default void setZ(double z)\n {\n getAxis().setZ(z);\n }\n\n /**\n * Sets the components of this axis-angle to represent a \"zero\" rotation. After calling the axis is\n * equal to {@link Axis3D#X} and the angle to 0.\n */\n @Override\n default void setToZero()\n {\n getAxis().set(Axis3D.X);\n setAngle(0.0);\n }\n\n /**\n * Sets the components of this axis-angle to {@link Double#NaN}.\n */\n @Override\n default void setToNaN()\n {\n getAxis().setToNaN();\n setAngle(Double.NaN);\n }\n\n /**\n * Tests if this axis-angle contains a {@link Double#NaN}.\n *\n * @return {@code true} if this axis-angle contains a {@link Double#NaN}, {@code false} otherwise.\n */\n @Override\n default boolean containsNaN()\n {\n return AxisAngleReadOnly.super.containsNaN();\n }\n\n /**\n * Sets each component of this axis-angle to its absolute value.\n */\n default void absolute()\n {\n getAxis().absolute();\n setAngle(Math.abs(getAngle()));\n }\n\n /**\n * Negates each component of this axis-angle.\n */\n default void negate()\n {\n getAxis().negate();\n setAngle(-getAngle());\n }\n\n /** {@inheritDoc} */\n @Override\n default void invert()\n {\n setAngle(-getAngle());\n }\n\n /**\n * Normalizes the axis of this axis-angle such that its norm is equal to 1 after calling this method\n * and its direction remains unchanged.\n * <p>\n * Edge cases:\n * <ul>\n * <li>if this axis-angle contains {@link Double#NaN}, this method is ineffective.\n * </ul>\n * </p>\n */\n @Override\n default void normalize()\n {\n getAxis().normalize();\n }\n\n /**\n * Multiplies the angle of this axis-angle by the given {@code scale}.\n *\n * @param scale the scaling factor to apply to the angle of this axis-angle.\n */\n default void scaleAngle(double scale)\n {\n setAngle(scale * getAngle());\n }\n\n /**\n * Sets this axis-angle to represent a new rotation of axis ({@code x}, {@code y}, {@code z}) and\n * angle of {@code angle}.\n *\n * @param x x-component of the new axis.\n * @param y y-component of the new axis.\n * @param z z-component of the new axis.\n * @param angle the new angle.\n */\n default void set(double x, double y, double z, double angle)\n {\n getAxis().set(x, y, z);\n setAngle(angle);\n }\n\n /** {@inheritDoc} */\n @Override\n default void set(Orientation3DReadOnly orientation3DReadOnly)\n {\n if (orientation3DReadOnly instanceof AxisAngleReadOnly)\n set((AxisAngleReadOnly) orientation3DReadOnly);\n else\n orientation3DReadOnly.get(this);\n }\n\n /**\n * Sets the axis and the angle of this axis-angle.\n *\n * @param axis the new axis. Not modified.\n * @param angle the new angle.\n */\n default void set(Vector3DReadOnly axis, double angle)\n {\n getAxis().set(axis);\n setAngle(angle);\n }\n\n /**\n * Sets this axis-angle to the same value as the given axis-angle {@code other}.\n *\n * @param other the other axis-angle. Not modified.\n */\n default void set(AxisAngleReadOnly other)\n {\n getAxis().set(other.getAxis());\n setAngle(other.getAngle());\n }\n\n /**\n * Sets this axis-angle to {@code other} and then calls {@link #negate()}.\n *\n * @param other the other axis-angle to copy the values from. Not modified.\n */\n default void setAndNegate(AxisAngleReadOnly other)\n {\n set(other);\n negate();\n }\n\n /**\n * Copies the values in the given array into this axis-angle as follows:\n * <ul>\n * <li>{@code this.setX(axisAngleArray[0]);}\n * <li>{@code this.setY(axisAngleArray[1]);}\n * <li>{@code this.setZ(axisAngleArray[2]);}\n * <li>{@code this.setAngle(axisAngleArray[3]);}\n * </ul>\n *\n * @param axisAngleArray the array containing the new values for this axis-angle. Not modified.\n */\n default void set(double[] axisAngleArray)\n {\n set(0, axisAngleArray);\n }\n\n /**\n * Copies the values in the given array into this axis-angle as follows:\n * <ul>\n * <li>{@code this.setX(axisAngleArray[startIndex + 0]);}\n * <li>{@code this.setY(axisAngleArray[startIndex + 1]);}\n * <li>{@code this.setZ(axisAngleArray[startIndex + 2]);}\n * <li>{@code this.setAngle(axisAngleArray[startIndex + 3]);}\n * </ul>\n *\n * @param startIndex the first index to start reading from in the array.\n * @param axisAngleArray the array containing the new values for this axis-angle. Not modified.\n */\n default void set(int startIndex, double[] axisAngleArray)\n {\n setX(axisAngleArray[startIndex++]);\n setY(axisAngleArray[startIndex++]);\n setZ(axisAngleArray[startIndex++]);\n setAngle(axisAngleArray[startIndex]);\n }\n\n /**\n * Copies the values in the given array into this axis-angle as follows:\n * <ul>\n * <li>{@code this.setX(axisAngleArray[0]);}\n * <li>{@code this.setY(axisAngleArray[1]);}\n * <li>{@code this.setZ(axisAngleArray[2]);}\n * <li>{@code this.setAngle(axisAngleArray[3]);}\n * </ul>\n *\n * @param axisAngleArray the array containing the new values for this axis-angle. Not modified.\n */\n default void set(float[] axisAngleArray)\n {\n set(0, axisAngleArray);\n }\n\n /**\n * Copies the values in the given array into this axis-angle as follows:\n * <ul>\n * <li>{@code this.setX(axisAngleArray[startIndex + 0]);}\n * <li>{@code this.setY(axisAngleArray[startIndex + 1]);}\n * <li>{@code this.setZ(axisAngleArray[startIndex + 2]);}\n * <li>{@code this.setAngle(axisAngleArray[startIndex + 3]);}\n * </ul>\n *\n * @param startIndex the first index to start reading from in the array.\n * @param axisAngleArray the array containing the new values for this axis-angle. Not modified.\n */\n default void set(int startIndex, float[] axisAngleArray)\n {\n setX(axisAngleArray[startIndex++]);\n setY(axisAngleArray[startIndex++]);\n setZ(axisAngleArray[startIndex++]);\n setAngle(axisAngleArray[startIndex]);\n }\n\n /** {@inheritDoc} */\n @Override\n default void setAxisAngle(double x, double y, double z, double angle)\n {\n set(x, y, z, angle);\n }\n\n /** {@inheritDoc} */\n @Override\n default void setQuaternion(double x, double y, double z, double s)\n {\n AxisAngleConversion.convertQuaternionToAxisAngle(x, y, z, s, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void setRotationVector(double x, double y, double z)\n {\n AxisAngleConversion.convertRotationVectorToAxisAngle(x, y, z, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void setYawPitchRoll(double yaw, double pitch, double roll)\n {\n AxisAngleConversion.convertYawPitchRollToAxisAngle(yaw, pitch, roll, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void setRotationMatrix(double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22)\n {\n AxisAngleConversion.convertMatrixToAxisAngle(m00, m01, m02, m10, m11, m12, m20, m21, m22, this);\n }\n\n @Override\n default void setToYawOrientation(double yaw)\n {\n getAxis().set(Axis3D.Z);\n setAngle(yaw);\n }\n\n @Override\n default void setToPitchOrientation(double pitch)\n {\n getAxis().set(Axis3D.Y);\n setAngle(pitch);\n }\n\n @Override\n default void setToRollOrientation(double roll)\n {\n getAxis().set(Axis3D.X);\n setAngle(roll);\n }\n\n /**\n * Selects a component of this axis-angle based on {@code index} and sets it to {@code value}.\n * <p>\n * For {@code index} values of 0, 1, and 2, the corresponding components are x, y, and z,\n * respectively, while 3 corresponds to the angle.\n * </p>\n *\n * @param index the index of the component to set.\n * @param value the new value of the selected component.\n * @throws IndexOutOfBoundsException if {@code index} ∉ [0, 3].\n */\n default void setElement(int index, double value)\n {\n switch (index)\n {\n case 0:\n setX(value);\n break;\n case 1:\n setY(value);\n break;\n case 2:\n setZ(value);\n break;\n case 3:\n setAngle(value);\n break;\n default:\n throw new IndexOutOfBoundsException(Integer.toString(index));\n }\n }\n\n /**\n * Multiplies this axis-angle by {@code other}.\n * <p>\n * this = this * other\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void multiply(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiply(this, other, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void append(Orientation3DReadOnly other)\n {\n AxisAngleTools.multiply(this, false, other, false, this);\n }\n\n /**\n * Sets this axis-angle to the multiplication of {@code aa1} and {@code aa2}.\n * <p>\n * this = aa1 * aa2\n * </p>\n *\n * @param aa1 the first axis-angle in the multiplication. Not modified.\n * @param aa2 the second axis-angle in the multiplication. Not modified.\n */\n default void multiply(AxisAngleReadOnly aa1, AxisAngleReadOnly aa2)\n {\n AxisAngleTools.multiply(aa1, aa2, this);\n }\n\n /**\n * Multiplies this axis-angle by the inverse of {@code other}.\n * <p>\n * this = this * other<sup>-1</sup>\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void multiplyInvertOther(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiplyInvertRight(this, other, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void appendInvertOther(Orientation3DReadOnly orientation)\n {\n AxisAngleTools.multiply(this, false, orientation, true, this);\n }\n\n /**\n * Sets this axis-angle to the multiplication of the inverse of {@code this} and {@code other}.\n * <p>\n * this = this<sup>-1</sup> * other\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void multiplyInvertThis(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiplyInvertLeft(this, other, this);\n }\n\n /**\n * Sets this axis-angle to the multiplication of the inverse of {@code this} and the inverse of\n * {@code other}.\n * <p>\n * this = this<sup>-1</sup> * other<sup>-1</sup>\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void multiplyInvertBoth(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiplyInvertBoth(this, other, this);\n }\n\n /**\n * Appends a rotation about the z-axis to this axis-angle.\n *\n * <pre>\n * / ux = 0 \\\n * this = this * | uy = 0 |\n * | uz = 1 |\n * \\ angle = yaw /\n * </pre>\n *\n * @param yaw the angle to rotate about the z-axis.\n */\n @Override\n default void appendYawRotation(double yaw)\n {\n AxisAngleTools.appendYawRotation(this, yaw, this);\n }\n\n /**\n * Appends a rotation about the y-axis to this axis-angle.\n *\n * <pre>\n * / ux = 0 \\\n * this = this * | uy = 1 |\n * | uz = 0 |\n * \\ angle = pitch /\n * </pre>\n *\n * @param pitch the angle to rotate about the y-axis.\n */\n @Override\n default void appendPitchRotation(double pitch)\n {\n AxisAngleTools.appendPitchRotation(this, pitch, this);\n }\n\n /**\n * Appends a rotation about the x-axis to this axis-angle.\n *\n * <pre>\n * / ux = 1 \\\n * this = this * | uy = 0 |\n * | uz = 0 |\n * \\ angle = roll /\n * </pre>\n *\n * @param roll the angle to rotate about the x-axis.\n */\n @Override\n default void appendRollRotation(double roll)\n {\n AxisAngleTools.appendRollRotation(this, roll, this);\n }\n\n /**\n * Pre-multiplies this axis-angle by {@code other}.\n * <p>\n * this = other * other\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void preMultiply(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiply(other, this, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void prepend(Orientation3DReadOnly orientation)\n {\n AxisAngleTools.multiply(orientation, false, this, false, this);\n }\n\n /**\n * Sets this axis-angle to the multiplication of the inverse of {@code other} and {@code this}.\n * <p>\n * this = other<sup>-1</sup> * this\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void preMultiplyInvertOther(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiplyInvertLeft(other, this, this);\n }\n\n /** {@inheritDoc} */\n @Override\n default void prependInvertOther(Orientation3DReadOnly orientation)\n {\n AxisAngleTools.multiply(orientation, true, this, false, this);\n }\n\n /**\n * Sets this axis-angle to the multiplication of {@code other} and the inverse of {@code this}.\n * <p>\n * this = other * this<sup>-1</sup>\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void preMultiplyInvertThis(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiplyInvertRight(other, this, this);\n }\n\n /**\n * Sets this axis-angle to the multiplication of the inverse of {@code other} and the inverse of\n * {@code this}.\n * <p>\n * this = other<sup>-1</sup> * this<sup>-1</sup>\n * </p>\n *\n * @param other the other axis-angle to multiply this. Not modified.\n */\n default void preMultiplyInvertBoth(AxisAngleReadOnly other)\n {\n AxisAngleTools.multiplyInvertBoth(other, this, this);\n }\n\n /**\n * Prepends a rotation about the z-axis to this axis-angle.\n *\n * <pre>\n * / ux = 0 \\\n * this = | uy = 0 | * this\n * | uz = 1 |\n * \\ angle = yaw /\n * </pre>\n *\n * @param yaw the angle to rotate about the z-axis.\n */\n @Override\n default void prependYawRotation(double yaw)\n {\n AxisAngleTools.prependYawRotation(yaw, this, this);\n }\n\n /**\n * Prepends a rotation about the y-axis to this axis-angle.\n *\n * <pre>\n * / ux = 0 \\\n * this = | uy = 1 | * this\n * | uz = 0 |\n * \\ angle = pitch /\n * </pre>\n *\n * @param pitch the angle to rotate about the y-axis.\n */\n @Override\n default void prependPitchRotation(double pitch)\n {\n AxisAngleTools.prependPitchRotation(pitch, this, this);\n }\n\n /**\n * Prepends a rotation about the x-axis to this axis-angle.\n *\n * <pre>\n * / ux = 1 \\\n * this = | uy = 0 | * this\n * | uz = 0 |\n * \\ angle = roll /\n * </pre>\n *\n * @param roll the angle to rotate about the x-axis.\n */\n @Override\n default void prependRollRotation(double roll)\n {\n AxisAngleTools.prependRollRotation(roll, this, this);\n }\n}",
"public double getTargetAngle(){\n return lastKnownAngle;\n }",
"public static BinaryExpression greaterThan(Expression expression0, Expression expression1) { throw Extensions.todo(); }",
"public Bearing rotate(Rotation rotation) {\n switch (rotation.min()) {\n case L90:\n return this.leftFrom();\n case R90:\n return this.rightFrom();\n case L180:\n case R180:\n return this.reverse();\n }\n return this; // matches NONE\n }",
"public int getBedAngle() {\n return truckBed.getAngle();\n }",
"public Bearing rightFrom() {\n return this.get(((this.bearing + 2) + 8) % 8);\n }",
"@Test\r\n public void testCalculateAngle1() {\r\n System.out.println(\"calculateAngle1\");\r\n DialDraw instance = new TachometerDraw();\r\n instance.setValue(36);\r\n double expResult = Math.toRadians(115.2);\r\n double result = instance.calculateAngle();\r\n assertEquals(result, expResult, 0.0001);\r\n }",
"public double getAngle() {\n\t\treturn navx.getAngle();\n\t}",
"public atan( ) {\n super(1);\n }",
"public AbstractBoolean greater(Interval other){\n\t\ttry {\n\t\t\t// If this.max > this.min then True\n\t\t\tif ((!this.low.equals(\"-Inf\"))\n\t\t\t\t\t&& (!other.high.equals(\"+Inf\"))\n\t\t\t\t\t&& Integer.parseInt(this.low) > Integer.parseInt(other.high))\n\t\t\t\treturn AbstractBoolean.True();\n\n\t\t\t// If this.min < other.max then False\n\t\t\tif ((!other.low.equals(\"-Inf\"))\n\t\t\t\t\t&& (!this.high.equals(\"+Inf\"))\n\t\t\t\t\t&& Integer.parseInt(this.high) < Integer.parseInt(other.low))\n\t\t\t\treturn AbstractBoolean.False();\n\n\t\t} catch (NumberFormatException e){\n\t\t\treturn AbstractBoolean.TopBool();\n\t\t}\n\n\t\treturn AbstractBoolean.TopBool();\n\t}",
"public JAngle(double angle) {\n GridBagLayout layout = new GridBagLayout();\n GridBagConstraints c = new GridBagConstraints();\n c.anchor = GridBagConstraints.EAST;\n c.fill = GridBagConstraints.BOTH;\n setLayout(layout);\n c.gridy = 0;\n\n JLabel ldeg = null;\n int unit = Coordinates.angleUnit();\n double d;\n switch(unit) {\n case Coordinates.RADIAN:\n deg = new JTextField(12);\n ldeg = new JLabel(\"rad\");\n deg.setText(String.valueOf(Math.round(angle * 10000000000.0) /\n\t\t 10000000000.0));\n break;\n case Coordinates.DEGRE:\n deg = new JTextField(14);\n ldeg = new JLabel(\"aa\");\n deg.setText(String.valueOf(Math.round(180.0 * angle / Math.PI *\n\t\t\t\t\t 10000000000.0) / 10000000000.0));\n break;\n case Coordinates.DEGMN:\n case Coordinates.DEGMNSEC:\n deg = new JTextField(3);\n String sgn = \"\";\n if(angle < 0.0) {\n\tangle = -angle;\n\tsgn = \"-\";\n }\n angle = 180.0 * angle / Math.PI;\n deg.setText(sgn + String.valueOf((int) angle));\n deg.setHorizontalAlignment(JTextField.RIGHT);\n ldeg = new JLabel(\"aa\");\n break;\n }\n c.gridx = 0;\n c.weightx = 0.0;\n\n layout.setConstraints(deg, c);\n add(deg);\n c.gridx = 1;\n c.weightx = 0.0;\n layout.setConstraints(ldeg, c);\n add(ldeg);\n\n if(unit == Coordinates.DEGMN || unit == Coordinates.DEGMNSEC) {\n mn = new JTextField((unit == Coordinates.DEGMN) ? 8 : 2);\n mn.setHorizontalAlignment(JTextField.RIGHT);\n c.gridx = 2;\n c.weightx = 0.0;\n layout.setConstraints(mn, c);\n add(mn);\n JLabel lmn = new JLabel(\"'\");\n c.gridx = 3;\n c.weightx = 0.0;\n layout.setConstraints(lmn, c);\n add(lmn);\n angle -= (int) angle;\n angle *= 60.0;\n \n if(unit == Coordinates.DEGMNSEC) {\n\tmn.setText(String.valueOf((int) angle));\n\tangle -= (int) angle;\n\tangle *= 60.0;\n\tsec = new JTextField((unit == Coordinates.DEGMN) ? 5 : 6);\n\tsec.setHorizontalAlignment(JTextField.RIGHT);\n\tc.gridx = 4;\n\tc.weightx = 0.0;\n\tlayout.setConstraints(sec, c);\n\tadd(sec);\n\tJLabel lsec = new JLabel(\"\\\"\");\n\tc.gridx = 5;\n\tc.weightx = 0.0;\n\tlayout.setConstraints(lsec, c);\n\tadd(lsec);\n\tsec.setText(String.valueOf(Math.round(angle * 10000.0) / 10000.0));\n }\n else {\n\tmn.setText(String.valueOf(Math.round(angle * 1000000.0) / 1000000.0));\n }\n }\n }",
"private int getAttackAngle() {\n\t\treturn (160 - (level * 10));\n\t}",
"public static double reverseAngle(double angle) {\n return 180 - angle;\n }",
"protected abstract D getUpper(R range);",
"public double betweenAngle(Coordinates a, Coordinates b, Coordinates origin);",
"public void bounce() {\n angle = -angle;\n }",
"public double toAngle()\n\t{\n\t\treturn Math.toDegrees(Math.atan2(y, x));\n\t}",
"public double findAngle() {\n return 0d;\n }",
"public static Transform newYRotation(float th){\n float sinth = (float) Math.sin(th);\n float costh = (float) Math.cos(th);\n return new Transform(new float[][]{\n {costh, 0.0f, sinth, 0.0f},\n {0.0f, 1.0f, 0.0f, 0.0f},\n {-sinth, 0.0f, costh, 0.0f},\n {0.0f, 0.0f, 0.0f, 1.0f}\n });\n }",
"public double getAngle() {\n\t\treturn this.position[2];\n\t}",
"public boolean greaterThan(PositionRadians p) {\n\t\tif (value > p.value) \n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}",
"public String polarRotation(double angle, double newAngle)\n {\n angle = angle + newAngle;\n \n String str = \"Rotated polar point:\" + angle;\n return str;\n }",
"double adjust_angle_rotation(double angle) {\n double temp;\n temp=angle;\n if(temp>90) {\n temp=180-temp;\n }\n return temp;\n }",
"public double getAngle() {\n\treturn CVector.heading(v1, v2);\n }",
"@Override\n\tprotected GreaterThan getFixture() {\n\t\treturn (GreaterThan)fixture;\n\t}",
"@Factory\n public static Matcher<QueryTreeNode> greaterThan(Matcher<QueryTreeNode> leftMatcher, Matcher<QueryTreeNode> rightMatcher) {\n return relation(leftMatcher, \">\", rightMatcher);\n }",
"AngleScalarMultiply createAngleScalarMultiply();",
"public void goToAngle(){\n currentAngle = getAverageVoltage2(); \r\n if (Math.abs(elevationTarget - currentAngle) <= .1){//TODO: check angle\r\n off();\r\n // System.out.println(\"off\");\r\n } else if (elevationTarget > currentAngle && elevationTarget < maxLimit){\r\n raise();\r\n //System.out.println(\"raise\");\r\n } else if (elevationTarget < currentAngle && elevationTarget > minLimit){\r\n //System.out.println(\"lower\");\r\n } \r\n \r\n }",
"public AngularMeasurement(double angle) {\r\n this(angle, getDefaultUnit());\r\n }",
"public void rotate(float angle);",
"private double getAngle(){\n //Get a new angle measurement\n angles = imu.getAngularOrientation(AxesReference.INTRINSIC, AxesOrder.ZYX, AngleUnit.DEGREES);\n //Get the difference between current angle measurement and last angle measurement\n double deltaAngle = angles.firstAngle - lastAngles.firstAngle;\n\n //Process the angle to keep it within (-180,180)\n //(Once angle passes +180, it will rollback to -179, and vice versa)\n if (deltaAngle < -180)\n deltaAngle += 360;\n else if (deltaAngle > 180)\n deltaAngle -= 360;\n\n //Add the change in angle since last measurement (deltaAngle)\n //to the change in angle since last reset (globalAngle)\n globalAngle += deltaAngle;\n //Set last angle measurement to current angle measurement\n lastAngles = angles;\n\n return globalAngle;\n }",
"double getAngle(int id);",
"public Loan() {\n this(2.5, 1, 1000);\n }",
"public Rotation to(Bearing target) {\n int diff = ((target.getValue() - this.getValue() + 8) % 8);\n switch (diff) {\n case 0:\n return Rotation.NONE;\n case 2:\n return Rotation.R90;\n case 4:\n return Rotation.R180;\n case 6:\n return Rotation.L90;\n default:\n throw new RuntimeException();\n// throw new RuntimeException(\"Not implemented...\");\n }\n }",
"void setAngle(int id, double value);",
"@Test\r\n public void testCalculateAngle4() {\r\n System.out.println(\"calculateAngle4\");\r\n DialDraw instance = new TachometerDraw();\r\n instance.setValue(90);\r\n double expResult = Math.toRadians(18);\r\n double result = instance.calculateAngle();\r\n assertEquals(result, expResult, 0.0001);\r\n }"
]
| [
"0.6876558",
"0.65664226",
"0.6464996",
"0.5873762",
"0.5723507",
"0.571531",
"0.571531",
"0.5714665",
"0.56697476",
"0.55449176",
"0.5383655",
"0.5341572",
"0.53368026",
"0.532502",
"0.5321804",
"0.5263114",
"0.5219681",
"0.5219681",
"0.5205314",
"0.51918095",
"0.5166225",
"0.51661104",
"0.51244706",
"0.51176596",
"0.5116975",
"0.50782496",
"0.50741935",
"0.5065256",
"0.50340736",
"0.50137734",
"0.5009702",
"0.50086915",
"0.50086915",
"0.4995328",
"0.49749997",
"0.49695414",
"0.49509037",
"0.49436226",
"0.49427947",
"0.49111414",
"0.49111414",
"0.4907601",
"0.49012652",
"0.48985764",
"0.48957932",
"0.48882505",
"0.48796806",
"0.4862144",
"0.48562145",
"0.4852246",
"0.48452923",
"0.48404452",
"0.4825967",
"0.48138604",
"0.4806606",
"0.48052529",
"0.4800393",
"0.47941193",
"0.4768827",
"0.476694",
"0.4764934",
"0.476439",
"0.475424",
"0.47506562",
"0.47488746",
"0.47329053",
"0.47244805",
"0.47215888",
"0.47178105",
"0.47150737",
"0.47105366",
"0.47102112",
"0.46969208",
"0.46947944",
"0.46888998",
"0.4688756",
"0.46884727",
"0.46864793",
"0.46848902",
"0.4683678",
"0.46731526",
"0.46721283",
"0.46705186",
"0.46695787",
"0.46682832",
"0.46520904",
"0.4651173",
"0.4641935",
"0.4639665",
"0.46212152",
"0.46187708",
"0.46121645",
"0.46100697",
"0.46080998",
"0.4605391",
"0.4598412",
"0.45810258",
"0.4579316",
"0.45781606",
"0.45734245"
]
| 0.88409954 | 0 |
Returns the package supported by this factory. | RaspiroverPackage getRaspiroverPackage(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"PackageType getRequiredPackage();",
"public PackageNode getPackage();",
"java.lang.String getPackage();",
"public String getPackageName();",
"public String getPackageName() {\n return pkg;\n }",
"String getPackageName();",
"public DsByteString getPackage() {\n return m_strPackage;\n }",
"java.lang.String getPackageName();",
"public String getPackageName() {\n\t\treturn pkgField.getText();\n\t}",
"private static String getPackage() {\n\t\tPackage pkg = EnergyNet.class.getPackage();\n\n\t\tif (pkg != null) {\n\t\t\tString packageName = pkg.getName();\n\n\t\t\treturn packageName.substring(0, packageName.length() - \".api.energy\".length());\n\t\t}\n\n\t\treturn \"ic2\";\n\t}",
"io.deniffel.dsl.useCase.useCase.Package getPackage();",
"public String getPackageInfomartion() {\n\t\treturn packageInfomartion;\n\t}",
"protected abstract String getPackageName();",
"default String getPackageName() {\n return declaringType().getPackageName();\n }",
"public String getPackageName() {\n return packageName.get();\n }",
"String getPackager();",
"public static String getPackageName() {\n return CELibHelper.sPackageName;\n }",
"public Short getPackageType() {\n\t\treturn packageType;\n\t}",
"String getPackage() {\n return mPackage;\n }",
"public String getBasePackage() {\n\t\treturn this.basePackage;\n\t}",
"String pkg();",
"public static String getPackageName() {\n return mPackageName;\n }",
"public String getAppPackage() {\n\t\treturn fnh.getOutputAppPackage();\n\t}",
"public abstract String getTargetPackage();",
"public abstract String getTargetPackage();",
"public java.lang.Boolean getServicePackageInfoSupported() {\r\n return servicePackageInfoSupported;\r\n }",
"EisPackage getEisPackage();",
"private String getPkgName () {\n return context.getPackageName();\n }",
"@NonNull\n RepoPackage getPackage();",
"public UMLPackageBean getPackage() {\n return umlPkg;\n }",
"public String getPackagedJava();",
"public String getPackageName() {\n return packageName;\n }",
"public String getPackageName() {\n return packageName;\n }",
"PiviPackage getPiviPackage();",
"public Package.Builder getBuilder() {\n return pkgBuilder;\n }",
"public String getPackageName() {\n\t\treturn this.PackageName;\n\t}",
"public String getPackaging();",
"public String getPackageName() {\n\t\treturn packageName;\n\t}",
"public String getPackage() {\n return carrierPackage;\n }",
"public abstract String packageName();",
"PackageConfiguration getPackageConfiguration();",
"protected final Product getProduct() {\n Product.Builder product = new Product.Builder()\n .implementationTitle(getClass())\n .implementationVersion(getClass());\n Optional.ofNullable(getClass().getPackage())\n .flatMap(p -> Optional.ofNullable(p.getSpecificationVersion()))\n .map(specVersion -> \"(specification \" + specVersion + \")\")\n .ifPresent(product::comment);\n return product.build();\n }",
"public String getPackageName() {\n JavaType.FullyQualified fq = TypeUtils.asFullyQualified(qualid.getType());\n if (fq != null) {\n return fq.getPackageName();\n }\n String typeName = getTypeName();\n int lastDot = typeName.lastIndexOf('.');\n return lastDot < 0 ? \"\" : typeName.substring(0, lastDot);\n }",
"public PersistedBmmPackage getPackage(String packageName) {\n return packages.get(packageName.toUpperCase());\n }",
"public abstract String getAndroidPackage();",
"NfrPackage getNfrPackage();",
"@NonNull\n public String getPackageName() {\n return mPackageName;\n }",
"public String getBasePackage() {\n\t\treturn DataStore.getInstance().getBasePackage();\n\t}",
"public static String getBukkitPackage() {\n return Bukkit.getServer().getClass().getPackage().getName().split(\"\\\\.\")[3];\n }",
"boolean hasPackageName();",
"public String getPackageName() {\n Object ref = packageName_;\n if (ref instanceof String) {\n return (String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n packageName_ = s;\n }\n return s;\n }\n }",
"ApiPackage getApiPackage();",
"public String getPackageName() {\n final var lastDotIdx = name.lastIndexOf('.');\n\n if (lastDotIdx > 0) {\n return name.substring(0, lastDotIdx);\n } else {\n throw new CodeGenException(String.format(\"Couldn't determine package name of '%s'\", name));\n }\n }",
"public String getPackageName() {\n if (mPackageName == null) {\n try {\n mPackageName = mSessionBinder.getPackageName();\n } catch (RemoteException e) {\n Log.d(TAG, \"Dead object in getPackageName.\", e);\n }\n }\n return mPackageName;\n }",
"public String getPackageName() {\n Object ref = packageName_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n packageName_ = s;\n }\n return s;\n } else {\n return (String) ref;\n }\n }",
"IrSpecificPackage getIrSpecificPackage();",
"public String getPackages() {\n\t\treturn this.packages;\n\t}",
"public String getPackageName() {\n return mAppEntry.info.packageName;\n }",
"com.google.protobuf.ByteString\n getPackageBytes();",
"public static String getCraftBukkitPackage() {\n \t\t// Ensure it has been initialized\n \t\tgetMinecraftPackage();\n \t\treturn CRAFTBUKKIT_PACKAGE;\n \t}",
"NgtPackage getNgtPackage();",
"public String getProductPack() {\n return (String)getAttributeInternal(PRODUCTPACK);\n }",
"public String getModelPackageStr() {\n\t\tString thepackage = getModelXMLTagValue(\"package\");\n\t\treturn thepackage != null ? thepackage + \".\" : \"\";\n\t}",
"VmPackage getVmPackage();",
"String packageName() {\n return name;\n }",
"private PackageService getPackageService() {\n\t\treturn packageService;\n\t}",
"private Package_c getPackage(final String name) {\n\t\tPackage_c communication = Package_c.PackageInstance(modelRoot,\n\t\t\t\tnew ClassQueryInterface_c() {\n\n\t\t\t\t\tpublic boolean evaluate(Object candidate) {\n\t\t\t\t\t\tPackage_c selected = (Package_c) candidate;\n\t\t\t\t\t\treturn selected.getName().equals(name);\n\t\t\t\t\t}\n\n\t\t\t\t});\n\t\treturn communication;\n\t}",
"ParkingPackage getParkingPackage();",
"public int getWMCPackaged(){\r\n\t\t \r\n\t\treturn mccabe.getWMCPackage();\t\t\r\n\t}",
"private BasePackage getPackageModel()\r\n {\r\n return packageCartService.getBasePackage();\r\n }",
"NassishneidermanPackage getNassishneidermanPackage();",
"PackageClause getPackageClause();",
"public String getPackageDesc() {\n\t\treturn packageDesc;\n\t}",
"public String getPkgId() {\n return pkgId;\n }",
"public String getVersionsSupported();",
"public static String getMinecraftPackage() {\n \t\t// Speed things up\n \t\tif (MINECRAFT_FULL_PACKAGE != null) {\n \t\t\treturn MINECRAFT_FULL_PACKAGE;\n \t\t}\n \n \t\tfinal Server craftServer = Bukkit.getServer();\n \n \t\t// This server should have a \"getHandle\" method that we can use\n \t\tif (craftServer != null) {\n \t\t\ttry {\n \t\t\t\tfinal Class<?> craftClass = craftServer.getClass();\n \t\t\t\tfinal Method getHandle = craftClass.getMethod(\"getHandle\");\n \n \t\t\t\tfinal Class<?> returnType = getHandle.getReturnType();\n \t\t\t\tfinal String returnName = returnType.getCanonicalName();\n \n \t\t\t\t// The return type will tell us the full package, regardless of\n \t\t\t\t// formating\n \t\t\t\tCRAFTBUKKIT_PACKAGE = getPackage(craftClass.getCanonicalName());\n \t\t\t\tMINECRAFT_FULL_PACKAGE = getPackage(returnName);\n \t\t\t\treturn MINECRAFT_FULL_PACKAGE;\n \n \t\t\t} catch (final SecurityException e) {\n \t\t\t\tthrow new RuntimeException(\n \t\t\t\t\t\t\"Security violation. Cannot get handle method.\", e);\n \t\t\t} catch (final NoSuchMethodException e) {\n \t\t\t\tthrow new IllegalStateException(\n \t\t\t\t\t\t\"Cannot find getHandle() method on server. Is this a modified CraftBukkit version?\",\n \t\t\t\t\t\te);\n \t\t\t}\n \n \t\t} else {\n \t\t\tthrow new IllegalStateException(\n \t\t\t\t\t\"Could not find Bukkit. Is it running?\");\n \t\t}\n \t}",
"protected EPackage getEPackage() {\r\n return Wps10Package.eINSTANCE;\r\n }",
"CommunicationsprogramsPackage getCommunicationsprogramsPackage();",
"Shipment_Package getShipment_Package();",
"TggPackage getTggPackage();",
"public boolean isPackage()\n {\n ensureLoaded();\n return m_flags.isPackage();\n }",
"List<String> getSystemPackages();",
"public String getSupportedVersion() {\n return supportedVersion;\n }",
"ICpPackInfo getPackInfo();",
"TypePackage getTypePackage();",
"public String getPackingType() {\n return (String)getAttributeInternal(PACKINGTYPE);\n }",
"GramaticaPackage getGramaticaPackage();",
"default String getPackageId() {\n return getIdentifier().getPackageId();\n }",
"Quality_requirements_metamodelPackage getQuality_requirements_metamodelPackage();",
"MatchModelPackage getMatchModelPackage();",
"public String getProjectPackageName() {\n\t\treturn projectPackageName;\n\t}",
"ICpPack getPack();",
"public PackageName getRootPackageName() {\n return rootPackageName;\n }",
"public GeoPackage getGeoPackage() {\n\t\treturn this.geoPackage;\n\t}",
"HiphopsPackage getHiphopsPackage();",
"ReactNativePackage getReactNativePackage();",
"protected UMLPackage getUMLPackage() {\r\n return currentPackage;\r\n }",
"MystPackage getMystPackage();",
"public Short getPackageSeries() {\n\t\treturn packageSeries;\n\t}",
"public String getPackageId()\n {\n return packageId;\n }",
"ThingMLPackage getThingMLPackage();"
]
| [
"0.7029857",
"0.68230575",
"0.6817219",
"0.67516345",
"0.6717388",
"0.6703754",
"0.6697297",
"0.66774565",
"0.6634728",
"0.65557617",
"0.65180886",
"0.6499772",
"0.6495322",
"0.6481164",
"0.63756794",
"0.6350059",
"0.63377434",
"0.633683",
"0.63264704",
"0.63133883",
"0.63118196",
"0.6281368",
"0.62734336",
"0.62504584",
"0.62504584",
"0.6244375",
"0.62171626",
"0.6210761",
"0.619644",
"0.61867255",
"0.61756927",
"0.61654246",
"0.61654246",
"0.6152878",
"0.61365056",
"0.6130048",
"0.6118628",
"0.61093354",
"0.6094638",
"0.60564953",
"0.6038937",
"0.60077196",
"0.5988382",
"0.59846073",
"0.597061",
"0.5965969",
"0.5942434",
"0.59418213",
"0.59382224",
"0.59285915",
"0.59227574",
"0.59183055",
"0.59182566",
"0.5895353",
"0.5890824",
"0.58838147",
"0.58806646",
"0.5869664",
"0.58509165",
"0.58471614",
"0.58405256",
"0.5839526",
"0.5838443",
"0.58271325",
"0.5817514",
"0.5816952",
"0.58033895",
"0.5787063",
"0.57795864",
"0.57614625",
"0.5756924",
"0.57565063",
"0.5755537",
"0.57532024",
"0.5744626",
"0.573415",
"0.5731977",
"0.5725794",
"0.57250094",
"0.57176286",
"0.5715682",
"0.57154924",
"0.57042706",
"0.5702328",
"0.568859",
"0.5684974",
"0.5683121",
"0.56747895",
"0.56722355",
"0.5665499",
"0.5656669",
"0.5646242",
"0.5642507",
"0.5641586",
"0.56387126",
"0.56383026",
"0.5633531",
"0.56316864",
"0.5612671",
"0.5609713",
"0.5605203"
]
| 0.0 | -1 |
dfs get all combination | public void dfs(String[] letters, String digits, int index, String tmp, ArrayList<String> rnt){
if(index==digits.length()){
rnt.add(tmp);
return;
}
int num = digits.charAt(index) - '0';
String curr = letters[num];
//case 1: current length is 0
if(curr.length()==0)
dfs(letters, digits, index+1, tmp, rnt);
//case 2: not 0, try all combinations
else{
for(int i=0; i<curr.length(); i++){
String newtmp = tmp + curr.charAt(i);
dfs(letters, digits, index+1, newtmp, rnt);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public List<List<Integer>> subsets(int[] nums) {\n int size = nums.length;\n if (size == 0) {\n return new LinkedList();\n }\n\n List<List<Integer>> res = new LinkedList<>();\n dfs(nums, 0, new LinkedList<Integer>(), res);\n return res;\n\n }",
"public List<List<Integer>> subsetsWithDup(int[] nums) {\n \n if (nums == null || nums.length == 0) {\n res.add(new ArrayList()); \n return res; \n } \n \n Arrays.sort(nums); \n \n List<Integer> buffer = new ArrayList(); \n combinationDFS(nums, 0, buffer, true); \n \n return res; \n }",
"void dfs(){\n // start from the index 0\n for (int vertex=0; vertex<v; vertex++){\n // check visited or not\n if (visited[vertex]==false){\n Explore(vertex);\n }\n }\n }",
"public void dfs(LinkedList<Node>[] adjList){\n Set<Integer> visited = new HashSet<>();\n\n for(LinkedList<Node> node: adjList){\n Node curr = node.getFirst();\n if(!visited.contains(curr)){\n ArrayList<Integer> components = new ArrayList<>();\n components = getConnectedComponets(curr, visited, components);\n System.out.printf(\"do something %s\", components.toString());\n }\n }\n }",
"@Override\n public void dfs() {\n\n }",
"private static void dfsComponents() {\r\n\t\tprintThis(\"Standard DFS Demo (the input graph must be UNDIRECTED)\");\r\n\t\tfor (int i = 0; i < V; i++) { // for each vertex i in [0..V-1]\r\n\t\t\tif (dfs_num[i] == DFS_WHITE) { // if that vertex is not visited yet\r\n\t\t\t\tSystem.out.printf(\"Component %d:\", ++numComp);\r\n\t\t\t\tdfs(i);\r\n\t\t\t\tSystem.out.printf(\"\\n\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.printf(\"There are %d connected components\\n\", numComp);\r\n\t}",
"public List<List<Integer>> subsets(int[] nums) {\n List<List<Integer>> res = new ArrayList();\n if (nums == null) return res;\n \n dfs(nums, 0, new ArrayList(), res);\n \n return res;\n }",
"public List<List<Integer>> subsets(int[] nums) {\n List<List<Integer>> res = new ArrayList();\n if (nums == null) return res;\n \n dfs(nums, 0, new ArrayList(), res);\n \n return res;\n }",
"private List<List<Node>> combinationHelper(int k, int n) {\n\t\tList<List<Node>> res = new ArrayList<List<Node>>();\n\t\tList<int[]> combRes = combinationHelperImpl(k, n);\n\t\tfor (int[] elem : combRes) {\n\t\t\tArrays.sort(elem);\n\t\t\tList<Node> tmp = new ArrayList<Node>();\n\t\t\tfor (int i : elem) {\n\t\t\t\ttmp.add(queryNodes.get(i));\n\t\t\t}\n\t\t\tres.add(new ArrayList<Node>(tmp));\n\t\t}\n\t\treturn res;\n\t}",
"public void solve() throws IOException {\n int n = ni(); \n int ax = ni(), ay = ni(), bx = ni(), by = ni(), cx = ni(), cy = ni(); \n boolean[][] visited = new boolean[n + 1][n + 1];\n if (dfs(n,ax,ay,bx,by,cx,cy,visited))\n System.out.println(\"YES\");\n else\n System.out.println(\"NO\");\n }",
"public List<List<Integer>> combine(int n, int k) {\n List<List<Integer>> res = new ArrayList<>();\n dfs(res,1,k,new ArrayList<>(),n);\n return res;\n }",
"public void DFS() {\r\n for (int i = 0; i < vertexNum; i++) {\r\n DFS(i);\r\n }\r\n }",
"private List<List<Integer>> dfs(int[][] graph, int start, Map<Integer, List<List<Integer>>> memo) {\n if (start == graph.length - 1) {\n return Collections.singletonList(Collections.singletonList(start));\n } else {\n List<List<Integer>> cur = new ArrayList<>();\n for (int dep : graph[start]) {\n List<List<Integer>> next = dfs(graph, dep, memo);\n for (List<Integer> path : next) {\n List<Integer> temp = new ArrayList<>();\n temp.add(start);\n temp.addAll(path);\n cur.add(temp);\n }\n }\n return memo.put(start, cur);\n }\n }",
"public static void main(String[] args) {\n \tScanner sc = new Scanner(System.in);\n \n\t\tint t=sc.nextInt();\n\t\twhile(t-->0) {\n\t\t\t\n int n=sc.nextInt();\n\t\t\tint k=sc.nextInt();\n\t\t\tcurr_cc=0;\n\t\t\t\n\t\t\tadj=new ArrayList<>();\n\t\t\tfor(int i=0;i<=n;i++){\n adj.add(new ArrayList<Integer>());\n vis[i]=0;\n\t\t\t\tcc[i]=0;\n } \n\t\t\t\n ArrayList<Pair<Integer,Integer>> edgeList=new ArrayList<>();\n\t\t\t\n\t\t\twhile(k-->0) {\n\t\t\t\tint a=sc.nextInt();\n\t\t\t\tString op=sc.next();\n\t\t\t\tint b=sc.nextInt();\n\t\t\t\tif(op.equals(\"=\")) {\n\t\t\t\t\tadj.get(a).add(b);\n\t\t\t\t\tadj.get(b).add(a);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t edgeList.add(new Pair<Integer,Integer>(a,b));\n \n\t\t\t}\n\t\t\t\n\t\t\tfor(int i=1;i<=n;i++) {\n\t\t\t\tif(vis[i]==0) {\n\t\t\t\t\tcurr_cc++;\n\t\t\t\t\tdfs(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tboolean flag=true;\n\t\t\tfor(int i=0;i<edgeList.size();i++) {\n\t\t\t\tint a=edgeList.get(i).getKey();\n\t\t\t\tint b=edgeList.get(i).getValue();\n\t\t\t\tif(cc[a] == cc[b])\n\t\t\t\t{ flag=false;\n\t\t\t\t break;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n if(flag) System.out.println(\"YES\");\n\t\t\telse System.out.println(\"NO\");\n\t\t\t\n }\n\n\t}",
"public static void main(String[] args) {\n ArrayList<Integer> arr = new ArrayList<Integer>(); //각 영역의 넓이를 저장할 ArrayList 생성\n AdjMatrics_DFS b = new AdjMatrics_DFS();\n int[][] map = {{1,1,1,0,1},\n {1,1,0,0,1},\n {1,0,1,1,0},\n {0,0,1,1,1},\n {0,0,1,1,1}};\n boolean[][] check = new boolean[map.length][map[0].length]; //방문한 곳을 체크하기 위한 배열 행렬 생성\n\n for(int i=0; i<map.length; i++) {\n //System.out.println(\"다음 찾기 시작\");\n //(0,0) 부터 탐색 시작 후 1을 만나면 넓이 구하기 시작\n for(int j=0; j<map[i].length; j++) {\n if(map[i][j] == 1) {\n b.dfs(i,j,check,map);\n arr.add(cnt);\n cnt = 1;\n }\n // 아닌경우 continue\n else\n continue;\n }\n }\n //\tSystem.out.println(\"프로그램 종료\");\n System.out.println(\"arr : \"+ arr);\n }",
"public List<List<Integer>> subsetsWithDup(int[] nums) {\n \n if (nums == null || nums.length == 0) {\n res.add(new ArrayList()); \n return res; \n } \n \n Arrays.sort(nums); \n \n List<Integer> buffer = new ArrayList(); \n normalDFS(nums, 0, buffer); \n \n return res; \n }",
"private void getCombination(Set<Integer> set, int n, int r)\n {\n // A temporary array to store all combination\n // one by one\n int data[] = new int[r];\n\n // Print all combination using temprary\n // array 'data[]\n Integer[] setArray = new Integer[set.size()];\n set.toArray(setArray);\n\n combinationUtil(setArray, n, r, 0, data, 0);\n //System.out.println();\n }",
"public List<List<Integer>> combinationSum(int[] candidates, int target) {\n\n List<List<Integer>> result = new ArrayList<>();\n List<Integer> current = new ArrayList<>();\n dfs(candidates ,target, 0 ,0, current , result);\n return result;\n }",
"public static void main(String args[]){\n\n Scanner sc= new Scanner(System.in);\n int v=sc.nextInt();\n int e=sc.nextInt();\n int matrix[][] =new int[v][v];\n\n for(int i=0;i<e;i++){\n int v1=sc.nextInt();\n int v2=sc.nextInt();\n\n matrix[v1][v2]=1;\n matrix[v2][v1]=1;\n \n }\n\n dfsComponents(matrix);\n }",
"public List<List<Integer>> allPathsSourceTarget(int[][] graph) {\n \n boolean[] visited = new boolean[graph.length];\n \n List<Integer> paths = new ArrayList();\n paths.add(0);\n \n List<List<Integer>> allPaths = new ArrayList();\n \n dfs(0,graph.length-1, paths,allPaths,visited,graph);\n \n return allPaths;\n }",
"public MyArrayList<MyArrayList<Node>> DFS() {\n t = 0;\n for (int i = 0; i < nodes.size(); i++) {\n Node node = nodes.get(i);\n // reset all nodes in the graph to the initial DFS state\n node.setColor(Color.WHITE);\n node.setD(0);\n node.setF(0);\n node.setParent(null);\n }\n MyArrayList<MyArrayList<Node>> components = new MyArrayList<>();\n for (int i = 0; i < nodes.size(); i++) {\n Node node = nodes.get(i);\n if (node.getColor() == Color.WHITE) {\n // each time we start from a vertex here we are starting a new DFS component\n MyArrayList<Node> component = new MyArrayList<>();\n dfsVisit(node, component);\n components.add(component);\n }\n }\n return components;\n }",
"public static ArrayList<String> connectors2(Graph g) {\n boolean[] visits = new boolean[g.members.length]; \n for (int i=0;i<=g.members.length-1;i++) {\n \tvisits[i]=false;\n }\n int[] dfsnum = new int[g.members.length];\n int[] back = new int[g.members.length];\n ArrayList<String> answer = new ArrayList<String>();\n\n //driver portion\n for (Person person : g.members) {\n //if it hasn't been visited\n if (visits[g.map.get(person.name)]==false){\n //for different islands\n dfsnum = new int[g.members.length];\n dfs(g.map.get(person.name), g.map.get(person.name), g, visits, dfsnum, back, answer);\n }\n }\n \n //check if vertex has one neighbor\n for (int i = 0; i < answer.size(); i++) {\n Friend ptr = g.members[g.map.get(answer.get(i))].first;\n //counts number of neighbors\n int count = 0;\n while (ptr != null) {\n ptr = ptr.next;\n count++;\n }\n if (count == 1) answer.remove(i);\n if (count == 0) answer.remove(i);\n } \n for (Person member : g.members) {\n if (member.first!=null&& member.first.next == null) {\n if (answer.contains(g.members[member.first.fnum].name)==false)\n \t\t answer.add(g.members[member.first.fnum].name);\n }\n }\n answer=modify(answer,g);\n if (answer==null||answer.size()==0) return null;\n return answer;\n }",
"public static void main(String[] args) {\n /* *************** */\n /* * QUESTION 7 * */\n /* *************** */\n /* *************** */\n\n for(double p=0; p<1; p+=0.1){\n for(double q=0; q<1; q+=0.1){\n int res_1 = 0;\n int res_2 = 0;\n for(int i=0; i<100; i++){\n Graph graph_1 = new Graph();\n graph_1.generate_full_symmetric(p, q, 100);\n //graph_2.setVertices(new ArrayList<>(graph_1.getVertices()));\n Graph graph_2 = (Graph) deepCopy(graph_1);\n res_1+=graph_1.resolve_heuristic_v1().size();\n res_2+=graph_2.resolve_heuristic_v2();\n }\n res_1/=100;\n System.out.format(\"V1 - f( %.1f ; %.1f) = %s \\n\", p, q, res_1);\n res_2/=100;\n System.out.format(\"V2 - f( %.1f ; %.1f) = %s \\n\", p, q, res_2);\n }\n }\n\n }",
"public void dfs() {\n\t\tfor (Vertice v : vertices) {\n\t\t\tv.setVisited(false);\n\t\t}\n\t\tfor (Vertice v : vertices) {\n\t\t\tif (!v.getVisited()) {\n\t\t\t\tVisitar(v, -1);\n\t\t\t}\n\t\t}\n\t}",
"private static List<List<Integer[]>> getDIOCrossConnect() {\n List<List<Integer[]>> pairs = new ArrayList<List<Integer[]>>();\n List<Integer[]> setA =\n Arrays.asList(\n new Integer[][] {\n {DIOCrossConnectA1, DIOCrossConnectA2},\n {DIOCrossConnectA2, DIOCrossConnectA1}\n });\n pairs.add(setA);\n\n List<Integer[]> setB =\n Arrays.asList(\n new Integer[][] {\n {DIOCrossConnectB1, DIOCrossConnectB2},\n {DIOCrossConnectB2, DIOCrossConnectB1}\n });\n pairs.add(setB);\n // NOTE: IF MORE DIOCROSSCONNECT PAIRS ARE ADDED ADD THEM HERE\n return pairs;\n }",
"private List<Set<V>> findAllComponents(Graph<V, E> g, Set<V> F)\n {\n return new ConnectivityInspector<>(new AsSubgraph<>(g, F)).connectedSets();\n }",
"public static void main(String[]args) throws Exception{\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\r\n\t\tint n = Integer.parseInt(br.readLine());\r\n\t\tint m = Integer.parseInt(br.readLine());\r\n\t\tarr = new int[n+1][n+1];\r\n\t\tvisited = new boolean[n+1];\r\n\t\t\r\n\t\tStringTokenizer st;\r\n\t\tfor(int i=0; i<m; i++) {\r\n\t\t\tst = new StringTokenizer(br.readLine());\r\n\t\t\tint f = Integer.parseInt(st.nextToken());\r\n\t\t\tint b = Integer.parseInt(st.nextToken());\r\n\t\t\tarr[f][b] = 1;\r\n\t\t\tarr[b][f] = 1;\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tdfs(1);\r\n\t\tSystem.out.println(result);\r\n\t}",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint n = sc.nextInt();\n\t\tarr = new int[n][n];\n\t\ttmp = new int[n][n];\n\t\t\n\t\tint max = 0;\n\t\t\n\t\tfor(int i = 0; i < n; i++) {\n\t\t\tfor(int j = 0; j < n; j++) {\n\t\t\t\tarr[i][j] = sc.nextInt();\n\t\t\t\tmax = max > arr[i][j] ? max : arr[i][j];\n\t\t\t}\n\t\t}\n\t\t\n\t\tint cnt = 0;\n\t\tint res = 0;\n\t\t\n\t\tfor(int i = 0; i < max; i++) {\n\t\t\ttmp = new int[n][n];\n\t\t\tcnt = 0;\n\t\t\t\n\t\t\tfor(int j = 0; j < n; j++) {\n\t\t\t\tfor(int k = 0; k < n; k++) {\n\t\t\t\t\tdfs(i, j, k);\n\t\t\t\t\tif(ans > 0) {\n//\t\t\t\t\t\tSystem.out.println(k + \", \" + j + \" \" + ans);\n\t\t\t\t\t\tcnt++;\n\t\t\t\t\t}\n\t\t\t\t\tans = 0;\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t\t\n\t\t\tres = res > cnt ? res : cnt;\n\t\t}\n\t\t\n\t\tSystem.out.println(res);\n\t\t\t\n\t}",
"public List<List<Integer>> combinationSum3(int k, int n) {\n List<List<Integer>> res = new ArrayList<>();\n int min = 0, max = 0;\n for (int i = 1; i <= k; i++) {\n min += i;\n max += (10 - i);\n }\n if (n > max || n < min) return res;\n List<Integer> list = new ArrayList<>();\n dfs(k, n, res, list, 1);\n return res;\n }",
"public static List<List<Integer>> combinationSumRepeatedlyUsed(int[] nums, int target) {\n List<List<Integer>> lists = new ArrayList<>();\n\n if (nums == null || nums.length == 0) {\n return lists;\n }\n\n List<Integer> currentList = new ArrayList<>();\n\n dfs(nums, 0, target, currentList, lists);\n\n return lists;\n }",
"public static void botched_dfs3(Graph g, int s) {\n int cpt = 0;\n\n Stack<Integer> stack = new Stack<Integer>();\n boolean visited[] = new boolean[g.vertices()];\n stack.push(s);\n while (!stack.empty()) {\n System.out.println(\"Capacité : \" + stack.capacity());\n int u = stack.pop();\n if (!visited[u]) {\n visited[u] = true;\n System.out.println(u);\n for (Edge e : g.next(u))\n if (!visited[e.to]) {\n stack.push(e.to);\n cpt++;\n }\n }\n }\n }",
"private void DFS() {\n\t\tfor(Node node: nodeList) {\r\n\t\t\tif(!node.isVisited())\r\n\t\t\t\tdfsVisit(node);\r\n\t\t}\r\n\t}",
"public static void main(String[] args) throws NumberFormatException, IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\tString str = br.readLine();\n\t\tint t = Integer.parseInt(str);\n\t\tfor(int i = 0; i<t; i++) {\n\t\t\tString s = br.readLine();\n\t\t\tN = Integer.parseInt(s);\n\t\t\ts = br.readLine();\n\t\t\tint M = Integer.parseInt(s);\n\t\t\tarr = new int[N+2][N+2];\n\t\t\tfor(int j = 0; j<M; j++) {\n\t\t\t\ts = br.readLine();\n\t\t\t\tStringTokenizer st = new StringTokenizer(s);\n\t\t\t\tint a = Integer.parseInt(st.nextToken());\n\t\t\t\tint b = Integer.parseInt(st.nextToken());\n\t\t\t\tarr[a][b] = 1;\n\t\t\t\tarr[b][a] = 1;\n\t\t\t}\n\t\t\tfor(int x = 1; x<N+1; x++) {\n\t\t\t\tfor(int y = 1; y<N+1; y++) {\n\t\t\t\t\tSystem.out.print(arr[x][y]);\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t\tfor(int x = 1; x<N+1; x++) {\n\t\t\t\tvisited = new boolean[N+1];\n\t\t\t\tlist =new ArrayList<>();\n\t\t\t\tfor(int y = 1; y<N+1; y++) {\n\t\t\t\t\tif(arr[x][y]==1 && !visited[x]) {\n\t\t\t\t\t\tdfs(x,y);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tSystem.out.println(list.size());\n\t\t\t}\n\t\t}\n\t}",
"@SuppressWarnings(\"serial\")\r\n\tprivate void fcbuild() {\n\t\tfor (int i = 0; i < keys.size(); i++) {\r\n\t\t\tString s = keys.get(i);\r\n\t\t\tfc.add(new ArrayList<String>() {\r\n\t\t\t\t{\r\n\t\t\t\t\tadd(sharedV.get(s).get(0));\r\n\t\t\t\t\tadd(s);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tfor (int i = 0; i < sharedV.size(); i++) {\r\n\t\t\tfor (int j = i + 1; j < sharedV.size(); j++) {\r\n\t\t\t\tif (sharedV.get(keys.get(i)).containsAll(sharedV.get(keys.get(j)))\r\n\t\t\t\t\t\t&& sharedV.get(keys.get(j)).containsAll(sharedV.get(keys.get(i)))) {\r\n\r\n\t\t\t\t\tString s = sharedV.get(keys.get(i)).get(0); // c1\r\n\t\t\t\t\tint ii = i;\r\n\t\t\t\t\tint jj = j;\r\n\t\t\t\t\tfc.add(new ArrayList<String>() {\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tadd(s);\r\n\t\t\t\t\t\t\tadd(keys.get(ii));\r\n\t\t\t\t\t\t\tadd(keys.get(jj));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\toptimizefc();\r\n\r\n\t}",
"public List<List<Integer>> combinationSum(int[] candidates, int target) {\n Arrays.sort(candidates);\n List<List<Integer>> list = new ArrayList<>();\n \n List<Integer> path = new ArrayList();\n dfs(target, path, list, candidates, 0);\n \n return list;\n }",
"public static void main(String[] args) throws Exception {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\tN = Integer.parseInt(in.readLine());\n\t\tint temp = 0;\n\t\tcnt = 1;\n\n\t\tint map[][] = new int[N + 1][N + 1];\n\t\tc = new int[N * N + 1];\n\n\t\tString temStr;\n\t\tfor (int i = 1; i <= N; i++) {\n\t\t\ttemStr = in.readLine();\n\t\t\tfor (int j = 1; j <= N; j++) {\n\t\t\t\tif (temStr.charAt(j - 1) == '1')\n\t\t\t\t\tmap[i][j] = -1;\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 1; i <= N; i++) {\n\t\t\tfor (int j = 1; j <= N; j++) {\n\t\t\t\tif (map[i][j] == -1 && map[i][j] != cnt) {\n\t\t\t\t\tdfs(i, j, map);\n\t\t\t\t\tcnt++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(cnt - 1);\n\t\tArrays.sort(c);\n\t\tfor (int i = 1; i < c.length; i++) {\n\t\t\tif (c[i] != 0)\n\t\t\t\tSystem.out.println(c[i]);\n\t\t}\n\t}",
"public void getAllPaths(Graph<Integer> graph) {\n\t\tTopologicalSort obj = new TopologicalSort();\r\n\t\tStack<Vertex<Integer>> result = obj.sort(graph);\r\n\t\t\r\n\t\t// source (one or multiple) must lie at the top\r\n\t\twhile(!result.isEmpty()) {\r\n\t\t\tVertex<Integer> currentVertex = result.pop();\r\n\t\t\t\r\n\t\t\tif(visited.contains(currentVertex.getId())) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tstack = new Stack<Vertex<Integer>>();\r\n\t\t\tSystem.out.println(\"Paths: \");\r\n\t\t\tvisited = new ArrayList<Long>();\r\n\t\t\tdfs(currentVertex);\r\n\t\t\t//System.out.println(stack);\r\n\t\t\t//GraphUtil.print(stack);\t\t\t\r\n\t\t}\r\n\r\n\t}",
"public List<List<Integer>> combinationSum2(int[] candidates, int target) {\n Arrays.sort(candidates);\n List<List<Integer>> result = new ArrayList<>();\n List<Integer> current = new ArrayList<>();\n dfs2(candidates ,target, 0 ,0, current , result);\n return result;\n }",
"private List<Branch> findBranchs()\r\n\t{\t\r\n\t\tList<Branch> localBranchs = new ArrayList<>();\r\n\t\tHashMap<String, Node> destinationNodes = new HashMap<>();\r\n\t\t\r\n\t\t// Percorre todos os arcos da rede\r\n\t\tfor (Edge edge: this.getEdges())\r\n\t\t{\t\r\n\t\t\t// Se ha carga no no destino do arco, este no � uma folha da rede\r\n\t\t\tif (edge != null && edge.getDestinationNode().getLoads().size() > 0) \r\n\t\t\t{\t\r\n\t\t\t\t// Verifica se h� mais de um arco com a mesma carga\r\n\t\t\t\tif (!destinationNodes.containsKey(edge.getDestinationNode().getLabel()))\r\n\t\t\t\t{\t\t\t\t\t\r\n\t\t\t\t\tBranch branch = new Branch(edge.getDestinationNode().getLabel());\r\n\t\t\t\t\tbranch.addEdges(edge);\r\n\t\t\t\t\tEdge newEdge = edge.getReference();\r\n\t\t\t\t\tdestinationNodes.put(edge.getDestinationNode().getLabel(), edge.getDestinationNode());\r\n\t\t\t\t\t\r\n\t\t\t\t\t// percorre os elementos amontantes do no e monta o laco\r\n\t\t\t\t\twhile (newEdge != null) \r\n\t\t\t\t\t{\t\t\r\n\t\t\t\t\t\tbranch.addEdges(newEdge.getReference());\r\n\t\t\t\t\t\tnewEdge = newEdge.getReference();\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\tlocalBranchs.add(branch);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t\r\n\t\r\n\t\treturn localBranchs; \r\n\t}",
"public static void botched_dfs2(Graph g, int s) {\n Stack<Integer> stack = new Stack<Integer>();\n boolean visited[] = new boolean[g.vertices()];\n stack.push(s);\n System.out.println(s);\n visited[s] = true;\n while (!stack.empty()) {\n int u = stack.pop();\n for (Edge e : g.next(u))\n if (!visited[e.to]) {\n System.out.println(e.to);\n visited[e.to] = true;\n stack.push(e.to);\n }\n }\n }",
"public static void main(String[] args) {\n\t\tString vertex=\"abcdefghij\";\n\t\tString edge=\"bdegachiabefbc\";\n\t\tchar[] vc=vertex.toCharArray();\n\t\tchar[] ec=edge.toCharArray();\n\t\tint[] v=new int[vc.length];\n\t\tfor (int i = 0; i < v.length; i++) {\n\t\t\tv[i]=vc[i]-'a'+1;\n\t\t}\n\t\tint[] e=new int[ec.length];\n\t\tfor (int i = 0; i < e.length; i++) {\n\t\t\te[i]=ec[i]-'a'+1;\n\t\t}\t\t\n\t\t\n\t\tDS_List ds_List=new DS_List(v.length);\n//\t\tfor (int i = 0; i < v.length; i++) {\n//\t\t\tds_List.make_set(v[i]);\n//\t\t}\n//\t\tfor (int i = 0; i < e.length; i=i+2) {\n//\t\t\tif (ds_List.find_set(e[i])!=ds_List.find_set(e[i+1])) {\n//\t\t\t\tds_List.union(e[i], e[i+1]);\n//\t\t\t}\n//\t\t}\n\t\tds_List.connect_components(v, e);\n\t\tfor (int i = 0; i < v.length; i++) {\n\t\t\tSystem.out.print(ds_List.find_set(v[i])+\" \");\n\t\t}\n\t\tSystem.out.println();\n\t\tSystem.out.println(ds_List.same_component(v[1], v[2]));\n\t}",
"public static void main(String[] args) throws Exception\n\t{\n\t\tBufferedReader reader=new BufferedReader(new InputStreamReader(new FileInputStream(new File(\"D:\\\\data.txt\")) ,\"GBK\") );\n\t\tint[] nums = {0};\n\t\tList<List<Integer>> z=subsetsWithDup(nums);\n\t\tfor(List<Integer> t:z){\n\t\t\tfor(int x: t)\n\t\t\t\tSystem.out.print(x+\" \");\n\t\t\tSystem.out.println();\n\t\t}\n\t\treader.close();\n\t}",
"public void DFS(List<List<Integer>> result, List<Integer> temp, int n, int start){\n for(int i = start; i * i <= n; i++){\n //we skip undividable factor\n if(n%i != 0) continue;\n \n //found a pair of factor, we can add them to temp list to build a valid factor combination\n List<Integer> copy = new ArrayList<Integer>(temp);\n //since i <= n/i, we will add i first, then n/i\n copy.add(i);\n copy.add(n/i);\n result.add(copy);\n \n //then we try to decompose larger n/i factor, and our later factors shall not be > i, since i has been inserted into list \n temp.add(i);\n DFS(result, temp, n/i, i);\n temp.remove(temp.size() - 1);\n }\n }",
"private Set<Integer>[] getKernelDAG(List<Integer>[] adjacent) {\n Set<Integer>[] adjacentComponents = (HashSet<Integer>[]) new HashSet[sccCount];\n for (int i = 0; i < adjacentComponents.length; i++) {\n adjacentComponents[i] = new HashSet<>();\n }\n\n for (int vertexId = 0; vertexId < adjacent.length; vertexId++) {\n int currentComponent = sccIds[vertexId];\n\n for (int neighbor : adjacent[vertexId]) {\n if (currentComponent != sccIds[neighbor]) {\n adjacentComponents[currentComponent].add(sccIds[neighbor]);\n }\n }\n }\n return adjacentComponents;\n }",
"public List<String> permutations(String set) {\n List<String> result = new ArrayList<>();\n if (set == null) {\n return result;\n }\n char[] array = set.toCharArray();\n DFS(array, 0, result);\n return result;\n }",
"private static void dfsBribe(int n, List<Integer>[] ch, long[] w) {\n if (ch[n].size() == 0){\n In[n] = w[n];\n OutD[n] = Long.MAX_VALUE;\n OutU[n] = 0;\n }\n //recurrance case: non.leaf, do dfs for all subordinates then calculate In, OutUp & OutDown.\n else{\n for (int c:ch[n])\n dfsBribe(c, ch, w); //running once for each child thereby O(N)\n In[n] = w[n];\n for (int c:ch[n]){ //O(N) running time\n In[n] += OutU[c];\n OutU[n] += Math.min(In[c], OutD[c]);\n OutD[n] += Math.min(In[c], OutD[c]);\n }\n OutD[n] += delta(n, ch); //add delta for no in Children\n }\n\n }",
"public static void main(String[] args) {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint V = sc.nextInt();\n\t\tint E = sc.nextInt();\n\n\t\tList<Integer>[]adjList = new ArrayList[10010];\n\t\tList<Integer>[]reverseAdjList = new ArrayList[10010];\n\n\t\tList<List<Integer>>scc = new ArrayList<List<Integer>>();\n\t\tint visited[] = new int[10010];\n\n\t\tfor(int i = 1 ; i <= V ; i++){\n\t\t\tadjList[i] = new ArrayList<Integer>();\n\t\t\treverseAdjList[i] = new ArrayList<Integer>();\n\t\t}\n\n\t\tfor(int i = 1 ; i <= E ; i++){\n\n\t\t\tint start = sc.nextInt();\n\t\t\tint end = sc.nextInt();\n\t\t\tadjList[start].add(end);\n\t\t\treverseAdjList[end].add(start);\n\t\t}\n\n\n\t\t//선작업 DFS 스택에 담음.\n\t\tStack <Integer>stack = new Stack<Integer>();\n\t\tfor(int i = 1 ; i <= V ; i++){\n\t\t\tif(visited[i] == 0){\n\t\t\t\tdfs(i,visited,stack,adjList);\n\t\t\t}\n\t\t}\n\n\n\t\t//후작업 역 DFS\n\t\tvisited = new int[10010];\n\n\t\tint r = 0;\n\t\twhile(!stack.isEmpty()){\n\n\t\t\tint here = stack.peek();\n\t\t\tstack.pop();\n\t\t\tif(visited[here] == 1){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tscc.add(new ArrayList<Integer>());\n\t\t\t++r;\n\t\t\treverseDFS(here, r-1, visited, scc, reverseAdjList);\n\n\t\t}\n\n\t\tSystem.out.println(r);\n\t\tfor(int i = 0 ; i < r ; i++){\n\t\t\tList <Integer>temp = scc.get(i);\n\t\t\tCollections.sort(temp);\n\t\t}\n\n\t\tscc.sort(new Comparator<List<Integer>>() {\n\t\t\t@Override\n\t\t\tpublic int compare(List<Integer> o1, List<Integer> o2) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tif(o1.get(0)< o2.get(0)){\n\t\t\t\t\treturn -1;\n\t\t\t\t}else if(o1.get(0) > o2.get(0)){\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t});\n\n\t\t\tfor(List <Integer>list : scc){\n\t\t\t\tfor(int i = 0 ; i < list.size() ; i++){\n\t\t\t\t\tSystem.out.print(list.get(i) + \" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"-1\");\n\t\t\t}\n\n\t}",
"private void dfs(Node s, HashSet<Integer> visited) {\n\t\tif(visited.contains(s.id)) {\n\t\t\treturn;\n\t\t}\n\t\tSystem.out.println(s.id);\n\t\tvisited.add(s.id);\n\t\tfor(Node n :s.adj) {\n\t\t\tdfs(n,visited);\n\t\t}\n\t}",
"@Override\r\n\tpublic List<Combination> getAllCombination() {\n\t\tString hql = \"from Combination\";\r\n\t\treturn (List<Combination>) getHibernateTemplate().find(hql);\r\n\t}",
"private List<List<Edge>> dfs(List<Point> vertices, int start, int end) {\n\n /**\n * used for the answer returned\n */\n List<List<Edge>> allTessellations = new ArrayList<>();\n\n /**\n * Base Case: Return an empty list if current polygon is already a\n * triangle. If the difference between the end vertices and the start\n * vertices is less than 3, there can't be any possible tessellations\n * made\n */\n if (end - start < 3) {\n return allTessellations;\n }\n\n /**\n * iterate through the current polygon\n */\n for (int k = start + 1; k < end; k++) {\n\n /**\n * placeholder for storing possible tessellations\n */\n List<Edge> temp = new ArrayList<>();\n\n /**\n * Add the length of the internal edge to the list \n *\n * An internal edge can only be internal if the k vertices is either\n * not the adjacent vertices of the start or end point of the\n * current tessellation of the polygon.\n */\n if (start + 1 < k) {\n temp.add(new Edge(new Point(vertices.get(k).getxPos(), vertices.get(k).getyPos()),\n new Point(vertices.get(start).getxPos(), vertices.get(start).getyPos())));\n }\n\n if (end - 1 > k) {\n temp.add(new Edge(new Point(vertices.get(k).getxPos(), vertices.get(k).getyPos()),\n new Point(vertices.get(end).getxPos(), vertices.get(end).getyPos())));\n }\n\n /**\n * get the left and right tessellations\n */\n List<List<Edge>> left = dfs(vertices, start, k);\n List<List<Edge>> right = dfs(vertices, k, end);\n\n /**\n * if the left and right tessellations are empty then only add the\n * temp list\n * \n * if not, then get the cartesian product of each side to get every \n * possible tessellation with both lists\n */\n if (left.isEmpty() && right.isEmpty()) \n allTessellations.add(temp);\n else\n allTessellations.addAll(combine(left, right, temp));\n\n }\n\n return allTessellations;\n\n }",
"void DFS() {\n \t\n \t// Mark all the vertices as not visited(set as false by default in java) \n \tboolean visited[] = new boolean[V];\n \t\n \t// Call the recursive helper function to print DFS traversal \n // starting from all vertices one by one \n \tfor (int i=0; i<V; i++) { \n \t\t if (visited[i] == false)\n \t\t\t DFSUtil(i, visited);\n \t}\n }",
"private DFSResult dfs(HashSet<Integer> exploredEdges, int letter) {\r\n int nLoops = 0;\r\n int nNodes = 0;\r\n int maxConnectedLetter = 0;\r\n int maxConnections = -1;\r\n\r\n Stack<Integer> chain = new Stack<>();\r\n\r\n matrix[letter][letter] = 1;\r\n chain.push(letter);\r\n\r\n while(!chain.isEmpty()) {\r\n int u = chain.pop();\r\n nNodes++;\r\n\r\n int nConnections = 0;\r\n\r\n Iterator it = getIterator(u);\r\n\r\n Integer vertex;\r\n\r\n while((vertex = it.next()) != null) {\r\n nConnections++;\r\n\r\n if(exploredEdges.contains(this.matrix[u][vertex])) {\r\n continue;\r\n }\r\n\r\n exploredEdges.add(this.matrix[u][vertex]);\r\n\r\n if(matrix[vertex][vertex] == 0) {\r\n matrix[vertex][vertex] = 1;\r\n chain.push(vertex);\r\n } else if(matrix[vertex][vertex] == 1) {\r\n nLoops++;\r\n }\r\n }\r\n\r\n if(nConnections > maxConnections) {\r\n maxConnections = nConnections;\r\n maxConnectedLetter = u;\r\n }\r\n }\r\n\r\n return new DFSResult(nLoops, nNodes, maxConnectedLetter);\r\n }",
"public static void main(String[] args) throws IOException {\n\n // read in graph\n Scanner scanner = new Scanner(System.in);\n int n = scanner.nextInt(), m = scanner.nextInt();\n ArrayList<Integer>[] graph = new ArrayList[n];\n for (int i = 0; i < n; i++)\n graph[i] = new ArrayList<>();\n\n for (int i = 0; i < m; i++) {\n scanner.nextLine();\n int u = scanner.nextInt() - 1, v = scanner.nextInt() - 1; // convert to 0 based index\n graph[u].add(v);\n graph[v].add(u);\n }\n\n int[] dist = new int[n];\n Arrays.fill(dist, -1);\n // partition the vertices in each of the components of the graph\n for (int u = 0; u < n; u++) {\n if (dist[u] == -1) {\n // bfs\n Queue<Integer> queue = new LinkedList<>();\n queue.add(u);\n dist[u] = 0;\n while (!queue.isEmpty()) {\n int w = queue.poll();\n for (int v : graph[w]) {\n if (dist[v] == -1) { // unvisited\n dist[v] = (dist[w] + 1) % 2;\n queue.add(v);\n } else if (dist[w] == dist[v]) { // visited and form a odd cycle\n System.out.println(-1);\n return;\n } // otherwise the dist will not change\n }\n }\n }\n\n }\n\n BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));\n // vertices with the same dist are in the same group\n List<Integer>[] groups = new ArrayList[2];\n groups[0] = new ArrayList<>();\n groups[1] = new ArrayList<>();\n for (int u = 0; u < n; u++) {\n groups[dist[u]].add(u + 1);\n }\n for (List<Integer> g: groups) {\n writer.write(String.valueOf(g.size()));\n writer.newLine();\n for (int u: g) {\n writer.write(String.valueOf(u));\n writer.write(' ');\n }\n writer.newLine();\n }\n\n writer.close();\n\n\n }",
"public static void main(String[] args) throws NumberFormatException, IOException {\n\t\tBufferedReader in=new BufferedReader(new InputStreamReader(System.in));\n\t\tint tc=Integer.parseInt(in.readLine());\n\t\tfor(int t=1;t<=tc;t++) {\n\t\t\tint answer=0;\n\t\t\tn=Integer.parseInt(in.readLine());\n\t\t\tm=Integer.parseInt(in.readLine());\n\t\t\tmap1=new boolean[n+1][n+1];\n\t\t\tmap2=new boolean[n+1][n+1];\n\t\t\t\n\t\t\tfor(int i=0;i<m;i++) {\n\t\t\t\tStringTokenizer token=new StringTokenizer(in.readLine());\n\t\t\t\tint from=Integer.parseInt(token.nextToken());\n\t\t\t\tint to=Integer.parseInt(token.nextToken());\n\t\t\t\tmap1[from][to]=true;\n\t\t\t\tmap2[to][from]=true;\n\t\t\t}\n\t\t\tfor(int i=1;i<=n;i++) {\n\t\t\t\tv1=new boolean[n+1];\n\t\t\t\tv2=new boolean[n+1];\n\t\t\t\tnum1=0;\n\t\t\t\tnum2=0;\n\t\t\t\tdfs1(i);\n\t\t\t\tdfs2(i);\n\t\t\t\tif(num1+num2==n-1)answer++;\n\t\t\t}\n\t\t\tSystem.out.println(\"#\"+t+\" \"+answer);\n\t\t\t\n\t\t}\n\t}",
"@Override\r\n public Set<List<String>> findAllPaths(int sourceId, int targetId, int reachability) {\r\n //all paths found\r\n Set<List<String>> allPaths = new HashSet<List<String>>();\r\n //collects path in one iteration\r\n Set<List<String>> newPathsCollector = new HashSet<List<String>>();\r\n //same as the solution but with inverted edges\r\n Set<List<String>> tmpPathsToTarget = new HashSet<List<String>>();\r\n //final solution\r\n Set<List<String>> pathsToTarget = new HashSet<List<String>>();\r\n \r\n String[] statementTokens = null; \r\n Set<Integer> allProcessedNodes = new HashSet<Integer>(); //to avoid duplicates\r\n List<String> statementsFound = new ArrayList<String>();\r\n \r\n for (int i = 0; i < reachability; i++) {\r\n if (i == 0) { \r\n Collection<String> inEdges = jungCompleteGraph.getInEdges(sourceId);\r\n for (String inEdge: inEdges) {\r\n \r\n statementsFound = new ArrayList<String>();\r\n statementTokens = inEdge.split(\"->\");\r\n int inNodeId = Integer.parseInt(statementTokens[0]);\r\n //allProcessedNodes.add(inNodeId); \r\n //Incoming nodes are reversed\r\n statementsFound.add(new StringBuilder(inEdge).reverse().toString());\r\n allPaths.add(statementsFound);\r\n if (inNodeId == targetId) tmpPathsToTarget.add(statementsFound);\r\n }\r\n \r\n Collection<String> outEdges = jungCompleteGraph.getOutEdges(sourceId);\r\n \r\n for (String outEdge: outEdges) {\r\n \r\n statementsFound = new ArrayList<String>();\r\n statementTokens = outEdge.split(\"->\");\r\n int outNodeId = Integer.parseInt(statementTokens[2]);\r\n statementsFound.add(outEdge);\r\n allPaths.add(statementsFound);\r\n if (outNodeId == targetId) tmpPathsToTarget.add(statementsFound);\r\n \r\n }\r\n \r\n } else {\r\n newPathsCollector = new HashSet<List<String>>();\r\n\r\n for (List<String> statements: allPaths) {\r\n allProcessedNodes = new HashSet<Integer>(); //to avoid duplicates\r\n int lastNodeInPath = 0;\r\n \r\n for (String predicate: statements) {\r\n if (predicate.contains(\">-\")) {\r\n statementTokens = predicate.split(\">-\");\r\n allProcessedNodes.add(Integer.parseInt(\r\n new StringBuilder(statementTokens[0]).reverse().toString()));\r\n allProcessedNodes.add(Integer.parseInt(\r\n new StringBuilder(statementTokens[2]).reverse().toString()));\r\n lastNodeInPath = Integer.parseInt(\r\n new StringBuilder(statementTokens[2]).reverse().toString());\r\n } else {\r\n statementTokens = predicate.split(\"->\"); \r\n allProcessedNodes.add(Integer.parseInt(statementTokens[0]));\r\n allProcessedNodes.add(Integer.parseInt(statementTokens[2]));\r\n lastNodeInPath = Integer.parseInt(statementTokens[2]);\r\n }\r\n }\r\n \r\n Collection<String> inEdges = jungCompleteGraph.getInEdges(lastNodeInPath);\r\n for (String inEdge: inEdges) {\r\n \r\n statementsFound = new ArrayList<String>();\r\n statementsFound.addAll(statements);\r\n statementTokens = inEdge.split(\"->\");\r\n int inNodeId = Integer.parseInt(statementTokens[0]);\r\n if (allProcessedNodes.contains(inNodeId)) continue;\r\n \r\n //Incoming nodes are reversed \r\n statementsFound.add(new StringBuilder(inEdge).reverse().toString());\r\n newPathsCollector.add(statementsFound);\r\n if (inNodeId == targetId) tmpPathsToTarget.add(statementsFound);\r\n \r\n }\r\n \r\n Collection<String> outEdges = jungCompleteGraph.getOutEdges(lastNodeInPath);\r\n for (String outEdge: outEdges) {\r\n \r\n statementsFound = new ArrayList<String>();\r\n statementsFound.addAll(statements);\r\n statementTokens = outEdge.split(\"->\");\r\n int outNodeId = Integer.parseInt(statementTokens[2]);\r\n if (allProcessedNodes.contains(outNodeId)) continue;\r\n \r\n //Incoming nodes are reversed \r\n statementsFound.add(outEdge);\r\n newPathsCollector.add(statementsFound);\r\n if (outNodeId == targetId) tmpPathsToTarget.add(statementsFound);\r\n }\r\n }\r\n allPaths.addAll(newPathsCollector);\r\n }\r\n \r\n //System.out.println(\"*****End of iteration \" + i);\r\n //System.out.println(\"#SIZE OF allPaths: \" + allPaths.size());\r\n int numItems = 0;\r\n for (List<String> currList: allPaths) {\r\n numItems = numItems + currList.size();\r\n }\r\n //System.out.println(\"#NUMBER OF ELEMS OF ALL LISTS: \" + numItems);\r\n //System.out.println(\"#SIZE OF tmpPathsToTarget : \" + tmpPathsToTarget.size());\r\n }\r\n \r\n //We need to reverse back all the predicates\r\n for (List<String> statements: tmpPathsToTarget) { \r\n List<String> fixedStatements = new ArrayList<String>(); \r\n for (int i = 0; i < statements.size(); i++) { \r\n String statement = statements.get(i); \r\n if (statement.contains(\">-\")) {\r\n fixedStatements.add(new StringBuilder(statement).reverse().toString());\r\n } else {\r\n fixedStatements.add(statement);\r\n } \r\n }\r\n pathsToTarget.add(fixedStatements);\r\n }\r\n return pathsToTarget;\r\n }",
"private void computeAllPaths()\n {\n for (Station src : this.graph.stations)\n {\n List<Station> visited = new ArrayList<Station>();\n computePathsForNode(src, null, null, visited);\n }\n Print.printTripList(this.tripList);\n }",
"public void dfs() {\n int currentVertexIndex = 0;\r\n dfsStack.push(0);\r\n vertexList[0].wasVisited = true;\r\n System.out.println(vertexList[dfsStack.peek()]);\r\n while (dfsStack.top != -1) {\r\n\r\n\r\n currentVertexIndex = this.getAdjUnvisitedVert(dfsStack.peek());\r\n if (currentVertexIndex != -1) {\r\n dfsStack.push(currentVertexIndex);\r\n vertexList[currentVertexIndex].wasVisited = true;\r\n System.out.println(vertexList[dfsStack.peek()]);\r\n\r\n\r\n } else {\r\n currentVertexIndex = dfsStack.pop();\r\n\r\n }\r\n }\r\n// reset wasVisted\r\n for (Vertex x : vertexList) {\r\n x.wasVisited = false;\r\n }\r\n }",
"public static void main(String[] args) {\n\t\tList<List<Integer>> res = combinationSum2(new int[]{1,1,2,2,4,5,5,6,7,8,9}, 17);\n\t\t//expected:<[[8, 9], [1, 7, 9], [2, 6, 9], [2, 7, 8], [4, 5, 8], [4, 6, 7], [5, 5, 7], \n\t\t//[1, 1, 6, 9], [1, 1, 7, 8], [1, 2, 5, 9], [1, 2, 6, 8], [1, 4, 5, 7], [1, 5, 5, 6], \n\t\t//[2, 2, 4, 9], [2, 2, 5, 8], [2, 2, 6, 7], [2, 4, 5, 6], [1, 1, 2, 4, 9], [1, 1, 2, 5, 8], \n\t\t//[1, 1, 2, 6, 7], [1, 1, 4, 5, 6], [1, 2, 2, 4, 8], [1, 2, 2, 5, 7], [1, 2, 4, 5, 5], [1, 1, 2, 2, 4, 7], \n\t\t//[1, 1, 2, 2, 5, 6]]>\n\t\t//but was:\n\t\tfor (int i = 0; i < res.size(); i++) {\n\t\t\tfor (int num : res.get(i)) {\n\t\t\t\tSystem.out.print(num + \", \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"static void floodfill() {\r\n\t\tprintThis(\"Flood Fill Demo (the input graph must be UNDIRECTED)\");\r\n\t\tnumComp = 0;\r\n\t\tdfs_num = new int[V];\r\n\t\tArrays.fill(dfs_num, DFS_WHITE);\r\n\t\tfor (int i = 0; i < V; i++)\r\n\t\t\tif (dfs_num[i] == DFS_WHITE)\r\n\t\t\t\tfloodfill(i, ++numComp);\r\n\t\tfor (int i = 0; i < V; i++)\r\n\t\t\tSystem.out.printf(\"Vertex %d has color %d\\n\", i, dfs_num[i]);\r\n\t}",
"public static void main(String[] args) throws IOException {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\r\n\t\tStringTokenizer st = new StringTokenizer(br.readLine());\r\n\t\tN = Integer.parseInt(st.nextToken());\r\n\t\tM = Integer.parseInt(st.nextToken());\r\n\t\tK = Integer.parseInt(st.nextToken());\r\n\t\tchk = new int[M+1];\r\n\t\tsum = new int[N];\r\n\t\tarr = new ArrayList[N+1];\r\n\t\tvisit = new boolean[N];\r\n\t\t\r\n\t\tArrays.fill(chk, -1);\r\n\t\t\r\n\t\tfor(int i = 0; i < N; i++)\r\n\t\t{\r\n\t\t\tst = new StringTokenizer(br.readLine());\r\n\t\t\tint num = Integer.parseInt(st.nextToken());\r\n\t\t\tsum[i] = num;\r\n\t\t\tarr[i] = new ArrayList<>();\r\n\t\t\tfor(int j = 0; j < num; j++)\r\n\t\t\t\tarr[i].add(Integer.parseInt(st.nextToken()));\r\n\t\t}\r\n\t\t\r\n\t\tint res = 0, cnt = 0;\r\n\t\tfor(int i = 0; i < N; i++)\r\n\t\t{\r\n\t\t\tArrays.fill(visit, false);\r\n\t\t\tif(dfs(i))\r\n\t\t\t\tres++;\r\n\t\t}\r\n\t\t\r\n\t\tfor(int i = 0; i < N; i++)\r\n\t\t{\r\n\t\t\tArrays.fill(visit, false);\r\n\t\t\tif(dfs(i))\r\n\t\t\t{\r\n\t\t\t\tres++;\r\n\t\t\t\tcnt++;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(cnt == K) break;\r\n\t\t}\r\n\t\tSystem.out.println(res);\r\n\t}",
"public List<List<String>> getCTPsfromGraphs(List<List<Integer>> listOfDedGraphs) {\n\n List<String> queryTriplets = null;\n int count = 0;\n\n for (int i = 0; i < listOfDedGraphs.size(); i++) {\n\n Collections.sort(listOfDedGraphs.get(i));\n for (int j = 0; j < listOfDedGraphs.get(i).size(); j++) {\n\n queryTriplets = mapLogClQueryToAllTPEnts.get(listOfDedGraphs.get(i).get(j) - 1);\n getCTPfromQuery(queryTriplets, i, listOfDedGraphs.get(i).get(j) - 1);\n\n }\n }\n\n System.out.println();\n System.out.println(\"\\t================ Candidate Triple Patterns (CTPs)================\");\n System.out.println();\n\n for (int i = 0; i < DTPCandidates.size(); i++) {\n\n count++;\n System.out.println(\"\\t\\t\\tCTP no [\" + count + \"] \" + DTPCandidates.get(i).get(0) + \" \"\n + DTPCandidates.get(i).get(1) + \" \" + DTPCandidates.get(i).get(2) + \" \");\n }\n\n System.out.println();\n System.out.println(\"\\t================ Candidate Triple Patterns (CTPs)================\");\n System.out.println();\n\n return DTPCandidates;\n }",
"public List<Set<SDGNode>> secondPass() {\n Object[] edges = icfg.edgeSet().toArray();\n\n // first, temporarily remove all edges but CF and RT\n for (int i = 0; i < edges.length; i++) {\n SDGEdge e = (SDGEdge) edges[i];\n if (e.getKind() != SDGEdge.Kind.CONTROL_FLOW && e.getKind() != SDGEdge.Kind.RETURN) {\n buffer.addFirst(e);\n icfg.removeEdge(e);\n }\n }\n\n // then compute SCCs\n StrongConnectivityInspector<SDGNode, SDGEdge> sci = new StrongConnectivityInspector<SDGNode, SDGEdge>(icfg);\n List<Set<SDGNode>> erg = sci.stronglyConnectedSets();\n\n // put call edges back\n for (SDGEdge e : buffer) {\n icfg.addEdge(e);\n }\n buffer.clear();\n\n return erg;\n }",
"public List<List<Integer>> subsets1(int[] nums) {\n if (nums == null || nums.length == 0) {\n return new ArrayList<>();\n }\n\n Queue<List<Integer>> queue = new LinkedList<>();\n int level = -1;\n\n queue.offer(new LinkedList<>());\n\n while (++level < nums.length) {\n int size = queue.size();\n\n for (int i = 0; i < size; i++) {\n List<Integer> cur = queue.poll();\n List<Integer> newList = new LinkedList<>();\n\n for (Integer tmp : cur) {\n newList.add(tmp);\n }\n\n newList.add(level);\n queue.offer(cur);\n queue.offer(newList);\n }\n }\n\n List<List<Integer>> res = new LinkedList<>();\n\n for (List<Integer> list : queue) {\n List<Integer> tmp = new LinkedList<>();\n\n for (Integer idx : list) {\n tmp.add(nums[idx]);\n }\n\n res.add(tmp);\n }\n\n return res;\n }",
"private void connectAll()\n {\n\t\tint i = 0;\n\t\tint j = 1;\n\t\twhile (i < getNodes().size()) {\n\t\t\twhile (j < getNodes().size()) {\n\t\t\t\tLineEdge l = new LineEdge(false);\n\t\t\t\tl.setStart(getNodes().get(i));\n\t\t\t\tl.setEnd(getNodes().get(j));\n\t\t\t\taddEdge(l);\n\t\t\t\tj++;\n\t\t\t}\n\t\t\ti++; j = i+1;\n\t\t}\n\n }",
"public List<Configuration> solve(){\n int group = 0;\n for(List<Configuration> set : input){\n minimize(set);\n\n for(Configuration root : set) {\n root.setGroup(group);\n }\n group++;\n\n }\n\n // Step 2: Preprocess\n sortBySize(input);\n\n // Step 5: Initialize set of partial solutions\n List<Configuration> partialSolutions;\n if(input.size()==0){\n return null;\n }\n else {\n partialSolutions = input.get(0);\n input.remove(partialSolutions);\n }\n\n // Step 6: The compositional computations\n for(List<Configuration> set : input) {\n filter(partialSolutions, setCutoff);\n filter(set, setCutoff);\n partialSolutions = combine(partialSolutions, set, constraints);\n }\n\n // Step 7: Postprocessing\n //greedyPostProcessing(partialSolutions);\n\n return partialSolutions;\n }",
"public void dft() {\r\n\t\tHashMap<String, Boolean> processed = new HashMap<>();\r\n\t\tLinkedList<Pair> stack = new LinkedList<>();\r\n\r\n\t\tArrayList<String> vnames = new ArrayList<>(vces.keySet());\r\n\t\tfor (String vname : vnames) {\r\n\t\t\tif (processed.containsKey(vname)) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tPair rootpair = new Pair(vname, vname);\r\n\t\t\tstack.addFirst(rootpair);\r\n\t\t\twhile (stack.size() != 0) {\r\n\t\t\t\t// 1. removeFirst\r\n\t\t\t\tPair rp = stack.removeFirst();\r\n\r\n\t\t\t\t// 2. check if processed, mark if not\r\n\t\t\t\tif (processed.containsKey(rp.vname)) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tprocessed.put(rp.vname, true);\r\n\r\n\t\t\t\t// 3. Check, if an edge is found\r\n\t\t\t\tSystem.out.println(rp.vname + \" via \" + rp.psf);\r\n\r\n\t\t\t\t// 4. Add the unprocessed nbrs back\r\n\t\t\t\tArrayList<String> nbrnames = new ArrayList<>(rp.vtx.nbrs.keySet());\r\n\t\t\t\tfor (String nbrname : nbrnames) {\r\n\t\t\t\t\tif (!processed.containsKey(nbrname)) {\r\n\t\t\t\t\t\tPair np = new Pair(nbrname, rp.psf + nbrname);\r\n\t\t\t\t\t\tstack.addFirst(np);\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}",
"ArrayList<Node> DFSRec(Graph graph, final Node start, final Node end )\n {\n ArrayList<Node> path = new ArrayList<Node>();\n\n if ( start == end )\n {\n return path;\n }\n\n boolean visited[] = new boolean[graph.numNodes];\n visited[start.id] = true;\n\n path.addAll(DFSRec_helper(graph, start, end, visited)); \n\n return path;\n }",
"private void dfs(String source) {\n visited.add(source);\n\n System.out.println(source);\n\n for (Object vertex : graph.get(source)) {\n if (!visited.contains(vertex))\n dfs((String) vertex);\n }\n }",
"private void getCombinations(int arr[], int n, int r) \n\t{ \n\t\tsetOfIntArrays = new ArrayList<ArrayList<Integer>>();\n\t\t// A temporary array to store all combination one by one \n\t\tint data[]=new int[r]; \n\n\t\t// Print all combination using temporary array 'data[]' \n\t\tcombinationUtil(arr, data, 0, n-1, 0, r,setOfIntArrays);\n\t\t//System.out.println(\"Hello\");\n\t}",
"public Path dfs(Graph G, int v) {\r\n Path result = new Path();\r\n \tcount++;\r\n marked[v] = true;\r\n Iterator<Integer> it = G.getAdjList(v).iterator();\r\n while(it.hasNext()){\r\n \tint w = it.next();\r\n if (!marked[w]) {\r\n \t\t result.addPath(new Edge(v,w));\r\n result.append(dfs(G, w));\r\n \t}\r\n \t//System.out.print(v + \" \"+ w + \"\\n\");\r\n }\r\n return result;\r\n }",
"public static void main(String[] args) {\n //\n // define set of fruits\n Set<String> fruits = \n ImmutableSet.<String>builder()\n .add(\"apple\")\n .add(\"orange\")\n .add(\"banana\")\n .add(\"guava\")\n .build();\n\n // all combinations\n Set<Set<String>> fruitsPowerSet = Sets.powerSet(fruits);\n\n // print combinations\n for (Set<String> fruit : fruitsPowerSet) {\n System.out.println(fruit);\n }\n }",
"public ShortestPathMatrix<V,E> allPairsShortestPaths();",
"public static void main(String[] args) {\n\t\tdfs(1) ;\n\t\tfor(int i=0;i<list.size();i++){\n\t\t\tSystem.out.println(list.get(i));\n\t\t}\n\t}",
"public void dfs(int[][] graph, int u) {\n int degree = 0;\n int v = -1;\n int anyv = -1;\n for (int col=0; col<n; col++){\n if (graph[u][col]!=1){\n continue;\n }\n if (isBridge(graph, u, col)){\n anyv=col;\n continue;\n }\n v=col;\n break;\n }\n //no edge anymore\n if (v==-1){\n //last edge.\n v = anyv;\n }\n if (v==-1){\n return;\n }\n\n //remove edge u->v\n graph[u][v]=0;\n graph[v][u]=0;\n path.add(String.format(\"%d->%d\", u, v));\n dfs(graph, v);\n }",
"private void go(int i) {\n\t\tcol[i] = 1;\r\n\t\tint j = f[i];\r\n\t\tint cnt = 0;\r\n\t\tint delAll = 0;\r\n\t\tint[][] cd = new int[1000][3];\r\n\t\tint sa = 0;\r\n\t\tint sb = 0;\r\n\t\tint m1 = Integer.MAX_VALUE;\r\n\t\tint m2 = Integer.MAX_VALUE;\r\n\t\tint m1a = 0;\r\n\t\tint m2a = 0;\r\n\t\tint m1b = 0;\r\n\t\tint m2b = 0;\r\n\t\twhile (j != -1) {\r\n\t\t\tif (col[e[j]] == 0) {\r\n\t\t\t\tgo(e[j]);\r\n\t\t\t\tdelAll += a[e[j]];\r\n\t\t\t\tint dif = b[e[j]] - a[e[j]];\r\n\t\t\t\tif (dif < m1) {\r\n\t\t\t\t\tm2 = m1;\r\n\t\t\t\t\tm2b = m1b;\r\n\t\t\t\t\tm2a = m1a;\r\n\t\t\t\t\tm1 = dif;\r\n\t\t\t\t\tm1a = a[e[j]];\r\n\t\t\t\t\tm1b = b[e[j]];\r\n\t\t\t\t} else if (dif < m2) {\r\n\t\t\t\t\tm2 = dif;\r\n\t\t\t\t\tm2a = a[e[j]];\r\n\t\t\t\t\tm2b = b[e[j]];\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tsa += a[e[j]];\r\n\t\t\t\tsb += a[e[j]];\r\n\t\t\t\tcd[cnt][0] = a[e[j]];\r\n\t\t\t\tcd[cnt][1] = b[e[j]];\r\n\t\t\t\tcd[cnt][2] = b[e[j]] - a[e[j]];\r\n\t\t\t\tcnt++;\r\n\t\t\t}\r\n\t\t\tj = next[j];\r\n\t\t}\r\n\t\tif (cnt == 0) {\r\n\t\t\ta[i] = 1;\r\n\t\t\tb[i] = 0;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tArrays.sort(cd, new Comparator<int[]>() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic int compare(int[] o1, int[] o2) {\r\n\t\t\t\t// TODO Auto-generated method stub\t\t\t\t\r\n\t\t\t\treturn o1[2] - o2[2];\r\n\t\t\t}\r\n\t\t});\r\n\t\ta[i] = delAll + 1;\r\n\t\t//leave 0 or 2\r\n\t\tint cost1 = 0;\r\n\t\tint cost = 0;\r\n\t\tfor (j = 2; j < cnt; j++)\r\n\t\t\tcost1 += cd[j][0];\r\n\t\tif (cnt >= 2) {\r\n\t\t\tcost += m1b + m2b + sa - m1a - m2a;\r\n\t\t\tcost1 += cd[0][1] + cd[1][1];\r\n\t\t} else {\r\n\t\t\tcost += sa;\r\n\t\t\tcost1 += cd[0][0];\r\n\t\t}\r\n\t\tif (cost1 != cost)\r\n\t\t\tSystem.err.println(\"FUCK\");\r\n\t\tb[i] = cost;\r\n\t}",
"public static void main(String[] args) {\n\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n\t\ttry {\n\t\t\tString[] arr = br.readLine().split(\" \");\n\t\t\tint N = Integer.parseInt(arr[0]);\n\t\t\tint M = Integer.parseInt(arr[1]);\n\n\t\t\tArrayList<Integer>[] adlist = (ArrayList<Integer>[]) new ArrayList[N + 1];\n\t\t\tfor (int i = 1; i <= N; i++)\n\t\t\t\tadlist[i] = new ArrayList<Integer>();\n\t\t\tfor (int i = 0; i < M; i++) {\n\t\t\t\tString[] arr1 = br.readLine().split(\" \");\n\t\t\t\tint a = Integer.parseInt(arr1[0]);\n\t\t\t\tint b = Integer.parseInt(arr1[1]);\n\t\t\t\tadlist[b].add(a);\n\t\t\t}\n\t\t\tint[] num = new int[N + 1];\n\t\t\tfor (int i = 1; i <= N; i++) {\n\t\t\t\tint[] c = new int[N + 1];\n\t\t\t\tconnectedCom = 0;\n\t\t\t\tdfs(i, adlist, c);\n\t\t\t\tnum[i] = connectedCom;\n\t\t\t}\n\t\t\tint max = 0;\n\t\t\tfor (int i = 1; i <= N; i++) {\n\t\t\t\tif (max < num[i])\n\t\t\t\t\tmax = num[i];\n\t\t\t}\n\t\t\tfor (int i = 1; i <= N; i++) {\n\t\t\t\tif (num[i] == max)\n\t\t\t\t\tSystem.out.print(i + \" \");\n\t\t\t}\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}",
"LinkedList<Loop> getCommonEnclosingLoops();",
"private List<List<XGraph.XVertex>> getComponents() {\n scc = new SCC(graph);\n int componentCount = scc.findSSC();\n List<List<XGraph.XVertex>> components = new ArrayList<>();\n for (int i = 0; i < componentCount; i++) {\n components.add(new ArrayList<>());\n }\n for (Graph.Vertex vertex : graph) {\n CC.CCVertex component = scc.getCCVertex(vertex);\n components.get(component.cno - 1).add((XGraph.XVertex) vertex);\n }\n return components;\n }",
"public String DFS(int g) {\n\t\t//TODO\n\t}",
"static void dfs(int x, int p, int f, int s, int v, int c) {\n\t\t\n\t\tif (p >= mins[0] && f >= mins[1] && s >= mins[2] && v >= mins[3]) {\n\t\t\tif (c<min) {\n\t\t\t\tres = new int[list.size()];\n\t\t\t\tfor (int i=0;i<list.size();i++) {\n\t\t\t\t\tres[i] = list.get(i);\n\t\t\t\t}\n\t\t\t\tmin = c;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tSystem.out.println(list);\n\t\tfor (int i = x; i < N; i++) {\n\t\t\tif (!visited[i]) {\n\t\t\t\tlist.add(i);\n\t\t\t\tvisited[i] = true;\n\t\t\t\tdfs(i + 1, p + info[i][0], f + info[i][1], s + info[i][2], v + info[i][3], c + info[i][4]);\n\t\t\t\tlist.remove(list.size() - 1);\n\t\t\t\tvisited[i] = false;\n\t\t\t}\n\t\t}\n\t}",
"protected LinkedList<FunQuadruple> generateCandidates(List<FunQuadruple> lk) {\n\n LinkedList<FunQuadruple> lkPlus1 = new LinkedList<>();\n if (lk.isEmpty()) {\n return lkPlus1;\n }\n Set<ColumnCombinationBitset> subsets = new HashSet<>();\n int k = lk.get(0).candidate.size();\n ColumnCombinationBitset union = new ColumnCombinationBitset();\n for (FunQuadruple subsetQuadruple : lk) {\n // TODO optimise: all bits are set? --> break\n // If subsetQuadruple represents a unique do not add it to subsets and union (it should be pruned).\n if (subsetQuadruple.count == 0) {\n continue;\n }\n union = subsetQuadruple.candidate.union(union);\n subsets.add(subsetQuadruple.candidate);\n }\n\n Map<ColumnCombinationBitset, Integer> candidateGenerationCount = new HashMap<>();\n\n List<ColumnCombinationBitset> lkPlus1Candidates;\n FunQuadruple lkPlus1Member;\n for (ColumnCombinationBitset subset : subsets) {\n lkPlus1Candidates = union.getNSubsetColumnCombinationsSupersetOf(\n subset, k + 1);\n // FIXME add key conditional here\n // Removed key conditional - should not be triggerable?\n for (ColumnCombinationBitset candidate : lkPlus1Candidates) {\n if (candidateGenerationCount.containsKey(candidate)) {\n int count = candidateGenerationCount.get(candidate);\n count++;\n candidateGenerationCount.put(candidate, count);\n } else {\n candidateGenerationCount.put(candidate, 1);\n }\n }\n }\n\n for (ColumnCombinationBitset candidate : candidateGenerationCount\n .keySet()) {\n if (candidateGenerationCount.get(candidate) == (k + 1)) {\n lkPlus1Member = new FunQuadruple(candidate, addPliGenerate(\n candidate).getRawKeyError());\n lkPlus1.add(lkPlus1Member);\n }\n }\n return lkPlus1;\n }",
"private static void dfs(int idx, boolean[] visited, boolean[] isbreak) {\n\t\tif(idx==N) {\n\t\t\t//System.out.println(\"����������\");\n\t\t\tint cnt=0;\n\t\t\tfor(int i=0; i<N; i++) {\n\t\t\t\tif(isbreak[i]) cnt++; \n\t\t\t}\n\t\t\tans=Math.max(ans, cnt);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(isbreak[idx]) {\n\t\t\tdfs(idx+1, visited, isbreak); return;\n\t\t}\n\t\t\n\t\tboolean flag = false;\n\t\tfor(int i=0; i<N; i++) {\n\t\t\t//System.out.println(\"i:\"+i);\n\t\t\tif(i==idx) continue;\n\t\t\t\n\t\t\tif(!isbreak[i]) {\n\t\t\t\tflag=true;\n\t\t\t\t/*System.out.println(i+\"�� ģ��\");\n\t\t\t\tSystem.out.println(\"ġ����\");\n\t\t\t\tSystem.out.println(list.get(idx).inner+\" \"+list.get(idx).weight);\n\t\t\t\tSystem.out.println(list.get(i).inner+\" \"+list.get(i).weight);*/\n\t\t\t\tlist.get(idx).inner-=list.get(i).weight;\n\t\t\t\tlist.get(i).inner-=list.get(idx).weight;\n\t\t\t\t/*System.out.println(\"ġ����\");\n\t\t\t\tSystem.out.println(list.get(idx).inner+\" \"+list.get(idx).weight);\n\t\t\t\tSystem.out.println(list.get(i).inner+\" \"+list.get(i).weight);*/\n\t\t\t\tif(list.get(i).inner <= 0) isbreak[i]=true;\n\t\t\t\tif(list.get(idx).inner <= 0) isbreak[idx]=true;\n\t\t\t\t\n\n\t\t\t\tdfs(idx+1,visited,isbreak);\n\t\t\t\t\n\t\t\t\tlist.get(idx).inner+=list.get(i).weight;\n\t\t\t\tlist.get(i).inner+=list.get(idx).weight;\n\t\t\t\tif(list.get(i).inner > 0) isbreak[i]=false;\n\t\t\t\tif(list.get(idx).inner > 0) isbreak[idx]=false;\n\t\t\t}\n\t\t}\n\t\tif(!flag) {\n\t\t\tint cnt=0;\n\t\t\tfor(int i=0; i<N; i++) {\n\t\t\t\tif(isbreak[i]) cnt++; \n\t\t\t}\n\t\t\tans=Math.max(ans, cnt);\n\t\t\treturn;\n\t\t}\n\t\t\n\t}",
"public static boolean checkPath(int[][] bs, int i) {\n ArrayList<Integer> temp_cP = new ArrayList<Integer>();\r\n Set<Integer> temp_setcP = new HashSet<Integer>();\r\n boolean denoter = true;\r\n while (i == 3) {\r\n for (int k = 0; k < i; k++) {\r\n for (int e = 0; e < 3; e++) {\r\n temp_cP.add(e, bs[k][e]);\r\n }\r\n }\r\n temp_setcP = new HashSet<Integer>(temp_cP);\r\n if (temp_cP.size() > temp_setcP.size()) {\r\n denoter = false;\r\n break;\r\n\r\n } else {\r\n temp_cP.clear();\r\n temp_setcP.clear();\r\n\r\n for (int k = 0; k < i; k++) {\r\n for (int e = 3; e < 6; e++) {\r\n temp_cP.add(bs[k][e]);\r\n }\r\n }\r\n temp_setcP = new HashSet<Integer>(temp_cP);\r\n if (temp_cP.size() > temp_setcP.size()) {\r\n denoter = false;\r\n break;\r\n\r\n } else {\r\n break;\r\n }\r\n }\r\n }\r\n while (i == 6) {\r\n\r\n for (int k = 3; k < i; k++) {\r\n for (int e = 0; e < 3; e++) {\r\n temp_cP.add(e, bs[k][e]);\r\n }\r\n }\r\n temp_setcP = new HashSet<Integer>(temp_cP);\r\n if (temp_cP.size() > temp_setcP.size()) {\r\n denoter = false;\r\n break;\r\n\r\n } else {\r\n temp_cP.clear();\r\n temp_setcP.clear();\r\n\r\n for (int k = 3; k < i; k++) {\r\n for (int e = 3; e < 6; e++) {\r\n temp_cP.add(bs[k][e]);\r\n }\r\n }\r\n temp_setcP = new HashSet<Integer>(temp_cP);\r\n if (temp_cP.size() > temp_setcP.size()) {\r\n denoter = false;\r\n break;\r\n\r\n } else {\r\n break;\r\n }\r\n }\r\n\r\n }\r\n return denoter;\r\n }",
"Set<String> dfsTraversal(Graph graph, String root) {\n Set<String> seen = new LinkedHashSet<String>();\n Stack<String> stack = new Stack<String>();\n stack.push(root);\n\n while (!stack.isEmpty()) {\n String node = stack.pop();\n if (!seen.contains(node)) {\n seen.add(node);\n for (Node n : graph.getAdjacentNodes(node)) {\n stack.push(n.data);\n }\n\n }\n }\n\n return seen;\n }",
"public Set<List<String>> combinationForWindDragon(int[] suit) {\n if (suit.length != 7) throw new IllegalArgumentException(\"Not wind and \"\n + \"dragon suit length\");\n //Dragon and suits.\n Set<List<String>> combinations = new HashSet<>();\n List<String> element = new ArrayList<>();\n for (int i = 0; i < suit.length; i++) {\n String s = \"\";\n for (int j = 0; j < suit[i]; j++) {\n s += i;\n }\n if (s != \"\") {\n element.add(s);\n }\n }\n combinations.add(element);\n return combinations;\n }",
"String getCombination(int numberOfSides);",
"public void DFS() {\r\n\t\tSet<Vertex> visited = new HashSet<Vertex>();\r\n\r\n\t\t// Create a stack for DFS\r\n\t\tStack<Vertex> stack = new Stack<Vertex>();\r\n\r\n\t\tDFS(this.vertices[3], visited, stack); // DFS starting with 40\r\n\r\n\t\t// Call the helper function to print DFS traversal\r\n\t\t// starting from all vertices one by one\r\n\t\tfor (int i = 0; i < N; ++i)\r\n\t\t\tif (!visited.contains(this.vertices[i]))\r\n\t\t\t\tDFS(this.vertices[i], visited, stack);\r\n\t}",
"public List<List<Integer>> permute1(int[] nums) {\n\t\tList<List<Integer>> res = new ArrayList<>();\n\t\tdfs(res, nums, 0);\n\t\treturn res;\n\t}",
"public Set<V> findCycles()\n {\n // ProbeIterator can't be used to handle this case,\n // so use StrongConnectivityAlgorithm instead.\n StrongConnectivityAlgorithm<V, E> inspector =\n new KosarajuStrongConnectivityInspector<>(graph);\n List<Set<V>> components = inspector.stronglyConnectedSets();\n\n // A vertex participates in a cycle if either of the following is\n // true: (a) it is in a component whose size is greater than 1\n // or (b) it is a self-loop\n\n Set<V> set = new LinkedHashSet<>();\n for (Set<V> component : components) {\n if (component.size() > 1) {\n // cycle\n set.addAll(component);\n } else {\n V v = component.iterator().next();\n if (graph.containsEdge(v, v)) {\n // self-loop\n set.add(v);\n }\n }\n }\n\n return set;\n }",
"public void dfs (Node node) {\r\n\t\t\r\n\t\tSystem.out.print(node.data+\" \");\r\n\t\tList<Node> adding = node.getPartners();\r\n\t\tnode.visited = true;\r\n\t\t\tfor(int loop=0; loop<adding.size(); loop++) {\r\n\t\t\t\tNode n = adding.get(loop);\r\n\t\t\t\t\tif (n!=null && !n.visited) {\r\n\t\t\t\t\t\tdfs(n);\r\n\t\t\t\t\t} // if loop ends here\r\n\t\t\t\t\t\r\n\t\t\t} // for loop ends here\r\n\t\t\r\n\t}",
"public static boolean checkPath(int[][] bs, int i) {\n\t\tArrayList<Integer> temp_cP = new ArrayList<Integer>();\n\t\tSet<Integer> temp_setcP = new HashSet<Integer>();\n\t\tboolean denoter = true;\n\t\twhile (i == 3) {\n\t\t\tfor (int k = 0; k < i; k++) {\n\t\t\t\tfor (int e = 0; e < 3; e++) {\n\t\t\t\t\ttemp_cP.add(e, bs[k][e]);\n\t\t\t\t}\n\t\t\t}\n\t\t\ttemp_setcP = new HashSet<Integer>(temp_cP);\n\t\t\tif (temp_cP.size() > temp_setcP.size()) {\n\t\t\t\tdenoter = false;\n\t\t\t\tbreak;\n\n\t\t\t} else {\n\t\t\t\ttemp_cP.clear();\n\t\t\t\ttemp_setcP.clear();\n\n\t\t\t\tfor (int k = 0; k < i; k++) {\n\t\t\t\t\tfor (int e = 3; e < 6; e++) {\n\t\t\t\t\t\ttemp_cP.add(bs[k][e]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttemp_setcP = new HashSet<Integer>(temp_cP);\n\t\t\t\tif (temp_cP.size() > temp_setcP.size()) {\n\t\t\t\t\tdenoter = false;\n\t\t\t\t\tbreak;\n\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\twhile (i == 6) {\n\n\t\t\tfor (int k = 3; k < i; k++) {\n\t\t\t\tfor (int e = 0; e < 3; e++) {\n\t\t\t\t\ttemp_cP.add(e, bs[k][e]);\n\t\t\t\t}\n\t\t\t}\n\t\t\ttemp_setcP = new HashSet<Integer>(temp_cP);\n\t\t\tif (temp_cP.size() > temp_setcP.size()) {\n\t\t\t\tdenoter = false;\n\t\t\t\tbreak;\n\n\t\t\t} else {\n\t\t\t\ttemp_cP.clear();\n\t\t\t\ttemp_setcP.clear();\n\n\t\t\t\tfor (int k = 3; k < i; k++) {\n\t\t\t\t\tfor (int e = 3; e < 6; e++) {\n\t\t\t\t\t\ttemp_cP.add(bs[k][e]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttemp_setcP = new HashSet<Integer>(temp_cP);\n\t\t\t\tif (temp_cP.size() > temp_setcP.size()) {\n\t\t\t\t\tdenoter = false;\n\t\t\t\t\tbreak;\n\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\treturn denoter;\n\t}",
"@Test\n public void dfsRecursiveTest() {\n Map<String, List<String>> graph = new HashMap<>();\n graph.put(\"A\", Lists.newArrayList(\"B\", \"S\"));\n graph.put(\"B\", Lists.newArrayList(\"A\"));\n graph.put(\"C\", Lists.newArrayList(\"D\", \"E\", \"F\", \"S\"));\n graph.put(\"D\", Lists.newArrayList(\"C\"));\n graph.put(\"E\", Lists.newArrayList(\"C\", \"H\"));\n graph.put(\"F\", Lists.newArrayList(\"C\", \"G\"));\n graph.put(\"G\", Lists.newArrayList(\"F\", \"H\", \"S\"));\n graph.put(\"H\", Lists.newArrayList(\"E\", \"G\"));\n graph.put(\"S\", Lists.newArrayList(\"A\", \"C\", \"G\"));\n\n List<String> traversal = new DFSRecursive().runDFS(\"A\", graph);\n\n Assert.assertEquals(Lists.newArrayList(\"A\", \"B\", \"S\", \"C\", \"D\", \"E\", \"H\", \"G\", \"F\"), traversal);\n }",
"private int[] genKeys() {\n HashSet<Integer> set = new HashSet<Integer>();\n HashSet<int[]> next = new HashSet<int[]>();\n rowKeys = new HashMap<Integer, Integer>();\n int[] rowKeys2combo = new int[keySize];\n\n // 1st set starts with 0004, 0040, 0400, 4000\n int counter = 0;\n int key;\n for (int i = 0; i < rowSize; i++) {\n int[] temp = new int[rowSize];\n temp[i] = rowSize;\n key = rowCombo2Key(temp);\n rowKeys2combo[counter] = key;\n rowKeys.put(key, counter++);\n set.add(key);\n next.add(temp);\n }\n\n while (next.size() > 0) {\n HashSet<int[]> expand = next;\n next = new HashSet<int[]>();\n for (int[] combo : expand) {\n for (int i = 0; i < rowSize; i++) {\n if (combo[i] > 0) {\n for (int j = 0; j < rowSize; j++) {\n if (i != j) {\n int[] shift = new int[rowSize];\n System.arraycopy(combo, 0, shift, 0, rowSize);\n shift[i] = combo[i] - 1;\n shift[j] = combo[j] + 1;\n key = rowCombo2Key(shift);\n if (!set.contains(key)) {\n rowKeys2combo[counter] = key;\n rowKeys.put(key, counter++);\n set.add(key);\n next.add(shift);\n }\n }\n }\n }\n }\n }\n }\n\n final int splitIdx = counter;\n\n // 2nd set starts with 0003, 0030, 0300, 3000\n for (int i = 0; i < rowSize; i++) {\n int[] temp = new int[rowSize];\n temp[i] = rowSize - 1;\n key = rowCombo2Key(temp);\n rowKeys2combo[counter] = key;\n rowKeys.put(key, counter++);\n set.add(key);\n next.add(temp);\n }\n\n while (next.size() > 0) {\n HashSet<int[]> expand = next;\n next = new HashSet<int[]>();\n for (int[] combo : expand) {\n for (int i = 0; i < rowSize; i++) {\n if (combo[i] > 0) {\n for (int j = 0; j < rowSize; j++) {\n if (i != j) {\n int[] shift = new int[rowSize];\n System.arraycopy(combo, 0, shift, 0, rowSize);\n shift[i] = combo[i] - 1;\n shift[j] = combo[j] + 1;\n key = rowCombo2Key(shift);\n if (!set.contains(key)) {\n rowKeys2combo[counter] = key;\n rowKeys.put(key, counter++);\n set.add(key);\n next.add(shift);\n }\n }\n }\n }\n }\n }\n }\n return genKeyLink(splitIdx, rowKeys2combo);\n }",
"public abstract List<List<Integer>> subsets(int[] S);",
"public static void main(String[] args) {\n\t\tint answer = 0;\r\n\t\t\t\t\r\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tint t = sc.nextInt();\r\n\t\t\r\n\t\t\r\n\t\twhile (t>0) {\r\n\t\t\tint n = sc.nextInt();\r\n\t\t\tint[] arr = new int[n+1];\r\n\t\t\tboolean[] visited = new boolean[n+1]; \r\n\t\t\tt--;\r\n\t\t\tfor(int i=1;i<=n;i++) {\r\n\t\t\t\tarr[i] = sc.nextInt();\r\n\t\t\t\tvisited[i] = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor(int i=1;i<=n;i++) {\r\n\t\t\t\tif (visited[i]==false) {\r\n\t\t\t\t\tdfs(arr,visited,i);\r\n\t\t\t\t\tanswer ++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.println(answer);\r\n\t\t\tanswer = 0;\r\n\t\t}\r\n\t\t\r\n\t}",
"private void dfs(List<List<Integer>> res, List<Integer> tmp, int n, int k, int start) {\n\t\tif(tmp.size() == k) {\n\t\t\tres.add(new ArrayList<Integer>(tmp));\n\t\t\treturn;\n\t\t}\n\t\tfor(int i=start;i<=n;i++) {\n\t\t\t//i <= (n - (k - tmp.size()) + 1) 剪枝,当可选的数已经不够时,直接剪枝\n\t\t\ttmp.add(i);\n\t\t\tdfs(res,tmp,n,k,i+1);//i+1,别老忘写+1\n\t\t\ttmp.remove(tmp.size()-1);\n\t\t}\n\t}",
"public int[] shortestAlternatingPaths(int n, int[][] red_edges, int[][] blue_edges) {\n int[] result = new int[n];\n if (n == 1) {\n result[0] = 0;\n return result;\n }\n Arrays.fill(result, -1); // initialize result array\n // build graph for future access\n boolean[][] redEdgesMatrix = new boolean[n][n];\n for (int i = 0; i < red_edges.length; i++) {\n redEdgesMatrix[red_edges[i][0]][red_edges[i][1]] = true;\n }\n boolean[][] blueEdgesMatrix = new boolean[n][n];\n for (int i = 0; i < blue_edges.length; i++) {\n blueEdgesMatrix[blue_edges[i][0]][blue_edges[i][1]] = true;\n }\n // run bfs\n Deque<Node> queue = new LinkedList<>();\n // enqueue entry point (the node 0 is special, it supports both R and B)\n queue.offer(new Node(0, \"RB\"));\n // set initial result\n result[0] = 0;\n // initialize level\n int level = 1;\n while(!queue.isEmpty()) {\n int nodeAtCurrentLevel = queue.size();\n for (int i = 0; i < nodeAtCurrentLevel; i++) {\n Node node = queue.poll();\n // visit node\n int from = node.value;\n String currentColor = node.color;\n for (int to = 0; to < n; to++) { // all entry points need to enqueue, including itself or some nodes that are already visited\n if ((currentColor.equals(\"R\") || currentColor.equals(\"RB\")) && blueEdgesMatrix[from][to]) {\n // update matrix\n blueEdgesMatrix[from][to] = false;\n // set result\n if (result[to] == -1) {\n result[to] = level;\n } else {\n result[to] = Math.min(result[to], level); \n }\n // enqueue\n queue.offer(new Node(to, \"B\"));\n }\n if ((currentColor.equals(\"B\") || currentColor.equals(\"RB\")) && redEdgesMatrix[from][to]) {\n // update matrix\n redEdgesMatrix[from][to] = false;\n // set result\n if (result[to] == -1) {\n result[to] = level;\n } else {\n result[to] = Math.min(result[to], level); \n }\n // enqueue\n queue.offer(new Node(to, \"R\"));\n }\n }\n }\n level++;\n }\n return result;\n }",
"public Set<List<String>> getCombination(int[] inHand) {\n Set<List<String>> result = new HashSet<>();\n for (int i = 0; i < inHand.length; i++) {\n if (inHand[i] < 1) continue;\n int[] copyHand = copyArray(inHand);\n //possibility of A AA AAA\n for (int j = 1; j <= inHand[i]; j++) {\n if (j == 1) {\n String cSet = \"\";\n\n for (int seq = i; seq <= i + 2; seq++) {\n if (seq >= inHand.length || copyHand[seq] < 1) continue;\n cSet += seq;\n copyHand[seq] -= 1;\n }\n// System.out.println(\"i: \" + i + \" j: \" + j+\"inhand: \" + arrayToString\n// (inHand));\n\n Set<List<String>> a = getCombination(copyHand);\n Set<List<String>> newA = new HashSet<>();\n for (List<String> s : a) {\n s.add(cSet);\n s.sort(Comparator.naturalOrder());\n if (s.equals(\"\")) continue;\n newA.add(s);\n }\n result.addAll(newA);\n continue;\n }\n\n String currentSet = \"\";\n int[] copyOfInHand = copyArray(inHand);\n for (int t = 0; t < j; t++) {\n currentSet += i;\n }\n\n copyOfInHand[i] -= j;\n Set<List<String>> after = getCombination(copyOfInHand);\n Set<List<String>> newAfter = new HashSet<>();\n for (List<String> s : after) {\n s.add(currentSet);\n s.sort(Comparator.naturalOrder());\n newAfter.add(s);\n }\n result.addAll(newAfter);\n }\n }\n if (result.isEmpty()) result.add(new ArrayList<>());\n int min = result.stream().map(set -> set.size()).min(Comparator\n .naturalOrder()).get();\n Set<List<String>> minSets = result.stream().filter(set -> set.size() == min)\n .collect(Collectors\n .toSet());\n// combinationCache.put(inHand, minSets);\n return minSets;\n }",
"public static void main(String[] args) throws Exception {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\r\n\t\tStringTokenizer st = new StringTokenizer(in.readLine());\r\n\t\tString str;\r\n\t\tN = Integer.parseInt(st.nextToken());\r\n\t\tarray = new int[N + 2][N + 2];\r\n\t\tboolArray = new boolean[N + 2][N + 2];\r\n\t\tQueue<Integer> queue = new PriorityQueue<Integer>();\r\n\t\tfor (int i = 1; i < N + 1; i++) {\r\n\t\t\tst = new StringTokenizer(in.readLine());\r\n\t\t\tstr = st.nextToken();\r\n\t\t\tfor (int j = 1; j < N + 1; j++) {\r\n\t\t\t\tif (str.charAt(j - 1) == '1') {\r\n\t\t\t\t\tarray[i][j] = 1;\r\n\t\t\t\t\tboolArray[i][j] = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (int i = 1; i < N + 1; i++) {\r\n\t\t\tfor (int j = 1; j < N + 1; j++) {\r\n\t\t\t\tif (boolArray[i][j]) {\r\n\r\n\t\t\t\t\tboolArray[i][j] = false;\r\n\t\t\t\t\tqueue.offer(dfs(i, j));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(queue.size());\r\n\t\twhile (!queue.isEmpty()) {\r\n\t\t\tSystem.out.println(queue.poll());\r\n\t\t}\r\n\r\n\t}",
"static void dfs(int[][] G){\n\t\tStack<Integer> s = new Stack<Integer>();\n\t\tfor (int ver_start=0; ver_start<N; ver_start++){\n\t\t\tif (visited[ver_start]) continue;\n\t\t\ts.push(ver_start);\n\t\t\tvisited[ver_start] = true;\n\n\t\t\twhile(!s.isEmpty()){\n\t\t\t\tint vertex = s.pop();\n\t\t\t\tSystem.out.print((vertex+1) + \" \");\n\t\t\t\tfor (int i=0; i<N; i++){\n\t\t\t\t\tif (G[vertex][i] == 1 && !visited[i]){\n\t\t\t\t\t\t// find neigbor of current vertex and not visited\n\t\t\t\t\t\t// add into the stack\n\t\t\t\t\t\ts.push(i);\n\t\t\t\t\t\tvisited[i] = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tSystem.out.println();\n\t\t}\n\t}"
]
| [
"0.5607745",
"0.5583573",
"0.5426944",
"0.54115206",
"0.5314424",
"0.52667195",
"0.51810217",
"0.51810217",
"0.5151434",
"0.5111086",
"0.5109659",
"0.5109401",
"0.51029754",
"0.5083413",
"0.50771093",
"0.50684774",
"0.50195336",
"0.5000434",
"0.49989942",
"0.49986845",
"0.49959642",
"0.49481526",
"0.4938836",
"0.49281335",
"0.4914543",
"0.49122164",
"0.49035394",
"0.48752156",
"0.48460287",
"0.48300213",
"0.48283666",
"0.48233476",
"0.47970518",
"0.47939518",
"0.47911",
"0.47782302",
"0.4763013",
"0.47616816",
"0.4755308",
"0.47402242",
"0.4736968",
"0.473366",
"0.470704",
"0.46972105",
"0.4696719",
"0.4696032",
"0.46855035",
"0.46706316",
"0.4664584",
"0.46555603",
"0.46482047",
"0.46458122",
"0.46455368",
"0.46449643",
"0.46398488",
"0.46322906",
"0.46271473",
"0.46219322",
"0.46216357",
"0.4621297",
"0.4620736",
"0.4611135",
"0.46020764",
"0.4590024",
"0.4589295",
"0.45796975",
"0.45773655",
"0.45678484",
"0.45633155",
"0.4559429",
"0.45572606",
"0.45547757",
"0.4550904",
"0.45502418",
"0.453987",
"0.45343307",
"0.453368",
"0.4533352",
"0.4532577",
"0.4522172",
"0.45159283",
"0.4512762",
"0.45093232",
"0.45079565",
"0.4496415",
"0.44946462",
"0.44932702",
"0.4492165",
"0.4490479",
"0.44788715",
"0.44760752",
"0.44703972",
"0.44665587",
"0.44625053",
"0.44606394",
"0.44595492",
"0.44588545",
"0.44515282",
"0.44514546",
"0.44511217"
]
| 0.45065355 | 84 |
Use two set to alternate adding chars | public List<String> letterCombinations(String digits) {
HashSet<String> rnt = new HashSet<String>();
for(int i=0 ;i<digits.length(); i++){
char[] array = getChar(digits.charAt(i));
HashSet<String> newSet = new HashSet<String>();
for(int j=0; j<array.length; j++){
for(String currs: rnt){
newSet.add(currs+array[j]);
}
if(i==0){
newSet.add(array[j]+"");
}
}
rnt = newSet;
}
ArrayList<String> rntList = new ArrayList<String>();
for(String currs: rnt){
rntList.add(currs);
}
return rntList;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static Set<String> m23474a(Set<String> set, Set<String> set2) {\n if (set.isEmpty()) {\n return set2;\n }\n if (set2.isEmpty()) {\n return set;\n }\n HashSet hashSet = new HashSet(set.size() + set2.size());\n hashSet.addAll(set);\n hashSet.addAll(set2);\n return hashSet;\n }",
"void addEmergingSymbols(Set<Integer> acc);",
"public static Collection<Character> union(String string1, String string2){\n\t\tCollection<Character> mergedVector = new TreeSet<Character>();\n\t\tmergedVector.addAll(stringToCharacterSet(string1));\n\t\tmergedVector.addAll(stringToCharacterSet(string2));\n\t\treturn uniqueCharacters(mergedVector);\n\t}",
"public void unionOf(IntegerSet set1, IntegerSet set2) {\n get = new int[0];\n for (int i : set1.get)\n insertElement(i);\n for (int i : set2.get)\n insertElement(i);\n }",
"private void combine(char[] chars, int begin) {\n\t\tif(begin==chars.length) {\r\n\t\t\tString result = String.valueOf(chars);\r\n\t\t\tif(!list.contains(result)) {\r\n\t\t\t\tlist.add(result);\r\n\t\t\t}\r\n\t\t\treturn ;\r\n\t\t}\r\n\t\tfor(int i=begin;i<chars.length;i++) {\r\n\t\t\tswap(chars,i,begin);\r\n\t\t\tcombine(chars, begin+1);\r\n\t\t\tswap(chars,i,begin);\r\n\t\t}\t\r\n\t}",
"private void AddSet(String set)\n\t{\n\t\tint i;\n\n\t\tif (_canonical && RangeCount() > 0 && set.length() > 0 && set.charAt(0) <= GetRangeAt(RangeCount() - 1)._last)\n\t\t{\n\t\t\t_canonical = false;\n\t\t}\n\n\t\tfor (i = 0; i < set.length() - 1; i += 2)\n\t\t{\n\t\t\t_rangelist.add(new SingleRange(set.charAt(i), (char)(set.charAt(i + 1) - 1)));\n\t\t}\n\n\t\tif (i < set.length())\n\t\t{\n\t\t\t_rangelist.add(new SingleRange(set.charAt(i), Lastchar));\n\t\t}\n\t}",
"public static String addStrings(String nums1, String nums2) {\n int i = nums1.length() - 1;\n int j = nums2.length() - 1;\n StringBuilder sb = new StringBuilder();\n int carry = 0;\n\n while (i >= 0 || j >= 0) {\n int sum = carry;\n if (i >= 0) {\n sum += nums1.charAt(i--) - '0';\n }\n if (j >= 0) {\n sum += nums2.charAt(j--) - '0';\n }\n sb.append(sum % 10);\n carry = sum / 10;\n }\n if (carry != 0) {\n sb.append(carry);\n }\n return sb.reverse().toString();\n }",
"public static void main(String[] args) {\n String s1 = \"ShivaniKashyap\";\n char[] chararray = s1.toCharArray();\n LinkedHashSet set = new LinkedHashSet();\n LinkedHashSet newset = new LinkedHashSet();\n for(int i=0;i<chararray.length;i++)\n {\n if( !set.add(chararray[i]))\n {\n newset.add(chararray[i]);\n\n }\n\n }\n System.out.println(newset);\n }",
"public static <T> Set<T> union(Set<? extends T> s1, Set<? extends T> s2) {\n Set<T> result = new HashSet<>(s1);\n result.addAll(s2);\n return result;\n }",
"public static void main(String[] args) {\n\t\tSet<Character> setA = new HashSet<Character>();\n\t\tchar[] carr = \"abcdef\".toCharArray();\n\t\tfor (char c : carr) {\n\t\t\tsetA.add(c);\n\t\t}\n\t\t\n\t\tSet<Character> setB = new HashSet<Character>();\n\t\tchar[] carr2 = \"chdedf\".toCharArray();\n\t\tfor (char c : carr2) {\n\t\t\tsetB.add(c);\n\t\t}\n\t\tsetB.removeAll(setA);\n\t\tSystem.out.println(setA.containsAll(setB));\n\t\tSystem.out.println(setB.isEmpty());\n\t\t\n\t\tSystem.out.println(contains(\"asdfkhas\", \"dfa\"));\n\t\tSystem.out.println(contains1(\"asdfkhas\", \"defa\"));\n\t}",
"public static void main(String[] args) {\n\t\tScanner s=new Scanner(System.in);\r\n\t\tString str=s.nextLine();\r\n\t\tchar []ch=str.toCharArray();\r\n\t\tint i;\r\n\t\tint j;\r\n\t\t\r\n\t\tString s1=\"\";\r\n\t\tLinkedHashSet set=new LinkedHashSet();\r\n\t\tfor(i=0;i<ch.length;i++){\r\n\t\t\tset.add(ch[i]);\r\n\t\t}\r\n\t\tfor(Object o:set){\r\n\t\t\ts1=s1+o;\r\n\t\t}\r\n\t\tSystem.out.println(s1);\r\n\t}",
"public static void main(String[] args) {\n\n\t\tString a = \"aabbbc\", b =\"cbad\";\n\t\t// a=abc\t\t\t\tb=cab\n\t\t\n\t\t\n\t\tString a1 =\"\" , b1 = \"\"; // to store all the non duplicated values from a\n\t\t\n\t\tfor(int i=0; i<a.length();i++) {\n\t\t\tif(!a1.contains(a.substring(i,i+1)))\n\t\t\t\ta1 += a.substring(i,i+1);\n\t\t}\n\t\t\n\t\tfor(int i=0; i<b.length();i++) {\n\t\t\tif(!b1.contains(b.substring(i,i+1)))\n\t\t\t\tb1 += b.substring(i,i+1);\n\t\t}\n\t\t\t\t\n\t\tchar[] ch1 = a1.toCharArray();\n\t\tSystem.out.println(Arrays.toString(ch1));\n\t\t\n\t\tchar[] ch2 = b1.toCharArray();\n\t\tSystem.out.println(Arrays.toString(ch2));\n\t\t\n\t\tArrays.sort(ch1);\n\t\tArrays.sort(ch2);\n\t\t\n\t\tSystem.out.println(\"=====================================================\");\n\t\t\n\t\tSystem.out.println(Arrays.toString(ch1));\n\t\tSystem.out.println(Arrays.toString(ch2));\n\t\t\n\t\tString str1 = Arrays.toString(ch1);\n\t\tString str2 = Arrays.toString(ch2);\n\t\t\n\t\tif(str1.contentEquals(str2)) {\n\t\t\tSystem.out.println(\"true, they build out of same letters\");\n\t\t}else { \n\t\t\tSystem.out.println(\"fasle, there is something different\");\n\t\t}\n\t\t\n\n\t\t\n\t\t// SHORTER SOLUTION !!!!!!!!!!!!!!!!!!!!\n\t\t\n//\t\tString Str1 = \"aaaabbbcc\", Str2 = \"cccaabbb\";\n//\t\t\n//\t\tStr1 = new TreeSet<String>( Arrays.asList(Str1.split(\"\"))).toString();\n//\t\tStr2 = new TreeSet<String>( Arrays.asList(Str2.split(\"\"))).toString();\n//\t\tSystem.out.println(Str1.equals(Str2));\n//\t\t\n//\t\t\n\t\t\n}",
"public static void main(String[] args) {\n\t\n\tString a = \"aabbbc\", b= \"cabbbac\";\n\t// a = abc, b=cab\n\t//we will remove all dublicated values from \"a\"\n\tString a1 = \"\"; //store all the non duplicated values from \"a\"\n\t\n\tfor (int j=0; j<a.length();j++) //this method is with nested loop\n\tfor (int i=0; i<a.length();i++) {\n\t\tif (!a1.contains(a.substring(j, j+1))) {\n\t\t\ta1 += a.substring(j, j+1);\n\t\t}\n\t\t\t\n\t}\n\tSystem.out.println(a1);\n\t//we will remove all duplicated values from \"b\"\n\tString b1 = \"\"; //store all the non duplicated values from \"b\"\n\tfor(int i=0; i<b.length();i++) { //this is with simple loop\n\t\tif(!b1.contains(b.substring(i, i+1))) {\n\t\t\t // \"\"+b.charAt(i)\n\t\t\tb1 += b.substring(i, i+1);\n\t\t\t// \"\"+b.charAt(i);\n\t\t}\n\t}\n\tSystem.out.println(b1);\n\t\n\t\n\t//a1 = \"acb\", b1 = \"cab\"\n\tchar[] ch1 = a1.toCharArray();\n\tSystem.out.println(Arrays.toString(ch1));\n\t\n\tchar[] ch2 = b1.toCharArray();\n\tSystem.out.println(Arrays.toString(ch2));\n\t\n\tArrays.sort(ch1);\n\tArrays.sort(ch2);\n\t\n\tSystem.out.println(\"========================\");\n\tSystem.out.println(Arrays.toString(ch1));\n\tSystem.out.println(Arrays.toString(ch2));\n\t\n\t\n\tString str1 = Arrays.toString(ch1);\n\tString str2 = Arrays.toString(ch2);\n\t\n\tif(str1.equals(str2)) {\n\t\tSystem.out.println(\"true, they are same letters\");\n\t}else {\n\t\tSystem.out.println(\"false, they are contain different letters\");\n\t}\n\t\n\t\n\t// solution 2:\n\t\t\t String Str1 = \"cccccaaaabbbbccc\" , Str2 = \"cccaaabbb\";\n\t\t\t \n\t\t\t Str1 = new TreeSet<String>( Arrays.asList( Str1.split(\"\"))).toString();\n\t\t\t Str2 = new TreeSet<String>( Arrays.asList( Str2.split(\"\"))).toString();\n\t\t\t \n\t\t\t System.out.println(Str1.equals(Str2));\n\t\t\t\t \n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n}",
"private static <T> Set<T> union(Collection<T> c1, Collection<T> c2) {\n return Stream.concat(c1.stream(), c2.stream()).collect(Collectors.toUnmodifiableSet());\n }",
"public ArrayList<Character> getNumeratorset(String word1, String word2) {\n\t\tArrayList<Character> myNumeratorset = new ArrayList<Character>();\n\t\tArrayList<Character> myS1set = new ArrayList<Character>();\n\t\tArrayList<Character> myS2set = new ArrayList<Character>();\n\n\t\tfor(int i = 0; i < word1.length(); i++) {\n\t\t\tif(!myS1set.contains(word1.charAt(i))) {\n\t\t\t\tmyS1set.add(word1.charAt(i));\n\t\t\t}\n\t\t}\n\n\t\tfor(int i = 0; i < word2.length(); i++) {\n\t\t\tif(!myS2set.contains(word2.charAt(i))) {\n\t\t\t\tmyS2set.add(word2.charAt(i));\n\t\t\t}\n\t\t}\n\n\t\tif(myS1set.size() < myS2set.size()) {\n\t\t\tfor(Character item:myS1set) {\n\t\t\t\tif(myS2set.contains(item)) {\n\t\t\t\t\tmyNumeratorset.add(item);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor(Character item:myS2set) {\n\t\t\t\tif(myS1set.contains(item)) {\n\t\t\t\t\tmyNumeratorset.add(item);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn myNumeratorset;\n\t}",
"public static void main(String[] args) {\nString str = \"java,C, Java\";\r\nStringBuffer sf = new StringBuffer();\r\nSet<Character> set = new HashSet<>();\r\nfor(int i=0;i<str.length();i++)\r\n{\r\nchar c=str.charAt(i);\r\nif(!set.contains(c))\r\n{\r\nset.add(c);\r\n//System.out.println(set);\r\n\r\nsf.append(c);\r\n\r\n//Set s = new Set();\r\n}\r\n}\r\nSystem.out.println(set);\r\nSystem.out.println(sf.toString());\r\n}",
"public ZYSet<ElementType> union(ZYSet<ElementType> otherSet){\n ZYSet<ElementType> result = new ZYArraySet<ElementType>();\n for(ElementType e :this){\n result.add(e);\n }\n for(ElementType e :otherSet){\n result.add(e);\n }\n \n return result;\n }",
"public static void main(String[] args) {\n\n\t\t\n\t\tList<Character>st1=new ArrayList<>();\n\t\n\t\tst1.add('a');\n\t\tst1.add('b');\n\t\tst1.add('a');\n\t\tst1.add('a');\n\t\tst1.add('c');\n\t\tst1.add('t');\n\t\n\t\tSystem.out.println(st1);//[a, b, a, a, c, t]\n\t\t\n\t\tList<Character>st2=new ArrayList<>();//empty []\n\t\tfor (int i=0; i<st1.size();i++) {\n\t\t\tif(!st2.contains(st1.get(i))) {\n\t\t\t\t// created str2 [empty], we will get the element from st1 to st2 while checking if there is repetition \n\t\t\t\tst2.add(st1.get(i));\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(st2);//[a, b, c, t]\n\t\t\n\n\t}",
"@Test\r\n public void addAllFromSetWithStrings() throws Exception {\r\n TreeSet<String> s = new TreeSet<>();\r\n s.addAll(sStr);\r\n assertTrue(s.contains(\"kek\"));\r\n assertTrue(s.contains(\"lel\"));\r\n assertTrue(s.contains(\"lol\"));\r\n }",
"static int makeAnagram(String a, String b) {\n int[] letters = new int[26];\n\n for (char c: a.toCharArray()){\n letters[c-'a']++;\n }\n\n for (char c: b.toCharArray()){\n letters[c-'a']--;\n }\n\n int sum = 0;\n\n for (int x:letters){\n sum+=Math.abs(x);\n }\n return sum;\n\n }",
"public String comboString(String a, String b) {\r\n return a.length() > b.length() ? b + a + b : a + b + a;\r\n }",
"@Test\n\tpublic void testAddAll() {\n\t Set<Integer> setA = new HashSet<>(Arrays.asList(1, 2, 3, 4, 5));\n\t Set<Integer> setB = new HashSet<>(Arrays.asList(9, 8, 7, 6, 5, 4, 3));\n\t setA.addAll(setB);\n\t Set<Integer> union = new HashSet<>(Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9));\n\t assertEquals(setA, union);\n }",
"static int makingAnagrams(String s1, String s2){\n // Complete this function\n StringBuilder b = new StringBuilder(s2);\n int delCount =0;\n for(int i=0;i<s1.length();i++){\n int index = b.indexOf(String.valueOf(s1.charAt(i)));\n if(index == -1){\n delCount++;\n }else{\n b.deleteCharAt(index);\n } \n }\n return delCount + b.length();\n }",
"protected abstract Set<String> _addToSet(String key, Collection<String> str);",
"protected <Ty> HashSet<Ty> union(HashSet<Ty> setA, HashSet<Ty> setB) {\n HashSet<Ty> retSet = new HashSet<>();\n retSet.addAll(setA);\n retSet.addAll(setB);\n return retSet;\n }",
"public static boolean sameUniqueCharsInBothLists( List<Character> list1, \n List<Character> list2 ) {\n Set<Character> s1 = new TreeSet<Character>( list1 );\n Set<Character> s2 = new TreeSet<Character>( list2 );\n return s1.equals(s2);\n }",
"private Set<String> replacementHelper(String word) {\n\t\tSet<String> replacementWords = new HashSet<String>();\n\t\tfor (char letter : LETTERS) {\n\t\t\tfor (int i = 0; i < word.length(); i++) {\n\t\t\t\treplacementWords.add(word.substring(0, i) + letter + word.substring(i + 1));\n\t\t\t}\n\t\t}\n\t\treturn replacementWords;\n\t}",
"public Set Union(Set secondSet) {\n\t\t\n\t\tArrayList<String> firstArray = noDuplicates(stringArray);\n\t\t// Taking out duplications out of our sets by calling the noDuplicates private function\n\t\tArrayList<String> secondArray = noDuplicates(secondSet.returnArray());\n\t\t\n\t\tArrayList<String> unionOfBoth = new ArrayList<String>();\n\t\t// New ArrayList to hold the final values\n\t\t\n\t\tfor (int i=0; i < 10; i++) {\n\t\t\tif (firstArray.size() > i) {\n\t\t\t\tif (unionOfBoth.contains(firstArray.get(i)) == false && firstArray.get(i).equals(\"emptyElement\") == false) {\n\t\t\t\t\tunionOfBoth.add(firstArray.get(i));\n\t\t\t\t\t// If our final ArrayList does not already contain the element, and the item is not an empty string\n\t\t\t\t\t// (Does not contain the phrase \"emptyElement\"), then add it to our final ArrayList\n\t\t\t\t}\n\t\t\t\telse if (unionOfBoth.contains(firstArray.get(i)) == false && firstArray.get(i).equals(\"emptyElement\")) {\n\t\t\t\t\tunionOfBoth.add(\"\");\n\t\t\t\t\t// If our final ArrayList does not already contain the element, but the item is an empty string\n\t\t\t\t\t// (Does contain the phrase \"emptyElement\"), then add an empty string to our final ArrayList\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (secondArray.size() > i) {\n\t\t\t\tif (unionOfBoth.contains(secondArray.get(i)) == false && secondArray.get(i).equals(\"emptyElement\") == false) {\n\t\t\t\t\tunionOfBoth.add(secondArray.get(i));\n\t\t\t\t\t// If our final ArrayList does not already contain the element, and the item is not an empty string\n\t\t\t\t\t// (Does not contain the phrase \"emptyElement\"), then add it to our final ArrayList\n\t\t\t\t}\n\t\t\t\telse if (unionOfBoth.contains(secondArray.get(i)) == false && secondArray.get(i).equals(\"emptyElement\")) {\n\t\t\t\t\tunionOfBoth.add(\"\");\n\t\t\t\t\t// If our final ArrayList does not already contain the element, but the item is an empty string\n\t\t\t\t\t// (Does contain the phrase \"emptyElement\"), then add an empty string to our final ArrayList\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSet unionReturn = new Set(unionOfBoth); // Initiate a Set object from out final ArrayList\n\t\t\n\t\treturn unionReturn; // Return the final Set Object\n\t}",
"public String addStrings(String num1, String num2) {\n int prev = 0, i = num1.length() - 1, j = num2.length() - 1;\n StringBuilder res = new StringBuilder();\n\n while (i >= 0 || j >= 0) {\n int cur = prev;\n if (i >= 0) cur += num1.charAt(i--) - '0';\n if (j >= 0) cur += num2.charAt(j--) - '0';\n prev = cur / 10;\n cur %= 10;\n res.append(cur);\n }\n if (prev != 0) res.append(prev);\n return res.reverse().toString();\n }",
"public static boolean unsignedIntersects(CharBuffer set1, int length1, CharBuffer set2,\n int length2) {\n if ((0 == length1) || (0 == length2)) {\n return false;\n }\n int k1 = 0;\n int k2 = 0;\n\n // could be more efficient with galloping\n char s1 = set1.get(k1);\n char s2 = set2.get(k2);\n\n mainwhile: while (true) {\n if (s2 < s1) {\n do {\n ++k2;\n if (k2 == length2) {\n break mainwhile;\n }\n s2 = set2.get(k2);\n } while (s2 < s1);\n }\n if (s1 < s2) {\n do {\n ++k1;\n if (k1 == length1) {\n break mainwhile;\n }\n s1 = set1.get(k1);\n } while (s1 < s2);\n } else {\n return true;\n }\n }\n return false;\n }",
"static int makeAnagram(String a, String b) {\n List<String> arr = new ArrayList<>(Arrays.asList(a.split(\"(?<!^)\")));\n List<String> arr2 = new ArrayList<>(Arrays.asList(b.split(\"(?<!^)\")));\n Iterator<String> iter = arr.iterator();\n \n while (iter.hasNext()) {\n String s = iter.next();\n\n if (arr2.contains(s)) {\n arr2.remove(arr2.indexOf(s));\n iter.remove();\n }\n }\n\n return (arr.size()) + (arr2.size());\n }",
"static int makeAnagram(String a, String b) {\n \n \tchar arr[] = a.toCharArray();\n char brr[] = b.toCharArray();\n Arrays.sort(arr);\n Arrays.sort(brr);\n Map<Character, Integer> aMap = new HashMap<>();\n Map<Character, Integer> bMap = new HashMap<>();\n for(int i =0 ;i <arr.length;i++){\n \tif(!aMap.containsKey(arr[i])){\n \t\taMap.put(arr[i], 1);\n \t}else{\n \t\taMap.put(arr[i], aMap.get(arr[i])+1);\n \t}\n }\n for(int i =0 ;i <brr.length;i++){\n \tif(!bMap.containsKey(brr[i])){\n \t\tbMap.put(brr[i], 1);\n \t}else{\n \t\tbMap.put(brr[i], bMap.get(brr[i])+1);\n \t}\n }\n int removeCharCount = 0;\n \n for(char ch = 'a'; ch<='z';ch++){\n \tif(aMap.containsKey(ch) && bMap.containsKey(ch)){\n \t\tif(aMap.get(ch) > bMap.get(ch)){\n \t\t\tint count = aMap.get(ch) - bMap.get(ch);\n \t\t\tremoveCharCount+=count;\n \t\t\taMap.put(ch, aMap.get(ch) - count);\n \t\t}else if(aMap.get(ch) < bMap.get(ch)){\n \t\t\tint count = bMap.get(ch) - aMap.get(ch);\n \t\t\tremoveCharCount+=count;\n \t\t\taMap.put(ch, bMap.get(ch) - count);\n \t\t}\n \t}else if(aMap.containsKey(ch) && !bMap.containsKey(ch)){\n \t\tint count = aMap.get(ch);\n \t\tremoveCharCount+=count;\n \t\taMap.remove(ch);\n \t}else if(!aMap.containsKey(ch) && bMap.containsKey(ch)){\n \t\tint count = bMap.get(ch);\n \t\tremoveCharCount+=count;\n \t\tbMap.remove(ch);\n \t}\n }\n /* if(removeCharCount == Math.min(arr.length, brr.length)){\n \treturn 0;\n }*/\n return removeCharCount;\n }",
"private boolean equalsChars(char[] first, char[] second) {\n for (int i = 0; i < second.length; i++)\n if (first[i] != second[i])\n return false;\n return true;\n }",
"public static String findUncommonCharacters(String s1, String s2) {\n\t\tHashSet<Character> uncommonChars = new HashSet<>();\n\n\t\t// Variable to check if the character is present in both the strings\n\t\tboolean isPresent = false;\n\n\t\t// Finding the uncommon characters that are present in string s1, but not in s2\n\t\tfor (int i = 0; i < s1.length(); i++) {\n\t\t\tfor (int j = 0; j < s2.length(); j++) {\n\t\t\t\t// Character is present in both s1 and s2\n\t\t\t\tif (s1.charAt(i) == s2.charAt(j)) {\n\t\t\t\t\tisPresent = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Character is not present in s2\n\t\t\tif (isPresent == false) {\n\t\t\t\tuncommonChars.add(s1.charAt(i));\n\t\t\t} else {\n\t\t\t\tisPresent = false;\n\t\t\t}\n\t\t}\n\n\t\tisPresent = false;\n\n\t\t// Finding the uncommon characters that are present in string s2, but not in s1\n\t\tfor (int i = 0; i < s2.length(); i++) {\n\t\t\tfor (int j = 0; j < s1.length(); j++) {\n\t\t\t\t// Character is present in both s1 and s2\n\t\t\t\tif (s2.charAt(i) == s1.charAt(j)) {\n\t\t\t\t\tisPresent = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Character is not present in s1\n\t\t\tif (isPresent == false) {\n\t\t\t\tuncommonChars.add(s2.charAt(i));\n\t\t\t} else {\n\t\t\t\tisPresent = false;\n\t\t\t}\n\t\t}\n\n\t\tString ans = \"\";\n\t\t // Sorting HashSet using TreeSet \n\t\tTreeSet<Character> treeSet = new TreeSet<Character>(uncommonChars);\n\t\tfor (char ch : treeSet) {\n\t\t\tans += ch;\n\t\t}\n\t\treturn ans;\n\t}",
"public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n int N = Integer.parseInt(in.nextLine());\n HashSet<Character> first = new HashSet<Character>();\n HashSet<Character> second = new HashSet<Character>();\n int i=0;\n char temp = 'a';\n for(temp='a';temp<='z';temp++){\n \t first.add(temp);\n }\n int j;\n while(i<N){\n \t second.clear();\n \t char[] stringArray = in.nextLine().toCharArray();\n \t for(j=0;j<stringArray.length;j++){\n \t\t second.add(stringArray[j]); \n \t }\n \t first.retainAll(second);\n \t i++;\n }\n System.out.println(first.size());\n }",
"public boolean anagram(char [] a, char [] b);",
"static int makeAnagram(String a, String b) {\r\n int[] charCount = new int[26];\r\n int deletions = 0;\r\n\r\n for(char c : a.toCharArray()) {\r\n charCount[c-'a'] += 1;\r\n }\r\n for(char c : b.toCharArray()) {\r\n charCount[c-'a'] -= 1;\r\n }\r\n for(int count : charCount) {\r\n deletions += Math.abs(count);\r\n }\r\n return deletions;\r\n }",
"private void many(Set<String> s) {\n\t\twhile (!done() && s.contains(program.charAt(pos)+\"\"))\n\t\t\tpos++;\n }",
"public static void main (String[] args) throws java.lang.Exception\n\t{\n\t\tScanner s = new Scanner(System.in);\n\t\tString s1=\"wipro\";\n\t\tString s2=\"technologies\";\n\t\tint i,j,temp;\n\t int a = s.nextInt();\n\t char[] c = s1.toCharArray();\n\t char[] d = s2.toCharArray();\n\t if(a==1)\n\t {\n\t \tfor(i=0;i<c.length;i++)\n\t \t{\n\t \t\tfor(j=0;j<d.length||j<c.length;j++)\n\t \t\t{\n\t \t\t\tif(c[i]==d[j])\n\t \t\t\t{\n\t \t\t\t\tSystem.out.println(c[i]);\n\t \t\t\t\tc[i]+='A'-'a';\n\t \t\t\t\td[j]+='A'-'a';\n\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 }\n\t \n\t else if(a==0)\n\t {\n\t \tfor(i=0;i<c.length;i++)\n\t \t{\n\t \t\tfor(j=0;j<d.length||j<c.length;j++)\n\t \t\t{\n\t \t\t\tif(c[i]!=d[j])\n\t \t\t\t{\n\t \t\t\t c[i]+='A'-'a';\n\t \t\t\t \n\t \t\t\t}\n\n\t \t\t}\n\t \t}\n\t for(i=0;i<d.length;i++)\n\t {\n\t \tfor(j=0;j<c.length;j++)\n\t \t\t{\n\t \t\t\tif(d[i]!=c[j])\n\t \t\t\t{\n\t \t\t\t d[i]+='A'-'a';\n\t \t\t\t \n\t \t\t\t}\n\n\t \t\t}\n\t \t}\n\t \t\n\t }\n\telse\n\t{\n\tSystem.out.println(\"no accepted value\");\n\t}\n\t \n\t \tSystem.out.print(c);\n\t \n\t \n\t \n\t \tSystem.out.print(d);\n\t \n\t}",
"public static String Add_pandy(String a, String b)\n\t{\n\t\tString ans = \"\";\n\t\tif (a.length() != b.length())\n\t\t{\n\t\t\tint len1 = a.length();\n\t\t\tint len2 = b.length();\n\t\t\tint lenght_max = Math.max(len1, len2);\n\n\t\t\tfor (int i = 0; i < lenght_max - len1; i++)\n\t\t\t{\n\t\t\t\ta = \"0\" + a;\n\t\t\t}\n\t\t\tfor (int i = 0; i < lenght_max - len2; i++)\n\t\t\t{\n\t\t\t\tb = \"0\" + b;\n\t\t\t}\n\t\t}\n\n\t\tint carry = 0;\n\t\tint tem = 0;\n\t\tfor (int i = a.length() - 1; i >= 0; i--)\n\t\t{\n\t\t\ttem = Integer.parseInt(String.valueOf(a.charAt(i)))\n\t\t\t\t\t+ Integer.parseInt(String.valueOf(b.charAt(i))) + carry;\n\t\t\tif (tem >= 10)\n\t\t\t\tcarry = 1;\n\t\t\telse\n\t\t\t\tcarry = 0;\n\t\t\tans = String.valueOf(tem % 10) + ans;\n\t\t}\n\t\tif (carry == 1)\n\t\t\tans = String.valueOf(carry) + ans;\n\n\t\t// System.out.println(a);\n\t\t// System.out.println(b);\n\n\t\treturn ans;\n\t}",
"static int twoCharaters(String s) {\n\t\tList<String> list = Arrays.asList(s.split(\"\"));\n\t\tHashSet<String> uniqueValues = new HashSet<>(list);\n\t\tSystem.out.println(uniqueValues);\n\t\tString result;\n\t\twhile(check(list,1,list.get(0))) {\n\t\t\tresult = replace(list,1,list.get(0));\n\t\t\tif(result != null) {\n\t\t\t\tSystem.out.println(result);\n\t\t\t\ts = s.replaceAll(result,\"\");\n\t\t\t\tlist = Arrays.asList(s.split(\"\"));\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(s);\n\t\treturn 5;\n }",
"private static boolean checkIfCanBreak( String s1, String s2 ) {\n\n if (s1.length() != s2.length())\n return false;\n\n Map<Character, Integer> map = new HashMap<>();\n for (Character ch : s2.toCharArray()) {\n map.put(ch, map.getOrDefault(ch, 0) + 1);\n }\n\n for (Character ch : s1.toCharArray()) {\n\n char c = ch;\n while ((int) (c) <= 122 && !map.containsKey(c)) {\n c++;\n }\n\n if (map.containsKey(c)) {\n map.put(c, map.getOrDefault(c, 0) - 1);\n\n if (map.get(c) <= 0)\n map.remove(c);\n }\n }\n\n return map.size() == 0;\n }",
"int main() \n{\n string s1,s2;\n cin>>s1>>s2;\n int freq[128]={0},i;\n for(i=0;i<s1.length();i++)\n freq[s1[i]]++;\n for(i=0;i<s2.length();i++)\n freq[s2[i]]--;\n for(i=0;i<128;i++)\n {\n if(freq[i]!=0)\n {\n cout<<\"Not anagrams\";\n return 0;\n }\n }\n cout<<\"Anagram\";\n}",
"private void initLegits(Set<String> s) {\n\t\ts.addAll(letters);\n\t\ts.addAll(digits);\n }",
"public static String addStrings(String num1, String num2) {\n\t\tif (num1 == null || num1.length() == 0 || num2 == null || num2.length() == 0) return null;\n char[] c1 = num1.toCharArray();\n char[] c2 = num2.toCharArray();\n int n1 = c1.length;\n int n2 = c2.length;\n \n StringBuilder sb = new StringBuilder();\n int i, j;\n int add = 0;\n for (i = n1 - 1, j = n2 - 1; i >= 0 && j >= 0; i--, j--) {\n \tint sum = (c1[i] - '0') + (c2[j] - '0') + add;\n \tsb.append(sum % 10);\n \tadd = sum / 10;\n }\n if (j > 0) {\n \tc1 = c2;\n }\n for (i = Math.max(i, j); i >= 0; i--) {\n \t\tint v = c1[i] - '0' + add;\n \t\tsb.append(v % 10);\n \t\tadd = v / 10;\n \t}\n \tif (add > 0) {\n \t sb.append(add);\n \t}\n \t\n \treturn sb.reverse().toString();\n }",
"public static boolean checkPermutaionMap(String s1, String s2) {\n if (s1.length() != s2.length()) return false;\n\n int[] charMap = new int[128];\n for (int i = 0; i < s1.length(); ++i) {\n charMap[s1.charAt(i)]++;\n }\n\n for (int i = 0; i < s2.length(); ++i) {\n if (--charMap[s2.charAt(i)] < 0) return false;\n }\n\n return true;\n }",
"public static String findCommonChars(String s1, String s2) {\n s1 = s1.trim().toLowerCase();\n s2 = s2.trim().toLowerCase();\n String fin = \"\";\n if (s1.equals(s2)) {\n return \"\";\n } else {\n for (int i = 0; i < s2.length(); i++) {\n if (s1.contains(s2.charAt(i) + \"\")) {\n s1 = s1.replace(s2.charAt(i) + \"\", \"\");\n s2 = s2.replace(s2.charAt(i) + \"\", \"\");\n }\n }\n\n //fin = s1 + s2;\n return s1+s2;\n\n\n }\n }",
"public static Set<Doc> or(Set<Doc> set1, Set<Doc> set2) {\r\n \t\tif(set1 == null)\r\n \t\t\tset1 = new TreeSet<Doc>();\r\n \t\tif(set2 == null)\r\n \t\t\tset2 = new TreeSet<Doc>();\r\n \t\t\r\n \t\tTreeSet<Doc> result = new TreeSet<Doc>(set1);\r\n \t\tresult.addAll(set2);\r\n \t\treturn result;\r\n \t}",
"public static void main(String[] args) {\nString s = \"Paypal\";\r\nString s1 = s.toLowerCase();\r\nchar[] c= s1.toCharArray();\r\n\r\nSet<Character> charset = new HashSet<Character>();\r\nSet<Character> dupcharset = new HashSet<Character>();\r\nfor(int i=0;i<c.length;i++) {\r\n\tBoolean t = charset.add(c[i]);\r\n\tif(!t) {\r\n\t\tdupcharset.add(c[i]);\r\n\t}\r\n\t\r\n}\r\nSystem.out.println(charset);\r\nSystem.out.println(dupcharset);\r\ndupcharset.removeAll(charset);\r\nSystem.out.println(charset);\r\nSystem.out.println(dupcharset);\r\nfor (Character character : charset) {\r\n\tif(character!=' ') {\r\n\t\tSystem.out.println(character);\r\n\t}\r\n}\r\n\t}",
"public static boolean isAnagram(char[]s1, char[]s2)\r\n{\n\t if(s1.length!=s2.length)\r\n\t\t return false; \r\n\t \r\n\t //sort both strings using Arrays sort method\r\n\t Arrays.sort(s1); \r\n\t Arrays.sort(s2);\r\n\t \r\n\t for(int i=0; i<s1.length;i++)\r\n\t if(s1[i]!=s2[i])\r\n\t\t return false; \r\n\t\r\n\treturn true; \r\n\t \r\n}",
"public static Set unionRaw(Set s1, Set s2) {\n\t\t// Warning : HashSet is a raw type. References to generic type HashSet<E> should\n\t\t// be parameterized\n\t\tSet result = new HashSet(s1);\n\t\t// Warning : Type safety: The method addAll(Collection) belongs to the raw type\n\t\t// Set. References to generic type Set<E> should be parameterized\n\t\tresult.addAll(s2);\n\t\treturn result;\n\t}",
"public static HashSet<String> concat(HashSet<String> begs, String mid, HashSet<String> ends, int bLen, int eLen) {\n HashSet<String> c = new HashSet<String>();\n Iterator<String> bitr;\n Iterator<String> eitr; \n int bs = begs.size();\n int es = ends.size();\n if (bs==0 && es==0) {\n if (bLen==0 && eLen==0) {c.add(mid);}\n } else if (bs==0) {\n if (bLen==0) {\n eitr = ends.iterator();\n while(eitr.hasNext()) {\n c.add(mid+\" \"+eitr.next());\n }\n }\n } else if (es==0) {\n if (eLen==0) {\n bitr = begs.iterator();\n while(bitr.hasNext()) {\n c.add(bitr.next()+\" \"+mid);\n }\n }\n } else {\n bitr = begs.iterator();\n eitr = ends.iterator(); \n while(bitr.hasNext()) {\n String beg = bitr.next();\n while(eitr.hasNext()) {\n String end = eitr.next();\n c.add(beg+\" \"+mid+\" \"+end);\n }\n }\n }\n return c;\n }",
"public void union(String first, String second) {\n\t\t\n\t\tString firstRepresentative = find(first);\n\t\tString secondRepresentative = find(second);\n\t\t\n\t\tSet<String> firstSet = null;\n\t\tSet<String> secondSet = null;\n\t\t\n\t\t//look for the sets containing the first and second elements \n\t\tfor(int i = 0; i < disjointSet.size(); i++) {\n\t\t\tMap<String, Set<String>> map = disjointSet.get(i);\n\t\t\tif(map.containsKey(firstRepresentative)) {\n\t\t\t\tfirstSet = map.get(firstRepresentative);\n\t\t\t}\n\t\t\tif(map.containsKey(secondRepresentative)) {\n\t\t\t\tsecondSet = map.get(secondRepresentative);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(firstSet != null && secondSet != null) {\n\t\t\t\n\t\t\t//merge the two sets\n\t\t\tfirstSet.addAll(secondSet);\n\t\t\t\n\t\t\t//select a representative and delete the set already merged \n\t\t\tfor(int i = 0; i < disjointSet.size(); i++) {\n\t\t\t\tMap<String, Set<String>> map = disjointSet.get(i);\n\t\t\t\tif(map.containsKey(firstRepresentative)) {\n\t\t\t\t\tmap.put(firstRepresentative, firstSet);\n\t\t\t\t}\n\t\t\t\telse if(map.containsKey(secondRepresentative)) {\n\t\t\t\t\tmap.remove(secondRepresentative);\n\t\t\t\t\tdisjointSet.remove(i);\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\n\t}",
"public RegexNode ReduceAlternation()\n\t{\n\t\t// Combine adjacent sets/chars\n\n\t\tboolean wasLastSet;\n\t\tboolean lastNodeCannotMerge;\n\t\tRegexOptions optionsLast;\n\t\tRegexOptions optionsAt;\n\t\tint i;\n\t\tint j;\n\t\tRegexNode at;\n\t\tRegexNode prev;\n\n\t\tif (_children == null)\n\t\t{\n\t\t\treturn new RegexNode(RegexNode.Nothing, _options);\n\t\t}\n\n\t\twasLastSet = false;\n\t\tlastNodeCannotMerge = false;\n\t\toptionsLast = RegexOptions.forValue(0);\n\n\t\tfor (i = 0, j = 0; i < _children.size(); i++, j++)\n\t\t{\n\t\t\tat = _children.get(i);\n\n\t\t\tif (j < i)\n\t\t\t{\n\t\t\t\t_children.set(j, at);\n\t\t\t}\n\n\t\t\tfor (;;)\n\t\t\t{\n\t\t\t\tif (at._type == Alternate)\n\t\t\t\t{\n\t\t\t\t\tfor (int k = 0; k < at._children.size(); k++)\n\t\t\t\t\t{\n\t\t\t\t\t\tat._children.get(k)._next = this;\n\t\t\t\t\t}\n\n\t\t\t\t\t//_children.InsertRange(i + 1, at._children);\n\t\t\t\t\t_children.addAll(i + 1, at._children);\n\t\t\t\t\tj--;\n\t\t\t\t}\n\t\t\t\telse if (at._type == Set || at._type == One)\n\t\t\t\t{\n\t\t\t\t\t// Cannot merge sets if L or I options differ, or if either are negated.\n\t\t\t\t\toptionsAt = RegexOptions.forValue(at._options.getValue() & (RegexOptions.RightToLeft.getValue() | RegexOptions.IgnoreCase.getValue()));\n\n\n\t\t\t\t\tif (at._type == Set)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!wasLastSet || optionsLast != optionsAt || lastNodeCannotMerge || !RegexCharClass.IsMergeable(at._str))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\twasLastSet = true;\n\t\t\t\t\t\t\tlastNodeCannotMerge = !RegexCharClass.IsMergeable(at._str);\n\t\t\t\t\t\t\toptionsLast = optionsAt;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if (!wasLastSet || optionsLast != optionsAt || lastNodeCannotMerge)\n\t\t\t\t\t{\n\t\t\t\t\t\twasLastSet = true;\n\t\t\t\t\t\tlastNodeCannotMerge = false;\n\t\t\t\t\t\toptionsLast = optionsAt;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\n\t\t\t\t\t// The last node was a Set or a One, we're a Set or One and our options are the same.\n\t\t\t\t\t// Merge the two nodes.\n\t\t\t\t\tj--;\n\t\t\t\t\tprev = _children.get(j);\n\n\t\t\t\t\tRegexCharClass prevCharClass;\n\t\t\t\t\tif (prev._type == RegexNode.One)\n\t\t\t\t\t{\n\t\t\t\t\t\tprevCharClass = new RegexCharClass();\n\t\t\t\t\t\tprevCharClass.AddChar(prev._ch);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tprevCharClass = RegexCharClass.Parse(prev._str);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (at._type == RegexNode.One)\n\t\t\t\t\t{\n\t\t\t\t\t\tprevCharClass.AddChar(at._ch);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tRegexCharClass atCharClass = RegexCharClass.Parse(at._str);\n\t\t\t\t\t\tprevCharClass.AddCharClass(atCharClass);\n\t\t\t\t\t}\n\n\t\t\t\t\tprev._type = RegexNode.Set;\n\t\t\t\t\tprev._str = prevCharClass.ToStringClass();\n\n\t\t\t\t}\n\t\t\t\telse if (at._type == RegexNode.Nothing)\n\t\t\t\t{\n\t\t\t\t\tj--;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\twasLastSet = false;\n\t\t\t\t\tlastNodeCannotMerge = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (j < i)\n\t\t{\n\t\t\t//_children.removeRange(j, i - j + j);\n\t\t\tArrayExt.removeRange(_children, j, i - j + j);\n\t\t}\n\n\t\treturn StripEnation(RegexNode.Nothing);\n\t}",
"public static void main(String[] args) {\n\n Set<String> set = new LinkedHashSet<>();\n set.add(\"ad\");\n set.add(\"text2\");\n set.add(\"ac\");\n set.add(\"text1\");\n set.add(\"text\");\n set.add(\"text2\");\n\n for (String s : set) {\n System.out.println(s);\n }\n }",
"public static void mashup(String a, String b) {\r\n System.out.println(a + b + a + b);\r\n }",
"public static void main(String[] args) {\r\n\t\tString s1 = \"ababab\";\r\n\t\tString s2 = \"bababa\";\r\n\t\tif(s1.length()!= s2.length()){\r\n\t\t\tSystem.out.println(\"not a anagram\");\r\n\t\t}else{\r\n\t\t\tchar[] c1 = s1.toCharArray();\r\n\t\t\tchar[] c2 = s2.toCharArray();\r\n\t\t//\tusingHashMap(c1, c2);\r\n\t\t\tusingArrays(c1,c2);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}",
"public static void isPermutation(String s1, String s2){\r\n\t\t\t\r\n\t\t\t// Can also do by sorting both string and comparing each character by character\r\n\t\t\t\r\n\t\t\tboolean flag = true;\r\n\t\t\t\r\n\t\t\tArrayList hm = new ArrayList();\r\n\t\t\t\r\n\t\t\tfor(int i = 0 ; i < s1.length(); i++){\r\n\t\t\t\t\r\n\t\t\t\t\thm.add(s1.charAt(i));\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tfor(int i = 0 ; i < s2.length(); i++){\r\n\t\t\t\tif(hm.contains(s2.charAt(i))){\r\n\t\t\t\t\thm.remove((Character)s2.charAt(i));\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tSystem.out.println(\"Not A permutation\");\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\tHashMap hm = new HashMap();\r\n//\t\t\t\r\n//\t\t\tfor(int i = 0 ; i < s1.length(); i++){\r\n//\t\t\t\tif(hm.containsKey(s1.charAt(i))){\r\n//\t\t\t\t\thm.put(s1.charAt(i),hm.get(s1.charAt(i) + 1 ));\r\n//\t\t\t\t}\r\n//\t\t\t\telse{\r\n//\t\t\t\t\thm.put(s1.charAt(i), 1);\r\n//\t\t\t\t}\r\n//\t\t\t}\r\n//\t\t\tfor(int i = 0 ; i < s2.length(); i++){\r\n//\t\t\t\tif(hm.containsKey(s2.charAt(i))){\r\n//\t\t\t\t\thm.put(s2.charAt(i),hm.get(s2.charAt(i) - 1 ));\r\n//\t\t\t\t}\r\n//\t\t\t\telse{\r\n//\t\t\t\t\tflag = false;\r\n//\t\t\t\t}\r\n//\t\t\t}\r\n\t\t\t\r\n\t\t\tif (hm.size()==0)\r\n\t\t\t\tSystem.out.println(\"Permutations\");\r\n\t\t\telse\r\n\t\t\t\tSystem.out.println(\"Not Permutations\");\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t// Checking by creating ascii character array\r\n\t\t\tif (s1.length() != s2.length()) {\r\n\t\t\t\tSystem.out.println(\"Second Solution Not Permutation\");\r\n\t\t\t\t}\r\n\t\t\t\tint[] letters = new int[256]; // Assumption\r\n\t\t\t\t\tchar[] s_array = s1.toCharArray();\r\n\t\t\t\tfor (char c : s_array) { // count number of each char in s.\r\n\t\t\t\t letters[c]++;\r\n\t\t\t\t }\r\n\t\t\t\t\r\n\t\t\t\t for (int i = 0; i < s2.length(); i++) {\r\n\t\t\t\t int c = (int) s2.charAt(i);\r\n\t\t\t\t if (--letters[c] < 0) {\r\n\t\t\t\t System.out.println(\" Second Solution Not Permutation\");\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}",
"public static void main(String[] args) {\n\n Set<String> mySetList = new SetC<>();\n Set<String> hashSetList = new HashSet<>();\n\n\n\n mySetList.add(\"Тест1\"); hashSetList.add(\"Тест1\");\n mySetList.add(\"Тест2\"); hashSetList.add(\"Тест2\");\n mySetList.add(\"Тест3\"); hashSetList.add(\"Тест3\");\n\n\n\n System.out.println(\"mySetList:\"+mySetList+\"\\nhashSetList:\"+hashSetList);\n\n\n\n }",
"private static Map<Character, Set<Character>> genLessMap(String[] words) throws Exception {\n Map<Character, Set<Character>> map = new HashMap<>();\n for (int i = 1; i < words.length; i ++) {\n String a = words[i - 1];\n String b = words[i];\n boolean allEqual = true;\n for (int j = 0; j < a.length() && j < b.length(); j ++) {\n if (a.charAt(j) == b.charAt(j))\n continue;\n allEqual = false;\n Set<Character> sb = map.get(a.charAt(j));\n if (sb == null) {\n sb = new HashSet<Character>();\n map.put(a.charAt(j), sb);\n }\n sb.add(b.charAt(j));\n break;\n }\n if (allEqual && a.length() > b.length())\n throw new Exception(\"Invalid.\");\n }\n return map;\n }",
"static String morganAndString(String a, String b) {\n\n\t\tString result = \"\";\n\n\t\tint pointerA = 0, pointerB = 0;\n\n\t\touter:\n\t\t\twhile ( pointerA < a.length() || pointerB < b.length()){\n\t\t\t\tif ( pointerA == a.length()) {\n\t\t\t\t\tresult = result + b.charAt(pointerB++);\n\t\t\t\t}\n\t\t\t\telse if ( pointerB == b.length()) {\n\t\t\t\t\tresult = result + a.charAt(pointerA++);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tchar ca = a.charAt ( pointerA );\n\t\t\t\t\tchar cb = b.charAt ( pointerB );\n\n\t\t\t\t\tif ( ca < cb ) {\n\t\t\t\t\t\tresult = result + ca;\n\t\t\t\t\t\tpointerA++;\n\t\t\t\t\t}\n\t\t\t\t\telse if ( cb < ca ){\n\t\t\t\t\t\tresult = result + cb;\n\t\t\t\t\t\tpointerB++;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// Find the smallest successor.\n\t\t\t\t\t\tint extraPointer = 1;\n\t\t\t\t\t\twhile ( pointerA + extraPointer < a.length() && pointerB + extraPointer < b.length()){\n\t\t\t\t\t\t\tchar cEa = a.charAt ( pointerA + extraPointer);\n\t\t\t\t\t\t\tchar cEb = b.charAt ( pointerB + extraPointer);\n\n\t\t\t\t\t\t\tif ( cEa < cEb ){\n\t\t\t\t\t\t\t\tresult = result + cEa;\n\t\t\t\t\t\t\t\tpointerA++;\n\t\t\t\t\t\t\t\tcontinue outer;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if ( cEb < cEa ){\n\t\t\t\t\t\t\t\tresult = result + cEb;\n\n\n\t\t\t\t\t\t\t\tpointerB++;\n\t\t\t\t\t\t\t\tcontinue outer;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\textraPointer++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// We got to the point in which both are the same.\n\t\t\t\t\t\tif ( pointerA + extraPointer == a.length() && pointerB + extraPointer == b.length()){\n\t\t\t\t\t\t\t// Both are equal. It doesn't matter which one I take it from.\n\t\t\t\t\t\t\tresult = result + ca;\n\t\t\t\t\t\t\tpointerA++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tif ( pointerA + extraPointer == a.length() ){\n\t\t\t\t\t\t\t\t// Compare the current one of B with the next letter.\n\t\t\t\t\t\t\t\t// If next letter is smaller than current one, cut from here.\n\t\t\t\t\t\t\t\t// else, cut from A.\n\t\t\t\t\t\t\t\tif ( b.charAt ( pointerB + extraPointer ) > b.charAt ( pointerB + extraPointer + 1)){\n\t\t\t\t\t\t\t\t\tresult = result + cb;\n\t\t\t\t\t\t\t\t\tpointerB++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tresult = result + ca;\n\t\t\t\t\t\t\t\t\tpointerA++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t// The opposite.\n\t\t\t\t\t\t\t\t// Compare the current one of B with the next letter.\n\t\t\t\t\t\t\t\t// If next letter is smaller than current one, cut from here.\n\t\t\t\t\t\t\t\t// else, cut from A.\n\t\t\t\t\t\t\t\tif ( a.charAt ( pointerA + extraPointer ) > a.charAt ( pointerA + extraPointer + 1)){\n\t\t\t\t\t\t\t\t\tresult = result + ca;\n\t\t\t\t\t\t\t\t\tpointerA++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tresult = result + cb;\n\t\t\t\t\t\t\t\t\tpointerB++;\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\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\treturn result;\n\n\n\t}",
"static String twoStrings(String s1, String s2){\n // Complete this function\n String letters = \"abcdefghijklmnopqrstuvwxyz\";\n for(int i=0;i<letters.length();i++){\n char lettersChar = letters.charAt(i); \n if(s1.indexOf(lettersChar) > -1 && s2.indexOf(lettersChar) > -1){\n return \"YES\";\n }\n }\n \n return \"NO\";\n }",
"public static boolean isAnagram1(String s1, String s2) {\r\n int[] arr = new int[256]; //Number of Ascii Values\r\n\r\n for (int i = 0; i < s1.length(); i++) {\r\n arr[s1.charAt(i)]++;\r\n arr[s2.charAt(i)]--;\r\n }\r\n\r\n for (int i = 0; i < arr.length; i++) {\r\n if (arr[i] != 0) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }",
"private static int[] union(int[] items1, int[] items2) {\n\t\tSet<Integer> itemSet = new HashSet<Integer>();\n\t\tfor(int i : items1) {\n\t\t\titemSet.add(i);\n\t\t}\n\t\tfor(int i : items2){\n\t\t\titemSet.add(i);\n\t\t}\n\t\tint[] items = new int[itemSet.size()];\n\t\tint i = 0;\n\t\tfor(int val : itemSet){\n\t\t\titems[i++] = val; \n\t\t}\n\t\treturn items;\n\t}",
"public static void main(String[] args) {\n Set<String>list=new LinkedHashSet<>();\n list.add(\"Work\");\n list.add(\" smart\");\n list.add(\" not\");\n list.add(\" hard\");\n\n String str2=\"\";\n\n for(String str:list){\n str2+=str;\n }\n System.out.println(str2);\n }",
"public static <T> Set<T> union(final Set<T> a, final Set<T> b) {\n return new Set<T>() {\n public boolean has(final T n) {\n return a.has(n) || b.has(n);\n }\n };\n }",
"private void updateCharSet(String s, HashSet<Character> charSet) {\n for (int i = 0; i < s.length(); ++i)\n charSet.add(s.charAt(i));\n }",
"int[] union(int s1,int t1,int s2,int t2)\r\n\t{\r\n\t\tint [] st=new int[2];\r\n\t\t//Please fill in the program here\r\n\t\tst[0] = incCapacity();\r\n\t\taddEdge(st[0], epssymbol, s1);\r\n\t\taddEdge(st[0], epssymbol, s2);\r\n\t\tst[1] = incCapacity();\r\n\t\taddEdge(t1, epssymbol, st[1]);\r\n\t\taddEdge(t2, epssymbol, st[1]);\r\n\r\n\t\treturn st;\r\n\t}",
"public SetSet setUnion(SetSet second){\n\t\tSetSet result = new SetSet(contents);\n\t\tfor(int i=0;i<second.size();i++){\n\t\t\tresult.add(second.get(i));\n\t\t}\n\t\treturn result;\n\t}",
"public boolean isIsomorphic(String str1, String str2) {\r\n if(str1.length() != str2.length()) return false;\r\n \r\n int[] arr1 = new int[256];\r\n int[] arr2 = new int[256];\r\n \r\n Arrays.fill(arr1, -1);\r\n Arrays.fill(arr2, -1);\r\n \r\n for(int i=0;i<str1.length();i++){\r\n int value1 = str1.charAt(i);\r\n int value2 = str2.charAt(i);\r\n if(arr1[value1]== -1){\r\n arr1[value1] = value2;\r\n } else {\r\n if(arr1[value1] != value2) return false;\r\n }\r\n \r\n if(arr2[value2]== -1){\r\n arr2[value2] = value1;\r\n } else {\r\n if(arr2[value2] != value1) return false;\r\n }\r\n \r\n }\r\n return true;\r\n \r\n}",
"public static void main(String[] args) {\n\t\tString num1 = \"123455\";\n\t\tString num2 = \"56789\";\n\t\tSystem.out.println(addStrings(num1, num2));\n\t}",
"private static Set symmetricSetDifference (Set<Integer> set1, Set<Integer> set2)\n {\n Set<Integer> skæringspunktet = new HashSet<Integer>(set1);\n\n // Holder på set2 også\n skæringspunktet.retainAll(set2);\n\n // Set1 fjerner alt fra Settet\n set1.removeAll(skæringspunktet);\n // Set1 fjerner alt fra Settet\n set2.removeAll(skæringspunktet);\n\n // Tilføjer alt fra set2 til set1\n set1.addAll(set2);\n\n // Returnerer set1\n return set1;\n }",
"public Set Product(Set secondSet) {\n\t\t\n\t\tArrayList<String> firstArray = noDuplicates(stringArray);\n\t\t// Taking out duplications out of our sets by calling the noDuplicates private function\n\t\tArrayList<String> secondArray = noDuplicates(secondSet.returnArray());\n\t\t\n\t\tArrayList<String> productOfBoth = new ArrayList<String>();\n\t\t// New ArrayList to hold the final values\n\t\t\n\t\tfor (int i=0; i < firstArray.size(); i++) {\n\t\t\tfor (int j=0; j < secondArray.size(); j++) {\n\t\t\t\tif (firstArray.get(i).equals(\"emptyElement\") == false && secondArray.get(j).equals(\"emptyElement\") == false) {\n\t\t\t\t\tproductOfBoth.add(firstArray.get(i)+secondArray.get(j));\n\t\t\t\t\t// If the both indices of our first and second array we are calling are not empty strings (Strings containing\n\t\t\t\t\t// the phrase \"emptyElement\"), then add both items concatinated together\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tSet productReturn = new Set(productOfBoth); // Initiate a Set object from our final ArrayList\n\t\t\n\t\treturn productReturn; // Return the final Set Object\n\t\t\n\t}",
"static int makeAnagram1(String a, String b) {\n int count = 0;\n Map<Character, Integer> mapA = initMap(a);\n Map<Character, Integer> mapB = initMap(b);\n\n Iterator<Character> it = mapA.keySet().iterator();\n while (it.hasNext()) {\n char c = it.next();\n int frequencyA = mapA.get(c);\n if (mapB.containsKey(c)) {\n int frequencyB = mapB.get(c);\n count += Math.abs(frequencyA - frequencyB);\n int min = Math.min(frequencyA, frequencyB);\n mapA.put(c, min);\n mapB.put(c, min);\n } else {\n count += frequencyA;\n }\n }\n\n it = mapB.keySet().iterator();\n while (it.hasNext()) {\n char c = it.next();\n int frequencyB = mapB.get(c);\n if (mapA.containsKey(c)) {\n int frequencyA = mapA.get(c);\n count += Math.abs(frequencyA - frequencyB);\n int min = Math.min(frequencyA, frequencyB);\n mapA.put(c, min);\n mapB.put(c, min);\n } else {\n count += frequencyB;\n }\n }\n return count;\n }",
"public static Collection<Character> intersect(String string1, String string2){\n\t\t Collection<Character> vector1 = uniqueCharacters(stringToCharacterSet(string1));\n\t\t Collection<Character> vector2 = uniqueCharacters(stringToCharacterSet(string2));\n\t\t Collection<Character> intersectVector = new TreeSet<Character>();\n\t\t for(Character c1 : vector1){\n\t\t\t for(Character c2 : vector2){\n\t\t\t\t if(c1.equals(c2)){\n\t\t\t\t\t intersectVector.add(c1);\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\t\t return intersectVector;\n\t}",
"static String twoStrings(String s1, String s2) {\n Hashtable<Character, Integer> shortDict = null;\n Hashtable<Character, Integer> longDict = null;\n \n boolean isCommonSubset = false;\n \n String longerString = s1.length() >= s2.length() ? s1 : s2;\n String shorterString = s1.length() < s2.length() ? s1 : s2;\n \n longDict = prepareHashtable(longerString);\n shortDict = prepareHashtable(shorterString);\n \n for (char ch: shortDict.keySet()) {\n if (longDict.containsKey(ch)) {\n isCommonSubset = true;\n break;\n }\n }\n \n return isCommonSubset ? \"YES\" : \"NO\";\n }",
"private static boolean union(Map<String, Integer> map, String c1, String c2){\n if(!map.containsKey(c1) && !map.containsKey(c2)){\n map.put(c1, counter);\n map.put(c2, counter);\n counter++;\n return true;\n }\n\n if(!map.containsKey(c1) && map.containsKey(c2)) {\n int newValue = map.get(c2);\n map.put(c1 , newValue);\n return true;\n }\n\n\n if(map.containsKey(c1) && !map.containsKey(c2)) {\n int newValue = map.get(c1);\n map.put(c2 , newValue);\n return true;\n }\n\n\n //If different unions, Make the second oen to be the first one\n if(map.containsKey(c1) && map.containsKey(c2)){\n int newValue = map.get(c1);\n int oldValue = map.get(c2);\n\n if(newValue == oldValue){\n return false;\n }\n\n for(String city : map.keySet()){\n if(map.get(city) == oldValue){\n map.put(city , newValue);\n }\n return true;\n }\n }\n\n return true;\n }",
"Set<String> getUniqueCharacterStrings();",
"public void addSourceTargetSet(UnicodeSet inputFilter, UnicodeSet sourceSet, UnicodeSet targetSet)\n/* */ {\n/* 261 */ UnicodeSet myFilter = getFilterAsUnicodeSet(inputFilter);\n/* 262 */ UnicodeSet items = new UnicodeSet();\n/* 263 */ StringBuilder buffer = new StringBuilder();\n/* 264 */ for (int i = 0; this.spec[i] != 65535;)\n/* */ {\n/* 266 */ int end = i + this.spec[i] + this.spec[(i + 1)] + 5;\n/* 267 */ int radix = this.spec[(i + 2)];\n/* 268 */ for (int j = 0; j < radix; j++) {\n/* 269 */ Utility.appendNumber(buffer, j, radix, 0);\n/* */ }\n/* */ \n/* 272 */ for (int j = i + 5; j < end; j++) {\n/* 273 */ items.add(this.spec[j]);\n/* */ }\n/* */ \n/* 276 */ i = end;\n/* */ }\n/* 278 */ items.addAll(buffer.toString());\n/* 279 */ items.retainAll(myFilter);\n/* */ \n/* 281 */ if (items.size() > 0) {\n/* 282 */ sourceSet.addAll(items);\n/* 283 */ targetSet.addAll(0, 1114111);\n/* */ }\n/* */ }",
"public void mo16912a(String str, Set<String> set) {\n try {\n this.f9119b.edit().putStringSet(str, set).apply();\n } catch (Throwable unused) {\n }\n }",
"public static void main(String[] args) {\n String str1 = \"listen\";\n String str2 = \"silent\";\n for (int i = 0; i < str1.length(); i++) {\n str2 = str2.replaceFirst(\"\" + str1.charAt(i), \"\");\n }\n System.out.println(str2.isEmpty() ? \"Anagram\" : \"NOT Anagram\");\n\n/*\n //Approach Two:\n String str1 = \"listen\";\n String str2 = \"silent\";\n String str11 = \"\";\n String str22 = \"\";\n char[] ch1 = str1.toCharArray();\n char[] ch2 = str2.toCharArray();\n Arrays.sort(ch1);\n Arrays.sort(ch2);\n for (char each:ch1) {\n str11+=each;\n }\n for (char each:ch2) {\n str22+=each;\n }\n System.out.println(str11.equalsTo(str22)? \"Anagram\" : \"NOT Anagram\");\n\n */\n/*\n\n //Approach Three:\n public static boolean Same(String str12, String str2) {\n str1 = new TreeSet<String>(Arrays.asList( str1.split(\"\") ) ).toString( );\n str2 = new TreeSet<String>(Arrays.asList( str2.split(\"\") ) ).toString( );\n return str1.equals(str2); }\n*/\n }",
"public static void main(String[] args) {\n\t\t\n\t\t\n\t\tAnagramCheck();\n\t\tSet<Character> se = new HashSet<Character>();\n\t\tSet<Character> se1 = new HashSet<Character>();\n\t\t\n\t\tStringBuffer sb = new StringBuffer();\n\t\tStringBuffer sb1 = new StringBuffer();\n\t\tString str =\"javav\";\n\t\t\n\t\tfor(int i =0; i <str.length();i++)\n\t\t{\n\t\t\tCharacter ch = str.charAt(i);\n\t\t\t\n\t\t\tif(!se.contains(ch))\n\t\t\t{\n\t\t\t\tse.add(ch);\n\t\t\t\tsb.append(ch);\n\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tse1.add(ch);\n\t\t\t\tsb1.append(ch);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\tSystem.out.println(\"The duplicates after removed \"+sb.toString());\n\t\t\n\t\tSystem.out.println(\"The duplicate item is \"+sb1.toString());\n\t}",
"private String rebef(String s, char a, char b){\n\t\t\tStringBuilder tmp = new StringBuilder();\t\t\n\t\t\tboolean copy = true;\n\t\t\tfor (int i = 0; i < s.length(); ++i){\n\t\t\t\tif(s.charAt(i) == a) copy = false;\n\t\t\t\tif(copy) tmp.append(s.charAt(i));\n\t\t\t\tif(s.charAt(i) == b) copy = true;\n\t\t\t}\n\t\t\treturn tmp.toString();\n\t\t}",
"@SuppressWarnings(\"unchecked\")\n\tpublic static String[] union(String[] t1, String[] t2) {\n \tSet<String> set = new HashSet<String>();\n \tfor(String t : t1) set.add(t);\n \tfor(String t : t2) set.add(t);\n \treturn set.toArray(new String[]{});\n }",
"private static void mergetokens(String tk, String[] a, String[] b, StringBuilder answer) {\n\t\tint[] i = new int[1];\n\t\tint[] j = new int[1];\n\t\twhile(toToken(tk, a, b, i, j, answer)){\n\t\t\tif(i[0] == a.length - 1 && j[0] == b.length - 1){\n\t\t\t\tanswer.append(a[i[0]]);\n\t\t\t\tanswer.append(b[j[0]]);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tString ntk = a[i[0]];\n\t\t\tString[] sa = getTokens(ntk, a, i);\n\t\t\tString[] sb = getTokens(ntk, b, j);\n\t\t\t\n\t\t\tif(sa.length == 0 && sb.length == 0){\n\t\t\t\tfor(; i[0] < a.length && a[i[0]] == ntk; i[0]++){\n\t\t\t\t\tanswer.append(a[i[0]]);\n\t\t\t\t}\n\t\t\t\tfor(; j[0] < b.length && b[j[0]] == ntk; j[0]++){\n\t\t\t\t\tanswer.append(b[i[0]]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tmergetokens(ntk, sa, sb, answer);\n\t\t}\n\t}",
"String combine(String pattern1, String pattern2);",
"public String nonStart(String a, String b) {\r\n String shortA = a.length() > 0 ? a.substring(1) : a;\r\n String shortB = b.length() > 0 ? b.substring(1) : b;\r\n\r\n return shortA + shortB;\r\n }",
"public Set<Character> alphabet(){\n\t\tSet<Character> a = new HashSet<Character>();\n\t\ta.addAll(gauche.alphabet());\n\t\ta.addAll(droit.alphabet());\n\t\treturn a;\n\t}",
"private int[] add(int[] a, int[] b)\n {\n int tI = a.length - 1;\n int vI = b.length - 1;\n long m = 0;\n\n while (vI >= 0)\n {\n m += (((long)a[tI]) & IMASK) + (((long)b[vI--]) & IMASK);\n a[tI--] = (int)m;\n m >>>= 32;\n }\n\n while (tI >= 0 && m != 0)\n {\n m += (((long)a[tI]) & IMASK);\n a[tI--] = (int)m;\n m >>>= 32;\n }\n\n return a;\n }",
"private int[] add(int[] a, int[] b)\n {\n int tI = a.length - 1;\n int vI = b.length - 1;\n long m = 0;\n\n while (vI >= 0)\n {\n m += (((long)a[tI]) & IMASK) + (((long)b[vI--]) & IMASK);\n a[tI--] = (int)m;\n m >>>= 32;\n }\n\n while (tI >= 0 && m != 0)\n {\n m += (((long)a[tI]) & IMASK);\n a[tI--] = (int)m;\n m >>>= 32;\n }\n\n return a;\n }",
"@Test\r\n\t\tpublic void testUnion() {\n\t\t\ttestingSet = new IntegerSet(list1);\r\n\t\t\ttestingSet2= new IntegerSet(list2);\r\n\t\t\t// 3rd set =to the union of the two lists \r\n\t\t\ttestingSet3= new IntegerSet(union);\r\n\t\t\t// 4th set equal to the union of sets 1 and 2 \r\n\t\t\ttestingSet4= testingSet.union(testingSet, testingSet2);\r\n\t\t\t// sets 3 and 4 should be equal\r\n\t\t\t// assertEquals method is deprecated \r\n\t\t\tassertArrayEquals(testingSet3.toArray(),testingSet4.toArray());\r\n\t\t\t \r\n\t\t}",
"@Test\n public void testEqualChars2() {\n char a = 'a';\n char b = 'b';\n char c = '1';\n char d = '2';\n\n boolean result1 = offByOne.equalChars(a, b);\n boolean result2 = offByOne.equalChars(c, d);\n\n assertTrue(result1);\n assertTrue(result2);\n }",
"private Set<String> intersection(Set<String> s1, Set<String> s2) {\n Set<String> intersection = new HashSet<>(s1);\n intersection.retainAll(s2);\n return intersection;\n }",
"public static void main(String[] args) {\n\t\tScanner in =new Scanner(System.in);\r\n\t\twhile(in.hasNext()){\r\n\t\t\tint n=in.nextInt();\r\n\t\t\tSet<String> hset1=new LinkedHashSet<String>();\r\n\t\t\tSet<String> hset2=new LinkedHashSet<String>();\r\n\t\t\tif(n>=1){\r\n\t\t\t\t\r\n\t\t\t\thset1.add(\"()\");\r\n\t\t\r\n\t\t\tfor(int i=1;i<n;i++){\r\n\t\t\t\thset2.clear();\r\n\t\t\t\thset2=new HashSet<String>(hset1);\r\n\t\t\t\thset1.clear();\r\n\t\t\t\tfor(String temp:hset2){\r\n\t\t\t\t\tfor(int j=0;j<=temp.length();j++){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\thset1.add(temp.substring(0, j)+\"()\"+temp.substring(j));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor(String temp:hset1){\r\n\t\t\t\tSystem.out.println(temp);\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t\tSystem.out.println();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}",
"public int minCharacters(String a, String b) {\n int[] c1 = new int[26];\n int[] c2 = new int[26];\n for (char c: a.toCharArray()) {\n c1[c-'a']++;\n }\n for (char c: b.toCharArray()) {\n c2[c-'a']++;\n }\n\n // initialize res\n int m = a.length();\n int n = b.length();\n int res = m + n;\n\n // 1. make string a and b only consist of distinct character\n for (int i = 0; i < 26; ++i) {\n // means operations to change all characters(m+n) to character i (c1[i] and c2[i])\n res = Math.min(res, m + n - c1[i] - c2[i]);\n }\n\n // cal prefix sum\n // this prefix sum represents the frequency of all characters less than i;\n for (int i = 1; i < 26; ++i) {\n c1[i] += c1[i - 1];\n c2[i] += c2[i - 1];\n }\n\n // 2,3 a less than b or b less than a\n // why the up-limit is 25? cos, the character 'z' can not be the base character. there is no one\n for (int i = 0; i < 25; ++i) {\n // c1[i] for freq of characters less than or equal to i in a\n // c2[i] for freq of characters less than or equal to i in b\n\n // 2. make a < b\n // replace all characters less or equal to i in `b` to larger ones and all characters grater than i in `a` to less ones\n res = Math.min(res, c2[i] + m - c1[i]);\n // 3. make a > b\n // replace all characters less or equal to i in `a` to larger ones and all characters grater than i in `b` to less ones\n res = Math.min(res, c1[i] + n - c2[i]);\n }\n return res;\n }",
"private static boolean isAnagram(String a, String b) {\n\t\tint[] charsA = new int[26];\n\t\tint[] charsB = new int[26];\n\t\t\n\t\tfor(int i = 0 ; i < a.length(); i++)\n\t\t\tcharsA[a.charAt(i) - 'a']++;\n\t\tfor(int i = 0 ; i < b.length(); i++)\n\t\t\tcharsB[b.charAt(i) - 'a']++;\n\t\t\n\t\tfor(int i = 0 ; i < 26 ; i++) \n\t\t\tif(charsA[i] != charsB[i])\n\t\t\t\treturn false;\n\t\treturn true;\n\t}",
"private static int coutSubst(char c1, char c2)\n {\n if (c1 == c2) return 0;\n return 1;\n }",
"public static void parseSetExp() {\n parseSLevel2();\n if (currToken.tokenType == Token.SETDIFFERENCE) {\n //TODO: Consume set difference token and add to output\n sb.append(\".intersect(\");\n getNextToken();\n parseSetExp();\n sb.append(\".complement())\");\n }\n \n }",
"public static boolean isAnagram(String strOne, String strTwo) throws IllegalArgumentException {\n if (strOne == null || strTwo == null)\n throw new IllegalArgumentException(\"One or both strings is null\");\n\n /**\n * Replace spaces and lower case the strings, note that we could\n * do this check while building up the map, but this is somewhat simpler\n * to understand/read, and it also allows us to not have to check to index\n * out of bounds issues when iterating through characters\n */\n String strOneCopy = strOne.replaceAll(\"\\\\s\", \"\").toLowerCase();\n String strTwoCopy = strTwo.replaceAll(\"\\\\s\", \"\").toLowerCase();\n\n if (strOne.isEmpty() || strTwo.isEmpty())\n return false;\n\n int strOneLen = strOneCopy.length();\n int strTwoLen = strTwoCopy.length();\n\n // If the strings aren't the same length they cannot be anagrams\n if (strOneLen != strTwoLen)\n return false;\n\n HashMap<Character, Integer> charCount = new HashMap<Character, Integer>();\n\n\n /**\n * Build a map of the counts of each character.\n *\n * The count will be positive if a character appears in first string one or more\n * times more than it appears in the second string\n *\n * The count will be negative if a character appears in second string one or more\n * times more than it appears in the first string\n */\n for (int i = 0; i < strOneLen; i++) {\n\n /**\n * Get the character from string one, we're not worried about out of bound index issues here\n * as we've already checked that the strings are the same length so there should\n * be characters at every index here for both strings\n */\n char charValKey = strOneCopy.charAt(i);\n\n int charKeyCount = 0;\n\n // Check if we've already seen this character and get the existing count if so\n if (charCount.containsKey(charValKey))\n charKeyCount = charCount.get(charValKey);\n\n // Increment the count\n charCount.put(charValKey, ++charKeyCount);\n\n\n /**\n * Get the character from string two, we're not worried about out of bound index issues here\n * as we've already checked that the strings are the same length so there should\n * be characters at every index here for both strings\n */\n charValKey = strTwoCopy.charAt(i);\n charKeyCount = 0;\n\n // Check if we've already seen this character and get the existing count if so\n if (charCount.containsKey(charValKey))\n charKeyCount = charCount.get(charValKey);\n\n // Decrement the count\n charCount.put(charValKey, --charKeyCount);\n\n }\n\n\n for (int value : charCount.values()) {\n if (value != 0)\n return false;\n }\n\n return true;\n }",
"@Test\n public void testEqualChars1() {\n char a = 'a';\n char b = 'a';\n char c = 'z';\n char d = 'B';\n\n boolean result1 = offByOne.equalChars(a, b);\n boolean result2 = offByOne.equalChars(a, c);\n boolean result3 = offByOne.equalChars(a, d);\n\n assertFalse(result1);\n assertFalse(result2);\n assertFalse(result3);\n }"
]
| [
"0.6645865",
"0.61824876",
"0.6113719",
"0.59895456",
"0.5977779",
"0.59533584",
"0.5941104",
"0.59204406",
"0.5861798",
"0.57408434",
"0.5733892",
"0.5727521",
"0.5722802",
"0.57086194",
"0.56979716",
"0.5697399",
"0.5677421",
"0.5670189",
"0.5669421",
"0.5664786",
"0.5662746",
"0.5652703",
"0.56509316",
"0.56503916",
"0.5633302",
"0.56138927",
"0.56011283",
"0.5592773",
"0.55710924",
"0.5560077",
"0.55549556",
"0.55432105",
"0.5542321",
"0.5519541",
"0.5500728",
"0.5498468",
"0.54888904",
"0.54875547",
"0.543818",
"0.54378486",
"0.54197395",
"0.5417956",
"0.5413103",
"0.5405203",
"0.5402561",
"0.5394549",
"0.5391573",
"0.53892815",
"0.538155",
"0.53805393",
"0.5378354",
"0.53761476",
"0.5369108",
"0.53617734",
"0.53567857",
"0.5345434",
"0.5344135",
"0.53174514",
"0.531731",
"0.53007114",
"0.5295592",
"0.52869004",
"0.5281432",
"0.5279866",
"0.5279433",
"0.52755386",
"0.5262678",
"0.52602386",
"0.5259756",
"0.5254284",
"0.5251018",
"0.52396125",
"0.52391195",
"0.5236854",
"0.52246624",
"0.52236354",
"0.52217376",
"0.52215904",
"0.5221374",
"0.52172786",
"0.5214801",
"0.521405",
"0.51988",
"0.5194988",
"0.51844394",
"0.5182235",
"0.5180841",
"0.51793027",
"0.5179141",
"0.5179141",
"0.51768863",
"0.51767147",
"0.5161388",
"0.515652",
"0.5153402",
"0.5149404",
"0.5146858",
"0.51457435",
"0.5145265",
"0.5143736"
]
| 0.561806 | 25 |
/ Demonstrate how to use Map that includes storing and retrieving elements. Add List into a Map. Like, Map> list = new HashMap>(); Use For Each loop and while loop with Iterator to retrieve data. Use any databases[MongoDB, Oracle, MySql] to store data and retrieve data. Create map to store | public static void main(String[] args) {
Map<String, List<String>> map = new HashMap<String, List<String>>();
// create list one and store values
List<String> valuSetOne = new ArrayList<String>();
valuSetOne.add("Apple");
valuSetOne.add("Banana");
// Create list two and store values
List<String> valuSetTwo = new ArrayList<String>();
valuSetTwo.add("Orange");
valuSetTwo.add("Watermelon");
// Create list three and store values
List<String> valuSetThree = new ArrayList<String>();
valuSetThree.add("Mango");
valuSetThree.add("Pineapple");
// Put values into the map
map.put("A", valuSetOne);
map.put("B", valuSetTwo);
map.put("C", valuSetThree);
//Retrieve values with for each loop
for(Map.Entry<String,List<String>> entry: map.entrySet()){
String key = entry.getKey();
List<String> values = entry.getValue();
System.out.println(key+" " + values);
}
Iterator itr = map.entrySet().iterator();
//Retrieve values with while loop
while (itr.hasNext()){
Map.Entry elements = (Map.Entry)itr.next();
System.out.println(elements.getKey()+" "+elements.getValue());
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main(String[] args) throws java.lang.Exception {\n\t\tMap<Integer, String> state = new HashMap<Integer, String>();\n\t\t//Storing values to Map by put() method\n\t\tstate.put(1, \"NY\");\n\t\tstate.put(2, \"TX\");\n\t\tstate.put(3, \"NJ\");\n\t\tstate.put(4, \"FL\");\n\n\t\t//Retrieving values by get() method\n\t\tString var = state.get(2);\n\t\tSystem.out.println(\"Value at index 2 is: \" + var);\n\t\tString var1 = state.get(3);\n\t\tSystem.out.println(\"Value at index 3 is: \" + var1);\n\n\t\tList<String> cityOfUS = new ArrayList<String>();\n\t\tcityOfUS.add(\"Miami\");\n\t\tcityOfUS.add(\"Sacramento\");\n\t\tcityOfUS.add(\"Rochester\");\n\n\t\tList<String> cityOfCanada = new ArrayList<String>();\n\t\tcityOfCanada.add(\"Vancouver\");\n\t\tcityOfCanada.add(\"Toronto\");\n\t\tcityOfCanada.add(\"Quebec City\");\n\n\t\tList<String> cityOfMexico = new ArrayList<String>();\n\t\tcityOfMexico.add(\"Tijuana\");\n\t\tcityOfMexico.add(\"Cancun\");\n\t\tcityOfMexico.add(\"Mexico City\");\n\n\t\t//Add List<String> into a Map. Like, Map<String, List<string>> list = new HashMap<String, List<String>>();\n\t\tMap<String, List<String>> b = new HashMap<String, List<String>>();\n\t\tb.put(\"US\", cityOfUS);\n\t\tb.put(\"Canada\", cityOfCanada);\n\t\tb.put(\"Mexico\", cityOfMexico);\n\n\t\t//Retrieve with while loop and iterator\n\t\tSystem.out.println(\"Retrieve with while loop and iterator\");\n\t\tIterator<Map.Entry<String, List<String>>> it = b.entrySet().iterator();\n\t\twhile (it.hasNext()) {\n\t\t\tMap.Entry<String, List<String>> x = it.next();\n\t\t\tSystem.out.println(x.getKey() + \" \" + x.getValue());\n\t\t}\n\n\t\t//Retrieve with For each Loop\n\t\tSystem.out.println(\"Retrieve with For each Loop\");\n\t\tfor (Map.Entry entry : b.entrySet()) {\n\t\t\tSystem.out.println(entry.getKey() + \" \" + entry.getValue());\n\t\t}\n\n\t\t//Connect to Database\n\t\tConnectToSqlDB connectToSqlDB = new ConnectToSqlDB();\n\n\t\t//Creating table, inserting data and read values\n\t\tconnectToSqlDB.createTableFromStringToMySql(\"tbl_map\", \"mapKey\", \"mapValue\");\n\t\tfor (Object str : b.keySet()) {\n\t\t\tfor (String str1 : b.get(str)) {\n\t\t\t\tList<String> list1 = new ArrayList<String>();\n\t\t\t\tlist1.add(str.toString()); // adds key\n\t\t\t\tlist1.add(str1); // adds value\n\t\t\t\t// Insert data in the database\n\t\t\t\tconnectToSqlDB.InsertDataFromArrayListToMySql(list1, \"tbl_map\", \"mapKey\", \"mapValue\");\n\t\t\t}\n\t\t}\n\n\t\t//System.out.println(\"Reading data from database: \");\n\t\t//Reading data from database\n\t\tList<String> numbers = connectToSqlDB.readDataBase(\"tbl_map\", \"mapKey\", \"mapValue\");\n\n\t\tfor (String st : numbers) {\n\t\t\tSystem.out.println(st);\n\t\t}\n\t}",
"public static void main(String[] args) {\n\t\tProduct proone=new Product();\r\n\t\tproone.setProdid(10001);\r\n\t\tproone.setProdname(\"lg\");\r\n\t\tproone.setProdprice(1181.11);\r\n\t\t\r\n\t\tProduct protwo=new Product();\r\n\t\tprotwo.setProdid(10008);\r\n\t\tprotwo.setProdname(\"lg\");\r\n\t\tprotwo.setProdprice(1181.11);\r\n\t\t\r\n\t\tProduct prothree=new Product();\r\n\t\tprothree.setProdid(10011);\r\n\t\tprothree.setProdname(\"lg\");\r\n\t\tprothree.setProdprice(1181.11);\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n /* Map<Integer,String> myMap=new HashMap<>();\r\n myMap.put(1, \"abcd\");\r\n myMap.put(2,\"life\");\r\n myMap.put(3,\"veena\");\r\n */\r\n\t\t Map<Integer,Product> myMap=new HashMap<>();\r\n\t myMap.put(1, protwo);\r\n\t myMap.put(3,prothree);\r\n System.out.println(myMap);\r\n System.out.println(myMap.keySet());//give all keys\r\n System.out.println(myMap.get(2));\r\n System.out.println(myMap.values());//all values\r\n System.out.println(\"____________________for loop_=====================\");\r\n \r\n for(Integer keys:myMap.keySet())\r\n {\r\n \t System.out.println(\"Keys are:\"+keys+\"Values \"+myMap.get(keys));\r\n }\r\n for(Integer keys:myMap.keySet())\r\n {\r\n \t System.out.println(myMap.get(keys).getProdid());\r\n \t System.out.println(myMap.get(keys).getProdname());\r\n \t System.out.println(myMap.get(keys).getProdprice());\r\n \t \r\n }\r\n System.out.println(\"____________________Iterator=====================\");\r\n \r\n // Iterator it=myMap.iterator(); error becoz map is not part of collection but list nd set are part of collection\r\n //convert to set wid help of keyset...keyset will only convert keys entryset will convert evrythng\r\n \r\n Set myData=myMap.entrySet();\r\n Iterator it=myData.iterator();\r\n \r\n while(it.hasNext())\r\n {\r\n \t System.out.println(it.next());\r\n }\r\n \r\n System.out.println(\"============================\");\r\n //Collections.sort(myMap);\r\n \r\n // Set<Product> trgtset=new HashSet<>(myMap.values());\r\n Collection<Product> mySet=myMap.values(); \r\n //Set<Product> sett=new TreeSet<>(mySet);\r\n List<Product> myList=new LinkedList<>(mySet);\r\n Collections.sort(myList);\r\n \r\n /* for(Product prod:myList)\r\n {\r\n \t System.out.println(prod.getProdid());\r\n \t System.out.println(prod.getProdname());\r\n \t System.out.println(prod.getProdprice());\r\n }\r\n\r\n */\r\n Iterator it1=myData.iterator();\r\n \r\n while(it1.hasNext())\r\n {\r\n \t System.out.println(it1.next());\r\n }\r\n Map mp=new HashMap<>();\r\n mp.put(null,null);\r\n mp.put(1, null);\r\n mp.put(2, null);\r\n mp.put(null,null);\r\n System.out.println(mp);\r\n //is same above snippet written with map mp=new HashTable<>() it will giv nullpointer exception\r\n \r\n\t}",
"private void hashMapDemo() {\n HashMap map = new HashMap();\n ArrayList<String> friendList = new ArrayList<>();\n \n // Add items to the ArrayList\n friendList.add(\"Jonathan\");\n friendList.add(\"Jasmine\");\n friendList.add(\"Craig\");\n \n // Add values to the HashMap\n map.put(\"Name\", \"Jonathan\");\n map.put(\"Age\", 26);\n \n // Attempt to add an ArrayList as a value\n map.put(\"Friends\", friendList);\n \n System.out.println(map);\n \n System.out.println(\"Name: \" + map.get(\"Name\"));\n System.out.println(\"Age: \" + map.get(\"Age\"));\n \n // To get the friends list to print out properly we have to iterate through it\n System.out.println(\"Friends: \");\n \n ListIterator iterator = friendList.listIterator();\n \n while (iterator.hasNext()) {\n \n System.out.println(\"\\t\" + iterator.next());\n \n }\n \n }",
"public static void main(String[] args) {\n\n List<String> cityofUsa = new LinkedList<>();\n\n cityofUsa.add(\"New York\");\n cityofUsa.add(\"CA\");\n cityofUsa.add(\"FL\");\n cityofUsa.add(\"NJ\");\n\n List<String> cityofCanada = new LinkedList<>();\n\n cityofCanada.add(\"Toronto\");\n cityofCanada.add(\"Vancouver\");\n cityofCanada.add(\"Calgary\");\n cityofCanada.add(\"Alberta\");\n\n Map<Integer,List<String>> map = new HashMap<>();\n\n map.put(1, cityofUsa);\n map.put(2, cityofCanada);\n\n for (Map.Entry<Integer,List<String>> city: map.entrySet()){\n System.out.println(\"->\"+city.getValue());\n }\n\n\t/*Map<Integer,String> map = new LinkedHashMap<>();\n\n\tmap.put(1, \"New York\");\n\tmap.put(2, \"NJ\");\n\tmap.put(3, \"California\");\n\n\tfor (Map.Entry<Integer,String> city: map.entrySet()){\n\tSystem.out.println(city.getKey()+\"->\"+city.getValue());\n\t}\n System.out.println(map.get(3));\n\n\t */\n }",
"public static void main(String[] args) {\n\n\t LinkedHashMap<Integer, String> hm = new LinkedHashMap<Integer, String>(); \n\t \n // Inserting the Elements \n hm.put(3, \"Geeks\"); \n hm.put(2, \"For\"); \n hm.put(1, \"Geeks\"); \n \n for (Map.Entry<Integer, String> mapElement : hm.entrySet()) { \n \n Integer key = mapElement.getKey(); \n \n // Finding the value \n String value = mapElement.getValue(); \n \n // print the key : value pair \n System.out.println(key + \" : \" + value); \n\t}\n\n}",
"public static void main(String[] args) {\n Person.insertToPeopleMap(new Person(39105153322l,\"Romas\",\"Garkas\"));\n Person.insertToPeopleMap(new Person(38512013245l,\"Arnas\",\"Lionginas\"));\n Person.insertToPeopleMap(new Person(48603142299l,\"Maryte\",\"Melninkaite\"));\n Person.insertToPeopleMap(new Person(49009103377l,\"Dalia\",\"Morka\"));\n Person.insertToPeopleMap(new Person(49009103377l,\"Milda\",\"Morkiene\"));\n\n\n for (Map.Entry<Long, List<Person>> personEntry : Person.getPeople().entrySet()){\n for (Person person : personEntry.getValue()){\n System.out.println(\"A.K.: \" + person.getCitizenCode() + \" Vardas: \" + person.getName() + \" Pavarde: \" + person.getSurname());\n }\n }\n }",
"public static void main(String[] args) {\n\t\tMap myMap = new HashMap();\r\n\t\tmyMap.put(91,\"India\");\r\n\t\tmyMap.put(65,\"Singapore\");\r\n\t\tmyMap.put(94, \"SriLanka\");\r\n\t\tmyMap.put(971, \"Dubai\");\r\n\t\tmyMap.put(91,\"India\");\r\n\t\tmyMap.put(98,\"India\");\r\n\t\tmyMap.put(null,\"India\");\r\n\t\tmyMap.put(null, \"SriLanka\");\r\n\t\tmyMap.put(99,null);\r\n\t\tmyMap.put(199,null);\r\n\t\t\r\n\t\tSystem.out.println(\"myMap :\"+myMap);\r\n\t\t\r\n\t\tSet keySet= myMap.keySet();\r\n\t\tSystem.out.println(\"keySet : \"+keySet);\r\n\t\t\r\n//\t\tfor (int i=0;i<keySet.size();i++) {\t\t\t\r\n//\t\t\tSystem.out.println(myMap.get(keySet));\r\n//\t\t}\r\n\t\tSystem.out.println(\"Using Iterator & while loop\");\r\n\t\tIterator itr = keySet.iterator();\r\n\t\twhile(itr.hasNext()) {\r\n\t\t\tSystem.out.println(myMap.get(itr.next()));\r\n\t\t}\r\n\t\tSystem.out.println(\"Using Enhanced for loop\");\r\n\t\tfor (Object object : keySet) {\r\n\t\t\tSystem.out.println(myMap.get(object));\r\n\t\t}\r\n\t}",
"public static void main(String[] args) {\n\tMap <String, Integer>phones=new HashMap<>();\r\n\tphones.put(\"Mila\", 98232433);\r\n\tphones.put(\"Jenia\", 2834732);\r\n\tphones.put(\"Yerlan\", 77398274);\r\n\tphones.put(\"Mila\",1263584);\r\n\t//last one will override the first one\r\n\t\r\n\tIterator <String> iterator=phones.keySet().iterator();\r\n\twhile (iterator.hasNext()){\r\n\t\tString key=iterator.next();\r\n\t\tInteger value=phones.get(key);\r\n\t\tSystem.out.println(key+\" \"+value);\r\n\t}\r\n\t\r\n\t//store keys in Set\r\n\tSet<String> keys=phones.keySet();\r\n\tfor (String key : keys) {\r\n\t\tSystem.out.println(key);\r\n\t}\r\n\t//store values in Collection\r\n Collection <Integer> val=phones.values();\r\n for (Integer values : val) {\r\n \tSystem.out.println(values);\r\n\t\t\r\n\t}\r\n \r\n Set<Entry<String,Integer>> entry=phones.entrySet();\r\n for (Entry<String, Integer> entry2 : entry) {\r\n\t\t//System.out.println(entry2);\r\n\t\tSystem.out.println(entry2.getKey()+\" \"+entry2.getValue());\r\n\t}\r\n}",
"public static Map<Long, Book> readToMap() throws ApplicationException {\r\n ArrayList<String> bookList = readFile();\r\n Map<Long, Book> books = new HashMap<>();\r\n\r\n for (int i = 0; i < bookList.size(); i++) {\r\n String[] rows = bookList.get(i).split(COMMA_DELIMITER, -1);\r\n Book book = readBookString(rows);\r\n books.put(book.getId(), book);\r\n LOG.debug(String.format(\"%s has been added to the Map\", book.getAuthor()));\r\n\r\n }\r\n\r\n return books;\r\n\r\n }",
"public static void main(String[] args) {\n\t\tMap<String, List<String>> map = new HashMap<>();\n\t\tList<String> list = new ArrayList<>();\n\t\tmap.put(\"key1\", list);\n\t\tmap.get(\"key1\").add(\"value1\");\n\t\tmap.get(\"key1\").add(\"value2\");\n\t\t\n\n\t\t//(map.get(\"key1\").get(0)).isEqualTo(\"value1\");\n\t\t//(map.get(\"key1\").get(1)).isEqualTo(\"value2\");\n\t\t\n\t\tMap<String, String> map1 = Stream.of(new String[][] {\n\t\t\t { \"Hello\", \"World\" }, \n\t\t\t { \"John\", \"Doe\" }, \n\t\t\t}).collect(Collectors.toMap(data -> data[0], data -> data[1])); \n\t\t//Notice here the data type of key and value of the Map is same.\n\t\t//In order to make it more generic letís take the array of Objects and perform the same operation:\n\t\tMap<String, Integer> map2 = Stream.of(new Object[][] { \n\t\t { \"data1\", 1 }, \n\t\t { \"data2\", 2 }, \n\t\t}).collect(Collectors.toMap(data -> (String) data[0], data -> (Integer) data[1]));\n\t\t//Here, we create a map of the key as String and value as an Integer.\n\t}",
"public static void main(String[] args) {\n HashMap<String, String> capitalCities = new HashMap<String, String>();\n\n // Add keys and values (Country, City)\n capitalCities.put(\"England\", \"London\");\n capitalCities.put(\"Germany\", \"Berlin\");\n capitalCities.put(\"Norway\", \"Oslo\");\n capitalCities.put(\"USA\", \"WashingtonDC\");\n\n System.out.println(capitalCities);\n\n //Access an Item\n capitalCities.get(\"England\");\n System.out.println(capitalCities.get(\"England\"));\n\n //Remove an Item\n capitalCities.remove(\"England\");\n System.out.println(capitalCities);\n\n //To remove all items, use the clear() method:\n //capitalCities.clear();\n //System.out.println(capitalCities);\n\n //HashMap Size\n capitalCities.size();\n System.out.println(capitalCities.size());\n\n //Loop Through a HashMap\n // Print keys\n for (String i : capitalCities.keySet()) {\n System.out.print(i + \" \");\n }\n System.out.println();\n\n // Print values\n for (String i : capitalCities.values()) {\n System.out.print(i + \" \");\n }\n System.out.println();\n\n\n // Create a HashMap object called people\n Map<String, Integer> people = new LinkedHashMap<String, Integer>();\n\n // Add keys and values (Name, Age)\n people.put(\"John\", 32);\n people.put(\"Steve\", 30);\n people.put(\"Angie\", 33);\n\n for (String i : people.keySet()) {\n System.out.println(\"key: \" + i + \" value: \" + people.get(i));\n }\n\n\n\n\n }",
"public static void main(String[] args) {\n\t\n\tHashMap<Integer, String> map=new HashMap<Integer, String>();\n\tmap.put(0, \"X\");\n\tmap.put(1, \"X\");\n\tmap.put(2, \"Y\");\n\tmap.put(3, \"Z\");\n\t\n\tSystem.out.println(map.get(2));\n\t\n\tfor(int i=0;i<=map.size();i++) {\n\t\tSystem.out.println(map.get(i));\n\t}\n\t\n\t//for(String s:li)\n\tfor (Map.Entry<Integer, String> entry : map.entrySet()) {\n\t System.out.println(entry.getKey() + \" = \" + entry.getValue());\n\t}\n\t\n\tmap.forEach((key,value) -> System.out.println(key + \" = \" + value));\n\t\n\t\n\tmap.forEach((key,value) -> System.out.println(key +\"=\"+value));\n\t\n\t\n}",
"public static void main(String[] args) throws IOException {\n\t File dbFile = File.createTempFile(\"mapdb\",\"db\");\n\t DB db = DBMaker.newFileDB(dbFile)\n\t .closeOnJvmShutdown()\n\t .encryptionEnable(\"password\")\n\t .make();\n\n\t //open an collection, TreeMap has better performance then HashMap\n\t ConcurrentNavigableMap<Integer,String> map = db.getTreeMap(\"collectionName\");\n\n\t map.put(1,\"one\");\n\t map.put(2,\"two\");\n\t //map.keySet() is now [1,2] even before commit\n\n\t db.commit(); //persist changes into disk\n\n\t map.put(3,\"three\");\n\t //map.keySet() is now [1,2,3]\n\t db.rollback(); //revert recent changes\n\t //map.keySet() is now [1,2]\n\n\t db.close();\n\n\t }",
"public static void getMapDetails(){\n\t\tmap=new HashMap<String,String>();\r\n\t map.put(getProjName(), getDevID());\r\n\t //System.out.println(\"\\n[TEST Teamwork]: \"+ map.size());\r\n\t \r\n\t // The HashMap is currently empty.\r\n\t\tif (map.isEmpty()) {\r\n\t\t System.out.println(\"It is empty\");\r\n\t\t \r\n\t\t System.out.println(\"Trying Again:\");\r\n\t\t map=new HashMap<String,String>();\r\n\t\t map.put(getProjName(), getDevID());\r\n\t\t \r\n\t\t System.out.println(map.isEmpty());\r\n\t\t}\r\n\t\t \r\n\t\t\r\n\t\t//retrieving values from map\r\n\t Set<String> keys= map.keySet();\r\n\t for(String key : keys){\r\n\t \t//System.out.println(key);\r\n\t System.out.println(key + \": \" + map.get(key));\r\n\t }\r\n\t \r\n\t //searching key on map\r\n\t //System.out.println(\"Map Value: \"+map.containsKey(toStringMap()));\r\n\t System.out.println(\"Map Value: \"+map.get(getProjName()));\r\n\t \r\n\t //searching value on map\r\n\t //System.out.println(\"Map Key: \"+map.containsValue(getDevID()));\r\n\t \r\n\t\t\t\t\t // Put keys into an ArrayList and sort it.\r\n\t\t\t\t\t\t//ArrayList<String> list = new ArrayList<String>();\r\n\t\t\t\t\t\t//list.addAll(keys);\r\n\t\t\t\t\t\t//Collections.sort(list);\r\n\t\t\t\t\r\n\t\t\t\t\t\t// Display sorted keys and their values.\r\n\t\t\t\t\t\t//for (String key : list) {\r\n\t\t\t\t\t\t// System.out.println(key + \": \" + map.get(key));\r\n\t\t\t\t\t\t//}\t\t\t \r\n\t}",
"public static void main(String[] args) {\n HashMap<Integer, String> Hm = new HashMap<Integer, String>();\n Hm.put(0, \"USA\");\n Hm.put(1, \"UK\");\n Hm.put(2, \"India\");\n Hm.put(3, \"Maldives\");\n \n Set sn=Hm.entrySet();\n Iterator i= sn.iterator(); \n while(i.hasNext()) {\n Map.Entry mp=(Map.Entry)i.next();\n System.out.println(mp.getKey());\n System.out.println(mp.getValue());\n }\n \n\t}",
"public static void main(String [] args){\n Map m = new HashMap();\n m.put(\"Tim\", 5);\n m.put(\"Joe\", \"x\");\n m.put(\"11\", 999);\n System.out.println(m);\n System.out.println(m.get(\"Tim\"));\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 static void main(String[] args) {\n\tMap map=new HashMap();\n\tmap.put(100,\"java\");\n\tSystem.out.println(map);\n\t\n\tArrayList<String> arr=new ArrayList<>();\n\tarr.add(\"java\");\n\tarr.add(\"Santosh\");\n\tString s=arr.get(1);\n\tSystem.out.println(s);\n\t\n\t\n}",
"@Test\n public void testMapCodeExamples() throws Exception {\n logger.info(\"Beginning testMapCodeExamples()...\");\n\n // Create an empty map\n Map<URL, Double> stocks = new Map<>();\n logger.info(\"Start with an empty map of stock prices: {}\", stocks);\n\n // Add some closing stock prices to it\n URL apple = new URL(\"http://apple.com\");\n stocks.setValue(apple, 112.40);\n URL google = new URL(\"http://google.com\");\n stocks.setValue(google, 526.98);\n URL amazon = new URL(\"http://amazon.com\");\n stocks.setValue(amazon, 306.64);\n logger.info(\"Add some closing stock prices: {}\", stocks);\n\n // Retrieve the closing price for Google\n double price = stocks.getValue(google);\n logger.info(\"Google's closing stock price is {}\", price);\n\n // Sort the stock prices by company URL\n stocks.sortElements();\n logger.info(\"The stock prices sorted by company web site: {}\", stocks);\n\n logger.info(\"Completed testMapCodeExamples().\\n\");\n }",
"@SuppressWarnings(\"rawtypes\")\r\n\tpublic static void main(String[] args) {\r\n\t\t\r\n\t\t/* Declare HashMap Object */\r\n\t\tHashMap<Integer, String> hmap = new HashMap<Integer, String>();\r\n\t\t\r\n\t\t//Add Elements\r\n\t\thmap.put(1, \"Liban\");\r\n\t\thmap.put(2, \"abdullahi\");\r\n\t\thmap.put(3, \"mohamed\");\r\n\t\thmap.put(4, \"Roble\");\r\n\t\thmap.put(5, \"Warfaa\");\r\n\t\thmap.put(6, \"Faarax\");\r\n\t\t\r\n\t\t/* Iterate Using For Loop*/\r\n\t\tSystem.out.println(\"Iterate Using for loop\");\r\n\t\tfor(Map.Entry me : hmap.entrySet())\r\n\t\t\tSystem.out.println(\"Key is: \" + me.getKey() + \" & Value is: \" + me.getValue());\r\n\t\tSystem.out.println();\r\n\t\t\r\n\t\t\r\n\t\t/* Iterate USING wHILE lOOP + iTERATOR */\r\n\t\tSystem.out.println(\"Iterate Using while loop + iterator\");\r\n\t\t\r\n\t\t// Getting a Set of Key-value pairs\r\n\t\tSet set = hmap.entrySet();\r\n\t\t\r\n\t\t// Obtaining an iterator for the entry set\r\n\t\tIterator iter = set.iterator();\r\n\t\t\r\n\t\t// Iterate through HashMap entries(Key-Value pairs)\r\n\t\twhile(iter.hasNext())\r\n\t\t{\r\n\t\t\tMap.Entry mentry = (Map.Entry)iter.next();\r\n\t\t\tSystem.out.println(\"Key is: \" + mentry.getKey() + \" & Value is: \" + mentry.getValue());\r\n\t\t}\r\n\r\n\t}",
"Map<K,V> readFromStore(Collection<K> keys);",
"public static void main(String[] args) {\n\t\tArrayList<String> clist=getCode();\r\n\t\tArrayList<String> clist1=getCode1();\r\n\t\tfor(String code:clist){\r\n\t\t\tif(clist1.contains(code)){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tSystem.out.println(code);\r\n\t\t\tMongoCollection<Document> collection=mongo.getShardConn(\"ss_all_speak\");\r\n\t\t\tBasicDBObject find=new BasicDBObject();\r\n\t\t\tfind.put(\"stock_code\",code);\r\n//\t\t\tfind.put(\"website\",\"同花顺\");\r\n\t\t\tMongoCursor<Document> cursor =collection.find(find).batchSize(1000).noCursorTimeout(true).iterator();\r\n\t\t\tHashMap<String, HashMap<String, Object>> dmap=new HashMap<String, HashMap<String,Object>>();\r\n\t\t\twhile(cursor.hasNext()){\r\n\t\t\t\tDocument doc=cursor.next();\r\n\t\t\t\tObject list=doc.get(\"list\");\r\n\t\t\t\tString time=doc.getString(\"timedel\").trim();\r\n\t\t\t\tHashMap<String, Object> map=countNamesAndComments(list,time);\r\n\t\t\t\tmap.put(\"time\",time);\r\n\t\t\t\tif(dmap.containsKey(time)){\r\n\t\t\t\t\tHashMap<String, Object> tmp=dmap.get(time);\r\n\t\t\t\t\tint a1=Integer.parseInt(map.get(\"names\").toString());\r\n\t\t\t\t\tint b1=Integer.parseInt(map.get(\"comments\").toString());\r\n\t\t\t\t\tint a2=Integer.parseInt(tmp.get(\"names\").toString());\r\n\t\t\t\t\tint b2=Integer.parseInt(tmp.get(\"comments\").toString());\r\n\t\t\t\t\ttmp.put(\"names\", a1+a2);\r\n\t\t\t\t\ttmp.put(\"comments\", b1+b2);\r\n\t\t\t\t\tdmap.put(time, tmp);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tdmap.put(time, map);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcursor.close();\r\n\t\t\tArrayList<HashMap<String, Object>> dlist=new ArrayList<HashMap<String,Object>>();\r\n\t\t\tfor(String key:dmap.keySet()){\r\n\t\t\t\tHashMap<String, Object> tmp=dmap.get(key);\r\n\t\t\t\tdlist.add(tmp);\r\n\t\t\t}\r\n\t\t\tCollections.sort(dlist, new Comparator<HashMap<String, Object >>() {\r\n\t public int compare(HashMap<String, Object > a, HashMap<String, Object > b) {\r\n\t \tString one =a.get(\"time\").toString();\r\n\t String two = b.get(\"time\").toString();\r\n\t int time=str2TimeMuli(one);\r\n\t int time1=str2TimeMuli(two);\r\n\t return time - time1;\r\n\t }\r\n\t });\r\n\t\t\tif(!dlist.isEmpty()){\r\n\t\t\t\tHashMap<String, Object> lastmap=new HashMap<String, Object>();\r\n\t\t\t\tlastmap.put(\"id\", code);\r\n\t\t\t\tlastmap.put(\"list\", dlist);\r\n//\t\t\t\tSystem.out.println(lastmap.toString());\r\n\t\t\t\ttry {\r\n\t\t\t\t\tmongo.upsertMapByTableName(lastmap, \"ss_data_count1\");\r\n\t\t\t\t} catch (Exception 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}\r\n\t\t\r\n\t}",
"public static void main(String[] args) {\n\t\t\n\t\tMap<Integer,Employee> map = new HashMap<Integer, Employee>();\n\t\tMap<String, Employee> hashMap = new HashMap();\n\t\tMap<Employee, Integer> hashMap1 = new HashMap();\n\t\tfor (int i =1; i<=10; i++){\n\t\t\t\n\t\t\tmap.put(i, new Employee(i+3, \"Manish\"+(i+3)));\n\t\t}\n\t\tSystem.out.println(map);\n\t\t\n\t\tEmployee emp1 = new Employee(4, \"Manish3\");\n\t\t//Use of Contains\n\t\tSystem.out.println(map.containsValue(emp1)); \n\t\t\n\t\t//Key Set\n\t\tSystem.out.println(map.keySet());\n\t\t\n\t\t//retrieve entry set\n\t\tSystem.out.println(map.entrySet());\n\t\t\n\t\t//map.forEach(action);; TO DO- need to understand this method\n\t\t\n\n\t\t//Returns in sorted order when Key is natural (permitives or String or Enum)\n\t\thashMap.put(\"A\", new Employee(1, \"Manish\"));\n\t\thashMap.put(\"C\", new Employee(3, \"Gaurav\"));\n\t\thashMap.put(\"B\", new Employee(2, \"Vinay\"));\n\t\tSystem.out.println(hashMap);\n\t\t\n\t\t//maintains insertion order when key is Object type(dont have any natural order)\n\t\thashMap1.put(new Employee(1, \"Manish\"),1);\n\t\thashMap1.put(new Employee(3, \"Gaurav\"),3);\n\t\thashMap1.put(new Employee(2, \"Vinay\"),2);\n\t\tSystem.out.println(hashMap1);\n\t\tHashMap<Long, String> masterRoomPoolMapping = new HashMap<Long, String>();\n\t\tmasterRoomPoolMapping.put(new Long(123), \"Manish\");\n\t\tmasterRoomPoolMapping.put(new Long(124), \"Manish\");\n\t\tmasterRoomPoolMapping.put(new Long(125), \"Manish\");\n\t\tSystem.out.println(\"***************************************************\");\n\t\tSet<Long> keySet = masterRoomPoolMapping.keySet();\n\t\tSet<Long> newKeySet = new HashSet<Long>();\n\t\tfor(Long key : keySet){\n\t\t\tnewKeySet.add(new Long(key));\n\t\t}\n\t\tSystem.out.println(\"newKeySet***************************************************\");\n\t\tif(newKeySet.contains(new Long(123)))\n\t\t\tnewKeySet.remove(new Long(123));\n\t\tfor(Long key : newKeySet){\n\t\t\tSystem.out.println(key);\n\t\t}\n\t\tSystem.out.println(\"keySet1***************************************************\");\n\t\tSet<Long> keySet1 = masterRoomPoolMapping.keySet();\n\t\tfor(Long key : keySet1){\n\t\t\tSystem.out.println(masterRoomPoolMapping.get(key));\n\t\t}\n\t\tSystem.out.println(\"***************************************************\");\n\t\tSystem.out.println(masterRoomPoolMapping);\n\t}",
"public static Map getStudentMap() {\r\n\t\tMap<Integer,Student> stds = new HashMap();\r\n\t\tList<Student> list= new ArrayList<>();\r\n\t\tStudent akash =new Student(\"Akash\",123);\r\n\t\tStudent kalpana =new Student(\"kalpana\",345);\r\n\t\tStudent sasha =new Student(\"sasha\",876);\r\n\t\tStudent prakash =new Student(\"prakasg\",567);\r\n\t\t\r\n\t\tlist.add(prakash);\r\n\t\tlist.add(akash);\r\n\t\tlist.add(sasha);\r\n\t\tlist.add(kalpana);\r\n\t\tIterator<Student> its =list.iterator();\r\n\t\twhile (its.hasNext()) {\r\n\t\t\tStudent st = its.next();// student object from the \"list\" is passed in to st. \r\n\t\t\tstds.put(st.getRoll(),st);// st.getRoll() sends the roll number and st sends the object of the student.\r\n\t\t}\r\n\t\t\r\n\t\treturn stds;\r\n\t}",
"public static void main(String[] args) {\n\n Map map = new HashMap();\n map.put(1, \"Raja\");\n map.put(1, \"hjihihi\");\n map.put(3, \"Aadherai\");\n map.put(4, \"ram\");\n\n // traversing the map by using set\n Set set = map.entrySet();\n\n Iterator itr = set.iterator();\n while(itr.hasNext()){\n\n // System.out.println(itr);\n\n Map.Entry entry= (Map.Entry)itr.next(); // converting to Map.Entry so that we can get key & value seperately\n\n System.out.println(entry.getKey()+\" \"+entry.getValue());\n }\n }",
"public static void main(String[] args) {\n\t\tMap<String,Double> items = new HashMap<>();\r\n\t\t\r\n\t\titems.put(\"Toaster\",350.00);\t\t//inits elements into map [STRING == KEY; DOUBLE == VALUE]\r\n\t\titems.put(\"Dongle\", 5.99);\r\n\t\titems.put(\"Sham Wow\", 19.99);\r\n\t\titems.put(\"Flex Seal\",19.99);\r\n\t\t\r\n\t\tSet<String> setOKeys = items.keySet();\r\n\t\tint count = 0;\r\n\t\tfor(String key : items.keySet()){\r\n\t\t\tSystem.out.print(++count + \") \" + key + \": $\" /*+ items.get(key)USED IN NORMAL FORMAT; NEEDED TO UPDATE FOR 2 DECI POINTS see below*/);\r\n\t\t\tSystem.out.printf(\"%.2f\\n\", items.get(key));\t//printf; decimal format to help\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(items.containsKey(\"Sham Wow\"));\r\n\t\tSystem.out.println(items.containsValue(19.99));\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t//ANIMAL BOOK HASH MAP EXAMPLE\r\n\t\tMap<String, Integer> ani = new HashMap<>();\r\n\t\tani.put(\"Toucan\", 40);\r\n\t\tani.put(\"Lizard\", 7);\t\t\t//Stored by Integer value\r\n\t\tani.put(\"Wallaby\", 18);\r\n\t\t\r\n\t\tSystem.out.println(ani.get(\"Lizard\"));\r\n\t\t\r\n\t\tani.remove(\"Toucan\");\r\n\t\t\r\n\t\tSystem.out.println(ani); //toString Method is in the collections class automatically\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t//TREE MAP\r\n\t\tSet<Character> letters = new TreeSet<>(); //LINKEDHASHSET will be unordered\r\n\t\tletters.add('b');\r\n\t\tletters.add('c');\r\n\t\tletters.add('a');\r\n\t\tletters.add('c');\t\t//duplicate REMOVED automatically\r\n\t\t\r\n\t\tSystem.out.println(letters);\r\n\t\t\r\n\t\tletters.remove('b');\r\n\t\tSystem.out.println(letters);\r\n\t\t\r\n\t\tSystem.out.println(letters.contains('f'));\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tLinkedList<String> food = new LinkedList<>(); //can do list-linked list, linked list-linked list\r\n\t\t\r\n\t\tfood.add(\"Sauerkraut\");\r\n\t\tfood.add(\"Carrots\");\r\n\t\tfood.add(\"Mud\");\r\n\t\tfood.add(1, \"Margarine\"); //at indx 1; Margarine\r\n\t\t\r\n\t\tCollections.sort(food); //method in collections class which sorts\r\n\t\tfood.toString();\r\n\t\t//food.clear(); clears list\r\n\t\t\r\n\t\tString marg = food.get(3);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tQueue<String> cities = new PriorityQueue<>();\r\n\t\t\r\n\t\tcities.offer(\"Detroit\");\t\t//QUEUES 'OFFER'\r\n\t\tcities.offer(\"Los Angeles\");\r\n\t\tcities.offer(\"Vienna\");\r\n\t\tcities.offer(\"Windsor\");\r\n\t\t\r\n\t\tSystem.out.println(cities.peek()); //insertion order\r\n\t\tSystem.out.println(cities);\r\n\t\t\r\n\t\tStack<String> dishes = new Stack<>();\r\n\t\t\r\n\t\tdishes.add(\"Cereal bowl\");\r\n\t\tdishes.add(\"Lunch tray\");\r\n\t\tdishes.add(\"Pots and pans\");\r\n\t\tdishes.add(\"Dinner fork\");\r\n\t\t\r\n\t\tSystem.out.println(dishes.peek());\r\n\t\t\r\n\t\tdishes.pop();\r\n\t\tdishes.pop();\t\t//removing the oldest; fifo \r\n\t\t\r\n\t\tSystem.out.println(dishes);\r\n\t}",
"public static void main(String[] args) {\n\n Map<String, Integer> stuId = new HashMap<String, Integer>(5);\n stuId.put(\"Marcon\", 132);\n stuId.put(\"Jems\", 125);\n stuId.put(\"Caleb\", null);\n System.out.println(\"Original Map: \" + stuId);\n stuId.put(\"jery\", 231);\n stuId.remove(\"Jems\");\n System.out.println(\"Updated Map: \" + stuId);\n System.out.println(stuId.keySet());\n System.out.println(stuId.values());\n\n String userName = \"codebind\";\n String password = \"fiker\";\n\n String url = \"jdbc;mysql;//localhost;3306/employees?useSSL=false\";\n String query = \"select * from students.students_detail;\";\n\n try {\n Class.forName(\"com.mysql.jdbc.Drive\");\n } catch (ClassNotFoundException e) {\n System.out.println(\"check driver\");\n e.printStackTrace();\n\n }\n }",
"public static void main(String[] args) {\n\t\tMongoClient client = new MongoClient(\"localhost\", 27017);\n\t\t// getting access to database.. if not available, it will create new one with this name 'test'\n\t\tMongoDatabase database = client.getDatabase(\"test\");\n\t\t// getting Collections from database.if not available, it will create new one with this name 'Employee'\n\t\tMongoCollection<Document> collection = database.getCollection(\"Employee\");\n\t\t//put data in map Collection\n\t\t/*\n\t\t Map<String,Object> m=new HashMap<>();\n\t\t\tm.put(\"id\", \"500\");\n\t\t\tm.put(\"name\", \"krishna\");\n\t\t\tm.put(\"address\", \"mum\");\n\t\t\tm.put(\"phone\", \"546325\");\n\t\t*/\n\t\t/**\n\t\t * Map Collection can not be used to store data. for mongo, we have to use document class of mongo\n\t\t * To store multiple document at a time,add document in list collection and store.\n\t\t * e.g.,\n\t\t * \n\t\t */\n\t\t\n\t\t// Creating single documents to add in mongo collections\n\t\t/*\n\t\tDocument document = new Document();\n\t\tdocument.append(\"id\", \"200\");\n\t\tdocument.append(\"name\", \"radha\");\n\t\tdocument.append(\"address\", \"pune\");\n\t\tdocument.append(\"phone\", \"78564\");\n\t\t*/\n\t\t/*//adding document to collection\n\t\tcollection.insertOne(document);*/\n\t\t\n\t\t// Creating multiple documents to add in mongo collections\n\t\t/**\n\t\t * Creating multiple documents instances\n\t\t */\n\t\tDocument document1 = new Document();\n\t\tdocument1.append(\"id\", \"300\");\n\t\tdocument1.append(\"name\", \"rani\");\n\t\tdocument1.append(\"address\", \"kol\");\n\t\tdocument1.append(\"phone\", \"56975\");\n\t\t\n\t\tDocument document2 = new Document();\n\t\tdocument2.append(\"id\", \"301\");\n\t\tdocument2.append(\"name\", \"sushma\");\n\t\tdocument2.append(\"address\", \"shimla\");\n\t\tdocument2.append(\"phone\", \"65987\");\n\t\t\n\t\tDocument document3 = new Document();\n\t\tdocument3.append(\"id\", \"302\");\n\t\tdocument3.append(\"name\", \"mamta\");\n\t\tdocument3.append(\"address\", \"delhi\");\n\t\tdocument3.append(\"phone\", \"78564\");\n\t\t\n\t\t/**\n\t\t * Adding multiple document instances in list Collection\n\t\t */\n\t\tList<Document> listOfDocuments=new ArrayList<>();\n\t\tlistOfDocuments.add(document1);\n\t\tlistOfDocuments.add(document2);\n\t\tlistOfDocuments.add(document3);\n\t\t\n\t\t//----------Calling insertMany(-) to save multiple document instances placed in list\n\t\n\t\tcollection.insertMany(listOfDocuments);\n\t\t\n\t\tSystem.out.println(\"documents inserted successfully\");\n\t\t// closing connection\n\t\tclient.close();\n\n\t}",
"public void createHashMap() {\n myList = new HashMap<>();\n scrabbleList = new HashMap<>();\n }",
"@Test\n public void queryTest() throws Exception {\n List<Map<String, Object>> mapList = mysqlQLSDao.queryList();\n for(Map<String, Object> map : mapList) {\n System.out.print(\"[\");\n for (Map.Entry<String, Object> entry : map.entrySet()) {\n// System.out.print(entry.getKey() + \":\" + entry.getValue() + \",\");\n System.out.print(entry.getKey() + \":\" + \",\");\n }\n System.out.println(\"]\");\n }\n }",
"public static void demo1() {\n Map<String, String> m = new HashMap<String, String>();\r\n // Key, Value\r\n m.put(\"cn\", \"China\");\r\n m.put(\"th\", \"Thailand\");\r\n m.put(\"jp\", \"Japan\");\r\n\r\n// System.out.println(m.get(\"jp\"));\r\n\r\n for (Map.Entry<String, String> item : m.entrySet()) {\r\n String key = item.getKey();\r\n String value = item.getValue();\r\n System.out.printf(\"%s => %s\\n\", key, value);\r\n }\r\n\r\n System.out.println(\"----------------------\");\r\n m.put(\"th\", \"Siam\");\r\n\r\n for (Map.Entry<String, String> item : m.entrySet()) {\r\n String key = item.getKey();\r\n String value = item.getValue();\r\n System.out.printf(\"%s => %s\\n\", key, value);\r\n }\r\n\r\n if (m.containsValue(\"Japan\")) {\r\n System.out.println(\"found Japan\");\r\n }\r\n\r\n if (m.containsKey(\"cn\")) {\r\n System.out.println(\"found key cn\");\r\n m.remove(\"cn\");\r\n System.out.println(\"----------------remove cn-------------\");\r\n for (Map.Entry<String, String> item : m.entrySet()) {\r\n String key = item.getKey();\r\n String value = item.getValue();\r\n System.out.printf(\"%s => %s\\n\", key, value);\r\n }\r\n }\r\n\r\n }",
"public static void main(String[] args) {\n DB_Utility.createConnection(\"dev\");\n\n\n// Run query \"SELECT * FROM EMPLOYEES\"\n//\n DB_Utility.runQuery(\"select * from SPARTANS\");\n//\n//// 1. Display all data in console\n// DB_Utility.displayAllData();\n//\n//// 2. Print column count\n// System.out.println(\"DB_Utility.getColumnCNT() = \" + DB_Utility.getColumnCNT());\n//\n//// 3. Print row count\n// System.out.println(\"DB_Utility.getRowCount() = \" + DB_Utility.getRowCount());\n//\n//// 4. Print out 3rd row data as a list\n// System.out.println(\"DB_Utility.getRowDataAsList(3) = \"\n// + DB_Utility.getRowDataAsList(3));\n//\n//// 5. Print out 2nd column data as a list\n// System.out.println(\"DB_Utility.getColumnDataAsList(2) = \"\n// + DB_Utility.getColumnDataAsList(2));\n//\n//// 6, Print out Name column data as a list\n// System.out.println(\"DB_Utility.getColumnDataAsList(\\\"NAME\\\") = \"\n// + DB_Utility.getColumnDataAsList(\"NAME\"));\n//\n//// 7, Print out 4th row as a Map\n// System.out.println(\"DB_Utility.getRowMap(4) = \"\n// + DB_Utility.getRowMap(4));\n\n//// 8, Print out the data at row 5, column 1\n System.out.println(\"DB_Utility.getColumnDataAtRow(5,1) = \"\n + DB_Utility.getColumnDataAtRow(5, 1));\n\n//// 9, Print out the data at row 53, phone column\n System.out.println(\"DB_Utility.getColumnDataAtRow(53,\\\"PHONE\\\") = \"\n + DB_Utility.getColumnDataAtRow(53, \"PHONE\"));\n//\n//\n//// 10. Print out all the data as List of Map\n System.out.println(\"DB_Utility.getAllDataAsListOfMap() = \"\n + \"\\n\"+DB_Utility.getAllDataAsListOfMap()+\"\\n\");\n\n\n }",
"public interface MapStore extends Closeable {\n\n /**\n * Creates a table with the given key.\n *\n * Note that this operation is idempotent\n * so a true response means that the table\n * exists after execution.\n *\n * @return true iff the table exists after execution\n */\n boolean createTable(\n String tableName,\n MapStoreTableKey tableKey\n );\n\n /**\n * Drops a table.\n *\n * @return true iff the drop was successful\n */\n boolean dropTable(String tableName);\n\n /**\n * Delete an item from the given table\n * with the give key.\n *\n * This should be idempotent if the item\n * does not exist.\n */\n void deleteItem(\n String tableName,\n MapStoreKey key\n );\n\n /**\n * Retrieves all items from the given table\n * with all keys.\n */\n List<Map<String, Object>> getAllItems(String tableName);\n\n /**\n * Retrieves an item from the given table\n * with the given key.\n *\n * Returns {@link Optional#empty()} if no\n * item exists with the given key.\n */\n Optional<Map<String, Object>> getItem(\n String tableName,\n MapStoreKey key\n );\n\n /**\n * Queries all items from the given table\n * which match the given {@link MapStoreKey}\n * range key operator.\n */\n List<Map<String, Object>> getItems(\n String tableName,\n MapStoreKey key,\n MapQueryOptions options\n );\n\n /**\n * Adds an item to the given table\n * under the given key.\n */\n Map<String, Object> putItem(\n String tableName,\n MapStoreKey key,\n Map<String, Object> payload\n );\n\n /**\n * Updates an item in the given table\n * under the given key.\n *\n * If no item exists at the given key,\n * this will fallback to {@link #putItem(String, MapStoreKey, Map)}\n * semantics.\n */\n Map<String, Object> updateItem(\n String tableName,\n MapStoreKey key,\n Map<String, Object> payload\n );\n}",
"public static void main(String[] args) {\n Map<Integer, String> lhm = new LinkedHashMap<Integer, String>();\n lhm.put(0, \"Berhampur\");\n lhm.put(1, \"Cuttack\");\n lhm.put(2, \"Bangalore\");\n System.out.println(lhm); // {0=Berhampur, 1=Cuttack, 2=Bangalore}\n }",
"public static void main(String[] args) {\n\tMap<Integer,String> cars = new HashMap<Integer,String>();\n\t\n\tcars.put(1, \"BMW\");\n\tcars.put(3, \"Audi\");\n\tcars.put(6, \"Toyota\");\n\tcars.put(9, \"Hyundai\");\n\t\n\tString myCar = cars.get(6);\n\tSystem.out.println(\"My car is : \"+myCar);\n\t\n\tcars.put(10, \"Hyundai\");\n\tString myCar2 = cars.get(3);\n\tSystem.out.println(\"My second car is : \"+myCar2);\n\t}",
"public static void main(String[] args) {\n\t\tMap<String, String> m=new HashMap();\n\t\t\nm.put(\"SW\", \"1\");\nm.put(\"HR\", \"2\");\nm.put(\"Admin\", \"3\");\nm.put(\"FOE\", \"4\");\n\nString s=m.get(\"Admin\");\nSystem.out.println(s);\nIterator i=m.keySet().iterator();\n\n//via iterator\nwhile(i.hasNext())\n{\n\tObject k=i.next();\n\tObject v=m.get(k);\n\tSystem.out.print(\"Key=\"+k+\"value=\"+v+\"\\n\");\n}\n//via for loop\nSystem.out.println(\"_________\");\nfor(String key:m.keySet())\n{\n\tString value=m.get(key);\n\t\n\tSystem.out.print(\"Key=\"+key+\"value=\"+value+\"\\n\");\n}\n\n}",
"public static void main(String[] args) {\n\t\tHashMap<String,String> capitalMap=new HashMap<String,String>();//creating hashmap\n\t\tcapitalMap.put(\"India\", \"New Delhi\");\n\t\tcapitalMap.put(\"USA\", \"WashingtonDC\");//adding values into it\n\t\tcapitalMap.put(\"UK\", \"London\");\n\t\tcapitalMap.put(\"Australlia\", \"Canberra\");\n\t\tcapitalMap.put(\"UK\", \"London111\");\n\t\tcapitalMap.put(\"Africa\", null);\n\t\tcapitalMap.put(\"Odisa\", null);\n\n\n\t\t//getting the values from it\n\t\tSystem.out.println(capitalMap.get(\"Australlia\"));\n\t\tSystem.out.println(capitalMap.get(\"Germany\"));// if value is not present then it will throw null\n\t\tSystem.out.println(capitalMap.get(\"UK\"));// always take the lates value\n\t\t\n\t\t//we can store n number of null valuesbut only one null key\n\t\tcapitalMap.put(null, \"LA\");\n\t\tcapitalMap.put(null, \"SFO\");// can have multiple null values but one null key\n\t\tSystem.out.println(capitalMap.get(null));\n\t\tSystem.out.println(capitalMap.get(\"Africa\"));\n\t\tSystem.out.println(capitalMap.get(\"Odisa\"));\n\t\t\n\t\t//How to Traverse through Hashmap-USing Iterator\n\t\tIterator<String> it=capitalMap.keySet().iterator();// applying iterator on keyset or value set\n\t\t\n\t\twhile(it.hasNext()) {\n\t\tString key=\tit.next();\n\t\tString value=capitalMap.get(key);\n\t\tSystem.out.println(\"Key = \"+key+\" \"+\"value= \"+value );\n\t\t}\n\t\t\n\t\tSystem.out.println(\"****************************************\");\n\t\t//entry set iterator\n\t\tIterator<Entry<String, String>> it1=capitalMap.entrySet().iterator();\n\t\t\n\t\twhile(it1.hasNext()) {\n\t\t\tEntry<String, String> entry=it1.next();\n\t\t\tSystem.out.println(\"Key is \"+entry.getKey()+ \" Value is \"+entry.getValue());\n\t\t}\n\t\t\n\t\tSystem.out.println(\"****************************************\");\n\t\t\n\t\t//iterator with for each and lamda java 8\n\t\tcapitalMap.forEach((k,v)->System.out.println(\"key \"+k+\" value\"+v));\n\t\t\n\t\t\n\t\t\n\n\n\t\t\n\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}",
"public interface Map<K,T> {\n\t/**\n\t * Puts a value <code>elem</code> associated with the <code>key</code>\n\t * @param key The key associated to the value\n\t * @param elem The value to store\n\t */\n\tpublic void put(K key, T elem);\n\t\n\t/**\n\t * Returns the corresponding element associated to the <code>key</code>\n\t * @param key The key identifying an element\n\t * @return The element associated to the <code>key</code>. If there is no such element, returns null\n\t */\n\tpublic T get(K key);\n\t\n\t/**\n\t * Returns the number of elements in the map\n\t * @return the number of elements in the map\n\t */\n\tpublic int size();\n\t\n\t/**\n\t * Returns a collection of the keys in the map.\n\t * @return a collection of the keys in the map\n\t */\n\tpublic List<K> keys();\n\t\n\t/**\n\t * Returns a collection of the values in the map.\n\t * @return a collection of the values in the map.\n\t */\n\tpublic List<T> values();\n\n\t/**\n\t * Removes the element correspondong to the <code>key</code> from the map\n\t * @param key\n\t */\n public void remove(K key);\n}",
"public final Map<String, Integer> mo33708h(List<String> list) {\n return (Map) m968r(new C2164bs(this, list));\n }",
"public interface Map<K, V>\n{\n // Adds the specified key-value pair to the map. Does nothing if the key already\n // exists in the map.\n void add(K key, V value);\n\n // Returns the value associated with the specified key, or null of that key doesn't\n // exist in the map\n V get(K key);\n\t\n // Removes the key-value pair with the specified key from the map. Does nothing if\n // the key doesn't exist in the map.\n void remove(K key);\n}",
"public static void main(String[] args) {\n\t\tMap map = new Map();\n\t\tHashMap<Integer,Integer> hashmap = new HashMap<>();\n\t\tmap.addValue(11);\n\t\tmap.addValue(12);\n\t\tmap.addValue(13);\n\t\tmap.updateValue(2, 100);\n\t\tmap.removeData(1);\n\t\thashmap = map.getAllData();\n\t\t\n\t\tSystem.out.println(hashmap);\n\t}",
"public static void main(String[] args) {\n\t\tMap<String, Integer> priceMap = new HashMap<>(); \n\t\tpriceMap.put(\"TV\", 500); priceMap.put(\"Phone\", 200); \n\t\tpriceMap.put(\"Car\", 20000); priceMap.put(\"Bike\", 6000); \n\t\tpriceMap.put(\"Furniture\", 700); \n\t\n\t\tSystem.out.println(\"price map: \" + priceMap); \n\t\t\n\t\tSet<String> keys = priceMap.keySet(); \n\t\tCollection<Integer> values = priceMap.values();\n\t\t\n\t\tSet<Entry<String, Integer>> entries = priceMap.entrySet(); \n\t\tSystem.out.println(\"keys of Map : \" + keys); \n\t\tSystem.out.println(\"values from Map :\" + values); \n\t\tSystem.out.println(\"entries from Map :\" + entries);\n\n\t\t//Output: price map: {Car=20000, Phone=200, Bike=6000, Furniture=700, TV=500} keys of Map : [Car, Phone, Bike, Furniture, TV] values from Map :[20000, 200, 6000, 700, 500] entries from Map :[Car=20000, Phone=200, Bike=6000, Furniture=700, TV=500]\n\n\t\t\t\t\n\t}",
"public interface Map<K,V> {\n\n int size();\n\n boolean isEmpty();\n\n boolean containsKey(Object key);\n\n boolean containsValue(Object value);\n\n V get(Object key);\n\n V put(K key, V value);\n\n void putAll(Map<? extends K, ? extends V > m);\n\n void clear();\n\n //views\n Set<K> keySet();\n\n Collection<V> values();\n\n Set<Map.Entry<K,V>> entrySet();\n\n interface Entry<K,V>{\n K getKey();\n\n V getValue();\n\n V setValue(V value);\n\n boolean equals(Object o);\n\n int hashCode();\n\n }\n\n boolean equals(Object o);\n\n int hashCode();\n\n}",
"public abstract java.util.Map<java.lang.Double, java.util.List<java.lang.Integer>> pnlListMap();",
"public static void main(String[] args) {\n\t\tMap<Integer , String> mapitr = new HashMap<>();\r\n\t\t//enter values\r\n\t\tmapitr.put(0, \"hi\");\r\n\t\tmapitr.put(1, \"hello\");\r\n\t\tmapitr.put(2, \"welcome\");\r\n\t\tmapitr.put(3, \"hey\");\r\n\t\t\r\n\t\tIterator<Entry<Integer, String>> iterator= mapitr.entrySet().iterator();\r\n\t\t\r\nwhile(iterator.hasNext()){\r\n\tEntry<Integer ,String> entry=iterator.next();\r\n\tSystem.out.println(entry.getValue());\r\n\tSystem.out.println(entry.getKey());\r\n\t\r\n\t\t\r\n\t}\r\n\t\t\t\r\n\t\t}",
"public static void main(String[] args) {\n System.out.println(\"HW1\");\n Map<String, Integer> map = new HashMap<>();\n map.put(\"Ivan\",19);\n map.put(\"Dm\",20);\n map.put(\"Petr\",19);\n\n\n }",
"public Map<T, V> populateMap() {\n Map<T, V> map = new HashMap<>();\n for (int i = 0; i < entryNumber; i++) {\n cacheKeys[i] = (T) Integer.toString(random.nextInt(1000000000));\n String key = cacheKeys[i].toString();\n map.put((T) key, (V) Integer.toString(random.nextInt(1000000000)));\n }\n return map;\n }",
"public final Map<String, Integer> mo34029a(List<String> list) {\n return (Map) m446a(new C1840ci(this, list));\n }",
"public static void main(String[] args) throws SQLException {\n\n ResultSet result= DB_Utility.getResult(\"select * from employees\");\n\n Map<String,Integer>employeeInfo=new LinkedHashMap<>();\n\n while (result.next()){\n\n String firstName=result.getString(\"first_name\");\n String lastName=result.getString(\"last_name\");\n String fullName=firstName+\" \"+lastName;\n\n Integer salary=result.getInt(\"salary\");\n System.out.println(fullName+\" \"+salary);\n\n employeeInfo.put(fullName,salary);\n\n\n }\n System.out.println(employeeInfo);\n System.out.println(employeeInfo.get(\"Steven King\")==24000);\n\n String sql=\"Update developers set name = 'Abdullah' where name= 'Nurullah'\";\n\n }",
"public interface Map<K, V> {\n /** Returns the number of entries in the map. */\n public int size();\n\n /** Returns whether the map is empty or not. */\n public boolean isEmpty();\n\n /**\n * Puts a given key and value pair into the map, replaces the previous\n * one, if exits. And returns the old value, if exits, otherwise returns\n * null.\n *\n * @throws com.rainicy.chapter8.InvalidKeyException if the key is invalid.\n */\n public V put(K key, V value) throws InvalidKeyException;\n\n /**\n * Gets the value by given key.\n * If the key cannot be found, return null.\n *\n * @throws com.rainicy.chapter8.InvalidKeyException if the key is invalid.\n */\n public V get(K key) throws InvalidKeyException;\n\n /**\n * Removes the key-value pair by given key.\n * Returns the value if found the key, otherwise return null.\n *\n * @throws com.rainicy.chapter8.InvalidKeyException if the key is invalid.\n */\n public V remove(K key) throws InvalidKeyException;\n\n /**\n * Returns iterable object containing all the keys in the map.\n */\n public Iterable<K> keys();\n\n /**\n * Returns iterable object containing all the values in the map.\n */\n public Iterable<V> values();\n\n /**\n * Returns iterable object containing all the entries in the map.\n */\n public Iterable<Entry<K, V>> entries();\n}",
"private static void loadResults() {\r\n\t\tint index = 5;\r\n\t\tsiteMap = new HashMap<String, Map<String, List<? extends TransactionData>>>();\r\n\t\ttry(MongoClient connection = new MongoClient(\"localhost\", 27017);){\r\n\t\t\twhile(index >= 5 && index <= 9) {\r\n\t\t\t\tString dbName = \"site\" + index + \"ResultsDB\";\r\n\t\t\t\tMongoDatabase database = connection.getDatabase(dbName);\r\n\t\t\t\tcollectionsMap = new HashMap<String, List<? extends TransactionData>>();\r\n\t\t\t\tfor (String collection : database.listCollectionNames()) {\r\n\t\t\t\t\ttry(MongoCursor<Document> iterator = database.getCollection(collection).find().iterator();) {\r\n\t\t\t\t\t\tloadCollectionData(iterator, collection);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tsiteMap.put(\"site\" + index, collectionsMap);\r\n\t\t\t\tindex++;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public static void main(String[] args) {\n String[] names= {\"Mehmet\", \"Asha\", \"Amina\", \"Omar\", \"Siyar\", \"Danny\"};\n \n Map<Integer, String> nameMap=new LinkedHashMap<>();\n \n int key=1;\n \n for(String name:names) {\n nameMap.put(key, name);\n key++;\n }\n System.out.println(nameMap);\n \n for(Map.Entry<Integer,String>entry:nameMap.entrySet()) {\n \t\tString mapValue=entry.getKey()+\" == \"+entry.getValue();\n \t\tSystem.out.println(mapValue);\n \t\t\n \t\t\n \t}\n \n Iterator<Entry<Integer, String>>it=nameMap.entrySet().iterator();\n\t\twhile(it.hasNext()) {\n\t\t\tMap.Entry entry=it.next();\n\t\t\tString valueFromMap=entry.getKey()+\" : \"+entry.getValue();\n\t\t\tSystem.out.println(valueFromMap);\n\t\t}\n\t\t\n\n }",
"public static void main(String[] arg) {\n\t\tSystem.out.println(\"\\n\\tBegin Map demo program\\n\\n\");\n\n\t\tMap<Integer, Employee> staff = new HashMap<Integer, Employee>();\n\n\t\tstaff.put(1, new Employee(1, \"Noan Mollai\", 45000));\n\t\tstaff.put(5, new Employee(5, \"Eti Mollai\", 89000));\n\t\tstaff.put(2, new Employee(2, \"Aron Thanasi\", 120000));\n\t\tstaff.put(4, new Employee(4, \"Emily Thanasi\", 135000));\n\t\tstaff.put(3, new Employee(3, \"Klentin Mollai\", 199000));\n\n\t\tSet<Integer> keySet = staff.keySet();\n\t\tEmployee emp = new Employee();\n\t\tfor (Integer key : keySet) {\n\t\t\temp = staff.get(key);\n\t\t\tSystem.out.println(emp.toString());\n\t\t}\n\n\t\tScanner in = new Scanner(System.in);\n\t\tSystem.out.print(\"\\nEnter a key to search for the employee:\");\n\t\tInteger input = in.nextInt();\n\t\temp = staff.get(input);\n\n\t\tif (emp == null)\n\t\t\tSystem.out.println(\" Key not found\");\n\n\t\telse\n\t\t\tSystem.out.println(emp.toString());\n\n\t\tSystem.out.print(\"\\nEnter a salary to search for the employee's salary : \\n\");\n\t\tinput = in.nextInt();\n\n\t\tfor (Integer key : keySet) {\n\t\t\temp = staff.get(key);\n\n\t\t\tif (emp.getEmployeeSalary() > (double) input) {\n\n\t\t\t\tSystem.out.println(emp.toString());\n\t\t\t}\n\t\t}\n\n\t\tin.close();\n\t\tSystem.out.println(\"\\n\\tEnd Map demo program\\n\");\n\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}",
"@Test\n public void mapKeys() {\n check(MAPKEYS);\n query(\"for $i in \" + MAPKEYS.args(\n MAPNEW.args(\" for $i in 1 to 3 return \" +\n MAPENTRY.args(\"$i\", \"$i+1\"))) + \" order by $i return $i\", \"1 2 3\");\n query(\"let $map := \" + MAPNEW.args(\" for $i in 1 to 3 return \" +\n MAPENTRY.args(\"$i\", \"$i + 1\")) +\n \"for $k in \" + MAPKEYS.args(\"$map\") + \" order by $k return \" +\n MAPGET.args(\"$map\", \"$k\"), \"2 3 4\");\n }",
"void setHashMap();",
"public static void main(String[] args) {\n HashMap<String, Double> hm = new HashMap<String, Double>();\n\n //put elements to the map\n hm.put(\"John Doe\", new Double(3434.34));\n hm.put(\"Tom Smith\", new Double(123.22));\n hm.put(\"Lane Baker\", new Double(1378.00));\n hm.put(\"Tod Hall\", new Double(99.22));\n hm.put(\"Ralph Smith\", new Double(-19.08));\n\n //get a set of the entries\n java.util.Set<Map.Entry<String, Double>> set = hm.entrySet();\n\n //Display the set\n for (Map.Entry<String, Double> me:set){\n System.out.print(me.getKey() + \": \");\n System.out.println(me.getValue());\n }\n System.out.println();\n\n //Deposit 1000 into Jon Doe's account\n double balance = hm.get(\"John Doe\");\n hm.put(\"John Doe\", balance + 1000);\n\n System.out.println(\"John Doe's new balanve: \" + hm.get(\"John Doe\"));\n\n\n }",
"public static void main(String[] args) {\n\t\tHashMap<String, String> hashmap = new HashMap();\r\n\r\n//Add key values pairs to hashmap\r\n\r\n\t\thashmap.put(\"1\", \"One\");\r\n\t\thashmap.put(\"2\", \"Two\");\r\n\t\thashmap.put(\"3\", \"Three\");\r\n\t\thashmap.put(\"4\", \"Four\");\r\n\t\thashmap.put(\"5\", \"Five\");\r\n\t\thashmap.put(\"6\", \"Six\");\r\n\r\n\t\t/*\r\n\t\t * To check whether a particular key exists in HashMap use boolean\r\n\t\t * containsKey(Object key) method of HashMap class. containsKey(Object key)\r\n\t\t * returns true if the HashMap contains mapping for specified key otherwise\r\n\t\t * false.\r\n\t\t */\r\n\r\n\t\tboolean isExists = hashmap.containsKey(\"4\");\r\n\t\tSystem.out.println(\"4 exists in HashMap ? : \" + isExists);\r\n\r\n\t\tif (!hashmap.isEmpty()) {\r\n\r\n\t\t\tIterator it = hashmap.entrySet().iterator();\r\n\r\n\t\t\twhile (it.hasNext()) {\r\n\r\n\t\t\t\tMap.Entry obj = (Entry) it.next();\r\n\t\t\t\tSystem.out.print(obj.getKey() + \" \");\r\n\t\t\t\tSystem.out.println(obj.getValue());\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}",
"public static void main(String args[]) {\n\t\tHashMap hm = new HashMap();\r\n\r\n\t\t// out elements to the map\r\n\t\t//hm.put(\"John Doe\", new Double(3434.34));\r\n\t\thm.put(\"John Doe\", 3434.34);\r\n\t\thm.put(\"Tom Smith\", 123.22);\r\n\t\thm.put(\"Jane Baker\", 1378.00);\r\n\t\thm.put(\"Todd Hall\", 99.22);\r\n\t\thm.put(\"Ralph Smith\", -19.08);\r\n\t\t// get a set of the entries\r\n\t\tSet set = hm.entrySet();\r\n\t\t// get an iterator()\r\n\t\tIterator i = set.iterator();\r\n\t\t//Display elements\r\n\t\twhile(i.hasNext()) {\r\n\t\t\tMap.Entry me = (Map.Entry)i.next();\r\n\t\t\tSystem.out.print(me.getKey() + \": \");\r\n\t\t\tSystem.out.print(me.getValue());\r\n System.out.println();\r\n\t\t}\r\n\t\tSystem.out.println(\"-----------------------------------------\");\r\n\t\t//deposit 1000 into John Doe's account\r\n\t\t//double balance = ((Double)hm.get(\"John Doe\")).doubleValue();\r\n\t\tdouble balance = ((Double)hm.get(\"John Doe\"));\r\n\t\t//hm.put(\"John Doe\", new Double(balance +1000.00));\r\n\t\thm.put(\"John Doe\", balance +1000.00);\r\n\t\tSystem.out.println(\"John Doe's new balance: \" + hm.get(\"John Doe\"));\r\n\t}",
"public static HashMap<Integer, Item> storeItems(){\n\t\tItem prod1 = new Item(\"Candy\",40);\n\t\tItem prod2 = new Item(\"Bread\",30);\n\t\tItem prod3 = new Item(\"Butter\",50);\n\t\tItem prod4 = new Item(\"Milk\",43);\n\t\tItem prod5 = new Item(\"Toast\",60);\n\t\tItem prod6 = new Item(\"Curd\",20);\n\t\tItem prod7 = new Item(\"Cream\",80);\n\t\tItem prod8 = new Item(\"Pastry\",45);\n\t\tItem prod9 = new Item(\"Cake\",300);\n\t\tItem prod10 = new Item(\"Panner\",200);\n\t\tItem prod11 = new Item(\"Egg\",8);\n\t\tproducts.put(1,prod1);\n\t\tproducts.put(2,prod2);\n\t\tproducts.put(3,prod3);\n\t\tproducts.put(4,prod4);\n\t\tproducts.put(5,prod5);\n\t\tproducts.put(6,prod6);\n\t\tproducts.put(7,prod7);\n\t\tproducts.put(8,prod8);\n\t\tproducts.put(9,prod9);\n\t\tproducts.put(10,prod10);\n\t\tproducts.put(11,prod11);\n\t\treturn products;\n\t}",
"public static void main(String[] args) {\n Map<String, Set<Integer>> ms = new HashMap<>(); \n Set<Integer> s1 = new HashSet<>(Arrays.asList(1,2,3));\n Set<Integer> s2 = new HashSet<>(Arrays.asList(4,5,6));\n Set<Integer> s3 = new HashSet<>(Arrays.asList(7,8,9));\n ms.put(\"one\", s1);\n ms.put(\"two\", s2);\n ms.put(\"three\", s3);\n System.out.println(ms); \n // ch07.collections.Ch0706InterfacesVsConcrete$1\n // {one=[1, 2, 3], two=[4, 5, 6], three=[7, 8, 9]}\n\n // this is how LinkedHashMap<Integer,Tuple2<String,LinkedHashMap<Double,String>>>\n // can be initially initialized\n LinkedHashMap<Integer,Tuple2<String,LinkedHashMap<Double,String>>> toc =\n new LinkedHashMap<>();\n System.out.println(toc); // just using toc to get rid of eclipse warning about not using it\n \n \n\n\n\n }",
"private static void feedMapWithWordList(List<String> wordList, HashMap<String, Long> dataMap) {\n\n\t\tfor(int i = 0, size = wordList.size(); i < size; i++) { // Go through the list of words being fed - if a word already exists, add 1 to its frequency; otherwise, create a new key and give it a value of 1\n\n\t\t\tfinal String word = wordList.get(i);\n\n\t\t\tif(dataMap.containsKey(word))\n\n\t\t\t\tdataMap.replace(word, dataMap.get(word) + 1);\n\n\t\t\telse\n\n\t\t\t\tdataMap.put(word, 1L);\n\t\t}\n\t}",
"private void populateUserMap(List<User> list) {\n\t\tfor (User user : list) {\n\t\t\tuserMap.put(user.getUserName(), user);\n\t\t}\n\n\t}",
"@Test\n\tpublic void testHashMap() {\n\n\t\t/*\n\t\t * Creates an empty HashMap object with default initial capacity 16 and default\n\t\t * fill ratio \"0.75\".\n\t\t */\n\t\tHashMap hm = new HashMap();\n\t\thm.put(\"evyaan\", 700);\n\t\thm.put(\"varun\", 100);\n\t\thm.put(\"dolly\", 300);\n\t\thm.put(\"vaishu\", 400);\n\t\thm.put(\"vaishu\", 300);\n\t\thm.put(null, 500);\n\t\thm.put(null, 600);\n\t\t// System.out.println(hm);\n\n\t\tCollection values = hm.values();\n//\t\tSystem.out.println(values);\n\n\t\tSet entrySet = hm.entrySet();\n\t\t// System.out.println(entrySet);\n\n\t\tIterator iterator = entrySet.iterator();\n\t\twhile (iterator.hasNext()) {\n\t\t\tMap.Entry entry = (Map.Entry) iterator.next();\n\t\t\t// System.out.println(entry.getKey()+\":\"+entry.getValue());\n\t\t}\n\n\t}",
"public static void main(String[] args) throws IOException {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t\thash_map();\n\t\t//textread();\n\t\t\n\t\t/*\n\n\t\tFileReader fromfile = new FileReader(\"E:\\\\OnlineJob\\\\PWD.txt\");\n\t\tBufferedReader bufferReader = new BufferedReader(fromfile);\n\t\t\n\t\tString textFromfile =null;\n\t\twhile ((textFromfile = bufferReader.readLine())!= null) {\n\t\t\tSystem.out.println(textFromfile);\n\t\t}\n\t\tfromfile.close();\n\t\tbufferReader.close();\n\t}\n\t\n\tpublic static void textread() {\n\t\t\n\t\tScanner userinput = new Scanner(System.in);\n\t\tSystem.out.println(\"Learning Java from?\");\n\t\tString variable = userinput.nextLine();\n\t\tSystem.out.println(variable);\n\t\tuserinput.close();\n\t\t} */\n\tpublic static void hash_map() {\n\t\tHashMap<Integer, String> testmp = new HashMap<Integer, String>(); \n\t\ttestmp.put(1, \"Param\");\n\t\ttestmp.put(2, \"Selvi\");\n\t\ttestmp.put(3,\"\" );\n\t\ttestmp.put(4, \"Ragha\");\n\t\t//testmp.put(4, 100);\n\t\t//testmp.put(4,250);\n\t\tSystem.out.println(\"Elements of Map:\");\n\t\ttestmp.remove(6);\n\t\tSystem.out.println(testmp.containsKey(6));\n\t\tSystem.out.println(testmp);\n\t\tSystem.out.println(testmp.keySet());\n\t\tSystem.out.println(testmp.values());\n\t\tSystem.out.println(testmp.isEmpty());\n\t\t\n\t}\n\n\t\n}",
"public static void main(String[] args) {\n\t\tMap<String,Integer>grocery=new HashMap<>();\n\t\tgrocery.put(\"milk\",1);\n\t\tgrocery.put(\"cucumber\",3);\n\t\tgrocery.put(\"banana\",12);\n\t\tgrocery.put(\"cheese\",2);\n\t\t\n\t\tSystem.out.println(grocery);\n//create a map of items to buy, we want to save order\n\t\tMap<String,Integer>household=new LinkedHashMap<>();\n\t\thousehold.put(\"lysol\",2);\n\t\thousehold.put(\"sanitizer\",4);\n\t\thousehold.put(\"papertowel\",2);\n\t\thousehold.put(\"facemask\",20);\n\t\tSystem.out.println(household);\n\t\t\n\t\t//create a map in which we store all previous items in ascending order\n\t\tMap<String,Integer>shopping=new TreeMap<>();\n\t\tshopping.putAll(household);\n\t\tSystem.out.println(shopping);\n\t\t\n\t\t//get all keys using loop\n\t\tfor(String key:shopping.keySet()) {\n\t\t\tSystem.out.println(\"Key: \"+key);\t\n\t\t}\n\t\t//get all keys using iterator\n\t\tIterator<String> it=shopping.keySet().iterator();\n\t\twhile(it.hasNext()) {\n\t\tSystem.out.println(\"Key=\"+it.next());\n\t\t\n\t}\n\t\t//get all values using loop\n\t\tfor(int val:shopping.values()) {\n\t\t\tSystem.out.println(\"Values: \"+val);\n\t\t}\n\t\t//get all values using iterator\n\t\tIterator<Integer>iterator=shopping.values().iterator();\n\t\twhile(iterator.hasNext()) {\n\t\t\tSystem.out.println(\"Key=\"+iterator.next());\n\t\t\t\t\n}\n}",
"public static void createHashMap() {\n\t\t// create hash map\n\t\tHashMap<Integer, String> students = new HashMap<Integer, String>();\n\t\tstudents.put(1, \"John\");\n\t\tstudents.put(2, \"Ben\");\n\t\tstudents.put(3, \"Eileen\");\n\t\tstudents.put(4, \"Kelvin\");\n\t\tstudents.put(5, \"Addie\");\n\t\t// print the hash map\n\t\tfor (Map.Entry<Integer, String> e : students.entrySet()) {\n\t\t\tSystem.out.println(e.getKey() + \" \" + e.getValue());\n\t\t}\n\t}",
"public static void main (String[] args){\n CustomHashMap<String,String> map = new CustomHashMap<String,String>();\n for(int i = 0; i < 100; i++){\n map.put(i+\"\",i+\"\");\n }\n for(int i = 0; i < 100; i++){\n System.out.println(\"map取值: \"+ i + \" = \"+map.get(i+\"\"));\n }\n }",
"private static void simpleMapExamples() {\n\t\tSystem.out.println(\"simpleMapExamples Start ----\");\n\t\t\n\t\tMap<String,Integer> mapEx1 = new HashMap<>();\n\t\t\n\t\tmapEx1.put(\"Amit\", 35);\n\t\tmapEx1.put(\"Gunjan\", 45);\n\t\tmapEx1.put(\"Vidut\", 55);\n\t\t\n\t\t//Loop over Map\n\t\tfor(Entry<String, Integer> entry : mapEx1.entrySet()) {\n\t\t\t\n\t\t\tString key = entry.getKey();\n\t\t\tInteger val = entry.getValue();\n\t\t\t\n\t\t\tSystem.out.println(\"KEY : \" + key + \" : VAL : \" + val);\n\t\t\t\n\t\t}\n\t\t\n\t\t//API to get collection of values from the map\n\t\tCollection<Integer> values = mapEx1.values();\n\t\t\n\t\t//Now browse over collection values using java8 lambda\n\t\tSystem.out.println(\"Printing values ...\");\n\t\tvalues.forEach((val) -> System.out.println(val));\n\t\t\n\t\t//Replace values in the map using \n\t\t//Here we are replacing each key's value to 46\n\t\tmapEx1.replaceAll(( s, i) -> {\n\t\t\treturn 46;\n\t\t});\n\t\t\n\t\tSystem.out.println(\"Printing after firing replaceAll...\");\n\t\t//Now print the key/value pair of map using lambda\n\t\tmapEx1.forEach((k,v) -> {\n\t\t\tSystem.out.println(\"Key : \" + k + \" Val \" + v);\n\t\t});\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(\"simpleMapExamples End ----\");\n\t}",
"public static void main(String[] args) {\n\t\tMap<String,String > cityCaptials = new HashMap<String,String>();\r\n\t\tcityCaptials.put(\"India\",\"Delhi\");\r\n\t\tcityCaptials.put(\"USA\",\"Washington\");\r\n\t\tcityCaptials.put(\"Aus\",\"Berra\");\r\n\t\tcityCaptials.put(\"Srilanka\",\"Columbo\");\r\n\t\tIterator<String> it = cityCaptials.keySet().iterator();\r\n\t\twhile(it.hasNext()) {\r\n\t\t\tSystem.out.println(cityCaptials.get(it.next()));\r\n\t\t\tcityCaptials.put(\"Sat\", \"Ragesh\");\r\n\t\t}\r\n\r\n\t}",
"public static void main(String[] args) {\n\t\tMap<Integer, Integer> myMap = new HashMap<Integer, Integer>();\n\t\t\n\t\tmyMap.put(1, 5);\n\t\tmyMap.put(2, 4);\n\t\tmyMap.put(3, 3);\n\t\tmyMap.put(4, 2);\n\t\tmyMap.put(5, 1);\n\t\t\n\t\tIterator<Map.Entry<Integer, Integer>> iterator =myMap.entrySet().iterator();\n\t\t\n\t\twhile(iterator.hasNext()) {\n\t\t\tMap.Entry<Integer, Integer> entry =iterator.next();\n\t\t\tSystem.out.println(\"key : \"+entry.getKey()\n\t\t\t+\" value : \"+entry.getValue());\n\t\t}\n\t\t\n\t\tSystem.out.println(\"-----------\");\n\t\t\n\t\tfor(Map.Entry<Integer, Integer> iteratoor : myMap.entrySet()) {\n\t\t\tSystem.out.println(iteratoor);\n\t\t}\n\t\t\n\t\tmyMap.forEach((k,v) -> System.out.println(k+\"-\"+v));\n\t}",
"public static void main(String[] args)\n\t{\n\t\t\n\t\tHashMap<String, Integer> map=new HashMap<String, Integer>(); // creating hashmap\n\t\t\n\t\tmap.put(\"Vishal\",12276); // adding object\n\t\tmap.put(\"Rashmi\",12277);\n\t\tmap.put(\"Shubhangi\",12278);\n\t\tmap.put(null,12279); // allowed null key so give value\n\t\t\n\t//\tSystem.out.println(map.get(\"Rashmi\")); \n\t//\tSystem.out.println(map.get(null)); \n\t\t\n\t\tSet<String> set =map.keySet(); // fetching all the value of key\n\t\t\n\t\tfor(String s:set)\n\t\t{\n\t\t\tSystem.out.println(map.get(s)); // iterating key..\n\t\t}\n\t\t\n\t\tSystem.out.println(\"--------------------\");\n\t\t\n\t\tHashtable<String, String> map2 = new Hashtable<String, String>();\n\t\t\n\t\tmap2.put(\"Firstname\", \"Vishal\");\n\t\tmap2.put(\"Lastname\",\"Pandey\");\n\t\t//map2.put(null,\"test\"); // will not allowed null key so give null pointer exception error.\n\t\t\n\t\tSystem.out.println(map2.get(null));\n\t\t\n\n\t}",
"private static Map<String, String> createMapFromList(final List<String> all) {\n\t\tfinal Map<String, String> map = new ConcurrentHashMap<>();\n\n\t\tfor (final String documentElement : all) {\n\t\t\tif (documentElement != null) {\n\t\t\t\tmap.put(documentElement, documentElement);\n\t\t\t}\n\t\t}\n\t\treturn map;\n\t}",
"public static void main(String[] args)throws Exception {\n\t\t\n\t\tHashMap<String, Integer> hm = new HashMap<>(20);\n\t\t\n\t\thm.put(\"India\", 20);\n\t\thm.put(\"China\",\t 55);\n\t\thm.put(\"ini\", 78);\n\t\thm.display();\n\t\tArrayList<String> yo = hm.keyset() ;\n\t\tSystem.out.println(yo);\n\t}",
"public static void main(String[] args) {\n\t\tLinkedHashMap<Integer, String> myLinkedHashMap = new LinkedHashMap<Integer, String>();\n\t\tmyLinkedHashMap.put(3, \"Pune\");\n\t\tmyLinkedHashMap.put(2, \"Chennai\");\n\t\tmyLinkedHashMap.put(5, \"Patna\");\n\t\tmyLinkedHashMap.put(1, \"Mumbai\");\n\t\tmyLinkedHashMap.put(4, \"Kolkata\");\n\t\tSystem.out.println(myLinkedHashMap);\n\n\t\t// Iteration on the collection-view of the LinkedHashMap\n\t\tSet<Map.Entry<Integer, String>> myLinkedHashMapCollectionView = myLinkedHashMap.entrySet();\n\t\tSystem.out.println(\"After converting to set: \");\n\t\tSystem.out.println(myLinkedHashMapCollectionView);\n\t\tIterator<Map.Entry<Integer, String>> itr = myLinkedHashMapCollectionView.iterator();\n\t\tSystem.out.println(\"After iterating using Iterator: \");\n\t\twhile (itr.hasNext()) {\n\t\t\tMap.Entry<Integer, String> entry = itr.next();\n\t\t\tSystem.out.println(\"Key: \" + entry.getKey() + \", Value: \" + entry.getValue());\n\t\t}\n\t}",
"@Test\n public void testWriteDict() {\n System.out.println(\"writeList\");\n /** Positive testing. */\n Map<String, Object> map = new HashMap();\n map.put(\"spam\", -3L);\n map.put(\"test\", 3L);\n map.put(\"book\", 0L);\n String expResult = \"d4:booki0e4:spami-3e4:testi3ee\";\n String result = Bencoder.writeDict(map);\n assertEquals(expResult, result);\n map.clear();\n map.put(\"abc\", new LinkedList<Long>(Arrays.asList(-1L, 0L, 1L)));\n map.put(\"cba\", \"moo\");\n expResult = \"d3:abcli-1ei0ei1ee3:cba3:mooe\";\n result = Bencoder.writeDict(map);\n assertEquals(expResult, result);\n }",
"public static void main(String[] args) {\n\t\t\n\t\tMap<String, String> map1 = new HashMap<>();\n\t\t\n\t\t// Put items into map1\n\t\tmap1.put(\"Cuthbert\", \"14\");\n\t\tmap1.put(\"Hugh\", \"8\");\n\t\tmap1.put(\"Barney McGrew\", \"12\");\n\t\tmap1.put(\"Pugh\", \"31\");\n\t\t\n\t\tSystem.out.println(\"Map Elements\");\n\t\tSystem.out.println(\"\\t\" + map1);\n\t\tSystem.out.println(\"\\tOrdered by key hash\");\n\t\t\n\t\t// Demo 7.7 - TreeMaps\n\t\t// Provides efficient means of storing key/value pairs in sorted order\n\t\t// Allows rapid retrieval\n\t\tTreeMap<String, Double> treeMap = new TreeMap<>();\n\t\t\n\t\ttreeMap.put(\"Pugh\", new Double(4321.12));\n\t\ttreeMap.put(\"Pugh\", new Double(123.45));\n\t\ttreeMap.put(\"Barney McGrew\", new Double(7654.21));\n\t\ttreeMap.put(\"Cuthbert\", new Double(456.123));\n\t\t\n\t\tSystem.out.println(\"TreeMap Elements\");\n\t\tSystem.out.println(\"\\t\" + treeMap);\n\t\tSystem.out.println(\"\\tSorted by key\");\n\t\t\n\t\t// Demo 7.8 - Linked Hash Map\n\t\t// Extends HashMap but it maintains linked list of entries in the order inserted\n\t\tMap<String, String> map2 = new LinkedHashMap<>();\n\t\t\n\t\t// Put items into map1\n\t\tmap2.put(\"Cuthbert\", \"14\");\n\t\tmap2.put(\"Hugh\", \"8\");\n\t\tmap2.put(\"Barney McGrew\", \"12\");\n\t\tmap2.put(\"Pugh\", \"31\");\n\t\t\t\t\n\t\tSystem.out.println(\"LinkedHashMap Elements\");\n\t\tSystem.out.println(\"\\t\" + map2);\n\t\tSystem.out.println(\"\\tInsertion order preserved\");\n\t\t\n\t}",
"public static void main(String[] args) {\n Map<String,Integer>people= new HashMap<String, Integer>();\n people.put(\"JOHN DOE\",26);\n people.put(\"CHRISTIAN CALLY\",28);\n people.put(\"ALISHA ALI\",23);\n\n for(Map.Entry<String, Integer>entry: people.entrySet()){\n System.out.println(\"NAME: \" + entry.getKey() + \" AGE: \" + entry.getValue());\n\n }\n }",
"public static void main(String[] args) {\n\t\t\t\n\t\t\tMap <Integer, Person> emp=new TreeMap<>();\n\t\t\temp.put(456, new Person(\"Judy\",\"Sun\", 45, 4600));\n\t\t\temp.put(234, new Person(\"Clara\",\"Hit\", 39, 4700));\n\t\t\temp.put(567, new Person(\"Jane\",\"Ainshtan\", 36, 3500));\n\t\t\temp.put(123, new Person(\"Jack\",\"Ngu\", 25, 2500));\n\t\t\t\n\t\t\t// we can get obj by using: .values(), .keySet(), .entrySet()\n\t\t\t\n\t\t\tSystem.out.println(\"*** getting obj by using .values() ******\");\n\t\t\t\n\t\t\tSystem.out.println(\"---- 1. using enhanced loop ------\");\n\t\t\n\t\t\tCollection <Person> col=emp.values();\n\t\t\t\n\t\t\tfor (Person c:col) {\n\t\t\t\tc.info();\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println();\n\t\t\t\n\t\t\tSystem.out.println(\"---2. using iterator ------\");\n\t\t\t\n\t\t\tIterator <Person> colIt=col.iterator();\n\t\t\t\n\t\t\twhile (colIt.hasNext()) {\n\t\t\t\tcolIt.next().info();\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println();\n\t\t\t\n\t\t\tSystem.out.println(\"*** getting obj by using .keySet() ******\");\n\t\t\t\n\t\t\tSet <Integer> keys=emp.keySet(); //--> <key> getting all keys (in key part we have Integer)\n\t\t\t\n\t\t\tSystem.out.println(\"---- 1. using enhanced loop ------\");\n\t\t\t\n\t\t\tfor (Integer key:keys ) {\n\t\t\t\tSystem.out.println(\"ID number is \"+key);\n\t\t\t emp.get(key).info();\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t\t\n\t\t\n\t\t\t\n\t\t\tSystem.out.println(\"---2. using iterator ------\");\n\t\t\t\n\t\t\tIterator <Integer> kIt=keys.iterator();\n\t\t\t\n\t\t\twhile (kIt.hasNext()) {\n\t\t\t\tint k=kIt.next();\t\t\t\n\t\t\t\t\n\t\t\tSystem.out.println(\"the ID number is \"+k);\n\t\t emp.get(k).info();\n\t\t\t\n\t\t\t// or we can use like this\n\t\t\t// System.out.println(\"Id: \"+ k+\" Name: \"+emp.get(k).name+\" \"+emp.get(k).lastName); //--> if name and lastName is visible\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//( but mine are private so it will not work)\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println();\n\t\t\t\n\t\t\tSystem.out.println(\"*** getting obj by using .entrySet() ******\");\n\t\t\t\n\t\t\n\t\t\tSet <Entry <Integer, Person>>entry=emp.entrySet();\n\t\t\t\n\t\t\tSystem.out.println(\"---- 1. using enhanced loop ------\");\n\t\t\t\n\t\t\tfor (Entry<Integer, Person> e:entry) {\n\t\t\t\tSystem.out.print(\"ID number \"+e.getKey()+\" \");\n\t\t\t\te.getValue().info();\n\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t\n\t\t\tSystem.out.println(\"---2. using iterator ------\");\n\t\t\t\n\t\t\tIterator <Entry<Integer, Person>> it=entry.iterator();\n\t\t\twhile(it.hasNext()) {\n\t\t\t\tEntry<Integer, Person> p=it.next();\n\t\t\t\tSystem.out.print(p.getKey()+\" \");\n\t\t\t\tp.getValue().info();\n\t\t\t}\n\t\t}",
"public static void main(String[] args) {\n\t\tHashMap<String, Integer> map1 = new HashMap<String, Integer> ();\n\t\t\n //2. Creating HashMap with some initial capacity\n\t\tHashMap<String,Integer> map2 = new HashMap<String,Integer> (30);\n\t\t\n\t\t//3. Creating HashMap with some initial capacity and some load factor\n\t\tHashMap<String, Integer> map3 = new HashMap<String, Integer> (30, .60f);\n\t\t\n\t\t//4. Creating HashMap by copying another HashMap\n\t\tHashMap<String, Integer> map4= new HashMap<String, Integer> (map1);\n\t\t\n\t}",
"Map<String, String> mo14888a();",
"public static void main(String[] args) {\n ArrayList<Integer> list = new ArrayList<Integer>();\n list.add(0, new Integer(0));\n Integer x = list.get(0);\n System.out.println(\" \" + x);\n\n // The compiler will \"autobox\" primitives for us.\n list.add(1, 1);\n\n // The compiler will \"unbox\" objects for us.\n int y = list.get(1);\n System.out.println(\" \" + y);\n\n\n // When creating a HashMap, we must specify both the type of the\n // keys and that of the values.\n HashMap<String, Integer> map = new HashMap<String, Integer>();\n map.put(\"Christopher\", 10);\n map.put(\"Jon\", 10);\n map.put(\"Caleb\", 5);\n map.put(\"Andrew\", 1);\n\n System.out.println(\" \" + map.get(\"Jon\"));\n }",
"public static void main(String[] args) {\n\t\tHashMap<Price,String> hm = new HashMap<Price,String>();\n\t\tPrice p1 = new Price(100,\"mango\");\n\t\tPrice p2 = new Price(200,\"apple\");\n\t\tPrice p3 = new Price(500,\"custard\");\n\t\tPrice p4 = new Price(700,\"grapes\");\n\t\thm.put(p1, \"mango\"); // key cannot accept duplicate keys so inserting price as a key\n\t\thm.put(p2, \"apple\");\n\t\thm.put(p3, \"custard\");\n\t\thm.put(p4, \"grapes\");\n\t\tPrice p5 = new Price(200,\"apple\");\n\t\thm.put(p5, \"apple\");\n\t\tSet set1 = hm.keySet();\n\t\tSystem.out.println(set1);\n\t\tCollection c = hm.values();\n\t\t\n\t\tfor(Map.Entry<Price, String> map : hm.entrySet()){\n\t\t\tPrice key =map.getKey();\n\t\t\tString value = map.getValue();\n\t\t\tSystem.out.println(key+\" \"+value);\n\t\t}\n\t}",
"public static void main(String[] args) {\n\t\tArrayList<String> givenArray = new ArrayList<String>();\n\t\tArrayList<String> listOfNamesStartingWithA = new ArrayList<String>();\n\t\tArrayList<String> listOfNamesStartingWithG = new ArrayList<String>();\n\t\tgivenArray.add(\"apple\");\n\t\tgivenArray.add(\"appleinc\");\n\t\tgivenArray.add(\"applemac\");\n\t\tgivenArray.add(\"google\");\n\t\t\n\t\tHashMap<String, ArrayList> map = new HashMap<String, ArrayList>();\n\t\tmap.clone();\n\t\tIterator<String> itr = givenArray.iterator();\n\t\t\n\t\twhile(itr.hasNext()) {\n\t\t\tString arrayListOb = itr.next();\n\n\t\t\tString key =arrayListOb.substring(0, 1);\n\t\t\tif(key.startsWith(\"a\")) {\n\t\t\t\tlistOfNamesStartingWithA.add(arrayListOb);\t\n\t\t\t\tmap.put(key, listOfNamesStartingWithA);\t\n\t\t\t}\n\t\t\tif(key.startsWith(\"g\")) {\n\t\t\t\tlistOfNamesStartingWithG.add(arrayListOb);\n\t\t\t\tmap.put(key, listOfNamesStartingWithG);\n\t\t\t}\t\t\t\t\n\t\t\tSystem.out.println(key);\n\t\t\tSystem.out.println(map.get(key));\n\t\t}\n\t\tSystem.out.println(map.size());\n\t\t//System.out.println(map.get(\"g\"));\n\t\t//System.out.println(map.get(\"a\"));\n\t\t/*for(Map.Entry<String,ArrayList> entry: map.entrySet())\n\t\t{\n\t\t\tSystem.out.println(map.get(\"a\"));\n\t\t}*/\n\t}",
"public static void main(String[] args) {\n\t\tLinkedHashMap<String, Student> hm = new LinkedHashMap<>();\n\t\thm.put(\"3\", new Student(\"Freshman\", \"lee\"));\n\t\thm.put(\"1\", new Student(\"Sophomore\", \"Kim\"));\n\t\thm.put(\"2\", new Student(\"Junior\", \"Park\"));\n\t\thm.put(\"2\", new Student(\"Senior\", \"Choi\"));\t// key 값이 같으면 overwriting\n\t\tSystem.out.println(hm.size());\n\t\tSystem.out.println(hm.isEmpty());\n\t\tSystem.out.println(hm.containsKey(\"1\"));\n\t\tSystem.out.println(hm); // hashcode\n\t\t\n\t\thm.remove(\"2\");\n\t\tSystem.out.println(hm);\n\t\thm.put(\"4\", new Student(\"Senior\", \"Choi\"));\n\t\tSystem.out.println(hm);\n\t\tSystem.out.println(hm.get(\"3\"));// value return, 없으면 null return\n\t\t\n\t\tfor(String key : hm.keySet()) {\n\t\t\tSystem.out.println(key + \", \" + hm.get(key));\n\t\t}\n\t\tfor(Map.Entry<String, Student> s : hm.entrySet()) {\n\t\t\tString key = s.getKey();\n\t\t\tStudent value = s.getValue();\n\t\t\tSystem.out.println(\"Key = \" + key + \", value = \" + value);\n\t\t}\n\t}",
"@Test\n public void hashMapInitialised()\n {\n Map<Integer, String> strings = MapUtil.<Integer, String>hashMap().keyValue(1, \"Me\").keyValue(2, \"You\");\n // Is this really better than calling strings.put(..)?\n\n assertEquals(\"You\", strings.get(2));\n }",
"public static void main(String[] args)\r\n\t{\n\t\tMap<String,String> map = new Hashtable<>(); // synchronized, slower\r\n\t\t\r\n\t\tmap.put(\"myName\", \"Bachhan\"); /* we can repeat value but we can't repeat key */\r\n\t\tmap.put(\"actor\", \"Akshay\");\r\n\t\tmap.put(\"ceo\", \"Pichai\");\r\n\t\tmap.put(\"actor\", \"Bachhan\");\r\n\t\t\r\n\t\t// store the keySet() value in Set\r\n\t\tSet<String> keys = map.keySet();\r\n\t\tfor(String key: keys){\r\n\t\t\r\n\t\tSystem.out.println(key+ \" \" +map.get(key));\r\n\t\t}\r\n\t}",
"private Map<String, Object> analysisMap(ArrayList<String> data) {\n Map<String, Object> map = new HashMap<>();\n map.put(DAILY, data);\n return map;\n }",
"public static void main(String[] args) \r\n {\n TreeMap<Employee, Integer> hashMap = new TreeMap<Employee, Integer>(); \r\n \r\n // Mapping string values to int keys \r\n hashMap.put(new Employee(10,\"uday\"), 10); \r\n hashMap.put(new Employee(11,\"uday\"), 11); \r\n hashMap.put(new Employee(12,\"uday\"), 12); \r\n hashMap.put(new Employee(13,\"uday\"), 13); \r\n \r\n for (Entry<Employee, Integer> e : hashMap.entrySet()) \r\n System.out.println(e.getKey().toString() + \" \" + e.getValue()); \r\n \r\n HashMap<String, Integer> map = new HashMap<>(); \r\n \r\n }",
"public interface MapP2P<K, V> {\n\n /** Adds key and value in associative array */\n boolean put(K key, V value);\n\n /** Gets from associative array particular value which associated with received key */\n V get(K key);\n\n /** Removes from associative array particular value which associated with received key */\n V remove(K key);\n\n /** Adds in current map other collection which implements interface MapP2P */\n boolean addAll(MapP2P<K, V> mapP2P);\n\n /** Returns information informing whether the given key is in the collection */\n boolean containsKey(K key);\n\n /** Returns information informing whether the given value is in the collection */\n boolean containsValue(Object value);\n\n /** Returns amount element which stored in the associative array */\n int size();\n\n /** Removes all elements (key-value) from collection */\n void clear();\n\n /** Returns set of nodes which contains key-value */\n Set<Node<K, V>> entrySet();\n\n /** Returns information about whether there are elements on the current associative array */\n boolean isEmpty();\n\n /** Interface for Node that contains key and value */\n interface Node<K, V> {\n /** Returns the key of current node */\n K getKey();\n /** Returns the value of current node */\n V getValue();\n }\n\n /** Performs the given action for each node in this map */\n default void forEach(BiConsumer<? super K, ? super V> action) {\n Objects.requireNonNull(action);\n for (Node<K, V> node : entrySet()) {\n action.accept(node.getKey(), node.getValue());\n }\n }\n\n}",
"public static void mapHashMap(Map<Integer, String> mapHashMap) {\n System.out.println(\"----------------------------- HashMap ----------------------------\");\n System.out.println(\"\\\"HashMap\\\" is unordered!\");\n mapHashMap.put(7, \"Cristiano Ronaldo\");\n mapHashMap.put(10, \"Leo Messi\");\n mapHashMap.put(8, \"Avi Nimni\");\n mapHashMap.put(24, \"Kobi Brian\");\n PrintUtils.printMap(mapHashMap);\n System.out.println();\n // STEP 2 - set p3 name to \"Moshe\"\n System.out.println(\"Set the name of player number 8 to be \\\"Moshe\\\":\");\n mapHashMap.replace(8, \"Avi Nimni\", \"Moshe\");\n // if you use \"put\" instead of \"replace\" it will work to!\n PrintUtils.printMap(mapHashMap);\n System.out.println();\n // STEP 3 - add p5 to the end of the list using using ADD method\n System.out.println(\"Add p5 to the end of the list using ADD method:\");\n System.out.println(\"Not an option!\");\n System.out.println();\n // STEP 4 - add p6 to position 3 the end of the list using ADD method\n System.out.println(\"Add p6 to position 3 the end of the list using ADD method:\");\n System.out.println(\"Not an option, you can wright over it!\");\n System.out.println();\n // STEP 5 - remove p2 from the list\n System.out.println(\"Remove p2 from the list and printing the list using a static method in a utility class:\");\n mapHashMap.remove(10, \"Leo Messi\");\n PrintUtils.printMap(mapHashMap);\n System.out.println();\n }",
"public static void main(String args[]) {\n HashMap hm = new HashMap();\n \n // Put elements to the map\n hm.put(\"Zara\", 3434.34);\n hm.put(\"Mahnaz\", 123.22);\n hm.put(\"Ayan\", 1378.00);\n hm.put(\"Daisy\", 99.22);\n hm.put(\"Qadir\", -19.08);\n \n // Get a set of the entries\n Set set = hm.entrySet();\n \n // Get an iterator\n Iterator i = set.iterator();\n \n // Display elements\n while(i.hasNext()) {\n Map.Entry me = (Map.Entry)i.next();\n System.out.print(me.getKey() + \": \");\n System.out.println(me.getValue());\n }\n System.out.println();\n \n // Deposit 1000 into Zara's account\n double balance = ((Double)hm.get(\"Zara\"));\n hm.put(\"Zara\", balance + 1000);\n System.out.println(\"Zara's new balance: \" + hm.get(\"Zara\"));\n }",
"@Override\r\n\tpublic List<Map<String, Object>> list(Map<String, Object> map) {\n\t\treturn dao.list(map);\r\n\t}",
"public static void main(String[] args) {\n\t\tHashMap<String, String> hm = new HashMap<String, String>();\n\t\thm.put(\"A1\", \"Distributed Software Systems\");\n\t\thm.put(\"A2\", \"Distributed Software Systems\");\n\t\t\n\t\tHashMapImplementation.hm.put(\"A1\", \"Distributed Software Systems\");\n\t\thm.put(\"A3\", \"Distributed Software Systems\");\n\t\t\n\t\tSystem.out.println(hm.hashCode());\n\t\tSystem.out.println(hm.entrySet());\n\n\t\t\n// Different ways of Iterating through a hashmap\t\t\n\t\tIterator it = hm.entrySet().iterator();\t\t// EntrySet \n\t\t\n\t\n\t\tfor(;it.hasNext();){\n\t\t\tMap.Entry<String, String> current = (Map.Entry<String, String>)it.next();\n\t\t\tSystem.out.println(current);\n\t\t}\n\t\t\n\t\tfor(Map.Entry<String, String> entry : hm.entrySet()){\n\t\t\tString key = entry.getKey();\n\t\t\tSystem.out.println(key);\n\t\t\tString value = entry.getValue();\n\t\t\tSystem.out.println(value);\n\t\t}\n\t\t\n\t\tIterator it1 = hm.keySet().iterator(); \t// Key set\n\t\t\n\t\tfor(;it1.hasNext();){\n\t\t\tString current = (String)it1.next();\n\t\t\tSystem.out.println(current);\n\t\t}\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\tTreeMap<String,Long> actorMap = new TreeMap<String, Long>();\t\t\n\t\tactorMap.put(\"Varun Dhawan\", 9966337744L);\n\t\tactorMap.put(\"Jonny Depp\", 9912347744L);\n\t\tactorMap.put(\"Robert Jr.\", 9967837744L);\n\t\tactorMap.put(\"Aalia Bhat\", 9526335744L);\n\t\tactorMap.put(\"Shraddha Kapoor\", 9963337744L);\n\t\t\n\t\tSystem.out.println(\"Phone No of Varun Dhawan : \" + actorMap.get(\"Varun Dhawan\"));\n\t\t\n\t\tSystem.out.println(actorMap);\n\t\n\t\tSystem.out.println(\"-------------------------------------------------\");\n\t\tSet<String> actor = actorMap.keySet();\n\t\tSystem.out.println(\"User Iterator\");\n\t\tIterator<String> it = actor.iterator();\n\t\twhile(it.hasNext()) {\n\t\t\tString actorName = it.next();\n\t\t\tlong phNo = actorMap.get(actorName);\n\t\t\tSystem.out.println(\"Actor Name : \" + actorName + \"\\tPhone Number : \" + phNo);\n\t\t}\n\t\tSystem.out.println(\"-------------------------------------------------\");\n\t\t\n\t\tNavigableMap<String, Long> hdMap = actorMap.headMap(\"Shraddha Kapoor\", false);\n\t\tSystem.out.println(\"Head Map : \" +hdMap);\n\t\t\n\t\tSystem.out.println(\"-------------------------------------------------\");\n\t\t\n\t\tNavigableMap<String, Long> tlMap = actorMap.tailMap(\"Shraddha Kapoor\", false);\n\t\tSystem.out.println(\"Tail Map : \" +tlMap);\n\t\t\n\t\tSystem.out.println(\"-------------------------------------------------\");\n\t\t\n\t\tSortedMap<String, Long> sbMap = actorMap.subMap(\"Aalia Bhat\", \"Shraddha Kapoor\");\n\t\tSystem.out.println(\"Sub Map : \" +sbMap);\n\t\t\n\t\tSystem.out.println(\"-------------------------------------------------\");\n\t\t\n\t\tSystem.out.println(\"Ceiling of Shraddha Kapoor is \" + actorMap.ceilingKey(\"Shraddha Kapoor\") );\n\t\t\n\t\tSystem.out.println(\"-------------------------------------------------\");\n\t\t\n\t\tSystem.out.println(\"Floor of Shraddha Kapoor is \" + actorMap.floorKey(\"Shraddha Kapoor\"));\n\t\t\n\t\tSystem.out.println(\"-------------------------------------------------\");\n\t\t\n\t\tSystem.out.println(\"Higher of Shraddha Kapoor is \" + actorMap.higherKey(\"Shraddha Kapoor\"));\n\t\t\n\t\tSystem.out.println(\"-------------------------------------------------\");\n\t\t\n\t\tSystem.out.println(\"Lower of Shraddha Kapoor is \" + actorMap.lowerKey(\"Shraddha Kapoor\"));\n\t\t\n\t}",
"public void map()\n\t{\n\t // key is the documentId\n\t\t// value is the url\n\t\t//fetch the document using the documentId\n\t\t\n\t}",
"@Test\n public void testDictionaryCodeExamples() {\n logger.info(\"Beginning testDictionaryCodeExamples()...\");\n\n // Create a dictionary with some associations in it\n String[] keys = { \"charlie\", \"bravo\", \"delta\" };\n Integer[] values = { 3, 2, 4 };\n Dictionary<Integer> dictionary = new Dictionary<>(keys, values);\n logger.info(\"A dictionary of numbers: {}\", dictionary);\n\n // Add a new association\n dictionary.setValue(\"alpha\", 1);\n logger.info(\"Appended a \\\"alpha-1\\\" key-value pair: {}\", dictionary);\n\n // Sort the dictionary\n dictionary.sortElements();\n logger.info(\"The list now sorted: {}\", dictionary);\n\n // Retrieve the value for a key\n int value = dictionary.getValue(\"charlie\");\n logger.info(\"The value for key \\\"charlie\\\" is: {}\", value);\n\n // Remove an association\n dictionary.removeValue(\"charlie\");\n logger.info(\"With the value for key \\\"charlie\\\" removed: {}\", dictionary);\n\n logger.info(\"Completed testDictionaryCodeExamples().\\n\");\n }",
"public static void main(String[] args) {\n\t\tLinkedHashMap obj=new LinkedHashMap();\n\t\tobj.put(1, \"sayan\");\n\t\tobj.put(3,\"saikat\");\n\t\tobj.put(3, \"biki\");\n\t\tobj.put(9, \"onjit\");\n\t\tobj.put(8,\"Shaswata\");\n\t\tSystem.out.println(obj);\n\t\t\n\t\tSet set=obj.entrySet();\n\t\tIterator itr=set.iterator();\n\t\twhile(itr.hasNext())\n\t\t{\n\t\t\tMap.Entry me= (Map.Entry) itr.next();\n\t\t\t\n\t\t\tSystem.out.println(me.getKey()+\" ===> \"+me.getValue());\n\t\t}\n\t}",
"public final /* synthetic */ Map mo34034b(List list) {\n int i;\n Map<String, C1844cm> d = m447d((List<String>) list);\n HashMap hashMap = new HashMap();\n Iterator it = list.iterator();\n while (it.hasNext()) {\n String str = (String) it.next();\n C1844cm cmVar = d.get(str);\n if (cmVar == null) {\n i = 8;\n } else {\n if (C1860db.m497a(cmVar.f577c.f572c)) {\n try {\n cmVar.f577c.f572c = 6;\n this.f588e.mo34195a().execute(new C1841cj(this, cmVar));\n this.f587d.mo34025a(str);\n } catch (C1826bv unused) {\n f584a.mo34142c(\"Session %d with pack %s does not exist, no need to cancel.\", Integer.valueOf(cmVar.f575a), str);\n }\n }\n i = cmVar.f577c.f572c;\n }\n hashMap.put(str, Integer.valueOf(i));\n }\n return hashMap;\n }",
"public static void main(String[] args) {\n\t\tHashMap<Integer, Movil> moviles = new HashMap<Integer, Movil>();\r\n\t\t\r\n\t\t/*\r\n\t\t//Utilizando \"var\" como en C#\r\n\t\tvar movilJuan = new Movil(111, 4, \"Samsung\", 4);\r\n\t\tvar movilMaria = new Movil(232, 6, \"Apple\", 4);\r\n\t\tvar movilPedro = new Movil(955, 4, \"Xiaomi\", 5);\r\n\t\t*/\r\n\t\tMovil movilJuan = new Movil(111, 4, \"Samsung\", 4);\r\n\t\tMovil movilMaria = new Movil(232, 6, \"Apple\", 4);\r\n\t\tMovil movilPedro = new Movil(955, 4, \"Xiaomi\", 5);\r\n\r\n\t\tMovil movilBusqueda = new Movil(232, 6, \"Apple\", 4);\r\n\t\t\r\n\t\t//Añadimos los elementos a la colección\r\n\t\t/*\r\n\t\tmoviles.put(111, movilJuan);\r\n\t\tmoviles.put(232, movilMaria);\r\n\t\tmoviles.put(955, movilPedro);\r\n\t\t*/\r\n\t\tmoviles.put(movilJuan.getImei(), movilJuan);\r\n\t\tmoviles.put(movilMaria.getImei(), movilMaria);\r\n\t\tmoviles.put(movilPedro.getImei(), movilPedro);\r\n\t\t\r\n\t\t\r\n\t\t//Comprobamos is un elemento se encuentra en la colección por su valor\r\n\t\t//El método containsValue() requiere redefinir el método equals() de la clase Movil para saber que campo debe comparar para determinar que dos objetos sean iguales.\r\n\t\t//En caso de no hacerlo, los objetos se comparan utilizando sus Hashcodes (direcciones de memoria).\r\n\t\tif (moviles.containsValue(movilBusqueda)) {\r\n\t\t\tSystem.out.println(\"Encontrado\");\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"No encontrado\");\r\n\t\t}\r\n\t\t\r\n\r\n\t\t\r\n\t}"
]
| [
"0.6526749",
"0.61684704",
"0.61273575",
"0.61125606",
"0.61009794",
"0.60778284",
"0.6073499",
"0.6060583",
"0.59953964",
"0.595992",
"0.5942408",
"0.5941634",
"0.5936791",
"0.5919206",
"0.59142727",
"0.5908353",
"0.58967906",
"0.58888334",
"0.5882633",
"0.5869771",
"0.5855339",
"0.5843726",
"0.5790139",
"0.5782564",
"0.5767047",
"0.57487565",
"0.57450217",
"0.5738576",
"0.57216424",
"0.57179105",
"0.5714462",
"0.5712487",
"0.5707264",
"0.5706416",
"0.5683687",
"0.5659596",
"0.56556886",
"0.563923",
"0.5637867",
"0.5620986",
"0.56193054",
"0.56165606",
"0.5592434",
"0.5576275",
"0.55742776",
"0.5568148",
"0.5565146",
"0.555106",
"0.55437547",
"0.55405813",
"0.5530109",
"0.55285734",
"0.5515641",
"0.55138844",
"0.55125785",
"0.54955375",
"0.5476233",
"0.54642594",
"0.5456016",
"0.5454626",
"0.5443888",
"0.5441194",
"0.54396296",
"0.54258037",
"0.54238147",
"0.54234785",
"0.54208124",
"0.5417361",
"0.54056543",
"0.54045624",
"0.5395532",
"0.5393117",
"0.5382333",
"0.5380987",
"0.53795975",
"0.53761375",
"0.5372794",
"0.5369029",
"0.53552437",
"0.53550607",
"0.5354795",
"0.5340215",
"0.5339129",
"0.5332909",
"0.53308654",
"0.53289324",
"0.5328455",
"0.53282416",
"0.5326929",
"0.53254384",
"0.53142303",
"0.5308639",
"0.53024447",
"0.5289894",
"0.5288595",
"0.5288326",
"0.5280542",
"0.5279397",
"0.52784634",
"0.5269045"
]
| 0.60955614 | 5 |
Test of ScaleToOneDimension method, of class ImageEditor. | @Test
public void shouldNotScaleImageWhenSameSize() {
givenIHaveAnImage();
whenIScaleImageWidthTo(14.999f);
thenTheImageWidthIs(15);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void testScale() {\n System.out.println(\"scale\");\n Float s = null;\n ImageFilter instance = null;\n BufferedImage expResult = null;\n BufferedImage result = instance.scale(s);\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }",
"@Override\r\n\t@Test(groups = {\"function\",\"setting\"} ) \r\n\tpublic boolean checkImageScale() {\n\t\tboolean flag = oTest.checkImageScale();\r\n\t\tAssertion.verifyEquals(flag, true);\r\n\t\treturn flag;\r\n\t}",
"public abstract BufferedImage scale(Dimension destinationSize);",
"public void testResize()\n {\n cover.resize(5, 5, 90);\n assertEquals(5.0, cover.getTop(), .1);\n assertEquals(5.0, cover.getLeft(), .1);\n }",
"@Test\n public void testScaling() {\n System.out.println(\"scaling\");\n double s = 0.0;\n ImageFilter instance = null;\n BufferedImage expResult = null;\n BufferedImage result = instance.scaling(s);\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }",
"@Test\n void testScaleUp() throws OperationFailedException {\n\n ScaledObjectAreaChecker checker = new ScaledObjectAreaChecker(SCALE_FACTOR);\n\n // Create an object that is a small circle\n ObjectMask unscaled = CircleObjectFixture.circleAt(new Point2d(8, 8), 7);\n checker.assertConnected(\"unscaled\", unscaled);\n\n ObjectMask scaled = unscaled.scale(checker.factor());\n\n checker.assertConnected(\"scaled\", scaled);\n checker.assertExpectedArea(unscaled, scaled);\n }",
"@Test\n public void scale() {\n assertEquals(\"Wrong vector scale\", new Vector(1,1,1).scale(2), new Vector(2,2,2));\n }",
"@Test\n\tpublic void testSetDimensions() {\n\t\tExplorer explore = new Explorer();\n\t\texplore.setDimensions(3, 3);\n\t\tassertTrue(explore.getHeight() == 3);\n\t\tassertTrue(explore.getWidth() == 3);\n\t}",
"@Test\n @DependsOnMethod(\"testConstantDimension\")\n public void testDimensionReduction() throws TransformException {\n isInverseTransformSupported = false;\n create(3, 0, 1);\n assertIsNotIdentity(transform);\n\n final double[] source = generateRandomCoordinates();\n final double[] target = new double[source.length * 2/3];\n for (int i=0,j=0; i<source.length; i++) {\n target[j++] = source[i++];\n target[j++] = source[i++];\n // Skip one i (in the for loop).\n }\n verifyTransform(source, target);\n\n makeProjectiveTransform();\n verifyTransform(source, target);\n }",
"private void scaleImagePanel(float scale){\n float oldZoom = imagePanel.getScale();\n float newZoom = oldZoom+scale;\n Rectangle oldView = scrollPane.getViewport().getViewRect();\n // resize the panel for the new zoom\n imagePanel.setScale(newZoom);\n // calculate the new view position\n Point newViewPos = new Point();\n newViewPos.x = (int)(Math.max(0, (oldView.x + oldView.width / 2) * newZoom / oldZoom - oldView.width / 2));\n newViewPos.y = (int)(Math.max(0, (oldView.y + oldView.height / 2) * newZoom / oldZoom - oldView.height / 2));\n scrollPane.getViewport().setViewPosition(newViewPos);\n }",
"@Test(expected = IllegalArgumentException.class)\n public void testScaleRectangleDuringSamePeriod() {\n model1.addShape(Rectangle.createRectangle(\"C\", new Point.Double(500, 100),\n new Color(0, 0, 1), 6, 100, 60.0, 30.0));\n model1.addAction(ScaleRectangleAction.createScaleRectangleAction(\"R\", 10, 50,\n 100, 100, 100, 100));\n model1.addAction(ScaleRectangleAction.createScaleRectangleAction(\"R\", 40, 60,\n 100, 100, 10, 10));\n }",
"@Test\n @MediumTest\n public void singleFrameScaleSmokeTest() throws Exception {\n scaleSmokeTest(false);\n }",
"public void scale(Point P, int scaleFactor) {\n\n\n }",
"@Test(expected = IllegalArgumentException.class)\n public void testRectangleScaleWidthToZero() {\n model1.addShape(Rectangle.createRectangle(\"R\", new Point.Double(200, 200),\n new Color(1, 0, 0), 1, 100, 50.0, 100.0));\n model1.addShape(Oval.createOval(\"C\", new Point.Double(500, 100),\n new Color(0, 0, 1), 6, 100, 60.0, 30.0));\n model1.addAction(ScaleRectangleAction.createScaleRectangleAction(\"R\", 10, 50,\n 50, 100, 0, 100));\n model1.addAction(new MoveAction(\"C\", 20, 70, new Point.Double(500, 100),\n new Point.Double(0, 300)));\n }",
"private BufferedImage scale(BufferedImage sourceImage) {\n GraphicsEnvironment graphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();\n GraphicsDevice graphicsDevice = graphicsEnvironment.getDefaultScreenDevice();\n GraphicsConfiguration graphicsConfiguration = graphicsDevice.getDefaultConfiguration();\n BufferedImage scaledImage = graphicsConfiguration.createCompatibleImage(IMAGE_DIMENSION, IMAGE_DIMENSION);\n\n Graphics2D newGraphicsImage = scaledImage.createGraphics();\n newGraphicsImage.setColor(Color.white);\n newGraphicsImage.fillRect(0, 0, IMAGE_DIMENSION, IMAGE_DIMENSION);\n\n double xScale = (double) IMAGE_DIMENSION / sourceImage.getWidth();\n double yScale = (double) IMAGE_DIMENSION / sourceImage.getHeight();\n AffineTransform affineTransform = AffineTransform.getScaleInstance(xScale,yScale);\n newGraphicsImage.drawRenderedImage(sourceImage, affineTransform);\n newGraphicsImage.dispose();\n\n return scaledImage;\n }",
"@Test(expected = IllegalArgumentException.class)\n public void testRectangleScaleWidthToNegative() {\n model1.addShape(Rectangle.createRectangle(\"R\", new Point.Double(200, 200),\n new Color(1, 0, 0), 1, 100, 50.0, 100.0));\n model1.addShape(Oval.createOval(\"C\", new Point.Double(500, 100),\n new Color(0, 0, 1), 6, 100, 60.0, 30.0));\n model1.addAction(ScaleRectangleAction.createScaleRectangleAction(\"R\", 10, 50,\n 50, 100, -51, 100));\n }",
"private void updateImageScale() {\r\n\t\t//Check which dimension is larger and store it in this variable.\r\n\t\tint numHexLargestDimension = this.numHexRow;\r\n\t\tif (this.totalHexWidth > this.totalHexHeight) {\r\n\t\t\tnumHexLargestDimension = this.numHexCol;\r\n\t\t}\r\n\t\t\r\n\t\tif (numHexLargestDimension < 35) {\r\n\t\t\tif (this.zoomer.getZoomScale() * (this.numHexCol / 2) > 16.5) {\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.LARGE;\r\n\t\t\t} else if (this.zoomer.getZoomScale() * (this.numHexCol / 2) > 7){\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.MEDIUM;\r\n\t\t\t} else {\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.SMALL;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (numHexLargestDimension < 70) {\r\n\t\t\tif (this.zoomer.getZoomScale() * (this.numHexCol / 2) > 22.2) {\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.LARGE;\r\n\t\t\t} else if (this.zoomer.getZoomScale() \r\n\t\t\t\t\t* (this.numHexCol / 2) > 14.5){\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.MEDIUM;\r\n\t\t\t} else {\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.SMALL;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (numHexLargestDimension < 105) {\r\n\t\t\tif (this.zoomer.getZoomScale() * (this.numHexCol / 2) > 32.6) {\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.LARGE;\r\n\t\t\t} else if (this.zoomer.getZoomScale() * (this.numHexCol / 2) > 21){\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.MEDIUM;\r\n\t\t\t} else {\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.SMALL;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (this.zoomer.getZoomScale() * (this.numHexCol / 2) > 44.4) {\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.LARGE;\r\n\t\t\t} else if (this.zoomer.getZoomScale() * (this.numHexCol / 2) > 28){\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.MEDIUM;\r\n\t\t\t} else {\r\n\t\t\t\tthis.currentImageScale = ImageDrawScales.SMALL;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"int getScale();",
"@Test\n public void testGetSize() {\n assertEquals(r1.getSize(), new Dimension2D(7, 4));\n assertEquals(r2.getSize(), new Dimension2D(0, 4));\n assertEquals(r3.getSize(), new Dimension2D(7, 0));\n assertEquals(r4.getSize(), new Dimension2D(0, 0));\n }",
"public abstract void setSize(Dimension d);",
"ScaleType getScale();",
"private float getNewScale() {\n int width = getWidth() - (padding[0] + padding[2]);\n float scaleWidth = (float) width / (cropRect.right - cropRect.left);\n\n int height = getHeight() - (padding[1] + padding[3]);\n float scaleHeight = (float) height / (cropRect.bottom - cropRect.top);\n if (getHeight() > getWidth()) {\n return scaleWidth < scaleHeight ? scaleWidth : scaleHeight;\n }\n return scaleWidth < scaleHeight ? scaleWidth : scaleHeight;\n }",
"public ImageScale getScale() {\n return this.scale;\n }",
"private static AppImage scale(AppImage image) {\n\t\treturn scale(image, GraphicsConfig.getScaleWidth(), GraphicsConfig.getScaleHeight());\n\t}",
"@Test\n\tpublic void testSetDimensions() {\n\n\t\t// empty stack\n\t\tip = new ImagePlus();\n\t\tip.setDimensions(1,2,3);\n\t\tassertEquals(1,ip.getNChannels());\n\t\tassertEquals(1,ip.getNSlices());\n\t\tassertEquals(ip.getStackSize(),ip.getNFrames());\n\n\t\t// stack but dimensions don't match\n\t\tip = new ImagePlus(\"Kerbam\",(Image)null);\n\t\tst = new ImageStack(2,2);\n\t\tst.addSlice(\"Oranges\", new byte[] {1,2,3,4});\n\t\tst.addSlice(\"Apples\", new byte[] {1,2,3,4});\n\t\tst.addSlice(\"Pears\", new byte[] {1,2,3,4});\n\t\tip.setStack(\"Kaboom\",st);\n\t\tip.setDimensions(1,2,3);\n\t\tassertEquals(1,ip.getNChannels());\n\t\tassertEquals(ip.getStackSize(),ip.getNSlices());\n\t\tassertEquals(1,ip.getNFrames());\n\n\t\t// stack with matching dimensions\n\t\tip = new ImagePlus(\"Kerbam\",(Image)null);\n\t\tst = new ImageStack(1,4);\n\t\tst.addSlice(\"Oranges\", new byte[] {1,2,3,4});\n\t\tst.addSlice(\"Apples\", new byte[] {1,2,3,4});\n\t\tst.addSlice(\"Pears\", new byte[] {1,2,3,4});\n\t\tst.addSlice(\"Quinces\", new byte[] {1,2,3,4});\n\t\tst.addSlice(\"Kiwis\", new byte[] {1,2,3,4});\n\t\tst.addSlice(\"Bananas\", new byte[] {1,2,3,4});\n\t\tip.setStack(\"Kaboom\",st);\n\t\tip.setDimensions(1,2,3);\n\t\tassertEquals(1,ip.getNChannels());\n\t\tassertEquals(2,ip.getNSlices());\n\t\tassertEquals(3,ip.getNFrames());\n\t}",
"public void rescale()\r\n\t{\n\t}",
"@Override\n\tfinal public void scale(double x, double y)\n\t{\n\t\twidth *= x;\n\t\theight *= y;\n\t}",
"@Test\n @MediumTest\n public void multiFrameScaleSmokeTest() throws Exception {\n scaleSmokeTest(true);\n }",
"void setSize(Dimension size);",
"@Test\n public void testRecomputeStretch(){\n //Recalculate stretch\n imageData.recomputeStretch(frArray, 0, rangeValues, true);\n BufferedImage stretchImage =imageData.getImage(frArray);\n Assert.assertNotEquals(expectedImage, stretchImage);\n }",
"@Test\n public void testWidth() {\n BetterImageSpan span = new BetterImageSpan(mDrawable, mAlignment);\n int size = span.getSize(null, null, 0, 0, null);\n assertThat(size).isEqualTo(mDrawableWidth);\n }",
"public int scale(int original);",
"@Test\r\n public void testSameSize(){\r\n List<Tone> palette = Arrays.asList(new Tone(Color.red));\r\n\r\n BufferedImage image = ImageFileUtils.loadImageResource(\"/sampleImages/dimensions/2x4.png\");\r\n\r\n PaletteReplacer replacer = new PaletteReplacer();\r\n\r\n BufferedImage result = replacer.replace(image, palette);\r\n\r\n assertDimensions(result, 2, 4);\r\n }",
"int getScale(Object elementID) throws Exception;",
"private void updateScale() {\n target.setScaleX(scaleValue);\n target.setScaleY(scaleValue);\n }",
"void setDimension(double width, double height);",
"public boolean hasScale() { return hasScale; }",
"public abstract int getDimension();",
"public float getScale();",
"public boolean testTilingscale(EIfcfillareastyletiles type) throws SdaiException;",
"public static BufferedImage scale(BufferedImage original) {\n return scale(original, false);\n }",
"int getWrongScale();",
"public void scale(float scale) {\n if (scale != 1.0f) {\n left = (int) (left * scale + 0.5f);\n top = (int) (top * scale + 0.5f);\n right = (int) (right * scale + 0.5f);\n bottom = (int) (bottom * scale + 0.5f);\n }\n }",
"private void setScaleToBoardViewPanes(double scale) {\n boardController.getDrawedBoard().setScaleX(scale);\n boardController.getDrawedBoard().setScaleY(scale);\n boardController.getCanvas().setScaleX(scale);\n boardController.getCanvas().setScaleY(scale);\n boardController.getDartBoard().setScaleX(scale);\n boardController.getDartBoard().setScaleY(scale);\n boardController.getPointsAreaPane().setScaleX(scale);\n boardController.getPointsAreaPane().setScaleY(scale);\n }",
"@Test\n\tpublic void testGetNDimensions() {\n\t\tip = new ImagePlus(\"Agent007\", (Image)null);\n\t\tst = new ImageStack(2,3);\n\t\tst.addSlice(\"suave\",new byte[] {1,2,3,4,5,6});\n\t\tip.setStack(\"MoneyPenny\",st);\n\t\tip.setDimensions(1,1,1);\n\t\tassertEquals(2,ip.getNDimensions());\n\n\t\tip = new ImagePlus(\"Agent007\", (Image)null);\n\t\tst = new ImageStack(2,3);\n\t\tst.addSlice(\"suave\",new byte[] {1,2,3,4,5,6});\n\t\tst.addSlice(\"debonair\",new byte[] {1,2,3,4,5,6});\n\t\tst.addSlice(\"sophisticated\",new byte[] {1,2,3,4,5,6});\n\t\tst.addSlice(\"handsome\",new byte[] {1,2,3,4,5,6});\n\t\tst.addSlice(\"humorous\",new byte[] {1,2,3,4,5,6});\n\t\tst.addSlice(\"aloof\",new byte[] {1,2,3,4,5,6});\n\t\tst.addSlice(\"calm\",new byte[] {1,2,3,4,5,6});\n\t\tst.addSlice(\"composed\",new byte[] {1,2,3,4,5,6});\n\t\tip.setStack(\"MoneyPenny\", st);\n\n\t\t// one dim > 1\n\t\tip.setDimensions(1,1,8);\n\t\tassertEquals(3,ip.getNDimensions());\n\t\tip.setDimensions(1,8,1);\n\t\tassertEquals(3,ip.getNDimensions());\n\t\tip.setDimensions(8,1,1);\n\t\tassertEquals(3,ip.getNDimensions());\n\n\t\t// two dims > 1\n\t\tip.setDimensions(1,2,4);\n\t\tassertEquals(4,ip.getNDimensions());\n\t\tip.setDimensions(1,4,2);\n\t\tassertEquals(4,ip.getNDimensions());\n\t\tip.setDimensions(2,1,4);\n\t\tassertEquals(4,ip.getNDimensions());\n\t\tip.setDimensions(2,4,1);\n\t\tassertEquals(4,ip.getNDimensions());\n\t\tip.setDimensions(4,1,2);\n\t\tassertEquals(4,ip.getNDimensions());\n\t\tip.setDimensions(4,2,1);\n\t\tassertEquals(4,ip.getNDimensions());\n\n\t\t// three dims > 1\n\t\tip.setDimensions(2,2,2);\n\t\tassertEquals(5,ip.getNDimensions());\n\t}",
"@Override\n\tpublic void setDimensions() {\n\t\t\n\t}",
"@Override\r\n\tpublic void setDimension() {\n\r\n\t}",
"@Override\r\n\tpublic void setDimension() {\n\r\n\t}",
"public int getScale() {\n return scale_;\n }",
"public void updateDimensions() {\n }",
"public void setScale(float scale);",
"@Test\n public void testSetZoomMultiplier() {\n final DraggingCamera camera = newValueObject();\n testBoundField(camera, DraggingCamera.ZOOM_MULTIPLIER, 1.678f);\n }",
"@Test(expected = IllegalArgumentException.class)\n public void testScaleOverlap() {\n testAnimation.addShape(r, 1, 100);\n size1 = new ScaleShape(r, 50.0, 100.0, 25.0, 100.0);\n size2 = new ScaleShape(r, 25.0, 100.0, 70.0, 1000.0);\n testAnimation.addEvent(r, size1, 90, 100);\n testAnimation.addEvent(r, size2, 89, 95);\n }",
"public PictureScaler() {\r\n try {\r\n URL url = getClass().getResource(\"images/BB.jpg\");\r\n picture = ImageIO.read(url);\r\n scaleW = (int)(SCALE_FACTOR * picture.getWidth());\r\n scaleH = (int)(SCALE_FACTOR * picture.getHeight());\r\n System.out.println(\"w, h = \" + picture.getWidth() + \", \" + picture.getHeight());\r\n setPreferredSize(new Dimension(PADDING + (5 * (scaleW + PADDING)), \r\n scaleH + (4 * PADDING)));\r\n } catch (Exception e) {\r\n System.out.println(\"Problem reading image file: \" + e);\r\n System.exit(0);\r\n }\r\n }",
"@Override\n\t\t\tpublic IFuzzySet scale(double scalar) {\n\t\t\t\treturn null;\n\t\t\t}",
"@Override\n\t\t\tpublic IFuzzySet scale(double scalar) {\n\t\t\t\treturn null;\n\t\t\t}",
"public void resize(Dimension paramDimension) {\n/* 231 */ resize(paramDimension.width, paramDimension.height);\n/* */ }",
"public void setScale(Scale scale) {\n this.scale = scale;\n }",
"private int scale(final int pixel, final int scale) {\n \t\treturn scale * (4 - pixel);\n \t}",
"private Image scaleImage(Image image) { \n\t\treturn image.getScaledInstance(700, 500, Image.SCALE_SMOOTH); //Going to Scale the Image to the Size and Width Specified with the Highest Smoothness Possible \n\t}",
"public void scaleBy(float scale) {\n internalGroup.scaleBy(scale);\n dataTrait.scaleX = internalGroup.getScaleX();\n dataTrait.scaleY = internalGroup.getScaleY();\n resetSprite();\n\n }",
"@Test\n public void testSetZoomMin() {\n final DraggingCamera camera = newValueObject();\n testBoundField(camera, DraggingCamera.ZOOM_MIN, 1.1f);\n }",
"public native MagickImage scaleImage(int cols, int rows)\n\t\t\tthrows MagickException;",
"@Test\n public void testGetWidth() throws FitsException, IOException{\n ImageData imageData = new ImageData(frArray, IMAGE_TYPE,COLROID, rangeValues, 0,0, 100, 100, true );\n Assert.assertEquals(100, imageData.getWidth());\n }",
"public void scale(float x, float y);",
"private static <T extends Shape> void scaleShape(T shape, double scale){\r\n\t\tshapeContainer = new ShapeContainer<Shape>(shape);\r\n\t\ttry {\r\n\t\t\tshapeContainer.changeShapeScale(scale);\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t}",
"@Test\n public void testConstantDimension() throws TransformException {\n create(3, 2, 1, 0);\n assertIsNotIdentity(transform);\n\n final double[] source = generateRandomCoordinates();\n final double[] target = new double[source.length];\n for (int i=0; i<source.length; i++) {\n final int r = i % 3;\n final int b = i - r;\n target[b + (2-r)] = source[i];\n }\n verifyTransform(source, target);\n\n makeProjectiveTransform();\n verifyTransform(source, target);\n }",
"Dimension getSize();",
"Dimension getSize();",
"@Test\n public void testImage() {\n int expected = 4;\n assertEquals(expected, image.getHeight());\n assertEquals(expected, image.getWidth());\n }",
"@Test\n\tpublic void testGetWidth() {\n\t\tip = new ImagePlus();\n\t\tip.getWidth();\n\t}",
"public void resize(int paramInt1, int paramInt2) {\n/* 215 */ Dimension dimension = size();\n/* 216 */ if (dimension.width != paramInt1 || dimension.height != paramInt2) {\n/* 217 */ super.resize(paramInt1, paramInt2);\n/* 218 */ if (this.stub != null) {\n/* 219 */ this.stub.appletResize(paramInt1, paramInt2);\n/* */ }\n/* */ } \n/* */ }",
"@Override\n\tboolean computeDimensions() {\n\t\treturn true;\n\t}",
"@Test(expected = IllegalArgumentException.class)\n public void testRectangleScaleHeightToZero() {\n model1.addShape(Rectangle.createRectangle(\"R\", new Point.Double(200, 200),\n new Color(1, 0, 0), 1, 100, 50.0, 100.0));\n model1.addShape(Oval.createOval(\"C\", new Point.Double(500, 100),\n new Color(0, 0, 1), 6, 100, 60.0, 30.0));\n model1.addAction(ScaleRectangleAction.createScaleRectangleAction(\"R\", 10, 50,\n 50, 100, 10, 0));\n }",
"public abstract Dimension getSize();",
"public void initSize() {\n WIDTH = 320;\n //WIDTH = 640;\n HEIGHT = 240;\n //HEIGHT = 480;\n SCALE = 2;\n //SCALE = 1;\n }",
"protected void isotrop()\r\n {\r\n Dimension d = getSize();\r\n int maxX = d.width - 1, maxY = d.height - 1;\r\n\tpSize = Math.max(width / maxX, height / maxY);\r\n\tcX = maxX / 2;\r\n\tcY = maxY / 2;\r\n\r\n\t// Since pixel size is max of width/height over their device sizes, one of these\r\n\t// values will actually be larger. This should be used to use all of the canvas\r\n\tactualWidth = maxX * pSize;\r\n\tactualHeight = maxY * pSize;\r\n }",
"private BufferedImage scale(final BufferedImage input,\n \t\tfinal int newWidth, final int newHeight)\n \t{\n \t\tfinal int oldWidth = input.getWidth(), oldHeight = input.getHeight();\n \t\tif (oldWidth == newWidth && oldHeight == newHeight) return input;\n \n \t\tfinal BufferedImage output =\n \t\t\tnew BufferedImage(newWidth, newHeight, input.getType());\n \t\tfinal AffineTransform at = new AffineTransform();\n \t\tat.scale((double) newWidth / oldWidth, (double) newHeight / oldHeight);\n \t\tfinal AffineTransformOp scaleOp =\n \t\t\tnew AffineTransformOp(at, AffineTransformOp.TYPE_BILINEAR);\n \t\treturn scaleOp.filter(input, output);\n \t}",
"public int xPixScale( double x ) { return (int)(width / xRange * x); }",
"public int getScale() {\r\n return scale;\r\n }",
"public void doScaling() {\n try {\n int orientation = getExifOrientation(file);\n System.out.println(file.getName());\n //Dimension d = Imaging.getImageSize(file);\n ImageInputStream imageInputStream = ImageIO.createImageInputStream(file);\n // Use a subsampled image from the original, avoids read images too large to fit in memory\n BufferedImage bufferedImage = subsampleImage(imageInputStream, TARGET_WIDTH * 2, TARGET_HEIGHT * 2);\n ImageInformation ii=new ImageInformation(orientation, bufferedImage.getWidth(), bufferedImage.getHeight());\n AffineTransform transform=getExifTransformation(ii);\n bufferedImage=transformImage(bufferedImage, transform); \n Scalr.Mode mode;\n // calculate which side will be largest/smaller\n // this works with any image size\n double scaleX=(TARGET_WIDTH*1.0)/(bufferedImage.getWidth()*1.0);\n double scaleY=(TARGET_HEIGHT*1.0)/(bufferedImage.getHeight()*1.0);\n if (scaleX<scaleY) {\n mode = Scalr.Mode.FIT_TO_WIDTH;\n } else {\n mode = Scalr.Mode.FIT_TO_HEIGHT;\n } \n \n BufferedImage thumbnail = Scalr.resize(bufferedImage,\n Scalr.Method.QUALITY,\n mode, TARGET_WIDTH, TARGET_HEIGHT,\n Scalr.OP_ANTIALIAS);\n BufferedImage combined = new BufferedImage(TARGET_WIDTH, TARGET_HEIGHT, BufferedImage.TYPE_INT_ARGB);\n int x = 0, y = 0;\n if (mode == Scalr.Mode.FIT_TO_HEIGHT) {\n x = (TARGET_WIDTH - thumbnail.getWidth()) / 2;\n }\n if (mode == Scalr.Mode.FIT_TO_WIDTH) {\n y = (TARGET_HEIGHT - thumbnail.getHeight()) / 2;\n }\n Graphics g = combined.getGraphics();\n g.setColor(new java.awt.Color(0.0f, 0.0f, 0.0f, 0.0f));\n g.fillRect(0, 0, combined.getWidth(), combined.getHeight());\n g.drawImage(thumbnail, x, y, null);\n g.dispose();\n //Writes test subsampled image taken from original\n if (saveSubSampled) {\n ImageIO.write(bufferedImage, OUTPUT_EXTENSION, new File(output));\n }\n //Writes thumbnail, created from the subsampled image.\n ImageIO.write(combined, OUTPUT_EXTENSION, new File(output_thumb));\n\n } catch (IOException ex) {\n Logger.getLogger(Scaler.class.getName()).log(Level.SEVERE, null, ex);\n } catch (Exception ex) {\n Logger.getLogger(Scaler.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"public ImageProperties setScale(ImageScale scale) {\n this.scale = scale;\n return this;\n }",
"public Integer getScale() {\n return _scale;\n }",
"public Integer getScale() {\n return _scale;\n }",
"public BufferedImage getScaledImage ( float scale ) {\n\n int oldW = param.Parameters.IMAGEW;\n int oldH = param.Parameters.IMAGEH;\n\n param.Parameters.SCALE = scale;\n param.Parameters.IMAGEW = (int)((float)param.Parameters.IMAGEW * param.Parameters.SCALE);\n param.Parameters.IMAGEH = (int)((float)param.Parameters.IMAGEH * param.Parameters.SCALE);\n\n BufferedImage img =\n param.Parameters.PROBLEM.getData(param.Parameters.STATE, program, 0, 0);\n\n param.Parameters.SCALE = 1.0f;\n param.Parameters.IMAGEW = oldW;\n param.Parameters.IMAGEH = oldH;\n\n System.gc();\n\n return img;\n\n }",
"public void setDimension(String key, Dimension value) {\n\t\tif (value != null && !value.equals(getDefault(key)))\n\t\t\tinternal.setProperty(key, value.width + \" \" + value.height);\n\t\telse\n\t\t\tinternal.remove(key);\n\t}",
"public Image getScaledCopy(float scale) {\r\n\t\treturn getScaledCopy(width * scale, height * scale);\r\n\t}",
"Dimension dimension();",
"public int getScale(){\n return scale;\n }",
"void setScale(ScaleSelector sensor, int scaleNo);",
"protected abstract void resize();",
"@Override\n public float getScale() {\n return scale;\n }",
"public boolean isCorrectSize(int height, int width);",
"@Override\n public void setScale(float scale) {\n this.scale = scale;\n }",
"@Test\n public void scale() {\n float[] a1 = new float[] {1.001f, 2.002f, 3.003f, 4.004f, 5.00f, 6.00f};\n float[] a2 = new float[] {3.003f, 4.004f, 5.00f, 6.00f};\n float[] expect = new float[] {9.009f, 12.012f, 15.00f, 18.00f};\n Vec4f.scale(3.0f, a1, 2);\n assertTrue(Vec4f.epsilonEquals(a1, 2, expect, 0, 1E-6f));\n Vec4f.scale(3.0f, a2);\n assertTrue(Vec4f.epsilonEquals(a2, expect, 1E-6f));\n }",
"public double getScale() {\n return scale;\n }",
"public ScaleRuleMetricDimension() {\n }",
"private static void testREsizeImage() throws IOException {\n\t\tresizeImage(\n\t\t\tnew File(\"/opt/bitnami/files/img/contabilidad.jpg\"),\n\t\t\tnew File(\"/opt/bitnami/files/img/contabilidad_100x100.jpg\"),\n\t\t\t\"jpg\", 100, 100, UtilImage.FIT_BOTH);\n\t}",
"@Override\n\t\tpublic void resize(int arg0, int arg1) {\n\t\t \n\t\t}",
"void previewSized();"
]
| [
"0.68644905",
"0.6805298",
"0.6630134",
"0.65659237",
"0.64652747",
"0.6317598",
"0.61214703",
"0.6079423",
"0.59668034",
"0.5934852",
"0.591151",
"0.59035236",
"0.58823335",
"0.58783287",
"0.5869214",
"0.58271664",
"0.5776321",
"0.5761695",
"0.57600623",
"0.5755719",
"0.5743599",
"0.5726349",
"0.56917465",
"0.56736547",
"0.56657964",
"0.5665383",
"0.56422067",
"0.5640515",
"0.56300783",
"0.56155694",
"0.55993783",
"0.5580681",
"0.557841",
"0.55593866",
"0.5555571",
"0.5552616",
"0.5541102",
"0.5519461",
"0.55063766",
"0.5505322",
"0.55051434",
"0.5500066",
"0.5485632",
"0.5475721",
"0.54622597",
"0.546025",
"0.5455026",
"0.5455026",
"0.543152",
"0.5431414",
"0.54303586",
"0.5416713",
"0.5414864",
"0.541294",
"0.5412565",
"0.5412565",
"0.54117894",
"0.5393251",
"0.5387935",
"0.5377656",
"0.5375835",
"0.5361899",
"0.53584766",
"0.5353789",
"0.5351624",
"0.53367186",
"0.5332208",
"0.5331392",
"0.5331392",
"0.5328429",
"0.5321037",
"0.5320921",
"0.5314825",
"0.5308217",
"0.5308154",
"0.53008187",
"0.5298867",
"0.5289576",
"0.5289571",
"0.5289253",
"0.52887017",
"0.5284115",
"0.52827007",
"0.52827007",
"0.5282612",
"0.5275434",
"0.5273821",
"0.52735925",
"0.5272267",
"0.52713794",
"0.52657753",
"0.5265496",
"0.5250893",
"0.5243252",
"0.52413046",
"0.5238041",
"0.5237632",
"0.52274",
"0.5217761",
"0.52091163"
]
| 0.67086655 | 2 |
Toast.makeText( MainActivity.this , "pageWidth= " + pageWidth + " pageHeight= " + pageHeight + " displayedPage=" + displayedPage , Toast.LENGTH_SHORT).show(); | @Override
public void onLayerDrawn(Canvas canvas, float pageWidth, float pageHeight, int displayedPage) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n Display display = getWindowManager().getDefaultDisplay();\n Point point=new Point();\n display.getSize(point);\n final float hieght = point.y; // screen height\n scrnHeight = hieght-250;\n final float width = point.x; // screen width\n scrnWidth = width-60;\n\n initUI();\n\n animateTopBottom(10000);\n\n}",
"private void getWidthAndHeight() {\n DisplayMetrics displaymetrics = new DisplayMetrics();\n getActivity().getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);\n screenHeight = displaymetrics.heightPixels;\n screenWidth = displaymetrics.widthPixels;\n }",
"@Override\n\t\t\tpublic void onPageSelected(int arg0) {\n\t\t\t\tToast.makeText(getBaseContext(), arg0 + \"\", Toast.LENGTH_SHORT).show();\n\t\t\t}",
"void onPageChanged(int position);",
"@Override\n public void onPageSelected(int position) {\n Toast.makeText(TeamViewActivity.this,\n \"Selected page position: \" + position, Toast.LENGTH_SHORT).show();\n }",
"@Override\n public void onPageSelected(int arg0) {\n currentPosition = arg0;\n tv_count.setText((arg0 + 1) + \"/\" + imageBigs.size());\n\n }",
"Point onPage();",
"public void initLoadingPage(Context c) {\n\n LayoutInflater inflater = (LayoutInflater) c.getSystemService( c.LAYOUT_INFLATER_SERVICE);\n final AlertDialog.Builder nameBuilder = new AlertDialog.Builder(c);\n View alertDiaView = inflater.inflate(R.layout.activity_loading_page,null);\n nameBuilder.setView(alertDiaView);\n\n avi = (AVLoadingIndicatorView) alertDiaView.findViewById(R.id.avi);\n avi.smoothToShow();\n\n\n int val= (int) (130 * Resources.getSystem().getDisplayMetrics().density);//dp to px\n alertDialog= nameBuilder.show();\n alertDialog.getWindow().setLayout(val ,val);\n\n\n }",
"@Override\n\tpublic void onShow (int screenWidth, int screenHeight) {\n\n\t}",
"@Override\n\tpublic void onShow (int screenWidth, int screenHeight) {\n\t}",
"@Override\n public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n\n }",
"@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n get_started_btn = findViewById(R.id.GetStartedBtn);\n get_started_btn.setOnClickListener(this);\n\n eye_examination_btn = findViewById(R.id.eyeExaminationBtn);\n eye_examination_btn.setOnClickListener(this);\n\n help_btn = findViewById(R.id.HelpBtn);\n help_btn.setOnClickListener(this);\n\n //Calculate the inch of the screen\n getWindowManager().getDefaultDisplay().getMetrics(Globals.dm);\n double x = Math.pow(Globals.dm.widthPixels/Globals.dm.xdpi, 2);\n double y = Math.pow(Globals.dm.heightPixels/Globals.dm.ydpi, 2);\n double screenInches = sqrt(x+y);\n Log.d(\"debug\", \"Screen Inches:\"+screenInches);\n Log.d(\"debug\", \"Screen Inches w:\"+Globals.dm.widthPixels);\n Log.d(\"debug\", \"Screen Inches h:\"+Globals.dm.heightPixels);\n\n Log.d(\"INCHES ! \", String.format(\"%.2f\", screenInches)+\" In\");\n\n }",
"@Override\n public void onPageSelected(int arg0) {\n current = arg0;\n // title.setText(content[current]);\n\n //\tToast.makeText(LearningActivity.this, \"Current = \"+arg0, Toast.LENGTH_SHORT).show();\n\n }",
"@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\n\t\trequestWindowFeature(Window.FEATURE_NO_TITLE);\n\t\tgetWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,\n\t\t\t\tWindowManager.LayoutParams.FLAG_FULLSCREEN);\n\n\t\tmTimeshow = new TextView(this);\n\t\tmTimeshow.setGravity(Gravity.BOTTOM);\n\t\thandler.post(updateThread);\n\t\tmPageWidget = new PageWidget(this);\n\t\tsetContentView(mPageWidget);\n\t\tmPageWidget.setOnTouchListener(this);\n\n\t\tDisplay d = this.getWindowManager().getDefaultDisplay();\n\t\tmCurPageBitmap = Bitmap.createBitmap(d.getWidth(), d.getHeight(),\n\t\t\t\tBitmap.Config.ARGB_8888);// 32bytes\n\t\tmNextPageBitmap = Bitmap.createBitmap(d.getWidth(), d.getHeight(),\n\t\t\t\tBitmap.Config.ARGB_8888);\n\n\t\tmCurPageCanvas = new Canvas(mCurPageBitmap);\n\t\tmNextPageCanvas = new Canvas(mNextPageBitmap);\n\n\t\tmPagefactory = new BookPageFactory(d.getWidth(), d.getHeight());\n\n\t\tBundle bunde = this.getIntent().getExtras();\n\t\tmFilenameString = bunde.getString(\"fileName\");\n\t\tsFlag = 1;\n\n\t\tint w = BitmapFactory.decodeResource(this.getResources(),\n\t\t\t\tmyImageIds[sPosition]).getWidth();\n\t\tint h = BitmapFactory.decodeResource(this.getResources(),\n\t\t\t\tmyImageIds[sPosition]).getHeight();\n\n\t\tsScaleWidth = ((float) d.getWidth() / w);\n\t\tsScaleHeight = ((float) d.getHeight() / h);\n\t\tsMatrix = new Matrix();\n\t\tsMatrix.postScale(sScaleWidth, sScaleHeight);\n\t}",
"public int getWidthScreen(){\n return widthScreen ;\n }",
"@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.paper);\n MyApplication.getInstance().addActivity(this);\n back = (RelativeLayout) findViewById(R.id.addinformationback);\n titt = (TextView) findViewById(R.id.addinformationtitle);\n titt.setText(\"变形计\");\n back.setOnClickListener(new OnClickListener() {\n\n @Override\n public void onClick(View v) {\n // TODO Auto-generated method stub\n finish();\n }\n });\n iv = (ImageView) findViewById(R.id.pagerimage);\n LayoutParams lp = (LayoutParams) iv.getLayoutParams();\n DisplayMetrics dm = new DisplayMetrics();\n getWindowManager().getDefaultDisplay().getMetrics(dm);\n int screenWidth = dm.widthPixels;\n int height = (int) (screenWidth / 1.7);\n lp.width = screenWidth;\n lp.height = height;\n iv.setLayoutParams(lp);\n\n title = (TextView) findViewById(R.id.pagertitle);\n from = (TextView) findViewById(R.id.pagerfrom);\n pagertop = (TextView) findViewById(R.id.pagerestop);\n pagerbottm1 = (TextView) findViewById(R.id.pageresbottom1);\n pagerbottm2 = (TextView) findViewById(R.id.pageresbottom2);\n pagerbottm3 = (TextView) findViewById(R.id.pageresbottom3);\n pagerbottm4 = (TextView) findViewById(R.id.pageresbottom4);\n pagerbottm5 = (TextView) findViewById(R.id.pageresbottom5);\n pagerbottm6 = (TextView) findViewById(R.id.pageresbottom6);\n pagerbottm7 = (TextView) findViewById(R.id.pageresbottom7);\n pagerbottm8 = (TextView) findViewById(R.id.pageresbottom8);\n pagerbottm9 = (TextView) findViewById(R.id.pageresbottom9);\n pagerbottm10 = (TextView) findViewById(R.id.pageresbottom10);\n pagerbottm11 = (TextView) findViewById(R.id.pageresbottom11);\n pagerbottm12 = (TextView) findViewById(R.id.pageresbottom12);\n String t = null;\n String aut = null;\n String be = null;\n String t1 = null;\n String t2 = null;\n String t3 = null;\n String t4 = null;\n String t5 = null;\n String n1 = null;\n String n2 = null;\n String n3 = null;\n String n4 = null;\n String n5 = null;\n iv.setScaleType(ScaleType.CENTER_INSIDE);\n iv.setBackgroundResource(R.drawable.nuanbaojihuaimage);\n t = \"变形计\";\n aut = \"小嗯\";\n be = \"无论她平时多折腾、多暴躁、多像个磨人的小妖精,可是一旦大姨妈来串门,她就好像是孙猴子被念了紧箍咒一般,如果这个时候作为男票的你只会说“多喝点热水吧”,那你的下场只有一个——再次沦为单身狗!面对如此脆弱又极易引爆的美少女,做为百分百暖男的你,可以做些什么呢?\";\n t1 = \"大姨妈前两天\";\n n1 = \" 1、阻止她参与剧烈运动,经期前的剧烈运动会影响女生经期的正常循环;\\n 2、不要让她吃太冰、辣等刺激性食物,很多大姨妈来临之后的疼痛就是由于这几天的刺激性饮食;\";\n t2 = \"大姨妈时间\";\n n2 = \"\\n 保暖:\\n 1、说一百万次多喝热水,不如一次把冲好的红糖姜水递到她手上;\\n 2、给她准备热水袋、暖宝宝或暖宝贴放小肚子上;\\n 3、督促她穿暖和一点,不可以淋雨,大姨妈时期不能受凉;\\n 4、抱抱给她温暖,或者把手搓热来帮她捂小肚子。\\n\\n 饮食:\\n 1、不要让她吃辛辣生冷等刺激性的食物,点餐的时候要细心的为她考虑到;\\n 2、火锅啊、麻辣烫、冰激凌啊等等都是不能吃的,她再怎么想吃撒娇都不可以,这个时候可不能惯着她;\\n 3、送红枣、阿胶枣、黑糖话梅等补气活血的食物给她,或者你亲自下厨给她熬个爱心粥,简直不能再暖;\\n\\n 暖心:\\n 1、大姨妈来了她会有点儿小脾气,可不是她故意的哦,要耐心的爱护包容她;\\n 2、不惹她生气,记得这个时候放低自己迁就她一下也没啥;\\n 3、逗她开心,送送花、送送礼物、讲讲段子等等;\\n 4、带她去喜欢的地方,看美丽的风景,吃好吃的东西;\\n 5、心疼她太累,可以替她做她当天必须完成的任务;\\n\\n 冷水:\\n 1、女生经期接触冷水不好,所以洗衣服、袜子、做饭这些活要全给包了;\\n 2、准备些湿巾,一起出去需要洗手的时候用湿巾代替冷水\\n\\n 学习:\\n 1、了解跟大姨妈有关的知识,弄清楚她是哪种痛,买一些相应的止痛药;\\n 2、学会计算经期,了解她常用的卫生巾的牌子,日用还是夜用,长的还是短的,如果缺了就大胆去买,不用不好意思;\\n\\n 陪伴:\\n 1、大姨妈随时都可能会痛,记得经常主动给亲爱的她打电话去关心;\\n 2、在知道她难受的时候,不要让她一个人,陪伴她身边;\\n 3、睡前轻轻地和她说晚安,这个阶段不可以熬夜,提醒她好好休息;\";\n n3 = \" 好好的爱护她,就像爱护小公主,女生是很感性的,她可以清楚的感受到所有这些事情背后,你那么爱她的那颗心\";\n pagerbottm12.setVisibility(View.GONE);\n pagerbottm11.setVisibility(View.GONE);\n pagerbottm10.setVisibility(View.GONE);\n pagerbottm9.setVisibility(View.GONE);\n pagerbottm8.setVisibility(View.GONE);\n pagerbottm7.setVisibility(View.GONE);\n pagerbottm5.setVisibility(View.GONE);\n set(t, aut, be, t1, t2, t3, t4, t5, n1, n2, n3, n4, n5);\n\n }",
"@Override\r\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n\r\n }",
"public void showInfo(){\n DisplayMetrics displaymetrics = new DisplayMetrics();\n getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);\n int height = displaymetrics.heightPixels;\n int width = displaymetrics.widthPixels;\n int colorDep = getWindowManager().getDefaultDisplay().getPixelFormat();\n //String android_id = Secure.getString(this.getContentResolver(), Secure.ANDROID_ID);\n TelephonyManager telephonyManager = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);\n\n Calendar c = Calendar.getInstance();\n SimpleDateFormat df = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n String now = df.format(c.getTime());\n\n String text = \"手机分辨率是:\"+width+\"*\"+height+\" 手机色深是:\"+colorDep+\" IMEI是:\"+telephonyManager.getDeviceId()+\" Time: \"+now;\n Toast.makeText(getApplicationContext(),text,Toast.LENGTH_SHORT).show();\n }",
"@Override\n public int getCount() {\n int TOTAL_PAGES = totalPages;\n return TOTAL_PAGES;\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.main);\n\n // 取得裝置螢幕的寬和高\n Display defDisp = getWindowManager().getDefaultDisplay();\n int dispWidth = defDisp.getWidth();\n int dispHeight = defDisp.getHeight();\n String s;\n if (dispWidth > dispHeight)\n \ts = \"橫向螢幕\";\n else if (dispWidth < dispHeight)\n \ts = \"直式螢幕\";\n else\n \ts = \"正方形螢幕\";\n Toast.makeText(Main.this, s + System.getProperty(\"line.separator\") + \"w = \" + dispWidth + \" h = \" + dispHeight, \n \t\tToast.LENGTH_LONG)\n\t\t\t.show();\n\n // 顯示程式可用區域的寬和高\n Toast.makeText(Main.this, \"appw = \" + MyLayout.appWindowWidth + \" apph = \" + MyLayout.appWindowHeight, \n \t\tToast.LENGTH_LONG)\n\t\t\t.show();\n\n\t\t// 取得裝置螢幕的實際解析度\n DisplayMetrics dm = new DisplayMetrics();\n getWindowManager().getDefaultDisplay().getMetrics(dm);\n // 也可以利用dm.heightPixels和dm.widthPixels取得螢幕的寬和高\n\t\tToast.makeText(Main.this, \"水平dpi = \" + dm.xdpi + \" 垂直dpi = \" + dm.ydpi, \n \t\tToast.LENGTH_LONG)\n\t\t\t.show();\n\n\t\t// 取得裝置螢幕的解析度分類\n int screenSizeClass = dm.densityDpi;\n\t\tswitch(screenSizeClass){\n\t\tcase DisplayMetrics.DENSITY_LOW:\n\t\t\tToast.makeText(Main.this, \"low density\", \n\t \t\tToast.LENGTH_LONG)\n\t\t\t\t.show();\n\t\t\tbreak;\n\t\tcase DisplayMetrics.DENSITY_MEDIUM:\n\t\t\tToast.makeText(Main.this, \"medium density\", \n\t \t\tToast.LENGTH_LONG)\n\t\t\t\t.show();\n\t\t\tbreak;\n\t\tcase DisplayMetrics.DENSITY_HIGH:\n\t\t\tToast.makeText(Main.this, \"high density\", \n\t \t\tToast.LENGTH_LONG)\n\t\t\t\t.show();\n\t\t\tbreak;\n\t\tcase DisplayMetrics.DENSITY_XHIGH:\n\t\t\tToast.makeText(Main.this, \"x-high density\", \n\t \t\tToast.LENGTH_LONG)\n\t\t\t\t.show();\n\t\t\tbreak;\n\t\t}\n }",
"public int getHeightScreen(){\n return heightScreen ;\n }",
"@Override\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n\n System.out.println(\"onPageScrolled is called\");\n\n\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n page = getArguments().getInt(\"someInt\", 0);\n title = getArguments().getString(\"someTitle\");\n }",
"@Override\n public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n\n }",
"protected void onPostExecute(String page) {\n textView.setText(page);\n }",
"@Override\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n\n }",
"@Override\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n\n }",
"@Override\n public int getCount() {\n return PAGE_COUNT;\n }",
"public void onEventSelected(int position) {\n Toast toast=Toast.makeText(getApplicationContext(),\"Hello Javatpoint\",Toast.LENGTH_SHORT);\n toast.setMargin(50,50);\n toast.show();\n }",
"@Override\n public void onPageChanged(int position) {\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n mPage = getArguments().getInt(ARG_PAGE);\n }",
"public SavingsInfoPage() {\n setLocationRelativeTo(null);\n setResizable(false); \n initComponents();\n onRun();\n }",
"@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.end);\n\t\tcd=(TextView) findViewById(R.id.cd);\n\t\tBundle gt=getIntent().getExtras();\n \t\tg=gt.getString(\"abcd\");\n \t\t\n \t\tcd.setText(g);\n \t\tToast.makeText(getApplicationContext(), \"Call Duration = \"+ g, Toast.LENGTH_SHORT).show();\n \t\t//Toast.makeText(getApplicationContext(), g+ \" :Call duration\", Toast.LENGTH_LONG).show();\n\t\tbh=(Button) findViewById(R.id.bh);\n\t\tbh.setOnClickListener(this);\n\n\t}",
"@Override\n public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n }",
"@Override\n public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n }",
"@Override\n public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n }",
"@Override\n public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n }",
"@Override\n public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n }",
"@Override\n // onCreate() method is used to inflate the layout, which means to set the content view of the screen to the XML layout\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n // Points to the XML file with the layout information\n setContentView(R.layout.activity_main);\n // Correlate the TextView parameter 'mShowCount' to the TextView in 'activity_main.xml'\n mShowCount = (TextView) findViewById(R.id.show_count);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View v = inflater.inflate(R.layout.detail_viewpager, container, false);\n title = getArguments().getString(\"title\");\n subtitle = getArguments().getString(\"subtitle\");\n writer = getArguments().getString(\"writer\");\n image = getArguments().getString(\"image\");\n position = getArguments().getInt(\"position\");\n max = getArguments().getInt(\"max\");\n\n TextView titleView = (TextView)v.findViewById(R.id.detail_viewpager_title);\n TextView subtitleView = (TextView)v.findViewById(R.id.detail_viewpager_subtitle);\n TextView writerView = (TextView)v.findViewById(R.id.detail_viewpager_writer);\n ImageView imageView = (ImageView)v.findViewById(R.id.detail_viewpager_image);\n TextView indexView = (TextView)v.findViewById(R.id.detail_viewPager_index);\n\n titleView.setText(title);\n subtitleView.setText(subtitle);\n writerView.setText(\"by.\"+writer);\n indexView.setText((position+1)+\"/\"+max);\n Glide.with(getContext()).load(image).into(imageView);\n imageView.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n Intent intent = new Intent(getContext(), FullScreenImageActivity.class);\n intent.putExtra(\"url\", image);\n startActivity(intent);\n }\n });\n\n return v;\n\n }",
"@Test(description = \"Проверка отображения стартовой страницы\")\n public void startPageDisplayCheck() {\n StartPage startPage = (StartPage) context.getBean(\"startPage\");\n\n startPage.checkPageShow();\n }",
"@Override\r\n\tprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) \r\n\t{\n\t\tsuper.onMeasure(widthMeasureSpec, heightMeasureSpec);\r\n\t\tSystem.out.println(\"Screen Mesure: \"+getMeasuredWidth()+\" \"+getMeasuredHeight());\r\n\t\twindowW = getMeasuredWidth();\r\n\t\twindowH = getMeasuredHeight();\r\n\t \r\n\t \r\n\t}",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n pagePosition = getArguments() != null ? getArguments().getInt(\"pagePosition\") : 0;\n }",
"@Override\r\n\tpublic void onPageScrolled(int position, float positionOffset,\r\n\t\t\tint positionOffsetPixels) {\n\r\n\t}",
"@Override\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n\n }",
"@Override\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n\n }",
"@Override\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n\n }",
"@Override\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n\n }",
"@Override\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n\n }",
"@Override\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n\n }",
"@Override\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n\n }",
"@Override\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n\n }",
"@Override\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n\n }",
"@Override\r\n public void onPageScrollStateChanged(int arg0) {\n\r\n }",
"@Override\n public int getCount() {\n return PAGE_COUNT;\n }",
"short getPageStart();",
"protected void toastshow() {\n \n\t\tToast toast=new Toast(getApplicationContext());\n\t\tImageView imageView=new ImageView(getApplicationContext());\n\t\timageView.setImageResource(R.drawable.icon);\n\t\ttoast.setView(imageView);\n\t\ttoast.show();\t\n\t}",
"private void getScreenSize() {\n WindowManager wm = getWindowManager();\n Display disp = wm.getDefaultDisplay();\n Point size = new Point();\n disp.getSize(size);\n screenWidth = size.x;\n screenHeight = size.y;\n }",
"@Override\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n }",
"@Override\n public void onPageScrollStateChanged(int state) {\n Log.d(TAG, \"onPageScrollStateChanged: \"+state);\n }",
"public void setPageInfo(){\n\t\tif(AllP>=1){\n\t\t\tPageInfo=\"<table border='0' cellpadding='3'><tr><td>\";\n\t\t\tPageInfo+=\"Show: \"+PerR+\"/\"+AllR+\" Records! \";\n\t\t\tPageInfo+=\"Current page: \"+CurrentP+\"/\"+AllP;\n\t\t\tPageInfo+=\"</td></tr></table>\";\t\t\t\n\t\t}\t\t\t\t\n\t}",
"public void onGenerateFirstPageFinish(View v,int x,int y, int pageWith, int pageHeight) {\n\t\t RelativeLayout.LayoutParams dlp = new RelativeLayout.LayoutParams( pagesView.getWidth(),pagesView.getHeight());\n\t drawingSurface.setLayoutParams(dlp);\n\t \n\t\t drawingSurface.setBookInitial(x,y,pageWith,pageHeight);\n\t}",
"@Override\n public void onPageScrolled(int position,\n float positionOffset, int positionOffsetPixels) {\n }",
"@Override\n public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n }",
"@Override\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n \n }",
"@Override\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n \n }",
"@Override\n public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n // Code goes here\n }",
"@Override\n public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n // Code goes here\n }",
"@Override\n public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n // Code goes here\n }",
"@Override\n public void onPageScrollStateChanged(int arg0) {\n\n }",
"ProfileViewPager mo106366h();",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n ViewGroup rootView = (ViewGroup) inflater\n .inflate(R.layout.tour_page_fragment, container, false);\n\n// // Set the title view to show the page number.\n// ((TextView) rootView.findViewById(android.R.id.text1)).setText(\n// getString(R.string.title_template_step, mPageNumber + 1));\n TextView textCabecalho;\n ImageView imageLogo;\n ImageView imagePrintscreen;\n\n textCabecalho = (TextView) rootView.findViewById(R.id.textMessageTour);\n imageLogo = (ImageView) rootView.findViewById(R.id.imageApp);\n imagePrintscreen = (ImageView) rootView.findViewById(R.id.imageScreen);\n imagePrintscreen.setScaleType(ImageView.ScaleType.FIT_XY);\n\n imagePrintscreen.setScaleType(ImageView.ScaleType.FIT_XY);\n\n if (cabecalho.equals(\"\")) {\n textCabecalho.setVisibility(View.GONE);\n textCabecalho.setText(\"\");\n } else {\n textCabecalho.setVisibility(View.VISIBLE);\n textCabecalho.setText(cabecalho);\n }\n\n if (logo_id == 0) {\n imageLogo.setVisibility(View.GONE);\n if (cabecalho.equals(\"\")) {\n LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);\n params.weight = 0.0f;\n imagePrintscreen.setLayoutParams(params);\n }\n } else {\n imageLogo.setVisibility(View.VISIBLE);\n LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);\n params.weight = 1.0f;\n imagePrintscreen.setLayoutParams(params);\n }\n\n ImageUtils.setImageViewResource(imageLogo, logo_id);\n ImageUtils.setImageViewResource(imagePrintscreen, printscreen_id);\n\n return rootView;\n }",
"@Override\n\t\t\tpublic void onPageScrolled(int position, float positionOffset,\n\t\t\t\t\tint positionOffsetPixels) {\n\t\t\t\t\n\t\t\t}",
"@Override\n public void onResume() {\n super.onResume();\n\n //call a page frgament instance\n\n\n }",
"@Override\n public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n Log.d(TAG, \"onPageScrolled: position=\"+position+\",positionOffset=\"+positionOffset+\",positionOffsetPixels=\"+positionOffsetPixels);\n }",
"int getCurrentPage();",
"@Override\n public void run() {\n Log.i(TAG, \"run: width\" + mWidth);\n Log.i(TAG, \"run: height----------\" + mHeight);\n }",
"public Integer getPageX() {\n return pageX;\n }",
"@Override\r\n\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\r\n\t}",
"@Override\r\n\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\r\n\t}",
"@Override\n public void onPageChanged(int page, int pageCount) {\n }",
"protected void toastshow1() {\n \n\t\tToast toast=Toast.makeText(this, \"image and text\", Toast.LENGTH_LONG);\n\t\t\n\t\tLinearLayout linearLayout=new LinearLayout(this);\n\t\tlinearLayout.setOrientation(LinearLayout.VERTICAL);\n\t\tImageView imageView=new ImageView(this);\n\t\timageView.setImageResource(R.drawable.icon);\n\t\tButton button=new Button(this);\n\t\tbutton.setText(\"progress over\");\n\t\tView toastView=toast.getView();\n\t\tlinearLayout.addView(imageView);\n\t\tlinearLayout.addView(button);\n\t\tlinearLayout.addView(toastView);\n\t\t\n\t\ttoast.setView(linearLayout);\n\t\ttoast.show();\n\t\t\n\t}",
"@Override\n public void onCreate(Bundle savedInstanceState)\n {\n super.onCreate(savedInstanceState);\n /* 載入main.xml Layout */\n setContentView(R.layout.main);\n \n /* 取得螢幕解析度大小 */\n DisplayMetrics dm=new DisplayMetrics();\n getWindowManager().getDefaultDisplay().getMetrics(dm);\n displayWidth=dm.widthPixels;\n /* 螢幕高度須扣除下方Button高度 */\n displayHeight=dm.heightPixels-80;\n /* 初始化相關變數 */\n bmp=BitmapFactory.decodeResource(getResources(),R.drawable.ex04_23);\n mImageView = (ImageView)findViewById(R.id.myImageView);\n layout1 = (AbsoluteLayout)findViewById(R.id.layout1); \n mButton01 = (Button)findViewById(R.id.myButton1);\n mButton02 = (Button)findViewById(R.id.myButton2);\n \n /* 幫縮小按鈕加上onClickListener */\n mButton01.setOnClickListener(new Button.OnClickListener()\n {\n @Override\n public void onClick(View v)\n {\n small();\n }\n });\n \n /* 幫放大按鈕加上onClickListener */\n mButton02.setOnClickListener(new Button.OnClickListener()\n {\n @Override\n public void onClick(View v)\n {\n big();\n }\n }); \n }",
"@Override\n\t\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\t\t\t\t\n\t\t\t}",
"public void onPageSelected(int position) {\n \t\n }",
"private void showPage(int index) {\n if (mPdfRenderer.getPageCount() <= index) {\n return;\n }\n // Make sure to close the current page before opening another one.\n if (null != mCurrentPage) {\n mCurrentPage.close();\n }\n // Use `openPage` to open a specific page in PDF.\n mCurrentPage = mPdfRenderer.openPage(index);\n // Important: the destination bitmap must be ARGB (not RGB).\n Bitmap bitmap = Bitmap.createBitmap(mCurrentPage.getWidth(), mCurrentPage.getHeight(),\n Bitmap.Config.ARGB_8888);\n // Here, we render the page onto the Bitmap.\n // To render a portion of the page, use the second and third parameter. Pass nulls to get\n // the default result.\n // Pass either RENDER_MODE_FOR_DISPLAY or RENDER_MODE_FOR_PRINT for the last parameter.\n mCurrentPage.render(bitmap, null, null, PdfRenderer.Page.RENDER_MODE_FOR_DISPLAY);\n // We are ready to show the Bitmap to user.\n mImageView.setImageBitmap(bitmap);\n updateUi();\n }",
"@Override\r\n protected void onCreate(Bundle savedInstanceState) {\r\n super.onCreate(savedInstanceState);\r\n setContentView(R.layout.activity_data_display_page);\r\n\r\n\r\n }",
"int getPageNumber();",
"protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n //Starts the selected layout as the first page when app opens\n setContentView(R.layout.activity_main_page);\n new JSONArrayExtractor().execute(); //This command allows the class to run and make URL requests without crashing\n try {\n Thread.sleep(1000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n mSectionStatePagerAdapter = new SectionsStatePagerAdapter(getSupportFragmentManager());\n mViewPager = (ViewPager) findViewById(R.id.container);\n setupViewPager(mViewPager);\n\n Log.i(TAG,\"MainPage Started.\");\n Toast.makeText(getApplicationContext(),\"Weather Found\", Toast.LENGTH_SHORT).show();\n }",
"@Override\n public boolean onTouch(View v, MotionEvent event) {\n switch(event.getAction()){\n case MotionEvent.ACTION_DOWN:\n System.out.println(\"---action down-----\");\n dx=event.getX();\n dy=event.getY();\n // show.setText(\"起始位置为:\"+\"(\"+event.getX()+\" , \"+event.getY()+\")\");\n break;\n case MotionEvent.ACTION_MOVE:\n //System.out.println(\"---action move-----\");\n //show.setText(\"移动中坐标为:\"+\"(\"+event.getX()+\" , \"+event.getY()+\")\");\n break;\n case MotionEvent.ACTION_UP:\n System.out.println(\"---action up-----\");\n ux=event.getX();\n uy=event.getY();\n\n if(dx>readingText.getWidth()/2){//页面三等分,中间跳出设置 设置字体大小时应重新加载页面\n // Toast.makeText(MainActivity.this, \"next\", Toast.LENGTH_SHORT).show();\n readingText.setText(getNext());\n }\n else {\n readingText.setText(getPre());\n\n //加载上一页\n //Toast.makeText(MainActivity.this, \"pre\", Toast.LENGTH_SHORT).show();\n //show.setText(\"pre:\"+\"(\"+event.getX()+\" , \"+event.getY()+\")\");\n }\n break;\n // show.setText(\"最后位置为:\"+\"(\"+event.getX()+\" , \"+event.getY()+\")\");\n }\n return true;\n }",
"@Override\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n }",
"@Override\n public void onPageScrolled(int arg0, float arg1, int arg2) {\n }"
]
| [
"0.6165689",
"0.5946189",
"0.58538014",
"0.58141595",
"0.57921314",
"0.5753521",
"0.57458526",
"0.5733388",
"0.56396204",
"0.5628396",
"0.56200445",
"0.5577123",
"0.55276495",
"0.5527603",
"0.5510633",
"0.5503888",
"0.54740965",
"0.54591304",
"0.5442794",
"0.5426632",
"0.54167813",
"0.5407719",
"0.5405906",
"0.53974503",
"0.5389531",
"0.5383693",
"0.5383693",
"0.53786665",
"0.53604716",
"0.5355395",
"0.53089565",
"0.53045094",
"0.5302685",
"0.52949",
"0.52949",
"0.52949",
"0.52949",
"0.52949",
"0.52850324",
"0.5272513",
"0.52699256",
"0.5243454",
"0.52212334",
"0.5220535",
"0.5215755",
"0.5215755",
"0.5215755",
"0.5215755",
"0.5215755",
"0.5215755",
"0.5215755",
"0.5215755",
"0.5215755",
"0.5215394",
"0.5211884",
"0.521044",
"0.52051485",
"0.51953286",
"0.51884586",
"0.51864463",
"0.51857716",
"0.51796776",
"0.51789516",
"0.5169029",
"0.5167478",
"0.5167478",
"0.5164925",
"0.5164925",
"0.5164925",
"0.5162777",
"0.51610786",
"0.5158289",
"0.515081",
"0.5143128",
"0.51414824",
"0.51328814",
"0.5128444",
"0.5126329",
"0.51222414",
"0.51222414",
"0.5121756",
"0.51206666",
"0.5116355",
"0.5116266",
"0.5116266",
"0.5116266",
"0.5116266",
"0.5116266",
"0.5116266",
"0.5116266",
"0.5116266",
"0.5116266",
"0.5116266",
"0.5115858",
"0.5111242",
"0.5109103",
"0.51024336",
"0.5099579",
"0.509745",
"0.50958675",
"0.50958675"
]
| 0.0 | -1 |
Aumenta a grossura da borda | public void setBorda(int borda) {
this.borda = borda;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void borra() {\n dib.borra();\n dib.dibujaImagen(limiteX-60,limiteY-60,\"tierra.png\");\n dib.pinta(); \n }",
"Groepen maakGroepsindeling(Groepen aanwezigheidsGroepen);",
"Gruppo getGruppo();",
"public void billeBarre() { \t\t\t\t\t\t\t\t\t\t\t\n\t\tint contact = 0;\n\n\t\t// Décomposition de la bille\n\t\t// 2 3 4\n\t\t// 1 5\n\t\t// 8 7 6 \n\n\t\t// Étude des contacts avec les 8 points de la bille\n\t\t// Contact GaucheHaut de la bille\n\n\t\t// Contact haut de la bille\n\t\tint[] p = billeEnCours.MH();\n\t\tif (p[1] <= barreEnCours.bas() && p[1] >= barreEnCours.haut() && p[0] <= barreEnCours.droite() && p[0] >= barreEnCours.gauche()) {\n\t\t\tcontact = 3;\n\t\t}\n\n\t\t// Contact bas de la bille\n\t\tif (contact == 0) {\n\t\t\tp = billeEnCours.MB();\n\t\t\tif (((p[1] <= barreEnCours.bas()) && (p[1] >= barreEnCours.haut())) && ((p[0] <= barreEnCours.droite()) && (p[0] >= barreEnCours.gauche()))) {\n\t\t\t\tcontact = 7;\n\t\t\t}\n\t\t}\n\n\t\t// Contact droite de la bille\n\t\tif (contact == 0) {\n\t\t\tp = billeEnCours.DM();\n\t\t\tif (((p[1] <= barreEnCours.bas()) && (p[1] >= barreEnCours.haut())) && ((p[0] <= barreEnCours.droite()) && (p[0] >= barreEnCours.gauche()))) {\n\t\t\t\tcontact = 5;\n\t\t\t}\n\t\t}\n\n\t\t// Contact gauche de la bille\n\t\tif (contact == 0) {\n\t\t\tp = billeEnCours.GM();\n\t\t\tif (((p[1] <= barreEnCours.bas()) && (p[1] >= barreEnCours.haut())) && ((p[0] <= barreEnCours.droite()) && (p[0] >= barreEnCours.gauche()))) {\n\t\t\t\tcontact = 1;\n\t\t\t}\n\t\t}\n\n\t\t// Contact GaucheHaut de la bille\n\t\tif (contact == 0) {\n\t\t\tdouble[] q = billeEnCours.GH();\n\t\t\tif (((q[1] <= barreEnCours.bas()) && (q[1] >= barreEnCours.haut())) && ((q[0] <= barreEnCours.droite()) && (q[0] >= barreEnCours.gauche()))) {\n\t\t\t\tcontact = 2;\n\t\t\t}\n\t\t}\n\n\t\t// Contact DroiteHaut de la bille\n\t\tif (contact == 0) {\n\t\t\tdouble[] q = billeEnCours.DH();\n\t\t\tif (((q[1] <= barreEnCours.bas()) && (q[1] >= barreEnCours.haut())) && ((q[0] <= barreEnCours.droite()) && (q[0] >= barreEnCours.gauche()))) {\n\t\t\t\tcontact = 4;\n\t\t\t}\n\t\t}\n\n\t\t// Contact GaucheBas de la bille\n\t\tif (contact == 0) {\n\t\t\tdouble[] q = billeEnCours.GB();\n\t\t\tif (((q[1] <= barreEnCours.bas()) && (q[1] >= barreEnCours.haut())) && ((q[0] <= barreEnCours.droite()) && (q[0] >= barreEnCours.gauche()))) {\n\t\t\t\tcontact = 8;\n\t\t\t}\n\t\t}\n\n\t\t// Contact DroiteBas de la bille\n\t\tif (contact == 0) {\n\t\t\tdouble[] q = billeEnCours.DB();\n\t\t\tif (((q[1] <= barreEnCours.bas()) && (q[1] >= barreEnCours.haut())) && ((q[0] <= barreEnCours.droite()) && (q[0] >= barreEnCours.gauche()))) {\n\t\t\t\tcontact = 6;\n\t\t\t}\n\t\t}\n\n\t\t// Mise à jour de la vitesse \n\n\t\t// Rencontre d'un coin\n\t\tif ((((contact == 2) || (contact == 4))) || ((contact == 8) || (contact == 6))) {\n\t\t\tbilleEnCours.demiTour();\n\t\t}\n\n\t\t// Contact Classique\n\t\t// Gauche - Droite\n\t\tif ((contact == 1) || (contact == 5)) {\n\t\t\tint[] nv = {- billeEnCours.renvoyerVitesse()[0], billeEnCours.renvoyerVitesse()[1]};\n\t\t\tbilleEnCours.changeVitesse(nv);\n\t\t}\n\n\t\t// Haut - Bas : Déviation de la balle\n\t\tif ((contact == 3) || (contact == 7)) {\n\t\t\tint[] nv = new int[] {1,1};\n\t\t\tif (billeEnCours.renvoyerPosition()[0] >= barreEnCours.renvoyerPosition()[0] - barreEnCours.renvoyerLargeur()/4 && billeEnCours.renvoyerPosition()[0] <= barreEnCours.renvoyerPosition()[0] + barreEnCours.renvoyerLargeur()/4) {\n\t\t\t\tnv = new int[] {billeEnCours.renvoyerVitesse()[0], - billeEnCours.renvoyerVitesse()[1]};\n\t\t\t}\n\t\t\tif (billeEnCours.renvoyerPosition()[0] <= barreEnCours.renvoyerPosition()[0] - barreEnCours.renvoyerLargeur()/4) {\n\t\t\t\tnv = new int[] {billeEnCours.renvoyerVitesse()[0] - 1, - billeEnCours.renvoyerVitesse()[1]};\n\t\t\t}\n\t\t\tif (billeEnCours.renvoyerPosition()[0] >= barreEnCours.renvoyerPosition()[0] + barreEnCours.renvoyerLargeur()/4) {\n\t\t\t\tnv = new int[] {billeEnCours.renvoyerVitesse()[0] + 1, - billeEnCours.renvoyerVitesse()[1]};\n\t\t\t}\n\t\t\tbilleEnCours.changeVitesse(nv);\n\t\t}\t\t\t\n\n\n\t}",
"public static void main(String[] args) {\n\t\t\n\t\tRubro rubro1= new Rubro (\"Cafeteria\");\n\t\t\n\t\t// inicializo el arreglo de importes\n\t\t\n\t\trubro1.inicializarGastos();\n\t\t\n\t\t\n\t\t// le cargo a enero y febrero gastos // pruebo método agregarGasto\n\t\t\n\t\trubro1.agregarGasto(MESDELANIO.ABRIL, 100);\n\t\trubro1.agregarGasto(MESDELANIO.ENERO, 200);\n\n\t\t\n\t\t// VEO QUE LO HAYA CARGADO BIEN\n\t\t\n\t\tSystem.out.println(rubro1);\n\t\t\n\t\n\t\t// pruebo método getNombre()\n\n\t\trubro1.getName();\n\t\tSystem.out.println(rubro1.getName());\n\t\t\n\t\t// pruebo método getTotalGastos - pido enero y pido abril \n\t\t// debería darme 200 y 100\n\t\t\n\t\trubro1.getTotalGastos(MESDELANIO.ENERO);\n\t\trubro1.getTotalGastos(MESDELANIO.ABRIL);\n\n\t\tSystem.out.println(rubro1.getTotalGastos(MESDELANIO.ENERO));\n\t\tSystem.out.println(rubro1.getTotalGastos(MESDELANIO.ABRIL));\n\t\t\n\t\t\n\t\t/// ---- MÉTODOS DE GASTOSTOTAL\n\t\t\n\t\t\n\t\t// Creo un objeto gasto anual\n\t\t\n\t\tGastoAnual gasto2020 = new GastoAnual ();\n\t\t\n\t\t// AGREGO rubros\n\t\tgasto2020.agregarRubro(rubro1);\n\t\t\n\t\t// pruebo el método AgregarGasto\n\t\t\n\t\tgasto2020.agregarGastoNuevo(MESDELANIO.ENERO, \"Cafeteria\", 200);\n\t\tgasto2020.agregarGastoNuevo(MESDELANIO.ENERO, \"Cafeteria\", 200);\n\t\n\t\t\n // esto debería agregar 200 pesos a cafeteria, lo cual daría un total de 400 \n\t\t\n\t\trubro1.getTotalGastos(MESDELANIO.ENERO);\n\t\tSystem.out.println(rubro1.getTotalGastos(MESDELANIO.ENERO));\n\t\t\n\t\t\n\t\t// ahora pruebo si agrega un rubro que no existe con AgregarGastoNuevo\n\t\t\n\tgasto2020.agregarGastoNuevo(MESDELANIO.MARZO, \"Tintoreria\", 200);\n\tSystem.out.println(gasto2020);\n\t\t \n\t\t\n\t\t// pruebo consolidadoDeGastos()\n\t\t\n\t\tgasto2020.consolidadoDeGastos();\n\t\t\n\t\t// pruebo gastoAcumulado(MESDELANIO mes) \n\t\t\n\t\tgasto2020.gastoAcumulado(MESDELANIO.ENERO);\n\t\tgasto2020.gastoAcumulado(MESDELANIO.FEBRERO);\n\t\tgasto2020.gastoAcumulado(MESDELANIO.MARZO);\n\t\t\n\t\t// deberia dar 400\n\t\t\n\t\tSystem.out.println(gasto2020.gastoAcumulado(MESDELANIO.ENERO));\n\t\t\n\t\t// deberia dar 0 \n\t\t\n\t\tSystem.out.println(gasto2020.gastoAcumulado(MESDELANIO.FEBRERO));\n\t\t\n\t\t// deberia dar 200\n\n\t\tSystem.out.println(gasto2020.gastoAcumulado(MESDELANIO.MARZO));\n\n\t\t\n\t\t\n\t\t// pruebo gastoAcumulado(String nombreRubro) por rubro\n\t\t\n\t\tgasto2020.gastoAcumulado(\"Cafeteria\");\n\t\t\n\t\t// debería dar 400\n\t\t\n\t\tSystem.out.println(gasto2020.gastoAcumulado(\"Cafeteria\"));\n\t\t\n\t\t// debería dar 200 \n\t\tSystem.out.println(gasto2020.gastoAcumulado(\"Tintoreria\"));\n\t\t\n\t\t\n\t\t// debería dar -1\n\t\tSystem.out.println(gasto2020.gastoAcumulado(\"Supermercado\"));\n\t\t\n\t\t\n\t\t// pruebo informarConsumoPorMes y por promedio \n\t\t\n\t\tgasto2020.informarConsumosPorMes();\n\t\t\n\t\t\n\t\t// pruebo public void informarMesMayorConsumo() - debe darme enero con 400 \n\t\t\n\t\t\n\t\tgasto2020.informarMesMayorConsumo();\n\t\t\n\n\t\n\t\t\n\t\t\n\n\t}",
"@Override\n protected String elaboraBody() {\n String text = CostBio.VUOTO;\n int numCognomi = mappaCognomi.size();\n int numVoci = Bio.count();\n int taglioVoci = Pref.getInt(CostBio.TAGLIO_NOMI_ELENCO);\n\n text += A_CAPO;\n text += \"==Cognomi==\";\n text += A_CAPO;\n text += \"Elenco dei \";\n text += LibWiki.setBold(LibNum.format(numCognomi));\n text += \" cognomi '''differenti''' utilizzati nelle \";\n text += LibWiki.setBold(LibNum.format(numVoci));\n text += \" voci biografiche con occorrenze maggiori di \";\n text += LibWiki.setBold(taglioVoci);\n text += A_CAPO;\n text += creaElenco();\n text += A_CAPO;\n\n return text;\n }",
"public void carregar(DadosGrafico dados){\r\n \r\n }",
"public SuperRodada(){\n this.pontos_em_disputa=0;\n this.truco=false;\n this.Desafiante=null;\n this.addPontosEmDisputa(2);\n Game game = Game.getGame();\n DonoDoBaralho=(DonoDoBaralho==null)?game.getDupla(1).getJogadorA():this.proximoAJogar(DonoDoBaralho);\n \n }",
"public Gigamesh(int vel, int daño,String derecha, String izquierda,String arriba, String abajo, String ataca,String ataca2,String interact,String salta,int intervaloAtaque)\n {\n super(\"giga\",9,6,vel,daño,derecha,izquierda,arriba,abajo,ataca,ataca2,interact,salta,intervaloAtaque); \n \n }",
"public void agregarBodega(String nombre_bodega){\n Nodo_Bodega Nueva_bodega = new Nodo_Bodega(Size,nombre_bodega);\n if(Nodo_bodega_inicial==null){\n Nodo_bodega_inicial = Nueva_bodega;\n Nodo_bodega_final = Nueva_bodega;\n Nodo_bodega_actual = Nueva_bodega;\n }else{\n Nueva_bodega.definirAnterior(Nodo_bodega_final);\n Nodo_bodega_final.definirSiguiente(Nueva_bodega);\n Nodo_bodega_final = Nueva_bodega;\n }\n Size++;\n }",
"void entrerAuGarage();",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Transactional\n\tprivate void generateGodSet() {\n\t\tMinionCard ex1 = createMinionCard(\"Chatton transcendent\", -2, 1 , 1 , -1, \"Utilise mon energie\",\"img/cardImg/godSet/glow.jpg\");\n\t\tMinionCard ex2 = createMinionCard(\"Reda EX\", -7, 1,1, -2, \"Oh la la.\",\"img/cardImg/godSet/Reda.png\");\n\t\tMinionCard ex3 = createMinionCard(\"François EX\", -12, 1, 1, -3, \"Aujourd'hui On a Oncle Bob\",\"img/cardImg/godSet/Francois.png\");\n\t\t\n\t\tcardRepository.save(ex1);\n\t\tcardRepository.save(ex2);\n\t\tcardRepository.save(ex3);\n\t\t\n\t}",
"@Override public String getMasa(){\n return \"gruesa \";\n }",
"private static void benvenuto() {\n\t\tUtilityIO.header(MSG_BENVENUTO, SIMBOLO_MESSAGGIO_BENV_USCITA);\n\t\tSystem.out.println();\n\t\t\n\t}",
"public void creaAziendaAgricola(){\n\t\tCantina nipozzano = creaCantina(\"Nipozzano\");\t\n\t\tBotte[] bottiNipozzano = new Botte[5+(int)(Math.random()*10)];\t\n\t\tfor(int i=0; i<bottiNipozzano.length; i++){\n\t\t\tbottiNipozzano[i] = creaBotte(nipozzano, i, (int)(Math.random()*10+1), tipologiaBotte[(int)(Math.random()*tipologiaBotte.length)]);\n\t\t}\t\t\n\t\tVigna mormoreto = creaVigna(\"Mormoreto\", 330, 25, EsposizioneVigna.sud, \"Terreni ricchi di sabbia, ben drenati. Discreta presenza di calcio. pH neutro o leggermente alcalino\");\n\t\tFilare[] filariMormoreto = new Filare[5+(int)(Math.random()*10)];\n\t\tfor(int i=0; i<filariMormoreto.length;i++){\n\t\t\tfilariMormoreto[i] = creaFilare(mormoreto, i, tipologiaFilare[(int)(Math.random()*tipologiaFilare.length)]);\n\t\t}\t\n\t\tVigna montesodi = creaVigna(\"Montesodi\", 400, 20, EsposizioneVigna.sud_ovest, \"Arido e sassoso, di alberese, argilloso e calcareo, ben drenato, poco ricco di sostanza organica\");\n\t\tFilare[] filariMontesodi = new Filare[5+(int)(Math.random()*10)];\n\t\tfor(int i=0; i<filariMontesodi.length;i++){\n\t\t\tfilariMontesodi[i] = creaFilare(montesodi, i, tipologiaFilare[(int)(Math.random()*tipologiaFilare.length)]);\n\t\t}\n\t\t/*\n\t\t * CANTINA: POMINO - VIGNETO BENEFIZIO\n\t\t */\n\t\t\n\t\tCantina pomino = creaCantina(\"Pomino\");\n\t\tBotte[] bottiPomino = new Botte[5+(int)(Math.random()*10)];\t\n\t\tfor(int i=0; i<bottiPomino.length; i++){\n\t\t\tbottiPomino[i] = creaBotte(pomino, i, (int)(Math.random()*10+1), tipologiaBotte[(int)(Math.random()*tipologiaBotte.length)]);\n\t\t}\n\t\tVigna benefizio = creaVigna(\"Benefizio\", 700, 9, EsposizioneVigna.sud_ovest, \"Terreni ricchi di sabbia, forte presenza di scheletro. Molto drenanti. Ricchi in elementi minerali. PH acido o leggermente acido.\");\n\t\tFilare[] filariBenefizio = new Filare[5+(int)(Math.random()*10)];\n\t\tfor(int i=0; i<filariBenefizio.length;i++){\n\t\t\tfilariBenefizio[i] = creaFilare(benefizio, i, tipologiaFilare[(int)(Math.random()*tipologiaFilare.length)]);\n\t\t}\n\t\t\n\t\taziendaAgricolaDAO.saveLuogo(nipozzano);\n\t\taziendaAgricolaDAO.saveLuogo(mormoreto);\n\t\taziendaAgricolaDAO.saveLuogo(montesodi);\n\t\t\n\t\taziendaAgricolaDAO.saveLuogo(pomino);\n\t\taziendaAgricolaDAO.saveLuogo(benefizio);\n\t\t\n\t\taziendaAgricolaDAO.saveResponsabile(responsabile(\"Giulio d'Afflitto\"));\n\t\taziendaAgricolaDAO.saveResponsabile(responsabile(\"Francesco Ermini\"));\n\n\t\t\n\t}",
"public void buscarGrado() {\n \tGrado grado = new Grado();\n \tgrado.setDescripcionSeccion(\"Primaria\");\n \tgrado.setNumGrado(4);\n \tgrado.setDescripcionUltimoGrado(\"NO\");\n \tString respuesta = negocio.buscarGrado(\"\", grado);\n \tSystem.out.println(respuesta);\n }",
"public Salle getBureau() {\n return bureau;\n }",
"public void notificaAlgiocatore(int azione, Giocatore g) {\n\r\n }",
"private void BScreate() {\n\n\t\tint sum=0;//全枝数のカウント\n\t\tfor(int i=0;i<banknode;i++) sum+=Bank.get(i).deg;\n\n\t\t//e,d,nの決定\n\t\tif(NW==\"BA\"){\n\t\tfor(int i=0;i<banknode;i++) {\n\t\t\tBank.get(i).totalassets=E*((double)Bank.get(i).deg/(double)sum);\n\t\t\tBank.get(i).n=Bank.get(i).totalassets*Bank.get(i).CAR;\n\t\t\tBank.get(i).d=Bank.get(i).totalassets-Bank.get(i).n;\n\t\t\tBank.get(i).buffer=Bank.get(i).totalassets;\n\t\t}\n\t\t}\n\n\t\tif(NW==\"CM\"){\n\t\t\tfor(int i=0;i<banknode;i++){\n\t\t\t\tBank.get(i).totalassets=E/banknode;\n\t\t\t\tBank.get(i).n=Bank.get(i).totalassets*asyCAR;\n\t\t\t\tBank.get(i).forcelev=megaCAR;\n\t\t\t\tBank.get(i).d=Bank.get(i).totalassets-Bank.get(i).n;\n\t\t\t\tBank.get(i).buffer=Bank.get(i).totalassets;\n\t\t\t}\n\n\t\t}\n\n\t}",
"public Girasol(int x,int y){\n super(x,y);\n this.setComportamiento(\"Crea 20 soles cada 2 turnos\");\n this.setVidas(1);\n this.impresion=\"G(\"+this.getVidas()+\")\";\n this.setDaño(0);\n this.setFrecuencia(2);\n }",
"private static Bala tipoBala(int idPj, Vector2 posicionRelativaRecibido, int tamanoBala) {\n Bala bala;\n Array<TextureRegion> arrayTexturas = Util.ficherosEnDirectorio(Gdx.files.internal(\"Balas/\" + idPj));\n switch (idPj) {\n //Balas con forma rectangular\n case 1:\n case 4:\n case 7:\n bala = new BalaRect(posicionRelativaRecibido, velocidadBalas, arrayTexturas, idPj, tamanoBala);\n break;\n //Balas con forma circular\n case 2:\n bala = new BalaCirc(posicionRelativaRecibido, velocidadBalas, arrayTexturas, idPj, tamanoBala);\n break;\n //Balas con forma poligonal\n case 3:\n case 5:\n case 6:\n case 8:\n case 9:\n case 10:\n bala = new BalaPol(posicionRelativaRecibido, velocidadBalas, arrayTexturas, idPj, tamanoBala);\n break;\n default:\n arrayTexturas = Util.ficherosEnDirectorio(Gdx.files.internal(\"Balas/1\"));\n bala = new BalaRect(posicionRelativaRecibido, velocidadBalas, arrayTexturas, idPj, tamanoBala);\n break;\n }\n return bala;\n }",
"public void insertarGrado() {\n \tGrado grado = new Grado();\n \tgrado.setIdSeccion(38);\n \tgrado.setNumGrado(2);\n \tgrado.setUltimoGrado(0);\n \tString respuesta = negocio.insertarGrado(\"\", grado);\n \tSystem.out.println(respuesta);\n }",
"public void aapneBomberOgFlagg() {\n brettTapt = true;\n if (trykketPaa) {\n return;\n }\n // Viser alle bomber som ikke er flagget\n if (bombe && !flagget) {\n setText(\"x\");\n setBackground(new Background(new BackgroundFill(Color.GREY, CornerRadii.EMPTY, Insets.EMPTY)));\n }\n // Fargekoder om flaggingen var korrekt eller ikke\n if (flagget) {\n if (!bombe) {\n setBackground(new Background(new BackgroundFill(Color.PINK, CornerRadii.EMPTY, Insets.EMPTY)));\n } else {\n Color lysegroenn = Color.rgb(86, 130, 3, 0.3);\n setBackground(new Background(new BackgroundFill(lysegroenn, CornerRadii.EMPTY, Insets.EMPTY)));\n }\n }\n }",
"public void eisagwgiGiatrou() {\n\t\t// Elegxw o arithmos twn iatrwn na mhn ypervei ton megisto dynato\n\t\tif(numOfDoctors < 100)\n\t\t{\n\t\t\tSystem.out.println();\n\t\t\tdoctor[numOfDoctors] = new Iatros();\n\t\t\tdoctor[numOfDoctors].setFname(sir.readString(\"DWSTE TO ONOMA TOU GIATROU: \")); // Pairnei apo ton xristi to onoma tou giatrou\n\t\t\tdoctor[numOfDoctors].setLname(sir.readString(\"DWSTE TO EPWNYMO TOU GIATROU: \")); // Pairnei apo ton xristi to epitheto tou giatrou\n\t\t\tdoctor[numOfDoctors].setAM(rnd.nextInt(1000000)); // To sistima dinei automata ton am tou giatrou\n\t\t\tSystem.out.println();\n\t\t\t\n\t\t\t// Elegxos monadikotitas tou am tou giatrou\n\t\t\th = rnd.nextInt(1000000);\n\t\t\tfor(int i = 0; i < numOfDoctors; i++)\n\t\t\t{\n\t\t\t\tif(doctor[i].getAM() == h)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t\tSystem.out.println(\"O KWDIKOS AUTOS YPARXEI HDH!\");\n\t\t\t\t\th = rnd.nextInt(1000000);\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t}\n\t\t\t}\n\t\t\tnumOfDoctors++;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"DEN MPOREITE NA EISAGETE ALLOUS GIATROUS!\");\n\t\t\tSystem.out.println(\"EXEI SYMPLHRWTHEI O PROVLEPOMENOS ARITHMOS!\");\n\t\t}\n\t}",
"public Fogon (String cocineroActual){\n Cocinero = cocineroActual;\n grados = 0; \n }",
"private void asignaNombre() {\r\n\r\n\t\tswitch (this.getNumero()) {\r\n\r\n\t\tcase 1:\r\n\t\t\tthis.setNombre(\"As de \" + this.getPalo());\r\n\t\t\tbreak;\r\n\t\tcase 2:\r\n\t\t\tthis.setNombre(\"Dos de \" + this.getPalo());\r\n\t\t\tbreak;\r\n\t\tcase 3:\r\n\t\t\tthis.setNombre(\"Tres de \" + this.getPalo());\r\n\t\t\tbreak;\r\n\t\tcase 4:\r\n\t\t\tthis.setNombre(\"Cuatro de \" + this.getPalo());\r\n\t\t\tbreak;\r\n\t\tcase 5:\r\n\t\t\tthis.setNombre(\"Cinco de \" + this.getPalo());\r\n\t\t\tbreak;\r\n\t\tcase 6:\r\n\t\t\tthis.setNombre(\"Seis de \" + this.getPalo());\r\n\t\t\tbreak;\r\n\t\tcase 7:\r\n\t\t\tthis.setNombre(\"Siete de \" + this.getPalo());\r\n\t\t\tbreak;\r\n\t\tcase 10:\r\n\t\t\tthis.setNombre(\"Diez de \" + this.getPalo());\r\n\t\t\tbreak;\r\n\t\tcase 11:\r\n\t\t\tthis.setNombre(\"Once de \" + this.getPalo());\r\n\t\t\tbreak;\r\n\t\tcase 12:\r\n\t\t\tthis.setNombre(\"Doce de \" + this.getPalo());\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}",
"@Override//sobrescribir metodo\n public String getDescripcion(){\n return hamburguesa.getDescripcion()+\" + lechuga\";//retorna descripcion del oobj hamburguesa y le agrega +lechuga\n }",
"Vaisseau_ordonneeLaPlusBasse createVaisseau_ordonneeLaPlusBasse();",
"private void carregaAvisosGerais() {\r\n\t\tif (codWcagEmag == WCAG) {\r\n\t\t\t/*\r\n\t\t\t * Mudan�as de idioma\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"4.1\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Ignorar arte ascii\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"13.10\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Utilizar a linguagem mais clara e simples poss�vel\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"14.1\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * navega��o de maneira coerente\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"13.4\", AVISO, codWcagEmag, \"\"));\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"14.2\", AVISO, codWcagEmag, \"\"));\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"11.4\", AVISO, codWcagEmag, \"\"));\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"14.3\", AVISO, codWcagEmag, \"\"));\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"12.3\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Fornecer mapa\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"13.3\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Abreviaturas\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"4.2\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Fornecer atalho\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"9.5\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Prefer�ncias (por ex., por idioma ou por tipo de conte�do).\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"11.3\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * BreadCrumb\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"13.5\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * fun��es de pesquisa\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"13.7\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * front-loading\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"13.8\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Documentos compostos por mais de uma p�gina\r\n\t\t\t */\r\n\t\t\t// comentado por n�o ter achado equi\r\n\t\t\t// erroOuAviso.add(new ArmazenaErroOuAviso(\"3.10\", AVISO,\r\n\t\t\t// codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Complementar o texto com imagens, etc.\r\n\t\t\t */\r\n\t\t\t// erroOuAviso.add(new ArmazenaErroOuAviso(\"3.11\", AVISO,\r\n\t\t\t// codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Forne�a metadados.\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"13.2\", AVISO, codWcagEmag, \"\"));\r\n\t\t} else if (codWcagEmag == EMAG) {\r\n\t\t\t/*\r\n\t\t\t * Mudan�as de idioma\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"1.2\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Ignorar arte ascii\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"1.3\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Utilizar a linguagem mais clara e simples poss�vel\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"1.9\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * navega��o de maneira coerente\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"1.10\", AVISO, codWcagEmag, \"\"));\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"1.21\", AVISO, codWcagEmag, \"\"));\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"1.24\", AVISO, codWcagEmag, \"\"));\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"2.9\", AVISO, codWcagEmag, \"\"));\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"2.11\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Fornecer mapa\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"2.17\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Abreviaturas\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"3.2\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Fornecer atalho\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"3.3\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Prefer�ncias (por ex., por idioma ou por tipo de conte�do).\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"3.5\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * BreadCrumb\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"3.6\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * fun��es de pesquisa\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"3.8\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * front-loading\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"3.9\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Documentos compostos por mais de uma p�gina\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"3.10\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Complementar o texto com imagens, etc.\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"3.11\", AVISO, codWcagEmag, \"\"));\r\n\t\t\t/*\r\n\t\t\t * Forne�a metadados.\r\n\t\t\t */\r\n\t\t\terroOuAviso.add(new ArmazenaErroOuAviso(\"3.14\", AVISO, codWcagEmag, \"\"));\r\n\t\t}\r\n\r\n\t}",
"public void reestablecerFullStock() { \n bodega Bodega = new bodega();\n Bodega.setProductosList(this.bodegaDefault());\n }",
"public Boleta(){\r\n\t\tsuper();\r\n\t}",
"public void dividirDineroGobierno() {\n\n double dineroDividible = super.getMundo().getGobierno().getCapitalEconomico() / 2;\n double dineroPorPersona = super.getMundo().contarPersonas();\n\n if (dineroDividible > 0) {\n\n super.getMundo().gobiernoDarDinero(dineroDividible);\n\n for (Persona p : super.getMundo().getListaDoctores())\n p.ganarDinero(dineroPorPersona);\n for (Persona p : super.getMundo().getListaCocineros())\n p.ganarDinero(dineroPorPersona);\n for (Persona p : super.getMundo().getListaAlbaniles())\n p.ganarDinero(dineroPorPersona);\n for (Persona p : super.getMundo().getListaHerreros())\n p.ganarDinero(dineroPorPersona);\n for (Persona p : super.getMundo().getListaCocineros())\n p.ganarDinero(dineroPorPersona);\n for (Persona p : super.getMundo().getListaDoctores())\n p.ganarDinero(dineroPorPersona);\n for (Persona p : super.getMundo().getListaCocineros())\n p.ganarDinero(dineroPorPersona);\n for (Persona p : super.getMundo().getListaAlbaniles())\n p.ganarDinero(dineroPorPersona);\n for (Persona p : super.getMundo().getListaHerreros())\n p.ganarDinero(dineroPorPersona);\n for (Persona p : super.getMundo().getListaCocineros())\n p.ganarDinero(dineroPorPersona);\n }\n }",
"@Optional\n Association<GebaeudeArtStaBuComposite> gebaeudeArtStaBu();",
"private void insertBoger() {\r\n\t\tEmne emne;\r\n\t\tBog bog;\r\n\t\tForfatter forfatter;\r\n\r\n\t\temne = _database.getEmne().get(0);\r\n\t\tbog = new BogEksemplar(\"Titel-1\", emne, 2001,1);\r\n\t\tforfatter = _database.getForfatter().get(0);\r\n\t\tbog.addForfatter(forfatter);\r\n\t\t_database.addBog(bog);\r\n\t\t\r\n\t\temne = _database.getEmne().get(0);\r\n\t\tbog = new BogEksemplar(\"Titel-1\", emne, 2001,2);\r\n\t\tforfatter = _database.getForfatter().get(0);\r\n\t\tbog.addForfatter(forfatter);\r\n\t\t_database.addBog(bog);\r\n\r\n\t\temne = _database.getEmne().get(0);\r\n\t\tbog = new BogEksemplar(\"Titel-2\", emne, 2002,1);\r\n\t\tforfatter = _database.getForfatter().get(1);\r\n\t\tbog.addForfatter(forfatter);\r\n\t\t_database.addBog(bog);\r\n\t\t\r\n\t\temne = _database.getEmne().get(1);\r\n\t\tbog = new BogEksemplar(\"Titel-3\", emne, 2003,1);\r\n\t\tforfatter = _database.getForfatter().get(1);\r\n\t\tbog.addForfatter(forfatter);\r\n\t\t_database.addBog(bog);\r\n\t\t\r\n\t\temne = _database.getEmne().get(0);\r\n\t\tbog = new BogEksemplar(\"Titel-4\", emne, 2001,1);\r\n\t\tforfatter = _database.getForfatter().get(2);\r\n\t\tbog.addForfatter(forfatter);\r\n\t\t_database.addBog(bog);\r\n\t\t\r\n\t}",
"@Override\n\tpublic void aumentar(int cantidad) {\n\t\t\n\t}",
"public void maakDambord() {\t\r\n\tbord.addSpeelBord(dambord.getSpeelbord());\r\n\tframe.pack();\r\n }",
"@Test\n public void bateauAtBateau() {\n Player p = new Player();\n List<Player> pL = new ArrayList<>();\n pL.add(p);\n Jeux j = new Jeux(ModeDeJeux.MONO_JOUEUR, pL);\n Grille g = new Grille(10, 10, j, p);\n\n Bateaux ba = new ContreTorpilleur(new Place[]{new Place(\"A5\")}, j, p, true);\n g.setListBateaux(Collections.singletonList(ba));\n\n Bateaux b = j.bateauAt(new Place(\"A5\"), g);\n\n assertEquals(\"Il n'y a pas de bateau ici\", ba, b);\n }",
"@Override\n\tpublic void onBlue() {\n\t\taddSequential(new DriveStraightByDistance(PEG_STRAIGHT - ROBOT_LENGTH / 2), 3.5);\n\t\t//TODO: might need to change to a little less\n\t\taddSequential(new TurnDegrees(90), 2.5);\n\t\taddSequential(new DriveStraightByDistance(EXTRA_DIS), 4);\n\t\taddSequential(new OpenPlacer2());\n\t\taddSequential(new ArcadeDriveByValues(-0.5, -0.5), 1);// TODO change commad\n\t\taddSequential(new ClosePlacer());\n\t\t\n\t}",
"public boolean tieneRepresentacionGrafica();",
"public Gestionnaire_Bdd(){\n\t\ttry {\n\t\t\t//Chargement driver hsqldb\n\t\t\tClass.forName(\"org.hsqldb.jdbcDriver\").newInstance();\n\t\t\t\n\t\t\tconnexion = DriverManager.getConnection(\"jdbc:hsqldb:file:BiblioBDD\", \"sa\", \"\");\n\t\t\trequete = connexion.createStatement();\n\t\t\tcreerTables();\n\t\t\t\n\t\t\tselection(new String[]{\"niveau\", \"professeur\"}, \"classes\");\n\t\t\trafraichir_tableau();\n\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (InstantiationException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IllegalAccessException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public void faiBagnetto() {\n System.out.println(\"Scrivere 1 per Bagno lungo, al costo di 150 Tam\\nSeleziona 2 per Bagno corto, al costo di 70 Tam\\nSeleziona 3 per Bide', al costo di 40 Tam\");\n\n switch (creaturaIn.nextInt()) {\n case 1 -> {\n puntiVita += 50;\n puntiFelicita -= 30;\n soldiTam -= 150;\n }\n case 2 -> {\n puntiVita += 30;\n puntiFelicita -= 15;\n soldiTam -= 70;\n }\n case 3 -> {\n puntiVita += 10;\n puntiFelicita -= 5;\n soldiTam -= 40;\n }\n }\n checkStato();\n }",
"public Bodega(@JsonProperty(value=\"id\") int id, @JsonProperty(value=\"estado\") char estado, @JsonProperty(value=\"tipo\") char tipo,@JsonProperty(value=\"ancho\") double ancho\r\n\t\t\t,@JsonProperty(value=\"largo\") double largo,@JsonProperty(value=\"plataformaExterna\") boolean plataformaExterna\r\n\t\t\t,@JsonProperty(value=\"tipoDeCarga\")TipoDeCarga tipoDeCarga,@JsonProperty(value=\"separacion\") double separacion\r\n\t\t\t, @JsonProperty(value=\"cuartosFrios\") List<CuartoFrio> cuartosFrios,@JsonProperty(value=\"entradas\") List<Operacion>entradas, @JsonProperty(value=\"salidas\") List<Operacion>salidas)\r\n\t{\r\n\t\tsuper(id,estado,tipo,entradas,salidas);\r\n\t\t\r\n\t\tthis.ancho=ancho;\r\n\t\tthis.largo=largo;\r\n\t\tthis.plataformaExterna=plataformaExterna;\r\n\t\tthis.tipoDeCarga=tipoDeCarga;\r\n\t\tthis.separacion=separacion;\r\n\t\tthis.setCuartosFrios(cuartosFrios);\r\n\t}",
"public gui obtenerGrafica();",
"public void setBunga(int tipeBunga){\n }",
"java.lang.String getBunho();",
"java.lang.String getBunho();",
"String getAnnoPubblicazione();",
"@Override // Métodos que fazem a anulação\n\tpublic void getBonificação() {\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}",
"public String draaiGangkaart()\n {\n if (vrijeGangkaart.getOrientatie() == 4)\n {\n vrijeGangkaart.setOrientatie(1);\n } else\n {\n vrijeGangkaart.setOrientatie((vrijeGangkaart.getOrientatie() + 1));\n }\n\n return vrijeGangkaart.toString();\n }",
"public int getBloco() {\r\n\t\treturn bloco;\r\n\t}",
"public void drukAf(){\n System.out.println(\"BSN :\" + burgerServiceNummer);\n System.out.println(\"voornaam :\" + voornaam);\n System.out.println(\"achternaam :\" + achternaam);\n System.out.println(\"geboortedatum :\" + geboorteDag + \"/\" + geboorteMaand + \"/\" + geboorteJaar);\n System.out.println(\"geslacht :\" + geslacht); \n }",
"public String getBairro() {\n return bairro;\n }",
"public String getBairro() {\n return bairro;\n }",
"private void createObstacole()\n {\n //Create Obstacole\n Obstacole topObstacole = new Obstacole(\"top\");\n Obstacole botObstacole = new Obstacole(\"bottom\");\n Obstacole midObstacole = new Obstacole(\"mid\");\n //amount of space between obstacole\n int ObstacoleSpacing = 150;\n \n //get object image\n GreenfootImage image = botObstacole.getImage();\n \n //random number to vary\n int numOfObstacoles = Greenfoot.getRandomNumber(40) + 15;\n \n //counter increment to 50\n ObstacoleCounter++;\n if (ObstacoleCounter == 50)\n {\n if (getObjects(Obstacole.class).size() < numOfObstacoles)\n {\n addObject(botObstacole, getWidth(), getHeight() / 2 + image.getHeight() - Greenfoot.getRandomNumber(100) - 10);\n addObject(topObstacole, getWidth(), botObstacole.getY() - image.getHeight() - ObstacoleSpacing);\n addObject(midObstacole, getWidth(), botObstacole.getY() + image.getHeight() / 3 + ObstacoleSpacing);\n }\n ObstacoleCounter = 0;\n }\n }",
"public Rectangle getUbicacion(){\n return ubicacion;\n }",
"@Test\n public void bateauAtNoBateau() {\n Player p = new Player();\n List<Player> pL = new ArrayList<>();\n pL.add(p);\n Jeux j = new Jeux(ModeDeJeux.MONO_JOUEUR, pL);\n Grille g = new Grille(10, 10, j, p);\n\n Bateaux ba = new ContreTorpilleur(new Place[]{new Place(\"A5\")}, j, p, true);\n g.setListBateaux(Collections.singletonList(ba));\n\n Bateaux b = j.bateauAt(new Place(\"A6\"), g);\n\n assertNull(\"Il n'y a pas de bateau ici\", b);\n }",
"public double Baricentro() {\n if (puntos.size() <= 2) {\n return 0;\n } else {\n // Inicializacion de las areas\n double areaPonderada = 0;\n double areaTotal = 0;\n double areaLocal;\n // Recorrer la lista conservando 2 puntos\n Punto2D antiguoPt = null;\n for (Punto2D pt : puntos) {\n if (antiguoPt != null) {\n // Cálculo deñ baricentro local\n if (antiguoPt.y == pt.y) {\n // Es un rectángulo, el baricentro esta en\n // centro\n areaLocal = pt.y * (pt.x - antiguoPt.x);\n areaTotal += areaLocal;\n areaPonderada += areaLocal * ((pt.x - antiguoPt.x) / 2.0 + antiguoPt.x);\n } else {\n // Es un trapecio, que podemos descomponer en\n // un reactangulo con un triangulo\n // rectangulo adicional\n // Separamos ambas formas\n // Primer tiempo: rectangulo\n areaLocal = Math.min(pt.y, antiguoPt.y) + (pt.x - antiguoPt.x);\n areaTotal += areaLocal;\n areaPonderada += areaLocal * ((pt.x - antiguoPt.x) / 2.0 + antiguoPt.x);\n //Segundo tiempo: triangulo rectangulo\n areaLocal = (pt.x - antiguoPt.x) * Math.abs(pt.y - antiguoPt.y) / 2.0;\n areaTotal += areaLocal;\n if (pt.y > antiguoPt.y) {\n // Baricentro a 1/3 del lado pt\n areaPonderada += areaLocal * (2.0 / 3.0 * (pt.x - antiguoPt.x) + antiguoPt.x);\n } else {\n // Baricentro a 1/3 dek lado antiguoPt\n areaPonderada += areaLocal * (1.0 / 3.0 * (pt.x - antiguoPt.x) + antiguoPt.x);\n }\n }\n }\n antiguoPt = pt;\n }\n // Devolvemos las coordenadas del baricentro\n return areaPonderada / areaTotal;\n }\n }",
"private void calculerBordsDomaine() {\n\t\tfor (Contrainte c : contraintes) {\n\t\t\tbords.add(new Bord(this, c));\n\t\t}\n\t}",
"public figuras(int opcion) {\r\n this.opcion = opcion;\r\n // this.aleatorio = aleatorio;\r\n }",
"public void dibujar(Graphics g){\n\t\tg2.setColor(Color.WHITE);\n\t\tfor ( int x =0; x < game.getAmountPersonajes() ;x++){\n\t\t\tRectangle2D.Double personaje =game.getPersonaje(x).getshape(); \n\t\t\t\n\t\t\ttemporal = game.getPersonaje(x).getImage().getImage();\n\t\t\tg.drawImage(temporal, (int)personaje.getX(), (int)(personaje.getY()), this);\n\t\t}\n\t\tfor ( int x =0; x < game.getAmountObjetivos() ;x++){\n\t\t\tRectangle2D.Double objetivo =game.getObjetivo(x).getShape(); \n\t\t\ttemporal = game.getObjetivo(x).getImage().getImage();\n\t\t\tg.drawImage(temporal, (int)objetivo.getX(), (int)(objetivo.getY()), this);\n\t\t}\n\t\tif (game.getCurrentSorpresa()!=null){\n\t\t\tRectangle2D.Double s =game.getCurrentSorpresa().getShape(); \n\t\t\ttemporal = game.getCurrentSorpresa().getImage().getImage();\n\t\t\tg.drawImage(temporal, (int)s.getX(), (int)(s.getY()), this);\t\t\t\n\t\t}\n\t\tif(game.getBloque().isActive() ){\n\t\t\tRectangle2D.Double s =game.getBloque().getShape(); \n\t\t\ttemporal = game.getBloque().getImage().getImage();\n\t\t\tg.drawImage(temporal, (int)s.getX(), (int)(s.getY()), this);\n\t\t}\n\t\t\n\t\tg2.setColor(new Color(100,221,23));\n\t\tg2.fill(game.getShapePelota(0));\n\t\n\t\n\t}",
"private void aumentarPilha() {\n this.pilhaMovimentos++;\n }",
"public CTematicaBienestar() {\r\n\t}",
"@Override\n\tvoid geraDados() {\n\n\t}",
"public VotacaoSegundoDia() {\n\n\t}",
"public void gerarRelatorioMedico() {\n Document documento = new Document(PageSize.A4.rotate());\n \n //Defina as margens\n documento.setMargins(40f, 40f, 150f, 40f);\n \n try {\n CabecalhoRodapeEvento inserircabecalho = new CabecalhoRodapeEvento();\n \n //Cria um arquivo relatorio.pdf com o documento\n PdfWriter.getInstance(documento, new FileOutputStream(\"relatorioMedico.pdf\")).setPageEvent(inserircabecalho);\n \n documento.open();\n \n Paragraph tituloDoRelatorio = new Paragraph(new Phrase(20F, \"RELATÓRIO DOS MÉDICOS CADASTRADOS\",\n FontFactory.getFont(FontFactory.HELVETICA_BOLD, 15F)));\n tituloDoRelatorio.setAlignment(Element.ALIGN_CENTER);\n\n documento.add(tituloDoRelatorio);\n \n Table tabelaMedicos = new Table(6);\n tabelaMedicos.setBorder(10);\n tabelaMedicos.setBorderWidth(2);\n tabelaMedicos.setBorderColor(Color.black);\n tabelaMedicos.setPadding(2);\n //tabelaMedicos.setSpacing(0);\n tabelaMedicos.setWidth(100f);\n tabelaMedicos.setWidths(new float[]{10f, 30f, 20f, 10f, 15f, 15f});\n \n Paragraph paragrafoCrm = new Paragraph(new Phrase(12F, \"CRM\",\n FontFactory.getFont(FontFactory.HELVETICA_BOLD, 10F)));\n paragrafoCrm.setAlignment(Element.ALIGN_CENTER);\n \n Paragraph paragrafoNome = new Paragraph(new Phrase(12F, \"NOME\",\n FontFactory.getFont(FontFactory.HELVETICA_BOLD, 10F)));\n paragrafoNome.setAlignment(Element.ALIGN_CENTER);\n \n Paragraph paragrafoEspecialidade = new Paragraph(new Phrase(12F, \"ESPECIALIDADE\",\n FontFactory.getFont(FontFactory.HELVETICA_BOLD, 10F)));\n paragrafoEspecialidade.setAlignment(Element.ALIGN_CENTER);\n \n Paragraph paragrafoSexo = new Paragraph(new Phrase(12F, \"SEXO\",\n FontFactory.getFont(FontFactory.HELVETICA_BOLD, 10F)));\n paragrafoSexo.setAlignment(Element.ALIGN_CENTER);\n \n Paragraph paragrafoSalario = new Paragraph(new Phrase(12F, \"SALARIO\",\n FontFactory.getFont(FontFactory.HELVETICA_BOLD, 10F)));\n paragrafoSalario.setAlignment(Element.ALIGN_CENTER);\n \n Paragraph paragrafoDataNascimento = new Paragraph(new Phrase(12F, \"DATA NASCIMENTO\",\n FontFactory.getFont(FontFactory.HELVETICA_BOLD, 10F)));\n paragrafoDataNascimento.setAlignment(Element.ALIGN_CENTER);\n \n Cell celulaMedicoCrm = new Cell(paragrafoCrm);\n Cell celulaMedicoNome = new Cell(paragrafoNome);\n Cell celulaMedicoEspecialidade = new Cell(paragrafoEspecialidade);\n Cell celulaMedicoSexo = new Cell(paragrafoSexo);\n Cell celulaMedicoSalario = new Cell(paragrafoSalario);\n Cell celulaMedicoDataNascimento = new Cell(paragrafoDataNascimento);\n \n celulaMedicoCrm.setHeader(true);\n tabelaMedicos.addCell(celulaMedicoCrm);\n tabelaMedicos.addCell(celulaMedicoNome);\n tabelaMedicos.addCell(celulaMedicoEspecialidade);\n tabelaMedicos.addCell(celulaMedicoSexo);\n tabelaMedicos.addCell(celulaMedicoSalario);\n tabelaMedicos.addCell(celulaMedicoDataNascimento);\n \n //definindo alinhamento, cores do cabeçalho da tabela\n for (int i = 0; i < tabelaMedicos.getColumns(); i++) {\n\n Cell celula = (Cell) tabelaMedicos.getElement(0, i);\n celula.setHorizontalAlignment(Element.ALIGN_CENTER);\n celula.setBackgroundColor(Color.yellow);\n celula.setBorderColor(Color.black);\n\n }\n \n for(Medico medico : listarTodosMedicos()) {\n paragrafoCrm = new Paragraph(new Phrase(15F, \"\"+ medico.getCRM(),\n FontFactory.getFont(FontFactory.HELVETICA, 9F)));\n paragrafoCrm.setAlignment(Element.ALIGN_CENTER);\n celulaMedicoCrm = new Cell(paragrafoCrm);\n celulaMedicoCrm.setBorderColor(Color.black);\n celulaMedicoCrm.setHorizontalAlignment(Element.ALIGN_CENTER);\n tabelaMedicos.addCell(celulaMedicoCrm);\n \n paragrafoNome = new Paragraph(new Phrase(15F, \"\"+ medico.getNome(),\n FontFactory.getFont(FontFactory.HELVETICA, 9F)));\n paragrafoNome.setAlignment(Element.ALIGN_CENTER);\n celulaMedicoNome = new Cell(paragrafoNome);\n celulaMedicoNome.setBorderColor(Color.black);\n celulaMedicoNome.setHorizontalAlignment(Element.ALIGN_LEFT);\n tabelaMedicos.addCell(celulaMedicoNome);\n \n paragrafoEspecialidade = new Paragraph(new Phrase(15F, \"\"+ medico.getEspecialidade(),\n FontFactory.getFont(FontFactory.HELVETICA, 9F)));\n paragrafoEspecialidade.setAlignment(Element.ALIGN_CENTER);\n celulaMedicoEspecialidade = new Cell(paragrafoEspecialidade);\n celulaMedicoEspecialidade.setBorderColor(Color.black);\n celulaMedicoEspecialidade.setHorizontalAlignment(Element.ALIGN_CENTER);\n tabelaMedicos.addCell(celulaMedicoEspecialidade);\n \n paragrafoSexo = new Paragraph(new Phrase(15F, \"\"+ medico.getSexo(),\n FontFactory.getFont(FontFactory.HELVETICA, 9F)));\n paragrafoSexo.setAlignment(Element.ALIGN_CENTER);\n celulaMedicoSexo = new Cell(paragrafoSexo);\n celulaMedicoSexo.setBorderColor(Color.black);\n celulaMedicoSexo.setHorizontalAlignment(Element.ALIGN_CENTER);\n tabelaMedicos.addCell(celulaMedicoSexo);\n \n paragrafoSalario = new Paragraph(new Phrase(15F, \"R$ \"+ medico.getSalario(),\n FontFactory.getFont(FontFactory.HELVETICA, 9F)));\n paragrafoSalario.setAlignment(Element.ALIGN_CENTER);\n celulaMedicoSalario = new Cell(paragrafoSalario);\n celulaMedicoSalario.setBorderColor(Color.black);\n celulaMedicoSalario.setHorizontalAlignment(Element.ALIGN_CENTER);\n tabelaMedicos.addCell(celulaMedicoSalario);\n \n paragrafoDataNascimento = new Paragraph(new Phrase(15F, \"\"+ sdf.format(medico.getDataDeNascimento()),\n FontFactory.getFont(FontFactory.HELVETICA, 9F)));\n paragrafoDataNascimento.setAlignment(Element.ALIGN_CENTER);\n celulaMedicoDataNascimento = new Cell(paragrafoDataNascimento);\n celulaMedicoDataNascimento.setBorderColor(Color.black);\n celulaMedicoDataNascimento.setHorizontalAlignment(Element.ALIGN_CENTER);\n tabelaMedicos.addCell(celulaMedicoDataNascimento);\n \n } \n \n documento.add(tabelaMedicos);\n \n Runtime.getRuntime().exec(new String[]{\"cmd.exe\", \"/c\", \"start\", \"relatorioMedico.pdf\"});\n \n documento.close();\n \n } catch (DocumentException ex) {\n System.out.println(ex);\n } catch (FileNotFoundException ex) {\n System.out.println(ex);\n } catch (IOException ex) {\n System.out.println(ex);\n } catch (SQLException ex) {\n System.out.println(ex);\n }\n }",
"@Test\n public void bateauAtPasDansGrille() {\n Player p = new Player();\n List<Player> pL = new ArrayList<>();\n pL.add(p);\n Jeux j = new Jeux(ModeDeJeux.MONO_JOUEUR, pL);\n Grille g = new Grille(10, 10, j, p);\n\n Bateaux b = j.bateauAt(new Place(\"Z84897\"), g);\n\n assertNull(\"Il n'y a pas de bateau ici\", b);\n }",
"public void setRaggio(double raggio){\n this.raggio = raggio;\n }",
"public void percentualGordura(){\n\n s0 = 4.95 / denscorp;\n s1 = s0 - 4.50;\n percentgord = s1 * 100;\n\n }",
"public int getGanadas(){\n\t\treturn ganadas;\n\t}",
"@Override\n public String toString(){\n return \"G(\"+this.getVidas()+\")\";\n }",
"private void aggiornamento()\n {\n\t gestoreTasti.aggiornamento();\n\t \n\t /*Se lo stato di gioco esiste eseguiamo il suo aggiornamento.*/\n if(Stato.getStato() != null)\n {\n \t Stato.getStato().aggiornamento();\n }\n }",
"@Override\n\tpublic void dibujar(Graphics2D g) {\n\n\t\tif (contadorJugador == 0) {\n\t\t\tenemigos.add(enemigo1);\n\t\t\tenemigos.add(enemigo2);\n\t\t\t// Se volverian a generar los objetos\n\t\t\tConstantes.volverTodoCero();\n\t\t\tcontadorJugador++;\n\t\t}\n\t\tg.scale(Constantes.ESCALAX, Constantes.ESCALAY);\n\t\t\n\t\t// Importante\n\t\tmapa.dibujar(g);\n\t\tdibujarArmas(g);\n\t\t//\n\t\tjugador.dibujar(g);\n\t\tenemigo1.dibujar(g);\n\t\tenemigo2.dibujar(g);\n\t\tcasa1.dibujar(g);\n\t\tcasa2.dibujar(g);\n\t\tcasa3.dibujar(g);\n\t\tcasa4.dibujar(g);\n\t\tcasa5.dibujar(g);\n\t\tcasa6.dibujar(g);\n\n\t\ttry {\n\t\t\t// Esto sirve para que no dispare seguido es el contador que va aumentado hasta\n\t\t\t// el tiempo que tenga cada arma\n\t\t\tif (Tecla.esperarArma != ((Armas) Tecla.objetoElegido).esperaDisparo) {\n\t\t\t\tTecla.esperarArma++;\n\t\t\t}\n\t\t} catch (NullPointerException | ClassCastException e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\n\t\t// System.out.println(Tecla.esperarArma);\n\n\t\tMapa.paredAbajo = new Rectangle(Mapa.rectanguloAbx, Mapa.rectanguloAby, Constantes.ANCHOMAPA, 3);\n\t\tMapa.paredIzquierda = new Rectangle(Mapa.rectanguloIx, Mapa.rectanguloIy, 3, Constantes.ALTOMAPA);\n\t\tMapa.paredArriba = new Rectangle(Mapa.rectanguloAx, Mapa.rectanguloAy, Constantes.ANCHOMAPA, 3);\n\t\tMapa.paredDerecha = new Rectangle(Mapa.rectanguloDx, Mapa.rectanguloDy, 3, Constantes.ALTOMAPA);\n\t\t// ---\n\t\t// Prueba\n\t\t// ---\n\n\t\trecorrerArrayBalaMover(g);\n\n\t\tg.drawRect(Mapa.rectanguloAbx, Mapa.rectanguloAby, Constantes.ANCHOMAPA, 3);\n\t\tg.drawRect(Mapa.rectanguloAx, Mapa.rectanguloAy, 3, Constantes.ALTOMAPA);\n\t\tg.drawRect(Mapa.rectanguloDx, Mapa.rectanguloDy, 3, Constantes.ALTOMAPA);\n\t\tg.drawRect(Mapa.rectanguloIx, Mapa.rectanguloIy, Constantes.ANCHOMAPA, 3);\n\n\t}",
"public void gastarDinero(double cantidad){\r\n\t\t\r\n\t}",
"public void chocoContraBomba(Bomba bomba){}",
"public void ergebnis(TrefferTyp ergebnisTyp, Koordinate position) {}",
"public Jugador ganador(){\n return partida.ganador();\n }",
"Wedstrijden maakWedstrijdschema(Groepen groepen);",
"public Boite(String path, int x_de_base, int y_de_base, int id) {\r\n \tRandom r = new Random();\r\n \tint valeur = 1 + r.nextInt(3 - 1);\r\n \tthis.value = valeur;\r\n \tthis.s= new Sprite(path);\r\n\tImageIcon im_mun = new ImageIcon(s.getImage().getScaledInstance(50,50,Image.SCALE_DEFAULT));\r\n\ts.setImageIcon(im_mun);\r\n\ts.setImage(im_mun);\r\n \tthis.coordonneX= x_de_base;\r\n \tthis.coordonneY= y_de_base;\r\n \tthis.hb = new Hitbox(this);\r\n \tthis.id = id; // Numero du perso tue dans l'arraylist AfficherPersonnage\r\n \tafficher = 0;\r\n }",
"void setGruppo(Gruppo gruppo);",
"public ingresarBiblioteca() {\n initComponents();\n this.nombreUsuario.setText(usuariosID[0].getNombre());\n this.Picture.setFont(new java.awt.Font(\"Dialog\", java.awt.Font.PLAIN,10));\n usuario.insertarInicio(this.nombreUsuario.getText()/*, carpeta*/);\n usuario.obtenerNodo(0).getArchivo().insertarFinal(\"GENERAL\");//carpeta.insertarFinal(\"GENERAL\");\n }",
"public BrewedEspresso(Gelato gelato) {\n super(gelato);\n }",
"Jugador consultarGanador();",
"public void gored() {\n\t\t\n\t}",
"private void comerFantasma(Fantasma fantasma) {\n // TODO implement here\n }",
"public void setGusta(int gusta) {\r\n\t\tthis.gusta = gusta;\r\n\t}",
"public void bajarBloque() {\n\t\tif (piezaActual != null) {\n\t\t\tif (Mapa.getInstance().estaLibre(piezaActual.getBloque3().getX(),\n\t\t\t\t\tpiezaActual.getBloque3().getY() + 1)) {\n\t\t\t\tpiezaActual.getBloque3().bajar(); // Dejar en ese orden\n\t\t\t\tpiezaActual.getBloque2().bajar();\n\t\t\t\tpiezaActual.getBloque1().bajar();\n\t\t\t} else {\n\t\t\t\tthis.piezaNueva();\n\t\t\t}\n\t\t}\n\t}",
"Vaisseau_abscisseLaPlusAGauche createVaisseau_abscisseLaPlusAGauche();",
"public MonticuloSVG(Lista<Integer> elementos) {\n ordenada = Lista.mergeSort(elementos);\n while (!ordenada.esVacia()) {\n arbol.agrega(ordenada.eliminaPrimero());\n }\n altura = arbol.altura();\n ancho = 100 * ((int) Math.pow(2, altura)) + (100 * ((int) Math.pow(2, altura) - 1)) + 300;\n alto = 100 * altura + 100 * (altura - 1) + 300;\n }",
"private void creaAddebitiGiornoConto(Date data, int codConto) {\n /* variabili e costanti locali di lavoro */\n boolean continua;\n Filtro filtro;\n int[] interi;\n ArrayList<Integer> codici = null;\n Modulo modAddFisso;\n Modulo modConto;\n boolean chiuso;\n\n try { // prova ad eseguire il codice\n\n /* controllo se il conto e' aperto */\n modConto = Albergo.Moduli.Conto();\n chiuso = modConto.query().valoreBool(Conto.Cam.chiuso.get(), codConto);\n continua = (!chiuso);\n\n if (continua) {\n\n /* filtro che isola gli addebiti fissi da eseguire\n * per il giorno e il conto dati */\n filtro = this.getFiltroFissiGiornoConto(data, codConto);\n continua = filtro != null;\n\n /* crea elenco dei codici addebito fisso da elaborare */\n if (continua) {\n modAddFisso = Albergo.Moduli.AddebitoFisso();\n interi = modAddFisso.query().valoriChiave(filtro);\n codici = Lib.Array.creaLista(interi);\n }// fine del blocco if\n\n /* crea un addebito effettivo per ogni addebito fisso */\n if (codici != null) {\n for (int cod : codici) {\n this.creaSingoloAddebito(cod, data);\n } // fine del ciclo for-each\n }// fine del blocco if\n\n }// fine del blocco if\n\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n }// fine del blocco try-catch\n }",
"public void anuncio() {\n\n\t\tapp.image(pantallaEncontrado, 197, 115, 300, 150);\n\n\t\tapp.image(botonContinuar, 253, 285);\n\n\t}",
"public void bulleRouge() {\r\n\t\tIcon icon = null;\r\n\t\ticon = new ImageIcon(\"../_Images/Bouton/bulle_rouge.png\");\r\n\t\tif (icon != null)\r\n\t\t\tbulleAide.setIcon(icon);\r\n\t}",
"public void aapne() {\n trykketPaa = true;\n setBackground(new Background(new BackgroundFill(Color.LIGHTGRAY, CornerRadii.EMPTY, Insets.EMPTY)));\n if (bombe) {\n setText(\"x\");\n Color moerkeregroenn = Color.rgb(86, 130, 3, 0.5);\n setBackground(new Background(new BackgroundFill(moerkeregroenn, CornerRadii.EMPTY, Insets.EMPTY)));\n } else if (bombeNaboer == 0) {\n setText(\" \");\n } else {\n setText(bombeNaboer + \"\");\n if (bombeNaboer == 1) {\n setTextFill(Color.BLUE);\n } else if (bombeNaboer == 2) {\n setTextFill(Color.GREEN);\n } else if (bombeNaboer == 3) {\n setTextFill(Color.RED);\n } else if (bombeNaboer == 4) {\n setTextFill(Color.DARKBLUE);\n } else if (bombeNaboer == 5) {\n setTextFill(Color.BROWN);\n } else if (bombeNaboer == 6) {\n setTextFill(Color.DARKCYAN);\n }\n }\n }",
"public void bulleBlanche() {\r\n\t\tIcon icon = null;\r\n\t\ticon = new ImageIcon(\"../_Images/Bouton/bulle_blanche.png\");\r\n\t\tif (icon != null)\r\n\t\t\tbulleAide.setIcon(icon);\r\n\t}",
"@Override\r\n\tpublic int getImage() {\n\t\treturn Parametre.BALLE;\r\n\t}",
"private String creaElenco() {\n String testoTabella ;\n String riga = CostBio.VUOTO;\n ArrayList listaPagine = new ArrayList();\n ArrayList listaRiga;\n HashMap mappaTavola = new HashMap();\n String cognomeText;\n int num;\n int taglioPagine = Pref.getInt(CostBio.TAGLIO_COGNOMI_PAGINA);\n String tag = \"Persone di cognome \";\n ArrayList titoli = new ArrayList();\n titoli.add(LibWiki.setBold(\"Cognome\"));\n titoli.add(LibWiki.setBold(\"Voci\"));\n\n for (Map.Entry<String, Integer> mappa: mappaCognomi.entrySet()) {\n\n cognomeText = mappa.getKey();\n num = mappa.getValue();\n if (num >= taglioPagine) {\n cognomeText = tag + cognomeText + CostBio.PIPE + cognomeText;\n cognomeText = LibWiki.setQuadre(cognomeText);\n cognomeText = LibWiki.setBold(cognomeText);\n }// end of if cycle\n\n listaRiga = new ArrayList();\n listaRiga.add(cognomeText);\n listaRiga.add(num);\n listaPagine.add(listaRiga);\n\n }// end of for cycle\n mappaTavola.put(Cost.KEY_MAPPA_SORTABLE_BOOLEAN, true);\n mappaTavola.put(Cost.KEY_MAPPA_TITOLI, titoli);\n mappaTavola.put(Cost.KEY_MAPPA_RIGHE_LISTA, listaPagine);\n testoTabella = LibWiki.creaTable(mappaTavola);\n\n return testoTabella;\n }",
"public void setGroupe(String groupe) {\r\n this.groupe = groupe;\r\n }",
"private void generaMappa() {\n\t\t// lettura e acquisizione del file sorgente\n\t\tdecoder.leggiFile(filePath);\n\t\tStrutturaDati file = decoder.getFile();\n\n\t\t// creazione della mappa seguendo il sorgente\n\t\tfor (StrutturaDati map : file.getAttributi()) {\n\t\t\tif (map.getNome().equals(TAG_MAP_MAP)) {\n\t\t\t\tnomeMappa = map.getTag(TAG_MAP_TITLE);\n\t\t\t}\n\t\t}\n\n\t\t// creo tutte le celle\n\t\tfor (StrutturaDati map : file.getAttributi()) {\n\t\t\tif (map.getNome().equals(TAG_MAP_MAP)) {\n\t\t\t\tfor (StrutturaDati cell : map.getAttributi()) {\n\t\t\t\t\tif (cell.getNome().equals(TAG_MAP_CELL)) {\n\t\t\t\t\t\tint id = Integer.valueOf(cell.getTag(TAG_MAP_CELL_ID));\n\t\t\t\t\t\tint tipo = getTipo(cell.getTag(TAG_MAP_CELL_TYPE));\n\t\t\t\t\t\tString desc = getDescrizione(cell);\n\t\t\t\t\t\tCella newCella = new Cella(id, tipo, desc);\n\t\t\t\t\t\tif (tipo == TAG_C_GATE || tipo == TAG_C_LOOT) {// nel caso la casella sia un gate\n\t\t\t\t\t\t\tnewCella.setOggetto(getOggetto(cell));\n\t\t\t\t\t\t\tif (tipo == TAG_C_LOOT) {//creazione bivio anomalo l\n\t\t\t\t\t\t\t\tBivio biv = new Bivio(\"\", Integer.valueOf(cell.getTag(TAG_MAP_CELL_OPTION_DESTINATION)),false, 0, true);\n\t\t\t\t\t\t\t\tnewCella.addBivio(biv);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcelle.add(newCella);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// creazione dei bivi\n\t\tfor (StrutturaDati map : file.getAttributi()) {\n\t\t\t// ciclo gli attributi di rpg\n\t\t\tif (map.getNome().equals(TAG_MAP_MAP)) {\n\t\t\t\tfor (StrutturaDati cell : map.getAttributi()) {\n\t\t\t\t\t// ciclo gli attributi di map\n\t\t\t\t\tif (cell.getNome().equals(TAG_MAP_CELL)) {\n\t\t\t\t\t\t// acquisizione cella attuale\n\t\t\t\t\t\tint idCellaAtt = Integer.valueOf(cell.getTag(TAG_MAP_CELL_ID));\n\t\t\t\t\t\tCella cellaAtt = cercaCella(idCellaAtt);\n\t\t\t\t\t\tfor (StrutturaDati bivio : cell.getAttributi()) {\n\t\t\t\t\t\t\t// ciclo gli attributi della cella\n\t\t\t\t\t\t\tif (bivio.getNome().equals(TAG_MAP_CELL_OPTION)) {// se l'attributo e' un opzione\n\t\t\t\t\t\t\t\tint idBivio = Integer.valueOf(bivio.getTag(TAG_MAP_CELL_OPTION_DESTINATION));\n\t\t\t\t\t\t\t\tString intro = getIntroduzione(bivio);\n\t\t\t\t\t\t\t\t// set effetto se necessario ovvero la cella è una cella effetto\n\t\t\t\t\t\t\t\tif (cellaAtt.getTipo() == TAG_C_EFFETTO) {\n\t\t\t\t\t\t\t\t\tboolean hasObj = false;\n\t\t\t\t\t\t\t\t\tint effetto = getEffetto(bivio);\n\t\t\t\t\t\t\t\t\tif (bivio.getTag().containsKey(TAG_CELL_HAS_OBG)) {\n\t\t\t\t\t\t\t\t\t\tif (bivio.getTag(TAG_CELL_HAS_OBG).equals(OBJ_POSITIVE)) {\n\t\t\t\t\t\t\t\t\t\t\thasObj = true;\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\tBivio newBivio = new Bivio(intro, idBivio, true, effetto, hasObj);\n\t\t\t\t\t\t\t\t\tcellaAtt.addBivio(newBivio);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tboolean hasObj = false;\n\t\t\t\t\t\t\t\t\tif (bivio.getTag().containsKey(TAG_CELL_HAS_OBG)) {\n\t\t\t\t\t\t\t\t\t\tif (bivio.getTag(TAG_CELL_HAS_OBG).equals(OBJ_POSITIVE)) {\n\t\t\t\t\t\t\t\t\t\t\thasObj = true;\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\t\n\t\t\t\t\t\t\t\t\tBivio newBivio = new Bivio(intro, idBivio, false, 0, hasObj);\n\t\t\t\t\t\t\t\t\tcellaAtt.addBivio(newBivio);\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\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}"
]
| [
"0.63791394",
"0.6365236",
"0.60374594",
"0.59758735",
"0.5867077",
"0.5857011",
"0.5850239",
"0.58309627",
"0.5820455",
"0.5778674",
"0.5770738",
"0.5768745",
"0.5768238",
"0.57643354",
"0.5748582",
"0.57392496",
"0.57372457",
"0.5736355",
"0.573619",
"0.57282984",
"0.57005227",
"0.5694566",
"0.5692574",
"0.5663892",
"0.56598586",
"0.5654509",
"0.5642539",
"0.5624249",
"0.56186265",
"0.5607102",
"0.56011736",
"0.5577369",
"0.5552697",
"0.55439687",
"0.5536947",
"0.5535517",
"0.553362",
"0.5532748",
"0.5530097",
"0.55159736",
"0.549944",
"0.5497269",
"0.5490595",
"0.54758817",
"0.5475219",
"0.54748386",
"0.54748386",
"0.5462778",
"0.5455156",
"0.5450559",
"0.5450559",
"0.5447642",
"0.5446851",
"0.54453886",
"0.54408324",
"0.54408324",
"0.54336685",
"0.54318124",
"0.5430251",
"0.54270226",
"0.5425374",
"0.54216474",
"0.5419209",
"0.5418904",
"0.541858",
"0.5412359",
"0.54057044",
"0.5398754",
"0.539175",
"0.5390705",
"0.5386735",
"0.5382434",
"0.53789455",
"0.5378942",
"0.53781456",
"0.5371565",
"0.5369421",
"0.53680915",
"0.5348915",
"0.53488886",
"0.53488857",
"0.5339173",
"0.5339058",
"0.53376174",
"0.5337123",
"0.53340137",
"0.53290516",
"0.5321021",
"0.5320812",
"0.5318606",
"0.53092974",
"0.53076386",
"0.5307064",
"0.530048",
"0.529865",
"0.5297202",
"0.5292848",
"0.52880585",
"0.5287736",
"0.5285285"
]
| 0.56754404 | 23 |
Modifica o tamanho da font | public void setFontSize(int font) {
this.font = font;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getFontSize();",
"public float getFontSize();",
"public int getFontSize()\n \t{\n \t\treturn 13;\n \t}",
"private void setFont() {\n\t}",
"public void createFont()\n {\n my_font = new Font(\"Helvetica\", Font.BOLD, (int) (getWidth() * FONT_SIZE));\n }",
"Font createFont();",
"public void setFont(Font value) {\r\n this.font = value;\r\n }",
"private void setDefaultTextSize() {\n this.text_size = (int) default_text_size;\n }",
"FONT createFONT();",
"public void GetFont (){\n fontBol = false;\n fontBolS = true;\n fontBolA = true;\n fontBolW = true;\n }",
"public short getNumberOfFonts() {\n\t\treturn 0;\n\t}",
"@Override\r\n\tpublic int getFontSize() {\n\t\treturn 0;\r\n\t}",
"public void setFont(RMFont aFont) { }",
"@Override\n\tpublic int tamanho() {\n\t\treturn tamanho;\n\t}",
"private void setupTextSize()\n\t{\n\t\tContext context = getContext();\n\t\tResources res = context.getResources();\n\t\tthis.mTextSize = (int) res.getDimension(R.dimen.tsz_main);\n\t}",
"public void setLabelFont(Font f);",
"public void setTextFont(Font font);",
"@Override\n public void changeFontSize(int i) {\n lyricsTV.setTextSize((float) i);\n PreferencesManager pm = PreferencesManager.getInstance();\n pm.setFontSize(i);\n }",
"public void setModifierFont(String name, int type, int size) \n {\n RendererSettings.getInstance().setLabelFont(name, type, size);\n _SPR.RefreshModifierFont();\n }",
"public void updateText()\r\n\t{\r\n\t\tdouble smallest = Math.min(menu.getController().getWidth(), menu.getController().getHeight());\r\n\t\tdouble equivalent12 = smallest/55;//Equivalent of 12 point font on base dimensions\r\n\t\t\r\n\t\ttextRenderer = new TextRenderer(new Font(fontName, Font.PLAIN, (int)(equivalent12*size)), true, true);\r\n\t}",
"public double getFontSize(\n )\n {return fontSize;}",
"void setFontScale(\n float s);",
"public void setFontSize(float fs) {\n\t\tif (fs != fontSize) {\n\t\t\tfontSize = fs;\n\t\t\treload();\n\t\t}\n\t}",
"public boolean isFontSet() { return false; }",
"public void setFont(Font newFont) {\n\tfont = newFont;\n }",
"private void configuraFonteNumeros(JLabel lblNumeros) {\n\r\n\t\tswitch (dificuldade) {\r\n\t\tcase FACIL:\r\n\t\t\tlblNumeros.setFont(new Font(\"Comic Sans MS\", Font.BOLD, 40));\r\n\t\t\tbreak;\r\n\t\tcase MEDIO:\r\n\t\t\tlblNumeros.setFont(new Font(\"Comic Sans MS\", Font.BOLD, 25));\r\n\t\t\tbreak;\r\n\t\tcase DIFICIL:\r\n\t\t\tlblNumeros.setFont(new Font(\"Comic Sans MS\", Font.BOLD, 20));\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t}",
"public void setFont(Font newFont) {\r\n\t\tfont = newFont;\r\n\t}",
"public void setFont(Font f) {\n font = f;\n compute();\n }",
"public int fontSize() {\n\t\treturn fixedFontSize;\n\t}",
"private int getFontSize(LabelGeometry geom)\r\n {\r\n float fontSize = AWTUtilities.getFontSize(geom.getRenderProperties().getFont());\r\n\r\n // Scale based on the view\r\n Function<Kilometers, Float> scaleFunction = geom.getRenderProperties().getScaleFunction();\r\n if (scaleFunction != null)\r\n {\r\n float viewScale = scaleFunction.apply(myViewAltitudeSupplier.get()).floatValue();\r\n fontSize *= viewScale;\r\n }\r\n\r\n return Math.round(fontSize);\r\n }",
"float getFontSize()\r\n\t{\r\n\t\tif (!appearanceTokens.isEmpty())\r\n\t\t{\r\n\t\t\t// daString looks like \"BMC /Helv 3.4 Tf EMC\"\r\n\t\t\t// use the fontsize of the default existing apperance stream\r\n\t\t\tint fontIndex = appearanceTokens.indexOf(Operator.getOperator(\"Tf\"));\r\n\t\t\tif (fontIndex != -1)\r\n\t\t\t{\r\n\t\t\t\treturn ((COSNumber) appearanceTokens.get(fontIndex - 1)).floatValue();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn 0f;\r\n\t}",
"public void GetFontS (){\n fontBolS = false;\n fontBol = true;\n fontBolA = true;\n fontBolW = true;\n }",
"abstract Font getFont();",
"public int getMyFontSize() {\n return myFont.size; /*Fault:: return 5; */\n }",
"private static GFont getIndexFont(GFont f) {\n\t\tint newSize = Math.max((int) (f.getSize() * 0.9), 8);\n\t\treturn f.deriveFont(f.getStyle(), newSize);\n\t}",
"public void setDisplayFont(int size){\n\t\tscreen.setFont(new Font(\"Serif\",Font.BOLD,size));\r\n\t}",
"static Font getFont(int style, int size) {\n\t\treturn new Font(\"Monospaced\", style, size);\n\t}",
"@Test\n public void Test_FontList_Size() throws Exception {\n int actual_value = 0;\n int expected_value = 2;\n\n PdfResource resrc = new PdfResource();\n resrc.addFont(new PdfFont(PdfFont.HELVETICA, false, false));\n resrc.addFont(new PdfFont(PdfFont.COURIER, true, true));\n\n actual_value = resrc.getFontList().size();\n\n assertThat(actual_value, equalTo(expected_value));\n }",
"public void GetFontA (){\n fontBolA = false;\n fontBolS = true;\n fontBol = true;\n fontBolW = true;\n }",
"public short getFontHeight()\n {\n return font.getFontHeight();\n }",
"private static void loadTextSizes(Context context)\n\t{\n\t\tDisplayMetrics metrics = context.getResources().getDisplayMetrics();\n\t\tTEXT_SIZE = (int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 14, metrics);\n\t\tTEXT_SIZE_BIG = (int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 20, metrics);\n\t\tPADDING = (int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 10, metrics);\n\t\tTEXT_SPACE = (int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 150, metrics);\n\t}",
"public int getEmbeddedFontBufSize() throws PDFNetException {\n/* 826 */ return GetEmbeddedFontBufSize(this.a);\n/* */ }",
"public static void setDefaultSize(int size) {\r\n\t\tSet<Object> keySet = UIManager.getLookAndFeelDefaults().keySet();\r\n\t\tObject[] keys = keySet.toArray(new Object[keySet.size()]);\r\n\r\n\t\tfor (Object key : keys) {\r\n\t\t\tif (key != null && key.toString().toLowerCase().contains(\"font\")) {\r\n\t\t\t\tFont font = UIManager.getDefaults().getFont(key);\r\n\t\t\t\tif (font != null) {\r\n\t\t\t\t\tfont = font.deriveFont((float)size);\r\n\t\t\t\t\tUIManager.put(key, font);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void setFont(Font font)\n {\n this.font = font;\n }",
"public void setFont(Font f) {\n super.setFont(f);\n columnWidth = 0;\n }",
"public void initFont() {\r\n\t\tFont dosFont = null;\r\n try {\r\n \t//setup font\r\n\t\t\t\tURL fontUrl = getURL(\"fonts/DOSFont.ttf\");\r\n\t\t \tdosFont = Font.createFont(Font.TRUETYPE_FONT, fontUrl.openStream());\r\n\t \tdosFont = dosFont.deriveFont(Font.PLAIN, 15);\r\n\t \tGraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();\r\n\t \tge.registerFont(dosFont);\r\n\t } catch(Exception e) {\r\n\t e.printStackTrace();\r\n\t System.exit(-1);\r\n\t }\r\n screen.setFont(dosFont);//set font on JTextArea\r\n\t}",
"public abstract Font getFont();",
"public void setFontSize(float fontSize){\n this.fontSize = fontSize;\n }",
"public int getFontSize()\r\n {\r\n return myFontSize;\r\n }",
"public void GetFontW (){\n fontBolW = false;\n fontBolS = true;\n fontBolA = true;\n fontBol = true;\n }",
"public void setTextSize(float textSize){\n Context context = getContext();\n Resources res;\n\n if(context == null){\n res = Resources.getSystem();\n }else{\n res = context.getResources();\n }\n\n setTextSizePx(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, textSize, res.getDisplayMetrics()));\n }",
"public void setFont(int fontId){\n this.fontId = fontId;\n }",
"private void initLrcFontSize() {\n int screeHeight=getResources().getDisplayMetrics().heightPixels;\n int marginLeft=(int)(1.0*screeHeight/9);\n LrcView.defaultTextSize=DensityUtil.px2sp(this, (marginLeft));//设置默认的歌词大小\n LrcView.defaultDividerHeight=marginLeft/2;\n }",
"public static Font getFont() {\n return getFont(12);\n }",
"public static int getAreaButtonTextSize(Context context, Typeface typeface) {\n DisplayMetrics displayMetrics = context.getResources()\n .getDisplayMetrics();\n // int deviceWidth = displayMetrics.widthPixels;\n int deviceWidth = displayMetrics.widthPixels;\n\n return determineTextSize(typeface, (int) (0.23f * (.14f * deviceWidth)));\n\n }",
"public void setFont(String fontname, int fontsize){\n\t\tint tw = textWidth;\n\t\tint fs = (int) localFont.getSize();\n\t\tlocalFont = GFont.getFont(winApp, fontname, fontsize);\n\t\tif(fontsize > fs)\n\t\t\theight += (fontsize - fs);\n\t\tsetText(text);\n\t\tif(textWidth > tw)\n\t\t\twidth += (textWidth - tw);\n\t\tArrayList<GOption> options = optGroup.getOptions();\n\t\tfor(int i = 0; i < options.size(); i++)\n\t\t\toptions.get(i).setWidth((int)width - 10);\n\t\tslider.setX((int)width - 10);\n\t}",
"public void setTextSize(float size) {\n\n if (size > 24f)\n size = 24f;\n if (size < 6f)\n size = 6f;\n\n mTextSize = Utils.convertDpToPixel(size);\n }",
"private float getFontHeight(Paint paint) {\n Rect rect = new Rect();\n paint.getTextBounds(\"1\", 0, 1, rect);\n return rect.height();\n }",
"public Font deriveFont(float size){\n\tHashtable newAttributes = (Hashtable)getRequestedAttributes().clone();\n\tapplySize(size, newAttributes);\n return new Font(newAttributes, createdFont, font2DHandle);\n }",
"public Font getLabelFont();",
"public int getMediumFontSize() {\n\t\treturn 10;\n\t}",
"private native void init(Font font, String nativeName, int size);",
"public float getFontSize() {\n return fontSize;\n }",
"public void setLabelFont(int fontSize){\n Font labelFont = new Font(\"Serif\", Font.PLAIN, fontSize);\n minLabel.setFont(labelFont);\n medLabel.setFont(labelFont);\n maxLabel.setFont(labelFont);\n emptyLabel.setFont(labelFont);\n errorLabel.setFont(labelFont);\n }",
"public void setModifierFont(String name, int type, int size, float tracking, Boolean kerning) \n {\n RendererSettings.getInstance().setLabelFont(name, type, size, kerning, tracking);\n _SPR.RefreshModifierFont();\n }",
"@Override\n\t\t\t\tpublic void onDismiss(String fontSzie) {\n\t\t\t\t\tfond_size.setText(fontSzie);\n\t\t\t\t\tdialog.dismiss();\n\t\t\t\t}",
"public void setLabelFont(Font value) {\n labelFont = value;\n }",
"public FontData deriveFont(float size) {\n return deriveFont(size, javaFont.getStyle());\n }",
"private void setFont() {\n try {\n setFont(Font.loadFont(new FileInputStream(FONT_PATH), 23));\n } catch (FileNotFoundException e) {\n setFont(Font.font(\"Verdana\", 23));\n }\n }",
"public native void setFont(Font value) /*-{\n\t\tvar jso = [email protected]::getJsObj()();\n\t\tjso.font = [email protected]::getJsObj()();\n }-*/;",
"@Override\n public void setFont(Font f) {\n super.setFont(f);\n menuDirty = true;\n ResizeUtils.updateSize(this, actions);\n }",
"public Font modify(Font font) {\n\t\tif (family == null) {\n\t\t\tif (style != null && size != null) {\n\t\t\t\treturn font.deriveFont(style, size);\n\t\t\t}\n\t\t\telse if (style != null) {\n\t\t\t\treturn font.deriveFont(style);\n\t\t\t}\n\t\t\treturn font.deriveFont((float) size);\n\t\t}\n\t\tint newStyle = style != null ? style : font.getStyle();\n\t\tint newSize = size != null ? size : font.getSize();\n\t\treturn new Font(family, newStyle, newSize);\n\t}",
"private void updateFontSet() {\n if (!isBigFontSet()) {\n UIFontUtils.initFontDefaults(UIManager.getDefaults(), null);\n } else {\n// <snip> Install sscaled font\n FontPolicy windowsPolicy = FontPolicies.getDefaultWindowsPolicy();\n FontSet fontSet = windowsPolicy.getFontSet(null, UIManager\n .getLookAndFeelDefaults());\n WrapperFontSet scaled = new WrapperFontSet(fontSet, 5);\n UIFontUtils.initFontDefaults(UIManager.getDefaults(), scaled);\n// </snip>\n }\n updateLookAndFeel();\n }",
"public void setFont(Font font) {\n\tthis.font = font;\n }",
"public FontConfig() {\n\t\tthis.name = \"Monospaced\";\n\t\tthis.style = FontStyle.PLAIN;\n\t\tthis.size = DEFAULT_SIZE;\n\t}",
"void setFontSpacingSlider(Font font);",
"public void set_fonts(Graphics2D g2, float scale) {\n if ( XHSIPreferences.get_instance().get_bold_fonts() ) {\n this.font_statusbar = new Font(\"Verdana\", Font.PLAIN, 9);\n this.font_tiny = new Font( \"Verdana\", Font.BOLD, 10);\n this.font_small = new Font( \"Verdana\", Font.BOLD, 12);\n this.font_medium = new Font( \"Verdana\", Font.BOLD, 16);\n this.font_large = new Font( \"Verdana\", Font.PLAIN, 24);\n this.font_zl = new Font( \"Verdana\", Font.PLAIN, Math.round(64.0f * scale));\n this.font_yl = new Font( \"Verdana\", Font.PLAIN, Math.round(32.0f * scale));\n this.font_xxl = new Font( \"Verdana\", Font.BOLD, Math.round(24.0f * scale));\n this.font_xl = new Font( \"Verdana\", Font.BOLD, Math.round(21.0f * scale));\n this.font_l = new Font( \"Verdana\", Font.BOLD, Math.round(18.0f * scale));\n this.font_m = new Font( \"Verdana\", Font.BOLD, Math.round(16.0f * scale));\n this.font_s = new Font( \"Verdana\", Font.BOLD, Math.round(14.0f * scale));\n this.font_xs = new Font( \"Verdana\", Font.BOLD, Math.round(12.0f * scale));\n this.font_xxs = new Font( \"Verdana\", Font.BOLD, Math.round(10.0f * scale));\n this.font_normal = new Font( \"Verdana\", Font.BOLD, Math.round(14.0f * scale));\n } else {\n this.font_statusbar = new Font(\"Verdana\", Font.PLAIN, 9);\n this.font_tiny = new Font( \"Verdana\", Font.PLAIN, 10);\n this.font_small = new Font( \"Verdana\", Font.PLAIN, 12);\n this.font_medium = new Font( \"Verdana\", Font.PLAIN, 16);\n this.font_large = new Font( \"Verdana\", Font.PLAIN, 24);\n this.font_zl = new Font( \"Verdana\", Font.PLAIN, Math.round(64.0f * scale));\n this.font_yl = new Font( \"Verdana\", Font.PLAIN, Math.round(32.0f * scale));\n this.font_xxl = new Font( \"Verdana\", Font.PLAIN, Math.round(24.0f * scale));\n this.font_xl = new Font( \"Verdana\", Font.PLAIN, Math.round(21.0f * scale));\n this.font_l = new Font( \"Verdana\", Font.PLAIN, Math.round(18.0f * scale));\n this.font_m = new Font( \"Verdana\", Font.PLAIN, Math.round(16.0f * scale));\n this.font_s = new Font( \"Verdana\", Font.PLAIN, Math.round(14.0f * scale));\n this.font_xs = new Font( \"Verdana\", Font.PLAIN, Math.round(12.0f * scale));\n this.font_xxs = new Font( \"Verdana\", Font.PLAIN, Math.round(10.0f * scale));\n this.font_normal = new Font( \"Verdana\", Font.PLAIN, Math.round(14.0f * scale));\n }\n\n // calculate font metrics\n // W is probably the largest characher...\n FontMetrics fm;\n\n fm = g2.getFontMetrics(this.font_large);\n this.line_height_large = fm.getAscent();\n this.max_char_advance_large = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_large = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_medium);\n this.line_height_medium = fm.getAscent();\n this.max_char_advance_medium = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_medium = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_small);\n this.line_height_small = fm.getAscent();\n this.max_char_advance_small = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_small = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_tiny);\n this.line_height_tiny = fm.getAscent();\n this.max_char_advance_tiny = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_tiny = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_zl);\n this.line_height_zl = fm.getAscent();\n this.max_char_advance_zl = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_zl = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_yl);\n this.line_height_yl = fm.getAscent();\n this.max_char_advance_yl = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_yl = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_xxl);\n this.line_height_xxl = fm.getAscent();\n this.max_char_advance_xxl = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_xxl = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_xl);\n this.line_height_xl = fm.getAscent();\n this.max_char_advance_xl = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_xl = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_l);\n this.line_height_l = fm.getAscent();\n this.max_char_advance_l = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_l = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_m);\n this.line_height_m = fm.getAscent();\n this.max_char_advance_m = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_m = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_s);\n this.line_height_s = fm.getAscent();\n this.max_char_advance_s = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_s = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_xs);\n this.line_height_xs = fm.getAscent();\n this.max_char_advance_xs = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_xs = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_xxs);\n this.line_height_xxs = fm.getAscent();\n this.max_char_advance_xxs = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_xxs = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n fm = g2.getFontMetrics(this.font_normal);\n this.line_height_normal = fm.getAscent();\n this.max_char_advance_normal = fm.stringWidth(\"WW\") - fm.stringWidth(\"W\");\n this.digit_width_normal = fm.stringWidth(\"88\") - fm.stringWidth(\"8\");\n\n }",
"private FontData(InputStream ttf, float size) throws IOException {\n if (ttf.available() > MAX_FILE_SIZE) {\n throw new IOException(\"Can't load font - too big\");\n }\n byte[] data = IOUtils.toByteArray(ttf);\n if (data.length > MAX_FILE_SIZE) {\n throw new IOException(\"Can't load font - too big\");\n }\n\n this.size = size;\n try {\n javaFont = Font.createFont(Font.TRUETYPE_FONT, new ByteArrayInputStream(data));\n TTFFile rawFont = new TTFFile();\n if (!rawFont.readFont(new FontFileReader(data))) {\n throw new IOException(\"Invalid font file\");\n }\n upem = rawFont.getUPEM();\n ansiKerning = rawFont.getAnsiKerning();\n charWidth = rawFont.getAnsiWidth();\n fontName = rawFont.getPostScriptName();\n familyName = rawFont.getFamilyName();\n\n String name = getName();\n System.err.println(\"Loaded: \" + name + \" (\" + data.length + \")\");\n boolean bo = false;\n boolean it = false;\n if (name.indexOf(',') >= 0) {\n name = name.substring(name.indexOf(','));\n\n if (name.indexOf(\"Bold\") >= 0) {\n bo = true;\n }\n if (name.indexOf(\"Italic\") >= 0) {\n it = true;\n }\n }\n\n if ((bo & it)) {\n javaFont = javaFont.deriveFont(Font.BOLD | Font.ITALIC);\n } else if (bo) {\n javaFont = javaFont.deriveFont(Font.BOLD);\n } else if (it) {\n javaFont = javaFont.deriveFont(Font.ITALIC);\n }\n } catch (FontFormatException e) {\n IOException x = new IOException(\"Failed to read font\");\n x.initCause(e);\n throw x;\n }\n }",
"public void checkTextSize(){\n mShp = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());\n String textSize = mShp.getString(\n getString(R.string.pref_textSize_key),\n getString(R.string.pref_textSize_default)\n );\n float size = Float.parseFloat(textSize);\n mTaleText.setTextSize(TypedValue.COMPLEX_UNIT_SP,size);\n }",
"public static String alternativeFont(int n) {\n\n if (n < 0 || n > 9)\n throw new IllegalArgumentException(\"Font number should be between 0 and 9.\");\n\n return CSI + (n + 10) + 'm';\n }",
"@Override\n public String getPreviewString(Object value) {\n assert value instanceof Font;\n Font fontVal = (Font) value;\n if (isIndeterminate()) {\n return \"-\"; //NOI18N\n } else {\n String size = EditorUtils.valAsStr(fontVal.getSize());\n return fontVal.getFamily() + \" \" + size + \"px\" //NOI18N\n + (!fontVal.getName().equals(fontVal.getFamily()) && !\"Regular\".equals(fontVal.getStyle()) ? //NOI18N\n \" (\" + fontVal.getStyle() + \")\" : \"\"); //NOI18N\n }\n }",
"public void saveFont()\r\n\t{\r\n\t\tsavedFont = g.getFont();\r\n\t}",
"public String getFontSizeText()\r\n\t{\r\n\t\treturn fontSizeTextField.getText(); // return the text in the Font Size text field\r\n\t}",
"public void setTitleFontSize(int size) {\n\t\tthis.title_fontsize = size;\n\t}",
"public Font createFont() {\n\t\treturn null;\n\t}",
"public void setFont( Font font ) {\r\n this.font = font;\r\n }",
"public short getFontHeight() {\n\t\treturn this.fontHeight;\n\t}",
"public FontData deriveFont(float size, int style) {\n FontData original = getStyled(getFamilyName(), style);\n FontData data = new FontData();\n data.size = size;\n data.javaFont = original.javaFont.deriveFont(style, size);\n data.upem = upem;\n data.ansiKerning = ansiKerning;\n data.charWidth = charWidth;\n\n return data;\n }",
"@Override\r\n public void setFont(Font font) {\r\n super.setFont(new Font(\"Arial\", Font.PLAIN, 11)); \r\n }",
"public final int getFontSize() {\n return fontSize;\n }",
"public float getTextSizePx() {\n return mPaint.getTextSize();\n }",
"public void setFontLevel(int level) {\n super.setFontLevel(level);\n Object[] objectsToSize = new Object[]\n {unmarkedLabel, fixedCoordinatesItem};\n FontSizer.setFonts(objectsToSize, level);\n }",
"public void fontLoader(){\n try {\n //create the font to use. Specify the size!\n customFont = Font.createFont(Font.TRUETYPE_FONT, new File(\".\\\\resources\\\\DS-DIGI.ttf\")).deriveFont(40f);\n GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();\n ge.registerFont(customFont);\n } catch (IOException e) {\n e.printStackTrace();\n } catch(FontFormatException e) {\n e.printStackTrace();\n }\n }",
"public int getLabelTextSize(){\n return labelTextSize;\n }",
"public void setTextSizePx(float size) {\n mPaint.setTextSize(size);\n mSpaceWidth = mPaint.measureText(\" \");\n invalidate();\n }",
"private int getNormalTextSizeWeight() {\n return Integer.parseInt(getMessage(\"report.tabular.normal.text.size.weight\"));\n }",
"void setFontFamily(ReaderFontSelection f);",
"public void setFontSize(int fontSize)\r\n {\r\n myFontSize = fontSize;\r\n }",
"public boolean isBigFontSet() {\n return hasBig;\n }",
"public String getFont() {\n return font;\n }"
]
| [
"0.7118928",
"0.6971648",
"0.67957854",
"0.6791666",
"0.6746545",
"0.66149944",
"0.65438735",
"0.6511484",
"0.6468682",
"0.6466082",
"0.64545923",
"0.6441213",
"0.6396415",
"0.63534564",
"0.6323086",
"0.63206476",
"0.6225832",
"0.62198055",
"0.619767",
"0.61976343",
"0.61922544",
"0.61907804",
"0.6188551",
"0.6175773",
"0.617234",
"0.6161134",
"0.6133482",
"0.6128297",
"0.61239",
"0.6116978",
"0.61166763",
"0.610463",
"0.60954344",
"0.6090048",
"0.6084178",
"0.6077467",
"0.6074729",
"0.60691863",
"0.6056575",
"0.60428363",
"0.6041251",
"0.603883",
"0.6020423",
"0.6013753",
"0.6012884",
"0.60128015",
"0.5991537",
"0.5988099",
"0.5987693",
"0.5986969",
"0.5983445",
"0.59704536",
"0.59680367",
"0.5966541",
"0.59556794",
"0.5948363",
"0.59431666",
"0.5942139",
"0.5936892",
"0.5932702",
"0.59173286",
"0.59045666",
"0.5884815",
"0.5881817",
"0.5880613",
"0.5876659",
"0.5868362",
"0.5867985",
"0.58654064",
"0.5864419",
"0.58614594",
"0.58510226",
"0.58465075",
"0.5845231",
"0.5835361",
"0.58297634",
"0.5823303",
"0.581796",
"0.58152896",
"0.580243",
"0.579801",
"0.57957655",
"0.5792491",
"0.578569",
"0.57714885",
"0.57491535",
"0.57473135",
"0.57457227",
"0.57424486",
"0.5737307",
"0.57363087",
"0.57311726",
"0.57265717",
"0.5709064",
"0.5707925",
"0.57042193",
"0.5701327",
"0.5689646",
"0.5689497",
"0.56768024"
]
| 0.6525436 | 7 |
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 Medidas)) {
return false;
}
Medidas other = (Medidas) object;
if ((this.idMedida == null && other.idMedida != null) || (this.idMedida != null && !this.idMedida.equals(other.idMedida))) {
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(Long id) {this.id = id;}",
"public void setId(Long id) {this.id = id;}",
"public void setID(String idIn) {this.id = idIn;}",
"public void setId(int id) { this.id = id; }",
"public void setId(int id) { this.id = 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 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 getId(){return id;}",
"public void setId(long id) {\n id_ = id;\n }",
"private int getId() {\r\n\t\treturn id;\r\n\t}",
"public Integer getId(){return id;}",
"public int id() {return id;}",
"public long getId(){return this.id;}",
"public int getId(){\r\n return this.id;\r\n }",
"@Override public String getID() { return id;}",
"public Long id() { return this.id; }",
"public Integer getId() { return id; }",
"@Override\n\tpublic Integer getId() {\n return id;\n }",
"@Override\n public Long getId () {\n return id;\n }",
"@Override\n public long getId() {\n return id;\n }",
"public Long getId() {return id;}",
"public Long getId() {return id;}",
"public String getId(){return id;}",
"@Override\r\n\tpublic Long getId() {\n\t\treturn null;\r\n\t}",
"public Integer getId() { return this.id; }",
"@Override\r\n public int getId() {\n return id;\r\n }",
"@Override\n\t\tpublic long getId() {\n\t\t\treturn 0;\n\t\t}",
"public int getId() {\n return id;\n }",
"public long getId() { return _id; }",
"public int getId() {\n/* 35 */ return this.id;\n/* */ }",
"public long getId() { return id; }",
"public long getId() { return id; }",
"public void setId(Long id) \n {\n 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(String id) {\n this.id = id;\n }",
"@Override\n\tpublic void setId(Long id) {\n\t}",
"public Long getId() {\n return id;\n }",
"public long getId() { return this.id; }",
"public int getId()\n {\n return id;\n }",
"public void setId(int id){\r\n this.id = id;\r\n }",
"protected abstract String getId();",
"@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 int getId(){\n\t\treturn id;\n\t}",
"public String getId() { return id; }",
"public String getId() { return id; }",
"public String getId() { return id; }",
"public int getID() {return id;}",
"public int getID() {return id;}",
"public int getId ()\r\n {\r\n return id;\r\n }",
"@Override\n public int getField(int id) {\n return 0;\n }",
"public int getId(){\r\n return localId;\r\n }",
"public void setId(Long id)\n/* */ {\n/* 66 */ this.id = id;\n/* */ }",
"@Override\n public Integer getId() {\n return id;\n }",
"void setId(int id) {\n this.id = id;\n }",
"@Override\n\tpublic Object selectById(Object id) {\n\t\treturn null;\n\t}",
"@Override\n public int getId() {\n return id;\n }",
"@Override\n public int getId() {\n return id;\n }",
"private void clearId() {\n \n id_ = 0;\n }",
"private void clearId() {\n \n id_ = 0;\n }",
"private void clearId() {\n \n id_ = 0;\n }",
"private void clearId() {\n \n id_ = 0;\n }",
"private void clearId() {\n \n id_ = 0;\n }",
"private void clearId() {\n \n id_ = 0;\n }",
"private void clearId() {\n \n id_ = 0;\n }",
"public void setId(int id)\n {\n this.id=id;\n }",
"@Override\r\n public int getID()\r\n {\r\n\treturn id;\r\n }",
"@Override\n\tpublic Integer getId() {\n\t\treturn null;\n\t}",
"public int getId()\r\n {\r\n return id;\r\n }",
"@java.lang.Override\n public int getId() {\n return id_;\n }",
"@java.lang.Override\n public int getId() {\n return id_;\n }",
"public void setId(Long id){\n this.id = id;\n }",
"public abstract Long getId();",
"final protected int getId() {\n\t\treturn id;\n\t}",
"private void clearId() {\n \n id_ = 0;\n }",
"public void setId(Long id) \r\n {\r\n this.id = id;\r\n }",
"@Override\n public long getId() {\n return this.id;\n }",
"public String getId(){ return id.get(); }",
"public void setId(long id){\n this.id = id;\n }",
"public void setId(long id){\n this.id = id;\n }",
"@SuppressWarnings ( \"unused\" )\n private void setId ( final Long id ) {\n this.id = id;\n }",
"public Long getId() \n {\n return id;\n }",
"public void setId(Integer id)\r\n/* */ {\r\n/* 122 */ this.id = id;\r\n/* */ }",
"@Override\n\tpublic void setId(int id) {\n\n\t}",
"@Override\r\n\tpublic Object getId() {\n\t\treturn null;\r\n\t}",
"public void test_getId() {\n assertEquals(\"'id' value should be properly retrieved.\", id, instance.getId());\n }",
"public int getId()\n {\n return id;\n }",
"public int getID(){\n return id;\n }",
"public String getID(){\n return Id;\n }"
]
| [
"0.6896072",
"0.6839122",
"0.6705258",
"0.66412854",
"0.66412854",
"0.65923095",
"0.65785074",
"0.65785074",
"0.65752834",
"0.65752834",
"0.65752834",
"0.65752834",
"0.65752834",
"0.65752834",
"0.6561566",
"0.6561566",
"0.6545169",
"0.6525343",
"0.65168375",
"0.64885366",
"0.6477314",
"0.64274967",
"0.6420125",
"0.6417802",
"0.640265",
"0.6367859",
"0.6355473",
"0.6352689",
"0.6348769",
"0.63258827",
"0.63203555",
"0.6302521",
"0.62946665",
"0.62946665",
"0.62845194",
"0.62724674",
"0.62673867",
"0.62664896",
"0.62628543",
"0.62604827",
"0.6256597",
"0.62518793",
"0.6248176",
"0.6248176",
"0.62445766",
"0.6240227",
"0.6240227",
"0.62322026",
"0.6223806",
"0.62218046",
"0.6220317",
"0.6212928",
"0.62090635",
"0.6203066",
"0.6201325",
"0.61939746",
"0.6190498",
"0.6190498",
"0.6190498",
"0.6189811",
"0.6189811",
"0.6185415",
"0.618307",
"0.6175355",
"0.6174499",
"0.6167348",
"0.6167341",
"0.61617935",
"0.61569077",
"0.61569077",
"0.61567014",
"0.61567014",
"0.61567014",
"0.61567014",
"0.61567014",
"0.61567014",
"0.61567014",
"0.61423147",
"0.6134403",
"0.6129919",
"0.61289775",
"0.6105535",
"0.6105535",
"0.61055124",
"0.6103899",
"0.6103877",
"0.61027",
"0.61002946",
"0.61002403",
"0.609533",
"0.609243",
"0.609243",
"0.60917705",
"0.6090932",
"0.60905474",
"0.60762745",
"0.6072683",
"0.6072517",
"0.6071208",
"0.60706896",
"0.6070472"
]
| 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void execute(Model model) throws Exception {
Map<String, Object> map = model.asMap();
HttpServletRequest request = (HttpServletRequest) map.get("request");
String mroom = request.getParameter("mroomname");
mbookingDAO dao = new mbookingDAO();
mbookingDTO dto = dao.mpopup(mroom);
model.addAttribute("mpopup", dto);
} | {
"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 |
private int[] cache = new int[110]; | public int fib(int n) {
// // 法一:记忆化递归
// if (n <= 1) {
// return n;
// }
// if (cache[n] != 0) {
// return cache[n];
// }
// cache[n] = (fib(n - 1) + fib(n - 2)) % 1000000007;
// return cache[n];
// // 法二:动态规划
// if (n == 0 || n == 1) {
// return n;
// }
// int[] dp = new int[n + 1];
// dp[0] = 0; dp[1] = 1;
// for (int i = 2; i <= n; i++) {
// dp[i] = dp[i - 1] + dp[i - 2];
// dp[i] = dp[i] % 1000000007;
// }
// return dp[n];
// 动态规划,优化空间
if (n == 0 || n == 1) {
return n;
}
int a = 0, b = 1, sum = 0;
for (int i = 2; i <= n; i++) {
sum = (a + b) % 1000000007;
a = b;
b = sum;
}
return sum;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public HitCounterReadWriteLock() {\r\n hits = new int[300];\r\n times = new int[300];\r\n }",
"public MyHashMap() {\n arr = new int[100000];\n \n //To initialize the value with -1\n Arrays.fill(arr,-1);\n \n }",
"static void initializeArray2() {\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tRandom r = new Random();\n\t\t\tint val = r.nextInt(m);\n\t\t\t// Hash implementation\n\t\t\tint mod = val % m;\n\t\t\tarray[mod] = val;\n\t\t\tresult[1]++;\n\t\t}\n\t}",
"protected void createLookupCache()\n/* */ {\n/* 1260 */ this.lookup = new SimpleCache(1, Math.max(getSize() * 2, 64));\n/* */ }",
"int[] mo56159c();",
"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}",
"private void init() {\n _capacity = 1 << 9;\n int holderSize = _capacity << 1;\n _keyValueHolder = new int[holderSize];\n _mask = holderSize - 1;\n _maxNumEntries = (int) (_capacity * LOAD_FACTOR);\n }",
"private static int[] initArray(int N){\n int[] a = new int[N];\n for (int i=0;i<N;i++)\n a[i] = (int)(Math.random()*99999 + 100000);\n return a;\n }",
"@SuppressWarnings(\"unchecked\")\n public WeakIdentityCache() {\n threshold = 16;\n entries = new Entry[threshold];\n }",
"public int[] reduceInit() {\n return null;\n }",
"protected void addShiftToCache () {\n if (digitalShift == null)\n for (int j = 0; j <= dim; j++)\n cachedCurPoint[j] = 0;\n else\n for (int j = 0; j <= dim; j++)\n cachedCurPoint[j] = digitalShift[j];\n }",
"public static void main(String[] args)\n {\n\tScanner sc = new Scanner(System.in);\n\tSystem.out.println(\"enter cache size in KB among (1, 2, 4, 8, 16, 32)\");\n\tint cacheSize = sc.nextInt();\n\tSystem.out.println(\"enter way associative value among(1,2,4,8)\");\n\tint wayAssociative = sc.nextInt();\n\tSystem.out.println(\"enter cache line size in bytes among(2,4,8,16,32,64)\");\n\tint cacheLineSize = sc.nextInt();\n\tsc.close();\n\n\tlong count_hit = 0, count_miss = 0;\n\tlong count_hit_2 = 0, count_miss_2 = 0, clockCycle_2 = 0;\n\tlong count_hit_4 = 0, count_miss_4 = 0, clockCycle_4 = 0;\n\tlong count_hit_8 = 0, count_miss_8 = 0, clockCycle_8 = 0;\n\n\tint numberOfCacheLines = (int) ((cacheSize * 1024) / cacheLineSize);\n\n\tArrayList<String> cacheKeys = new ArrayList<String>(numberOfCacheLines);\n\tArrayList<String> cacheValues = new ArrayList<String>(numberOfCacheLines);\n\tArrayList<String> cacheKeys_0 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheValues_0 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheKeys_1 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheValues_1 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheKeys_2 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheValues_2 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheKeys_3 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheValues_3 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheKeys_4 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheValues_4 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheKeys_5 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheValues_5 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheKeys_6 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheValues_6 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheKeys_7 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\tArrayList<String> cacheValues_7 = new ArrayList<String>(numberOfCacheLines / wayAssociative);\n\n\tlong clockCycle = 0;\n\n\tStringBuilder y = new StringBuilder(\"\");\n\n\t// creating main memory array to store all addresses in a 2d\n\t// array..mapping one\n\t// letter into one width length only..1 to 1 mapping.\n\t// so 2 width is one byte..to get value do block offset*2\n\tString[][] mainMemory = new String[1743][32];\n\tfor (int i = 0; i < 1743; i++)\n\t{\n\t for (int j = 0; j < 32; j++)\n\t {\n\t\tmainMemory[i][j] = \"\";\n\t }\n\t}\n\ttry\n\t{\n\t // read all input files\n\t\tString instructionAddresses = new String(\n\t\t\t\tFiles.readAllBytes(Paths\n\t\t\t\t\t\t.get(\"/Users/akashmalla/Documents/COEN210_Computer_Architecture/project1/inst_addr_trace_hex_project_1.txt\")));\n\t\tString dataSizes = new String(\n\t\t\t\tFiles.readAllBytes(Paths\n\t\t\t\t\t\t.get(\"/Users/akashmalla/Documents/COEN210_Computer_Architecture/project1/inst_data_size_project_1.txt\")));\n\t\tString memoryAddresses = new String(\n\t\t\t\tFiles.readAllBytes(Paths\n\t\t\t\t\t\t.get(\"/Users/akashmalla/Documents/COEN210_Computer_Architecture/project1/inst_mem_hex_16byte_wide.txt\")));\n\t\t// copy all memory addresses into the 2d mainMemory array\n\t\t// split into each line of address\n\n\t String[] memoryAddress = memoryAddresses.split(\"\\\\s+\");\n\t for (int i = 0; i < 1743; i++)\n\t {\n\t\t// split address into each letter\n\t\tString[] oneBit = memoryAddress[i].split(\"\");\n\n\t\tint z = -1;\n\n\t\tfor (int q = oneBit.length - 1; q >= 0; q--)\n\t\t{\n\t\t z++;\n\t\t // store each letter into the array as hex\n\t\t mainMemory[i][q] = oneBit[z];\n\t\t}\n\t }\n\n\t // splitting the instruction addresses into lines\n\t String[] instructionAddress = instructionAddresses.split(\"\\\\s+\");\n\n\t // splitting dataSizes to get length of each data\n\t String[] dataSize = dataSizes.split(\"\\\\s+\");\n\t for (int i = 0; i < instructionAddress.length; i++)\n\t {\n\t\ttry\n\t\t{\n\t\t String binaryIs = \"\";\n\t\t String binaryOffset = \"\";\n\t\t String blockNumber = \"\";\n\t\t if (Integer.parseInt(instructionAddress[i], 16) > 15)\n\t\t {\n\t\t\tbinaryIs = Integer.toBinaryString(Integer.parseInt(instructionAddress[i], 16));\n\t\t\tbinaryOffset = binaryIs.substring(binaryIs.length() - 4);\n\t\t\tblockNumber = binaryIs.substring(0, binaryIs.length() - 4);\n\t\t } else\n\t\t {\n\n\t\t\tblockNumber = \"0\";\n\t\t\tbinaryOffset = Integer.toBinaryString(Integer.parseInt(instructionAddress[i], 16));\n\t\t }\n\n\t\t // check if hit or miss for 1 way\n\t\t if (wayAssociative == 1)\n\t\t {\n\n\t\t\tif (cacheKeys.contains(blockNumber + \",\" + binaryOffset))\n\t\t\t{\n\t\t\t // cache hit situation\n\t\t\t count_hit++;\n\t\t\t clockCycle++;\n\n\t\t\t}\n\n\t\t\telse\n\t\t\t{\n\t\t\t // cache miss\n\t\t\t count_miss++;\n\t\t\t clockCycle += 15;\n\n\t\t\t // replacement for direct mapping.\n\n\t\t\t int newBlockNumber_Value = Integer.parseInt(blockNumber, 2);\n\t\t\t int newOffset_StartingPosition = (Integer.parseInt(binaryOffset, 2) * 2);\n\t\t\t int length = Integer.parseInt(dataSize[i]);\n\n\t\t\t y.append(mainMemory[newBlockNumber_Value][newOffset_StartingPosition]);\n\n\t\t\t int p = -1, beta = 0;\n\t\t\t for (int alpha = 1; alpha < length; alpha++)\n\t\t\t {\n\n\t\t\t\tif ((alpha + newOffset_StartingPosition) % 31 == 0)\n\t\t\t\t{\n\n\t\t\t\t newBlockNumber_Value++;\n\t\t\t\t newOffset_StartingPosition = 0;\n\t\t\t\t beta = length - alpha;\n\n\t\t\t\t if (p < beta)\n\t\t\t\t {\n\t\t\t\t\tp++;\n\t\t\t\t\ty.append(mainMemory[newBlockNumber_Value][p + newOffset_StartingPosition]);\n\t\t\t\t }\n\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t y.append(mainMemory[newBlockNumber_Value][alpha + newOffset_StartingPosition]);\n\t\t\t\t}\n\t\t\t }\n\n\t\t\t y = y.reverse();\n\n\t\t\t // if y is more than one byte then put it in next cache line\n\t\t\t if (y.length() > 4)\n\t\t\t {\n\n\t\t\t\tfor (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t{\n\t\t\t\t String yy = y.substring(o, o + 4);\n\n\t\t\t\t cacheKeys.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t cacheValues.add(yy);\n\n\t\t\t\t}\n\t\t\t } else\n\t\t\t {\n\n\t\t\t\tif (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t{\n\t\t\t\t cacheKeys.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t cacheValues.add(y.toString());\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t // System.out.println(\"cache is full...\");\n\n\t\t\t\t}\n\n\t\t\t }\n\n\t\t\t}\n\n\t\t\ty.delete(0, y.length());\n\n\t\t }\n\n\t\t else if (wayAssociative > 1)\n\t\t {\n\n\t\t\tif (wayAssociative == 2)\n\t\t\t{\n\n\t\t\t if (cacheKeys_0.contains(blockNumber + \",\" + binaryOffset)\n\t\t\t\t || (cacheKeys_1.contains(blockNumber + \",\" + binaryOffset)))\n\t\t\t {\n\t\t\t\t// cache hit situation\n\t\t\t\tcount_hit_2++;\n\t\t\t\tclockCycle_2++;\n\n\t\t\t }\n\n\t\t\t else\n\t\t\t {\n\t\t\t\t// cache miss\n\t\t\t\tcount_miss_2++;\n\t\t\t\tclockCycle_2 += 15;\n\n\t\t\t\t// replacement\n\t\t\t\tint newBlockNumber_Value = Integer.parseInt(blockNumber, 2);\n\t\t\t\tint newOffset_StartingPosition = (Integer.parseInt(binaryOffset, 2) * 2);\n\t\t\t\tint length = Integer.parseInt(dataSize[i]);\n\n\t\t\t\ty.append(mainMemory[newBlockNumber_Value][newOffset_StartingPosition]);\n\n\t\t\t\tint p = -1, beta = 0;\n\t\t\t\tfor (int alpha = 1; alpha < length; alpha++)\n\t\t\t\t{\n\n\t\t\t\t if ((alpha + newOffset_StartingPosition) % 31 == 0)\n\t\t\t\t {\n\n\t\t\t\t\tnewBlockNumber_Value++;\n\t\t\t\t\tnewOffset_StartingPosition = 0;\n\t\t\t\t\tbeta = length - alpha;\n\n\t\t\t\t\tif (p < beta)\n\t\t\t\t\t{\n\t\t\t\t\t p++;\n\t\t\t\t\t y.append(mainMemory[newBlockNumber_Value][p + newOffset_StartingPosition]);\n\t\t\t\t\t}\n\n\t\t\t\t } else\n\t\t\t\t {\n\t\t\t\t\ty.append(mainMemory[newBlockNumber_Value][alpha + newOffset_StartingPosition]);\n\t\t\t\t }\n\t\t\t\t}\n\n\t\t\t\ty = y.reverse();\n\n\t\t\t\tif (i % wayAssociative == 0)\n\t\t\t\t{\n\t\t\t\t if (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tif (cacheKeys.size() <= numberOfCacheLines)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t cacheKeys_0.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\t cacheValues_0.add(yy);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t cacheKeys_0.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t cacheValues_0.add(y.toString());\n\t\t\t\t\t}\n\t\t\t\t } else\n\t\t\t\t {\n\t\t\t\t\t// System.out.println(\"cache is full...\");\n\n\t\t\t\t }\n\n\t\t\t\t}\n\n\t\t\t\telse if (i % wayAssociative == 1)\n\t\t\t\t{\n\t\t\t\t if (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_1.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_1.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t}\n\t\t\t\t\t{\n\n\t\t\t\t\t cacheKeys_1.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t cacheValues_1.add(y.toString());\n\n\t\t\t\t\t}\n\t\t\t\t }\n\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t\t// System.out.println(\"cache is full...\");\n\n\t\t\t\t }\n\n\t\t\t\t}\n\n\t\t\t }\n\n\t\t\t y.delete(0, y.length());\n\n\t\t\t}\n\n\t\t\t// way =4\n\t\t\tif (wayAssociative == 4)\n\t\t\t{\n\n\t\t\t if (cacheKeys_0.contains(blockNumber + \",\" + binaryOffset)\n\t\t\t\t || cacheKeys_1.contains(blockNumber + \",\" + binaryOffset)\n\t\t\t\t || cacheKeys_2.contains(blockNumber + \",\" + binaryOffset)\n\t\t\t\t || cacheKeys_3.contains(blockNumber + \",\" + binaryOffset))\n\t\t\t {\n\t\t\t\t// cache hit situation\n\t\t\t\tcount_hit_4++;\n\t\t\t\tclockCycle_4++;\n\n\t\t\t }\n\n\t\t\t else\n\t\t\t {\n\t\t\t\t// cache miss\n\t\t\t\tcount_miss_4++;\n\t\t\t\tclockCycle_4 += 15;\n\n\t\t\t\t// replacement\n\t\t\t\tint newBlockNumber_Value = Integer.parseInt(blockNumber, 2);\n\t\t\t\tint newOffset_StartingPosition = (Integer.parseInt(binaryOffset, 2) * 2);\n\t\t\t\tint length = Integer.parseInt(dataSize[i]);\n\n\t\t\t\ty.append(mainMemory[newBlockNumber_Value][newOffset_StartingPosition]);\n\n\t\t\t\tint p = -1, beta = 0;\n\t\t\t\tfor (int alpha = 1; alpha < length; alpha++)\n\t\t\t\t{\n\n\t\t\t\t if ((alpha + newOffset_StartingPosition) % 31 == 0)\n\t\t\t\t {\n\n\t\t\t\t\tnewBlockNumber_Value++;\n\t\t\t\t\tnewOffset_StartingPosition = 0;\n\t\t\t\t\tbeta = length - alpha;\n\n\t\t\t\t\tif (p < beta)\n\t\t\t\t\t{\n\t\t\t\t\t p++;\n\t\t\t\t\t y.append(mainMemory[newBlockNumber_Value][p + newOffset_StartingPosition]);\n\t\t\t\t\t}\n\n\t\t\t\t } else\n\t\t\t\t {\n\t\t\t\t\ty.append(mainMemory[newBlockNumber_Value][alpha + newOffset_StartingPosition]);\n\t\t\t\t }\n\t\t\t\t}\n\n\t\t\t\ty = y.reverse();\n\n\t\t\t\tif (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t{\n\n\t\t\t\t if (i % wayAssociative == 0)\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_0.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_0.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t cacheKeys_0.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t cacheValues_0.add(y.toString());\n\n\t\t\t\t\t}\n\t\t\t\t }\n\n\t\t\t\t // mod 1\n\t\t\t\t else if (i % wayAssociative == 1)\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_1.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_1.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t cacheKeys_1.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t cacheValues_1.add(y.toString());\n\t\t\t\t\t}\n\t\t\t\t }\n\n\t\t\t\t // mod 2\n\t\t\t\t else if (i % wayAssociative == 2)\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_2.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_2.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t if (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t\t {\n\t\t\t\t\t\tcacheKeys_2.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_2.add(y.toString());\n\t\t\t\t\t } else\n\t\t\t\t\t {\n\t\t\t\t\t\t// System.out.println(\"cache is full...\");\n\n\t\t\t\t\t }\n\n\t\t\t\t\t}\n\n\t\t\t\t }\n\n\t\t\t\t // mmod 3\n\t\t\t\t else if (i % wayAssociative == 3)\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_3.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_3.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t if (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t\t {\n\t\t\t\t\t\tcacheKeys_3.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_3.add(y.toString());\n\t\t\t\t\t }\n\n\t\t\t\t\t}\n\n\t\t\t\t }\n\n\t\t\t\t}\n\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t // System.out.println(\"cache is full...\");\n\n\t\t\t\t}\n\n\t\t\t }\n\n\t\t\t y.delete(0, y.length());\n\n\t\t\t}\n\n\t\t\telse if (wayAssociative == 8)\n\t\t\t{\n\n\t\t\t if (cacheKeys_0.contains(blockNumber + \",\" + binaryOffset)\n\t\t\t\t || (cacheKeys_1.contains(blockNumber + \",\" + binaryOffset))\n\t\t\t\t || (cacheKeys_3.contains(blockNumber + \",\" + binaryOffset))\n\t\t\t\t || (cacheKeys_3.contains(blockNumber + \",\" + binaryOffset))\n\t\t\t\t || cacheKeys_4.contains(blockNumber + \",\" + binaryOffset)\n\t\t\t\t || (cacheKeys_5.contains(blockNumber + \",\" + binaryOffset))\n\t\t\t\t || (cacheKeys_7.contains(blockNumber + \",\" + binaryOffset))\n\t\t\t\t || (cacheKeys_6.contains(blockNumber + \",\" + binaryOffset)))\n\t\t\t {\n\t\t\t\t// cache hit situation\n\t\t\t\tcount_hit_8++;\n\t\t\t\tclockCycle_8++;\n\n\t\t\t }\n\n\t\t\t else\n\t\t\t {\n\t\t\t\t// cache miss\n\t\t\t\tcount_miss_8++;\n\t\t\t\tclockCycle_8 += 15;\n\n\t\t\t\t// replacement\n\n\t\t\t\tint newBlockNumber_Value = Integer.parseInt(blockNumber, 2);\n\t\t\t\tint newOffset_StartingPosition = (Integer.parseInt(binaryOffset, 2) * 2);\n\t\t\t\tint length = Integer.parseInt(dataSize[i]);\n\n\t\t\t\ty.append(mainMemory[newBlockNumber_Value][newOffset_StartingPosition]);\n\n\t\t\t\tint p = -1, beta = 0;\n\t\t\t\tfor (int alpha = 1; alpha < length; alpha++)\n\t\t\t\t{\n\n\t\t\t\t if ((alpha + newOffset_StartingPosition) % 31 == 0)\n\t\t\t\t {\n\n\t\t\t\t\tnewBlockNumber_Value++;\n\t\t\t\t\tnewOffset_StartingPosition = 0;\n\t\t\t\t\tbeta = length - alpha;\n\n\t\t\t\t\tif (p < beta)\n\t\t\t\t\t{\n\t\t\t\t\t p++;\n\t\t\t\t\t y.append(mainMemory[newBlockNumber_Value][p + newOffset_StartingPosition]);\n\t\t\t\t\t}\n\n\t\t\t\t } else\n\t\t\t\t {\n\t\t\t\t\ty.append(mainMemory[newBlockNumber_Value][alpha + newOffset_StartingPosition]);\n\t\t\t\t }\n\t\t\t\t}\n\n\t\t\t\ty = y.reverse();\n\n\t\t\t\tif (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t{\n\n\t\t\t\t if (i % wayAssociative == 0)\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_0.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_0.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t cacheKeys_0.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t cacheValues_0.add(y.toString());\n\n\t\t\t\t\t}\n\t\t\t\t }\n\n\t\t\t\t // mod 1\n\t\t\t\t else if (i % wayAssociative == 1)\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_1.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_1.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t cacheKeys_1.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t cacheValues_1.add(y.toString());\n\t\t\t\t\t}\n\t\t\t\t }\n\n\t\t\t\t // mod 2\n\t\t\t\t else if (i % wayAssociative == 2)\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_2.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_2.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t if (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t\t {\n\t\t\t\t\t\tcacheKeys_2.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_2.add(y.toString());\n\t\t\t\t\t } else\n\t\t\t\t\t {\n\t\t\t\t\t\t// System.out.println(\"cache is full...\");\n\n\t\t\t\t\t }\n\n\t\t\t\t\t}\n\n\t\t\t\t }\n\n\t\t\t\t // mmod 3\n\t\t\t\t else if (i % wayAssociative == 3)\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_3.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_3.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t if (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t\t {\n\t\t\t\t\t\tcacheKeys_3.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_3.add(y.toString());\n\t\t\t\t\t }\n\n\t\t\t\t\t}\n\n\t\t\t\t }\n\n\t\t\t\t // 4\n\t\t\t\t else if (i % wayAssociative == 4)\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_4.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_4.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t if (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t\t {\n\t\t\t\t\t\tcacheKeys_4.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_4.add(y.toString());\n\t\t\t\t\t }\n\n\t\t\t\t\t}\n\n\t\t\t\t }\n\n\t\t\t\t // 5\n\t\t\t\t else if (i % wayAssociative == 5)\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_5.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_5.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t if (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t\t {\n\t\t\t\t\t\tcacheKeys_5.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_5.add(y.toString());\n\t\t\t\t\t }\n\n\t\t\t\t\t}\n\n\t\t\t\t }\n\n\t\t\t\t // 6\n\t\t\t\t else if (i % wayAssociative == 6)\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_6.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_6.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t if (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t\t {\n\t\t\t\t\t\tcacheKeys_6.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_6.add(y.toString());\n\t\t\t\t\t }\n\n\t\t\t\t\t}\n\n\t\t\t\t }\n\n\t\t\t\t // 7\n\n\t\t\t\t else if (i % wayAssociative == 7)\n\t\t\t\t {\n\t\t\t\t\tif (y.length() > 4)\n\t\t\t\t\t{\n\n\t\t\t\t\t for (int o = 0; o < y.length(); o = o + 4)\n\t\t\t\t\t {\n\t\t\t\t\t\tString yy = y.substring(o, o + 4);\n\n\t\t\t\t\t\tcacheKeys_7.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_7.add(yy);\n\n\t\t\t\t\t }\n\t\t\t\t\t} else\n\t\t\t\t\t{\n\n\t\t\t\t\t if (cacheKeys.size() <= (numberOfCacheLines))\n\t\t\t\t\t {\n\t\t\t\t\t\tcacheKeys_7.add(blockNumber + \",\" + binaryOffset);\n\t\t\t\t\t\tcacheValues_7.add(y.toString());\n\t\t\t\t\t }\n\n\t\t\t\t\t}\n\n\t\t\t\t }\n\n\t\t\t\t //\n\t\t\t\t}\n\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t // System.out.println(\"cache is full...\");\n\n\t\t\t\t}\n\n\t\t\t }\n\n\t\t\t y.delete(0, y.length());\n\n\t\t\t}\n\n\t\t }\n\n\t\t // 3\n\n\t\t} catch (Exception e)\n\t\t{\n\t\t e.printStackTrace();\n\t\t}\n\n\t }\n\n\t // to print outputs\n\n\t if (wayAssociative == 1)\n\t {\n\t\tlong cache_access = count_hit + count_miss;\n\n\t\tSystem.out.println(\"Total number of cache accesses is \" + cache_access);\n\t\tSystem.out.println(\"Total number of clock cycles is \" + clockCycle);\n\t\tSystem.out.println(\"Total number of hits \" + count_hit);\n\n\t\tdouble hit_ratio = ((double) count_hit) / (count_hit + count_miss) * 100;\n\n\t\tSystem.out.println(\"cache hit ratio is \" + hit_ratio + \"%\");\n\n\t\tdouble ipc = ((double) instructionAddress.length) / clockCycle;\n\t\tSystem.out.println(\"IPC is \" + ipc);\n\t }\n\n\t else if (wayAssociative == 2)\n\t {\n\t\tlong cache_access = count_hit_2 + count_miss_2;\n\n\t\tSystem.out.println(\"Total number of cache accesses is \" + cache_access);\n\t\tSystem.out.println(\"Total number of clock cycles is \" + clockCycle_2);\n\t\tSystem.out.println(\"Total number of hits \" + count_hit_2);\n\n\t\tdouble hit_ratio = ((double) count_hit_2) / (count_hit_2 + count_miss_2) * 100;\n\n\t\tSystem.out.println(\"cache hit ratio is \" + hit_ratio + \"%\");\n\n\t\tdouble ipc = ((double) instructionAddress.length) / clockCycle_2;\n\t\tSystem.out.println(\"IPC is \" + ipc);\n\t }\n\n\t else if (wayAssociative == 4)\n\t {\n\t\tlong cache_access = count_hit_4 + count_miss_4;\n\n\t\tSystem.out.println(\"Total number of cache accesses is \" + cache_access);\n\t\tSystem.out.println(\"Total number of clock cycles is \" + clockCycle_4);\n\t\tSystem.out.println(\"Total number of hits \" + count_hit_4);\n\n\t\tdouble hit_ratio = ((double) count_hit_4) / (count_hit_4 + count_miss_4) * 100;\n\n\t\tSystem.out.println(\"cache hit ratio is \" + hit_ratio + \"%\");\n\n\t\tdouble ipc = ((double) instructionAddress.length) / clockCycle_4;\n\t\tSystem.out.println(\"IPC is \" + ipc);\n\n\t } else if (wayAssociative == 8)\n\t {\n\t\tlong cache_access = count_hit_8 + count_miss_8;\n\n\t\tSystem.out.println(\"Total number of cache accesses is \" + cache_access);\n\t\tSystem.out.println(\"Total number of clock cycles is \" + clockCycle_8);\n\t\tSystem.out.println(\"Total number of hits \" + count_hit_8);\n\n\t\tdouble hit_ratio = ((double) count_hit_8) / (count_hit_8 + count_miss_8) * 100;\n\n\t\tSystem.out.println(\"cache hit ratio is \" + hit_ratio + \"%\");\n\n\t\tdouble ipc = ((double) instructionAddress.length) / clockCycle_8;\n\t\tSystem.out.println(\"IPC is \" + ipc);\n\t }\n\n\t} catch (Exception e)\n\t{\n\t e.printStackTrace();\n\t}\n\n }",
"int[] mo12208a(int i);",
"static int[] implement_LRU_cache(int capacity, int[] query_type, int[] key, int[] value) {\n // Stores the key as key of map and value as position of this provided value in linkedlist\n Map<Integer, Node> cacheMap = new HashMap<Integer, Node>();\n LinkedList keyList = new LinkedList();\n List<Integer> returnedValues = new ArrayList<Integer>();\n for(int i=0;i<query_type.length;i++){\n if(query_type[i]==0){\n // Add the linked list node to head if its accessed\n if(cacheMap.containsKey(key[i])){\n Node valueNode = cacheMap.get(key[i]);\n returnedValues.add(valueNode.value);\n // refresh the position of this element in the list\n keyList.replaceNode(valueNode);\n }else{\n returnedValues.add(-1);\n }\n\n }else{\n Node node = new Node(key[i], value[i]);\n if(cacheMap.containsKey(key[i])) {\n node = cacheMap.get(key[i]);\n node.value = value[i];\n keyList.replaceNode(node);\n }\n else {\n if (capacity > cacheMap.size()) {\n keyList.addFirst(node);\n cacheMap.put(key[i], node);\n\n }else{\n cacheMap.remove(keyList.tail.key);\n keyList.deleteNode();\n\n keyList.addFirst(node);\n cacheMap.put(node.key, node);\n }\n\n }\n }\n }\n int[] returnArray = new int[returnedValues.size()];\n for(int i=0;i<returnedValues.size();i++){\n returnArray[i] = returnedValues.get(i);\n }\n return returnArray;\n }",
"private final int[] initializeInstanceVariable() {\n\t\tint n = 10;\n\t\tint[] temp = new int[n];\n\t\tfor (int i = 0; i < n; i++) {temp[i] = i;}\n\t\treturn temp;\n\t}",
"public HitCounter() {\n hits = new int[300];\n times = new int[300];\n }",
"public HitCounter() {\n hits = new int[300];\n times = new int[300];\n }",
"public static void main(String[] args){\n int MIN = Integer.parseInt(args[0]);\n MAX = Integer.parseInt(args[1]);\n cutoffs = new int[args.length - 2];\n cache = new ArrayList<IndexedArrayList<SuperSavvyTrieHelper2>>();\n for (int i = 2; i < args.length; i++){\n cutoffs[i - 2] = Integer.parseInt(args[i]);\n cache.add(new IndexedArrayList<SuperSavvyTrieHelper2>());\n }\n for (int i = 0; i < cutoffs.length / 2; i++){\n int temp = cutoffs[i];\n cutoffs[i] = cutoffs[cutoffs.length - 1 - i];\n cutoffs[cutoffs.length - 1 - i] = temp;\n }\n multiplicitiesUsed = new boolean[MAX + 1];\n basesUsed = new DoublyLinkedArray(MAX + 1);\n SuperSavvyTrieHelper2.setCorrespondance(basesUsed);\n /*\n long count1 = lowerRecursion(MAX, 0);\n long count2 = middleRecursion(MAX, 0);\n long count3 = upperRecursion(MAX, 0);\n long total = count1 + count2 + count3;\n System.out.printf(\"%d + %d + %d = %d\\n\", count1, count2, count3, total);\n */\n hitCounts = new long[cutoffs.length];\n missCounts = new long[cutoffs.length];\n statCollector = new StatCollector(cutoffs);\n\n long startTime = System.nanoTime();\n long[] values = new long[MAX - MIN + 1];\n for (int i = MIN; i <= MAX; i++) {\n values[i - MIN] = upperRecursionWrapper(i);\n }\n //long[] testValues = new long[] {1752443,1911046, 2067456,2249444,2429337, 2647532,2852449,3101167,3350292,3632299,3916575};\n for (int i = 0; i < values.length; i++){\n //if (testValues[i] != values[i]){\n System.out.printf(\"%d: %d\\n\", i + MIN, values[i]);\n //}\n }\n long endTime = System.nanoTime();\n System.out.printf(\"%f,\", (double)(endTime - startTime) / 1000000000.0);\n long totalMissCounts = 0;\n long totalMissWeight1 = 0;\n long totalMissWeight2 = 0;\n long totalMissWeight3 = 0;\n /*\n for (int i = 0; i < cutoffs.length; i++){\n long totalCounts = hitCounts[i] + missCounts[i];\n totalMissCounts += missCounts[i];\n totalMissWeight1 += missCounts[i] * cutoffs[i];\n totalMissWeight2 += (hitCounts[i] / missCounts[i]) * cutoffs[i];\n totalMissWeight3 += (hitCounts[i] - missCounts[i]) * cutoffs[i] * cutoffs[i];\n System.out.printf(\"\\tCache %d: %d/%d/%d (%.5f%%)\", cutoffs[i], hitCounts[i], missCounts[i], totalCounts, (double) hitCounts[i] / totalCounts);\n }\n System.out.printf(\"\\t\\tMissCounts: %d, weighted: %d, ratio: %d, diff^2: %d\\n\", totalMissCounts, totalMissWeight1, totalMissWeight2, totalMissWeight3);\n */\n statCollector.printAll();\n }",
"protected void addShiftToCache () {\n if (digitalShift == null)\n for (int j = 0; j < dimS; j++)\n cachedCurPoint[j] = 0;\n else\n for (int j = 0; j < dimS; j++)\n cachedCurPoint[j] = digitalShift[j];\n }",
"long getCacheHits();",
"private CacheWrapper<AccessPointIdentifier, Integer> createCache() {\n return new CacheWrapper<AccessPointIdentifier, Integer>() {\n \n @Override\n public void put(AccessPointIdentifier key, Integer value) {\n cache.put(key, value);\n }\n \n @Override\n public Integer get(AccessPointIdentifier key) {\n if (cache.containsKey(key)) {\n hitRate++;\n }\n return cache.get(key);\n }\n \n \n };\n }",
"@Override\r\n public void setCaching(int parseInt) {\n\r\n }",
"Cache(){\n // If the files exist, load the contents into memory as matrices.\n if(distanceFile.exists() && validMoveFile.exists()){\n try{\n FileInputStream in = new FileInputStream(distanceFile);\n byte[] tempDist = new byte[200 * 200 * 12 * 9 * 5];\n // Reads the file as a byte array, then stores it as a byte matrix.\n in.read(tempDist);\n int i = 0;\n for(int start = 1; start < 200; start++)\n for(int to = 1; to < 200; to++)\n for(int taxi = 0; taxi < 12; taxi++)\n for(int bus = 0; bus < 9; bus++)\n for(int underground = 0; underground < 5; underground++)\n distance[start][to][taxi][bus][underground] = tempDist[i++];\n\n in = new FileInputStream(validMoveFile);\n byte[] tempMoves = new byte[4 * 200 * 162];\n // Reads the file as a byte array, then stores it as an int matrix.\n in.read(tempMoves);\n i = 0;\n\n for(int node = 1; node < 200; node++)\n for(int taxi = 0; taxi < 3; taxi++)\n for(int bus = 0; bus < 3; bus++)\n for(int underground = 0; underground < 3; underground++)\n for(int doublet = 0; doublet < 2; doublet++)\n for(int secret = 0; secret < 3; secret++){\n // Compute the int from 4 consecutive bytes in the byte array\n for(int b = 0; b < 4; b++)\n validMoves[node][taxi][bus][underground][doublet][secret] =\n (validMoves[node][taxi][bus][underground][doublet][secret] << 8) | (tempMoves[b + i] & 0xFF);\n i += 4;\n }\n }\n catch(Exception e){\n System.out.println(\"Exception: \" + e);\n }\n }\n }",
"private int[] reset() {\n return data;\n }",
"private synchronized int[] getLookupCache(String name) {\n if (this.lookupCacheURLs != null && (lookupCacheEnabled ^ 1) == 0) {\n int[] cache = getLookupCacheForClassLoader(this.lookupCacheLoader, name);\n if (cache != null && cache.length > 0) {\n int maxindex = cache[cache.length - 1];\n if (!ensureLoaderOpened(maxindex)) {\n if (DEBUG_LOOKUP_CACHE) {\n System.out.println(\"Expanded loaders FAILED \" + this.loaders.size() + \" for maxindex=\" + maxindex);\n }\n }\n }\n }\n }",
"long getCacheMisses();",
"public int[] reset() {\n\t\treturn memos;\n\t}",
"static void initializeArray(boolean firstTime) {\n\t\tint count = 0;\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tRandom r = new Random();\n\t\t\tint val = r.nextInt(m);\n\t\t\tint mod = val % m;\n\t\t\tif (array[mod] == -1) {\n\t\t\t\tarray[mod] = val;\n\t\t\t\tresult[1]++;\n\t\t\t\tcount++;\n\t\t\t} else if (firstTime) {\n\t\t\t\tresult[0] = count;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}",
"Array(int x) {\n\t\tarray = new int[x];\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tarray[i] = 0; // make each index 0\n\t\t}\n\t}",
"@Override\n public int getCacheSize() {\n return 4 + 20 * 88;\n }",
"public int[] reset() {\n return store;\n }",
"public static int[] reset() {\n nums = Arrays.copyOf(numsBackUp, numsBackUp.length);\n return nums;\n }",
"private static int[] arrayInitializer(int length) {\n int[] myArray = new int[length];\n Random rand = new Random();\n for (int i = 0; i < length; i++) {\n myArray[i] = rand.nextInt(1000);\n }\n return myArray;\n }",
"private static Counters[] m147577a(int i) {\n return new Counters[i];\n }",
"public void init_lookup(){\n for(int i =0 ; i< MAX ; i++){\n lookup[i] =0;\n }\n }",
"public int[] cloneMemory(){\n return memory.clone();\n }",
"Array() {\n\t\tarray = new int[0];\n\t}",
"@Override\r\n public long problem2() {\r\n ArrayList<String> arrList = new ArrayList<>();\r\n long start = System.currentTimeMillis(); \r\n for(int i = 0; i<1234567; i++){\r\n arrList.add(Integer.toString(i));\r\n }\r\n long end = System.currentTimeMillis(); \r\n return end - start; \r\n }",
"public final int[] cacheNodeStatus() {\n return new int[]{0,0,0,0,0,0,0,0,0,0};\r\n }",
"One(){\n data = new int[DEFAULT_CAPACITY];\n }",
"@Override\n public int getCacheSize() {\n return 4 + this.arraySet.getTotalBytesSize();\n }",
"int cacheRowsWhenScan();",
"public long memory() {\n\treturn 0;\n }",
"public void cacheHashCode() {\n _hashCode = 1;\n for (int counter = size() - 1; counter >= 0; counter--) {\n _hashCode = 31 * _hashCode + get(counter).hashCode();\n }\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 JsonArray getCache() {\n return cache;\n }",
"public static void main(String[] args) {\nint[] a= new int[10];\nfor(int i=0;i<10;i++) {\na[i]=i;\n}\nfor(int i=0;i<10;i++) {\n\tSystem.out.println(a[i]);\n}\n\n}",
"int[] mo56160d();",
"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}",
"public MyHashMap() {\n array = new TreeNode[1024];\n\n }",
"public ArraySh(int max) {\n\t\ttheArray = new long[max];\n\t\tnElems = 0;\n\t}",
"public static native int getMaxCache();",
"private UInteger[] getHashValues() {\n int hashWindowSize = 48;\n UInteger[] hashValues = new UInteger[this.fileContent.length];\n int shiftAmount = this.getShiftAmount(hashWindowSize);\n int i = 0;\n\n int[] lookupTable =\n {0x5e3f7c48, 0x796a0d2b, 0xbecd4e32, 0x6f16159c, 0x687312bc, 0x12a6f30a, 0x8fca2662,\n 0x79b83d14, 0x3fab3f30, 0x984d6ca2, 0x4df5fe6c, 0x4acd3196, 0x6245ad21,\n 0x3a15e5ba, 0x90db6499, 0x05aacb6b, 0x791cf724, 0x504cd910, 0x98093570,\n 0x090392df, 0xf193e5b8, 0x42023c5b, 0x80a95c6a, 0x11e676be, 0xc70f2117,\n 0xeed4587f, 0x6479e9bd, 0x1b0c427c, 0x410486ba, 0x30f5b837, 0xf957d307,\n 0x1535f121, 0xabe45e90, 0x7a1ab8f0, 0x1c6887e4, 0x4170b7ba, 0x8b491bed,\n 0x5c920e73, 0x1b1ed791, 0x7a0ed482, 0xcce86619, 0x45dc7290, 0x57e71362,\n 0x2e24f01c, 0x0a0637f3, 0x0e8c5565, 0x15944012, 0x34f7eeea, 0xbc628141,\n 0x1e200874, 0xe9244379, 0x3e63aeca, 0x7a3b3cce, 0x73f8a245, 0xd734e215,\n 0x834fa434, 0xf96a0904, 0xfb39a424, 0x0bfa963a, 0x9b236ee2, 0xa2131005,\n 0x3eb70acf, 0x2907bcd8, 0x3f685f3a, 0x3765fd37, 0x1c1c34d2, 0x03a95179,\n 0x024be6c3, 0x06128960, 0x844e7490, 0xe2b371a3, 0x3382909c, 0x3d519a77,\n 0x90971ec9, 0x6ea745e5, 0x490b3a5c, 0x7f3916f7, 0xbc150351, 0x241a7ba0,\n 0xec93c2bb, 0x6c7083aa, 0xf3937751, 0xe6aa1df1, 0x129fc001, 0xb90709b9,\n 0x7e59a4fc, 0x4509e58a, 0x8a93ed43, 0x6934ce62, 0x8ec6af1a, 0xf36581a9,\n 0x53d01d93, 0xb34eef69, 0x08494a84, 0x0f6dff34, 0x74729aa3, 0x48b5475f,\n 0xb986dc84, 0xd0424c8d, 0xb72ad089, 0x0adbbdb8, 0x824fdbe8, 0x99ad1058,\n 0x98faec38, 0xe746242b, 0x2b7ee7fc, 0x2e151fa7, 0x6413270f, 0x68ed7239,\n 0x7729e2d3, 0x5697b3a5, 0x0b90a6c3, 0xdf7cefcf, 0xded46a48, 0x46956888,\n 0xb3bb6dc4, 0xe987578f, 0xf82e74b7, 0xc8eeeba4, 0xdd960ff9, 0x482ed28d,\n 0x4f343078, 0x563ab8a4, 0x3ec7aa0d, 0x2481d448, 0x5fe98704, 0x5aafc580,\n 0x841d81ec, 0xae7fe8fd, 0x6b31ccb6, 0x911ebdd4, 0x75f4703d, 0xe6855a0f,\n 0x6184b42e, 0x147a4a95, 0x39528e48, 0xe975b416, 0x3cba13d3, 0x1e23e544,\n 0xf7955286, 0xa5f96b7f, 0xaaa697aa, 0x29e794e3, 0x87628c09, 0xfeebf5f1,\n 0xf8b070cd, 0xe361b627, 0x8c7a8682, 0x69cab331, 0xca867ad1, 0xd0151a96,\n 0xfc19a6b9, 0x6d7439e7, 0x64cd62ac, 0x4a650747, 0x9ddbfa28, 0x337c8bed,\n 0xf12a6860, 0x3767ffd3, 0x13559ced, 0x71ac2011, 0xc11dc687, 0x260b7105,\n 0xc13bca0c, 0xcd0af893, 0x793b54e6, 0x89d27fc3, 0xc6bd1c88, 0xe3337313,\n 0x387bc671, 0x61280de4, 0x76941a36, 0xaa52a2b9, 0x6d7cb52c, 0x18ff4d70,\n 0x8987cf38, 0x306e47ed, 0xf7df8135, 0x18a8e024, 0xc9eb085f, 0xc1a7c769,\n 0xd5667a12, 0x9c8be93a, 0x028781b1, 0x6213dada, 0x07fef4f5, 0x5e6bf91d,\n 0x469ea798, 0xb9654a37, 0x1cb5e74e, 0x525d502d, 0xe805ec68, 0xdd8c4320,\n 0x7890848f, 0x61e59c8e, 0x1d99f9ef, 0x25b60b20, 0x2f198088, 0xe01b6926,\n 0xffa4917f, 0xb2fa0f22, 0xee8ac924, 0x18a1c5a7, 0xb76d8d7f, 0x88ad5e0d,\n 0x7b3fb12b, 0xc8a91add, 0x762a6f4e, 0x056fad31, 0xebecfab8, 0xea54cd17,\n 0x71f5af9f, 0xfaececa1, 0x08a52f4d, 0xbb5efebe, 0x5bcb04c2, 0xcb2530b0,\n 0x01bb862b, 0xbb5d54f0, 0x404deb4b, 0x038658bd, 0x09399005, 0xddd862c8,\n 0x8985776f, 0xcfcfd717, 0xbec756cb, 0x52aecc5a, 0x09ac3f62, 0x62c1c6fb,\n 0x76cc3221, 0xcde6d028, 0x844d9291, 0xc143eeac, 0x0ea5e772, 0x8855456e,\n 0xeb03a426, 0x3398475d, 0x73dc8107, 0x681605d0, 0xd18b6264, 0x934e43eb,\n 0x59e76d21, 0xd3ce2b77, 0x4ccfee1c, 0x2f4af76d, 0x8b12a309, 0x849bb415,\n 0xf45ad809, 0xc7bccae7, 0xac891c35, 0x59db2274, 0xbcd71393, 0x2c9b1705,\n 0xcb536a69, 0xb2800f00, 0x111313fc};\n\n while (i < this.fileContent.length) {\n UInteger hashValue = i == 0 ? uint(0) : hashValues[i - 1];\n int trailingEdgeData = i < hashWindowSize ? ubyte(0).intValue() :\n ubyte(this.fileContent[i - hashWindowSize]).intValue();\n int leadingEdgeData = ubyte(this.fileContent[i]).intValue();\n UInteger val = hashValue.xor(uint(lookupTable[trailingEdgeData]))\n .xor(uint(lookupTable[leadingEdgeData]));\n hashValues[i] =\n val.leftShift(2).inclusiveOr(val.rightShift(Integer.SIZE - shiftAmount));\n i++;\n }\n\n return hashValues;\n }",
"int getCurrentCacheSize();",
"private void allocateArray( int arraySize )\n {\n array = new HashEntry[ nextPrime( arraySize ) ];\n }",
"public void clearCache() {\n/* 105 */ this.cachedRed = null;\n/* 106 */ this.cachedUsr2dev = null;\n/* 107 */ this.cachedGn2dev = null;\n/* 108 */ this.cachedBounds = null;\n/* */ }",
"public int getCacheSize();",
"long memoryUnused();",
"public _No_706_DesignHashMap() {\n// Arrays.fill(arr, -1);\n }",
"@PostConstruct\n public void initCache() {\n cache = Collections.synchronizedMap(new HashMap<>(cacheCapacity, 1));\n }",
"public static int[] m22366a() {\n return (int[]) f17668c.clone();\n }",
"public int[] reset() \n {\n return reset;\n }",
"@Override\n\tpublic long getCacheSize() {\n\t\treturn 0;\n\t}",
"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 }",
"void alloc() {\n\t\tother = new int[symbol.length + 2];\n\t}",
"public static void bufferoverflowExample() {\n\t\tint[] intArray = new int[5];\n\t\tfor(int i = 0 ;i < 10 ; i++) \n\t\t{\n\t\t\tintArray[i] = i++;\n\t\t\tSystem.out.println(\"value of intArray[i] = \" + intArray[i]);\n\t\t}\n\t}",
"public Integer[] createArray() {\n Integer[] value = new Integer[defaultLaenge];\n\n for (int i = 0; i < value.length; i++) {\n value[i] = (int)(value.length*Math.random());\n }\n\n return value;\n }",
"static void pregenFact() \n\t{ \n\t\tfact[0] = fact[1] = 1; \n\t\tfor (int i = 1; i <= 1000000; ++i) \n\t\t{ \n\t\t\tfact[i] = (int) ((long) fact[i - 1] * i % mod); \n\t\t} \n\t}",
"public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight) {\n/* 17 */ int[] var5 = this.parent.getInts(areaX, areaY, areaWidth, areaHeight);\n/* 18 */ int[] var6 = IntCache.getIntCache(areaWidth * areaHeight);\n/* */ \n/* 20 */ for (int var7 = 0; var7 < areaHeight; var7++) {\n/* */ \n/* 22 */ for (int var8 = 0; var8 < areaWidth; var8++) {\n/* */ \n/* 24 */ initChunkSeed((var8 + areaX), (var7 + areaY));\n/* 25 */ var6[var8 + var7 * areaWidth] = (var5[var8 + var7 * areaWidth] > 0) ? (nextInt(299999) + 2) : 0;\n/* */ } \n/* */ } \n/* */ \n/* 29 */ return var6;\n/* */ }",
"long getMemswap();",
"public InsertDeleteGetRandom_380() {\n nums = new int[1000000];\n size = 0;\n lookup = new HashMap<>();\n }",
"long[] getBuffer() {\n\t\treturn buffer;\n\t}",
"@Override\n public int getCacheSize() {\n return 4 + 20 * (4 + 4 + 8);\n }",
"HugeUInt(HugeUInt arg) {\r\n array = new int[arg.array.length];\r\n for (int i = 0; i < arg.array.length; i++) array[i] = arg.array[i];\r\n }",
"public SpriteCache() {\n counter = 0;\n spritesToRender = new SparseArray<>();\n lock = new ReentrantLock();\n }",
"public static void main(String[] args) { int n = 100000000;\n// Integer[] array = ArrayGenerator.randomGenerator(n, n);\n// Integer[] arr = Arrays.copyOf(array, array.length);\n// PerformanceSort.test(\"QuickSort\", array);\n// PerformanceSort.test(\"MergeSort\", arr);\n// Integer[] array1 = ArrayGenerator.orderGenerator(n);\n// Integer[] arr1 = Arrays.copyOf(array1, array1.length);\n// PerformanceSort.test(\"QuickSort\", array1);\n// PerformanceSort.test(\"MergeSort\", arr1);\n//\n int n = 5000000;\n Integer[] array = ArrayGenerator.randomGenerator(n, 3);\n Integer[] arr = Arrays.copyOf(array, array.length);\n\n PerformanceSort.test(\"QuickSort3\", array);\n PerformanceSort.test(\"QuickSort2\", arr);\n// Integer[] array = new Integer[]{1, 8, 7, 6, 4};\n// PerformanceSort.test(\"QuickSort2\", array);\n\n }",
"@Test\r\n\tpublic void testIntegerCache_2() {\n\t\tRandomOrgCache<String[]> c = rocs[0].createIntegerCache(5, 50, 100, false, 16, 5);\r\n\t\tc.stop();\r\n\t\t\r\n\t\ttry {\r\n\t\t\tc.get();\r\n\t\t\tcollector.addError(new Error(\"should have thrown NoSuchElementException\"));\r\n\t\t} catch (NoSuchElementException e) {}\r\n\t\t\r\n\t\tcollector.checkThat(c.isPaused(), equalTo(true));\r\n\t\tc.resume();\r\n\t\t\r\n\t\tString[] got = null;\r\n\t\t\r\n\t\t// Testing RandomOrgCache function get()\r\n\t\twhile (got == null) {\r\n\t\t\ttry {\r\n\t\t\t\tgot = c.get();\r\n\t\t\t} catch (NoSuchElementException e) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tThread.sleep(50);\r\n\t\t\t\t} catch (InterruptedException e1) {\r\n\t\t\t\t\tcollector.addError(new Error(\"shouldn't have been interrupted!\"));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tcollector.checkThat(got, notNullValue());\r\n\t}",
"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 }",
"@Test\r\n\tpublic void testIntegerSequenceCache_4() {\n\t\tboolean[] replacement = {true, true, true, true};\r\n\t\tRandomOrgCache<String[][]> c = rocs[0].createIntegerSequenceCache(4, LENGTH, MIN, MAX, replacement, BASE, 10);\r\n\t\tc.stop();\r\n\r\n\t\ttry {\r\n\t\t\tc.get();\r\n\t\t\tcollector.addError(new Error(\"should have thrown NoSuchElementException\"));\r\n\t\t} catch (NoSuchElementException e) {}\r\n\t\t\r\n\t\tc.resume();\r\n\t\t\r\n\t\tString[][] got = null;\r\n\t\t\r\n\t\twhile (got == null) {\r\n\t\t\ttry {\r\n\t\t\t\tgot = c.get();\r\n\t\t\t} catch (NoSuchElementException e) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tThread.sleep(50);\r\n\t\t\t\t} catch (InterruptedException e1) {\r\n\t\t\t\t\tcollector.addError(new Error(\"shouldn't have been interrupted!\"));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tfor (int i = 0; i < got.length; i++) {\r\n\t\t\tcollector.checkThat(got[i].length == LENGTH[i], equalTo(true));\r\n\t\t}\r\n\t\t\r\n\t\tcollector.checkThat(got, notNullValue());\r\n\t}",
"public static void generator(){\n int vector[]= new int[5];\r\n vector[10]=20;\r\n }",
"public SortingBuffer(int numberOfThreads) \r\n {\r\n this.numberOfThreads = numberOfThreads;\r\n currentValue = new int[numberOfThreads];\r\n // Use a sentinel value to initialize array\r\n Arrays.fill(currentValue, Integer.MIN_VALUE);\r\n }",
"public static void main(String[] var0) {\n\n// for(int i =0;i<10;i++){\n// Object object = new byte[2*1024*1024];\n// map.put(i+\"\",object);\n// }\n // map =null;\n System.gc();\n// System.out.println(\"打印出了最大可用堆内存\");\n// System.out.println(\"-Xmx\" + Runtime.getRuntime().maxMemory() / 1024L / 1024L + \"M\");\n }",
"public int[] fillDatabase()\n {\n int [] db = new int [20];\n \n \n for (int i = 0; i < db.length; i++)\n {\n db[i] = new java.util.Random().nextInt(25);\n }\n return db;\n }",
"int getCachedCount();",
"protected long[] _getInternalLongArray() {\n\t\treturn _value;\n\t}",
"int[] retrieveAllData();",
"void resetCacheCounters();",
"public int[] viewQueue(){\r\n\t\tint[] newQueue = new int[5];\r\n\t\tnewQueue = queue.clone();\r\n\t\treturn newQueue;\r\n\t}",
"public byte[] cache(byte[] contents) {\r\n\t\tif (contents == null)\r\n\t\t\treturn null;\r\n\t\tByteArray ba = new ByteArray(contents);\r\n\t\tcache.putIfAbsent(ba, ba.contents);\r\n\t\treturn cache.get(ba);\r\n\t}",
"public static List<Integer> getIntegerList(){\n List<Integer> nums = new ArrayList<>();//ArrayList<Integer> list = new ArrayList<>();\n for(int i=0;i<=1_000_000;i++) {\n nums.add(i);\n }\n return nums;\n }",
"private void rehash( )\n {\n HashEntry<AnyType> [ ] oldArray = array;\n\n // Create a new double-sized, empty table\n allocateArray( 2 * oldArray.length );\n occupied = 0;\n theSize = 0;\n\n // Copy table over\n for( HashEntry<AnyType> entry : oldArray )\n if( entry != null) {\n \tput(entry.key, entry.value);\n }\n }",
"DS (int size) {sz = size; p = new int [sz]; for (int i = 0; i < sz; i++) p[i] = i; R = new int[sz];}",
"public IntMap(int size){\r\n hashMask=size-1;\r\n indexMask=(size<<1)-1;\r\n data=new int[size<<1];\r\n }",
"private void allocateArray(int arraySize) {\n\t array = new HashEntry[nextPrime(arraySize)];\n\t }",
"int[] getInts();",
"public Happy_Number()\r\n\t{\r\n\t\tnumberHolder = new int[20];\r\n\t\tfor(int ii = 0; ii < numberHolder.length; ii++)\r\n\t\t{\r\n\t\t\tnumberHolder[ii] = 0;\r\n\t\t}\r\n\t}",
"FixedTextureCache()\n {\n textureMap = new HashMap();\n componentMap = new HashMap();\n }",
"public void init()\n {\n list = new int[k];\n\n // Initialise my list of integers\n for (int i = 0; i < k; i++) {\n int b = 1;\n while (CommonState.r.nextBoolean())\n b++;\n list[i] = b;\n }\n }",
"static void makeAllWaysCacheDistToMethod(){\n allWaysCache = new long[8][NumToCheck + 1];\n int currentDescriptor = 0;\n for (int jump = 1; jump <= 3; jump++){\n for (int j = jump; j <= NumToCheck; j += jump){\n allWaysCache[currentDescriptor][j] = 1;\n }\n currentDescriptor++;\n }\n //1,2\n addShifted(allWaysCache[3], allWaysCache[0], 3);\n addShifted(allWaysCache[3], allWaysCache[1], 3);\n cummulativeShift(allWaysCache[3], 3);\n //1,3\n addShifted(allWaysCache[4], allWaysCache[0], 4);\n addShifted(allWaysCache[4], allWaysCache[2], 4);\n cummulativeShift(allWaysCache[4], 4);\n //2,3\n addShifted(allWaysCache[5], allWaysCache[1], 5);\n addShifted(allWaysCache[5], allWaysCache[2], 5);\n cummulativeShift(allWaysCache[5], 5);\n //1,2,3\n addShifted(allWaysCache[6], allWaysCache[3], 6);\n addShifted(allWaysCache[6], allWaysCache[4], 6);\n addShifted(allWaysCache[6], allWaysCache[5], 6);\n cummulativeShift(allWaysCache[6], 6);\n\n //do I want to add them together?\n //I think I do,\n for (int i = 0; i < 6; i++){\n for (int j = 0; j <= NumToCheck; j++){\n allWaysCache[6][j] += allWaysCache[i][j];\n }\n }\n addShifted(allWaysCache[5], allWaysCache[1], 0);\n addShifted(allWaysCache[5], allWaysCache[2], 0);\n addShifted(allWaysCache[4], allWaysCache[0], 0);\n addShifted(allWaysCache[4], allWaysCache[2], 0);\n addShifted(allWaysCache[3], allWaysCache[0], 0);\n addShifted(allWaysCache[3], allWaysCache[1], 0);\n for (int i = 0; i <= 6; i++){\n allWaysCache[i][0] = 1;\n }\n\n }",
"int getCacheConcurrency();",
"public synchronized long getEntries() {\n return entries;\n }"
]
| [
"0.630643",
"0.6176665",
"0.6114453",
"0.5996576",
"0.59546196",
"0.5949067",
"0.5948578",
"0.5926955",
"0.59101796",
"0.5887301",
"0.5882453",
"0.5875369",
"0.58752096",
"0.58708924",
"0.58545583",
"0.5827432",
"0.5827432",
"0.5827362",
"0.5819448",
"0.58157134",
"0.5813344",
"0.5803077",
"0.5782032",
"0.57668644",
"0.571818",
"0.5694376",
"0.56758136",
"0.5667297",
"0.5659004",
"0.56399924",
"0.5634155",
"0.56277233",
"0.5626405",
"0.5622188",
"0.5622038",
"0.5619158",
"0.56159794",
"0.5609298",
"0.5606698",
"0.56047565",
"0.56017756",
"0.5599541",
"0.55984586",
"0.55775875",
"0.55709577",
"0.556105",
"0.55606556",
"0.55243075",
"0.5516786",
"0.5513454",
"0.5507984",
"0.54971325",
"0.54961",
"0.54770327",
"0.54723454",
"0.54525805",
"0.5447606",
"0.5447174",
"0.5433093",
"0.54256976",
"0.5425216",
"0.54228044",
"0.5420942",
"0.54090095",
"0.5400362",
"0.5398066",
"0.53945225",
"0.53887075",
"0.5384901",
"0.5375597",
"0.5373845",
"0.53649527",
"0.5363122",
"0.5360404",
"0.53600323",
"0.535441",
"0.5352767",
"0.5349269",
"0.5345609",
"0.53423566",
"0.533043",
"0.5321691",
"0.531218",
"0.5309587",
"0.53029305",
"0.5292882",
"0.5287964",
"0.5284892",
"0.52829546",
"0.5282509",
"0.52823365",
"0.527341",
"0.5273099",
"0.52729124",
"0.52651095",
"0.52610034",
"0.5254293",
"0.5253738",
"0.52537173",
"0.52489734",
"0.52435493"
]
| 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void keyTyped(KeyEvent arg0) {
} | {
"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 appends the data to the text area. | public void showInfo(String data) {
textArea.append(data);
try{
int len=textArea.getText().length();
textArea.setCaretPosition(len);
}
catch(Exception E){
E.printStackTrace();
}
this.getContentPane().validate();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void appendText(String text) {\n textArea.appendText(text);\n }",
"public void append(String text)\n{\n\ttextArea().append(text);\n}",
"private void putDataToTextArea() {\n jTextArea1.setEditable(false);\n jTextArea1.setText(selectedFoods);\n }",
"private void appendText()\n\t{\n\t\tString fieldText = \"\";\n\t\tString newText = \"\";\n\t\tfieldText = entry.getText();\n\t\t\n\t\tif(fieldText.equals (\"0\"))\n\t\t{\n\t\t\tnewText += append;\n\t\t\tfieldText = newText;\n\t\t\tentry.setText (fieldText);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfieldText += append;\n\t\t\tentry.setText (fieldText);\n\t\t}\n\t\t\n\t\tentry.grabFocus ( );\n\t\t\n\t}",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\ttextArea.setText(textArea.getText()+\"\\n\"+s);\n\t\t\t}",
"public void addContent(String msg) {\n\t\tthis.textArea.append(msg + \"\\n\");\r\n\t}",
"@Override\n public void actionPerformed(ActionEvent e) {\n String text = tweetInsertTextBox.getText();\n if (text != null && text.length() > 0) {\n jTextAreaTweets.setText(jTextAreaTweets.getText() + text + \"\\n\");\n tweetInsertTextBox.setText(\"\");\n jTextAreaTweets.setRows(jTextAreaTweets.getLineCount());\n tweetList.add(text);\n //f1.validate();\n }\n }",
"private void popupMenuAppendData() {\n\t\t//\n\t\t// Display the dialog\n\t\t//\n\t\tAddDataDialog addDataDialog = new AddDataDialog(table.getShell(), Messages.HexEditorControl_48, HexEditorConstants.DIALOG_TYPE_APPEND);\n\t\tif (addDataDialog.open() != Window.OK)\n\t\t\treturn;\n\t\tint[] addDialogResult = addDataDialog.getResult();\n\n\t\tif (addDialogResult == null) {\n\t\t\t//\n\t\t\t// Cancel button pressed - do nothing\n\t\t\t//\n\t\t\treturn;\n\t\t}\n\n\t\t//\n\t\t// Retrieve the parameters from the 'Insert' dialog\n\t\t//\n\t\tint dataSize = addDialogResult[0];\n\t\tint dataValue = addDialogResult[1];\n\n\t\tif (dataSize <= 0) return;\n\n\t\t//\n\t\t// Append new bytes into the table\n\t\t//\n\t\tappendData(dataSize, dataValue);\n\n\t\t//\n\t\t// Update the status panel\n\t\t//\n\t\tupdateStatusPanel();\n\t}",
"public static void updateTextArea(String text) {\n\t\tchat.append(text);\n\t\tchat.setCaretPosition(chat.getDocument().getLength());\n\t}",
"public void addTextArea(String text) throws BadLocationException {\n\t\tcurrentTextArea = new JTextArea(text == null ? \"\" : text);\n AbstractDocument document = (AbstractDocument) currentTextArea.getDocument();\n document.setDocumentFilter(new Filter());\n\t\tcurrentTextArea.setBorder(BorderFactory.createLineBorder(Color.white));\n\t\tcurrentTextArea.setSize(750,2);\n\t\tcontainer.add(currentTextArea);\n\t\tcurrentTextArea.requestFocusInWindow();\n\t\tcurrentTextArea.setCaretPosition(currentTextArea.getDocument().getLength());\n\n\t\tcurrentTextArea.addKeyListener(new java.awt.event.KeyAdapter() {\n\t\t\tpublic void keyPressed(java.awt.event.KeyEvent evt) {\n\t\t\t\ttry {\n\t\t\t\t\tjTextArea1WriteCommand(evt);\n\t\t\t\t} catch (BadLocationException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\trefreshView();\n\t}",
"public void addTextAreaValue(String str){\n\t\tcenterPanel.addTextAreaValue(str);\n\t}",
"@Override\n\t\tpublic void addText(String txt) {\n\t\t\t\n\t\t}",
"@Override\n public void paste() {\n //if the cursor position is not at the start of a new line add the new line symbol before the pasted text\n if (!(keywordTextArea.getDocument().getLength()==0) && !keywordTextArea.getText().endsWith(\"\\n\")) {\n keywordTextArea.append(System.getProperty(\"line.separator\"));\n }\n keywordTextArea.setCaretPosition(keywordTextArea.getDocument().getLength());\n super.paste(); \n }",
"public static void fillTextArea() {\r\n\t\tString choice = (String) comboBox.getSelectedItem();\r\n\t\tStatement statement;\r\n\t\ttry {\r\n\t\t\tstatement = connection.createStatement();\r\n\t\t\tresults = statement\r\n\t\t\t\t\t.executeQuery(\"Select People.PeopleName,paragraph.text \"\r\n\t\t\t\t\t\t\t+ \"From People \" + \"inner join paragraph \"\r\n\t\t\t\t\t\t\t+ \"on People.peopleKey=paragraph.peopleKey \"\r\n\t\t\t\t\t\t\t+ \"where PeopleName = '\" + choice + \"'\");\r\n\r\n\t\t\tparagraphtextArea.setText(\"\");\r\n\t\t\tparagraphtextArea.setEditable(true);\r\n\t\t\twhile (results.next()) {\r\n\t\t\t\tparagraphtextArea.append(results.getString(\"text\"));\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"public void appendText(String text) {\n\t\ttry {\n\t\t\tDocument doc = getDocument();\n\n\t\t\t// Move the insertion point to the end\n\t\t\tsetCaretPosition(doc.getLength());\n\n\t\t\t// Insert the text\n\t\t\treplaceSelection(text);\n\n\t\t\t// Convert the new end location\n\t\t\t// to view co-ordinates\n\t\t\tRectangle r = modelToView(doc.getLength());\n\n\t\t\t// Finally, scroll so that the new text is visible\n\t\t\tif (r != null) {\n\t\t\t\tscrollRectToVisible(r);\n\t\t\t}\n\t\t} catch (BadLocationException e) {\n\t\t\tSystem.out.println(\"Failed to append text: \" + e);\n\t\t}\n\t}",
"@Override\n\tpublic void append(String str) {\n\t\ttry {\n\t\t\ttextarea.append(BULLET + str + ENDLINE);\n\t\t} catch(NullPointerException e) {\n\t\t\ttextarea.setText(null);\n\t\t}\n\t}",
"private void updateTextAreaLenght() {\n //\n }",
"@Override\r\n\tpublic DTextArea add(final String value) throws DOMException {\r\n\t\tsuper.add(value) ;\r\n\t\treturn this ;\r\n\t}",
"public void addDataLine(String line) {\n this.data.textProperty().set(\n String.format(\n \"%s\\n%s\",\n this.data.textProperty().get(),\n line\n )\n );\n }",
"public static void addTextToLog(String str, TextArea txtAreaMsg) {\n\t\tPlatform.runLater(() -> txtAreaMsg.appendText(str));\n\t}",
"private void syncContent() {\n \tdocument.setContent(textArea.getText());\n }",
"@Override\n public void actionPerformed(ActionEvent e) {\n String text = tagIdInsertTextBox.getText();\n if (text != null && text.length() > 0) {\n jTextAreaId.setText(jTextAreaId.getText() + \"\\n\" + text);\n tagIdInsertTextBox.setText(\"\");\n jTextAreaId.setRows(jTextAreaId.getLineCount());\n //f1.validate();\n }\n }",
"public static void editTextArea(String context) {\r\n\t\ttextArea.append(context+\"\\n\");\r\n\t}",
"public void run () {\n\t\t\t\t//This is the method that gets called everytime the GUI needs to be updated.\n\t\t\t\t\n\t\t\t\tchatWindow.append(text);\n\t\t\t\t\n\t\t\t\t\n\t\t\t}",
"private void saveData( ) throws IOException {\n \tString FILENAME = \"data_file\";\n String stringT = Long.toString((SystemClock.elapsedRealtime() - timer.getBase())/1000)+\"\\n\";\n String stringS = textView.getText().toString()+\"\\n\";\n String stringD = Long.toString(System.currentTimeMillis())+\"\\n\";\n FileOutputStream fos;\n\t\ttry {\n\t\t\tfos = openFileOutput(FILENAME, Context.MODE_APPEND); //MODE_APPEND\n\t\t\tfos.write(stringS.getBytes());\n\t\t\tfos.write(stringT.getBytes());\n\t\t\tfos.write(stringD.getBytes());\n\t\t\tfos.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n }",
"public void appendChatBox(String s){\r\n\t\tsynchronized(msgToAppend){ // synchronized to maintain thread-safety\r\n\t\t\tmsgToAppend.append(s);\r\n\t\t\ttextArea.append(msgToAppend.toString() + \"\\n\");\r\n\t\t\tmsgToAppend.setLength(0);\r\n\t\t}\r\n\t}",
"public void appendToText(String text) {\n if(this.text == null)\n this.text = new StringBuilder();\n if(StringUtils.hasLength(text))\n this.text.append(text);\n }",
"public static void putTextDatatoClipBoard(String textData) {\n\t\tLog.d(TAG, \"66666,textData = \" + textData);\n\t\t// ClipData clip = ClipData.newPlainText(\"simple text\",textData);\n\t\tmClipboard.setPrimaryClip(ClipData.newPlainText(\"data\", textData));\n\t\t// getTextDataFromClipBoard();\n\n\t}",
"void updateTextArea(final String text) {\r\n\t\tSwingUtilities.invokeLater(new Runnable() {\r\n\t\t\tpublic void run() {\r\n\t\t\t\tJCoresConsole.this.textArea.append(text);\r\n\t\t\t}\r\n\t\t});\r\n\t}",
"@Override\n public void log(String text) {\n jTextAreaLog.append(text+\"\\n\");\n }",
"void append(String text);",
"void append(String text);",
"public void addNewQuestionInputTextArea(final String question) {\n if (isQuestionEditMode || getQuestions().isEmpty()) {\n if (getNumberOfQuestions() <= (MAX_NUMBER_OF_QUESTIONS - 1)) {\n UIComponent questionsPanel = FacesContext.getCurrentInstance().getViewRoot().findComponent(\"tabsView:tabViewTasksSettings:viewEditPerformanceAppraisalSettingForm:questionsPerformanceAppraisalPanel\");\n ResourceBundle resourceBundle = PropertyResourceBundle.getBundle(\"messages/messages\");\n//\n// /*****************************QUESTION*TEXT*AREA***************************************************/\n// OutputLabel outputLabel = new OutputLabel();\n// outputLabel.setValue(String.format(\"%d. %s\", questions.indexOf(question) + 1, question));\n// outputLabel.setValueExpression(\"rendered\",\n// createValueExpression(\"#{!performanceAppraisalSettingBean.questionEditMode}\", boolean.class));\n// outputLabel.setStyle(\"width:310px;height:auto\"); //width:335px - default\n//\n// InputTextarea inputTextarea = new InputTextarea();\n// inputTextarea.setId(\"question\" + getNumberOfQuestions());\n// inputTextarea.setRows(1);\n// inputTextarea.setCols(56);\n// inputTextarea.setStyle(\"width:310px;height:auto\"); //width: 335px - default\n// inputTextarea.setValueExpression(\"rendered\",\n// createValueExpression(\"#{performanceAppraisalSettingBean.questionEditMode}\", boolean.class));\n// inputTextarea.setValue(question);\n// inputTextarea.addValidator(new QuestionValidator());\n//\n// AjaxBehavior ajaxBehavior = new AjaxBehavior();\n// ajaxBehavior.setUpdate(\"questionMessage\" + getNumberOfQuestions() + \", performanceAppraisalSettingSave\");\n// inputTextarea.addClientBehavior(\"keyup\", ajaxBehavior);\n// /**************************************************************************************************/\n//\n// column.getChildren().add(outputLabel);\n// column.getChildren().add(inputTextarea);\n//\n// row.getChildren().add(column);\n//\n// questionsPanel.getChildren().add(row);\n\n Row rowMessage = new Row();\n Column columnMessage = new Column();\n columnMessage.setStyle(\"height:30px!important\");\n Message message = new Message();\n message.setFor(\"question\" + getNumberOfQuestions());\n message.setId(\"questionMessage\" + getNumberOfQuestions());\n message.setDisplay(\"text\");\n columnMessage.getChildren().add(message);\n\n rowMessage.getChildren().add(columnMessage);\n\n questionsPanel.getChildren().add(rowMessage);\n\n setNumberOfQuestions(getNumberOfQuestions() + 1); //add one more question | need to iterate all questions and check max of questions\n } else {\n ResourceBundle resourceBundle = PropertyResourceBundle.getBundle(\"messages/messages\");\n String lastQuestionId = \"question\" + (MAX_NUMBER_OF_QUESTIONS - 1);\n FacesContext.getCurrentInstance().addMessage(\"tabsView:tabViewTasksSettings:viewEditPerformanceAppraisalSettingForm:\" + lastQuestionId,\n new FacesMessage(FacesMessage.SEVERITY_ERROR, \"\", resourceBundle.getString(\"AdminTask.PerformanceAppraisal.MaxNumberQuestions\")));\n }\n }\n }",
"private JTextArea getJTextFieldData() {\r\n\t\tif (jTextAreaData == null) {\r\n\t\t\tjTextAreaData = new JTextArea();\r\n\t\t\tjTextAreaData.setForeground(new Color(0, 0, 204));\r\n\t\t\tjTextAreaData.setFont(new Font(\"微软雅黑\", Font.PLAIN, 13));\r\n\t\t}\r\n\t\treturn jTextAreaData;\r\n\t}",
"public void textLogger(String text) {\n loggerTextarea.append(text + \"\\n\");\n }",
"private void generateTextArea()\n {\n //Clear the textArea\n textArea.selectAll();\n textArea.replaceSelection(\"\");\n\n MyCircle circle = panel.getCircle();\n\n //Add all of the required information to the textarea\n textArea.append(String.format(\"AREA: %.2f %n\", circle.getArea()));\n textArea.append(\"RADIUS: \"+circle.getRadius()+\"\\n\");\n textArea.append(\"DIAMETER: \"+circle.getDiameter()+\"\\n\");\n textArea.append(String.format(\"CIRCUMFERENCE: %.2f %n\", circle.getCircumference()));\n }",
"public void addText(String text) {\n resultsText.append(text);\n }",
"private void writeTextArea(){\r\n try\r\n {\r\n //Fill in \"textArea\" with club names and results\r\n textArea.appendText(\"OK: \" + choiceHomeTeam.getValue() + \" - \" + choiceAwayTeam.getValue() + \" \" \r\n + Integer.valueOf(finalTimeHomeScore.getText()) + \":\"\r\n + Integer.valueOf(finalTimeAwayScore.getText()) + \"(\" \r\n + Integer.valueOf(halfTimeHomeScore.getText()) + \":\" \r\n + Integer.valueOf(halfTimeAwayScore.getText()) + \")\\n\");\r\n textArea.setWrapText(true);\r\n //the letters will be green\r\n textArea.setStyle(\"-fx-text-fill: #4F8A10;\"); \r\n }\r\n //Fill in \"textArea\" with erros\r\n catch(NumberFormatException e)\r\n {\r\n textArea.appendText(\"Error: \" + e.getMessage() + \"\\n\");\r\n textArea.setWrapText(true);\r\n //the letters will be red\r\n textArea.setStyle(\"-fx-text-fill: RED;\"); \r\n } \r\n }",
"public void pasteText(){\n try{\n CharSequence text = mClipboardManager.getTextFromClipboard();\n if(text != null && mConnection != null){\n mConnection.commitText(text, 0);\n }\n }catch(Exception e){\n e.printStackTrace();\n Toast.makeText(getContext(),e.toString(),Toast.LENGTH_SHORT).show();\n }\n }",
"@Override\r\n\tpublic DTextArea add(final DNode newChild) throws DOMException {\r\n\t\tsuper.add(newChild) ;\r\n\t\treturn this ;\r\n\t}",
"@Override\r\n\t\t\tpublic void run() {\n\t\t\t\tdisplayArea.append(messageToDisplay);\r\n\t\t\t\tdisplayArea.setCaretPosition(displayArea.getText().length());\t//把文本区域中的输入光标定位到文本区域中最后一个字符之后\r\n\t\t\t}",
"public void receberMensagem(String mensagem) {\n this.textArea.setText(textArea.getText() + mensagem);//Limpa a Tela do Computador\n this.textArea.appendText(\"\");//Descendo Scroll da tela do Computador\n }",
"public void refreshDatabaseTextArea() {\n\ttry {\n\tList<OfficesList> offices = db.showOffices();\n\tdatabaseTextArea.setText(\"\");\n\t\tfor (OfficesList officesList : offices) {\n\t\t\tdatabaseTextArea.append(officesList.getOfficeCode() + \": \" + officesList.getCity() + \", \" + officesList.getPhone() + \", \" + officesList.getAddressLine1() + \", \" + officesList.getAddressLine2() + \", \" + officesList.getState() + \", \" + officesList.getCountry() + \", \" + officesList.getPostalCode() + \", \" + officesList.getTerritory() + \"\\n\");\n\t\t}\n\t} catch (SQLException err) {\n\t\terr.printStackTrace();\n\t}\n}",
"public void addText(String texto) {\n\t\tthis.texto = texto == null ? \"\" : texto.trim();\n\t}",
"public void append(MConstText srcText) {\r\n replace(length(), length(), srcText, 0, srcText.length());\r\n }",
"void appendFlushed() throws IOException {\n synchronized (flushed) {\n if (flushed.length() > 0) {\n final String s = flushed.toString();\n flushed.setLength(0);\n Platform.runLater(() -> {\n textArea.appendText(s);\n int textLength = textArea.getText().length();\n if (textLength > MAX_TEXT_LENGTH) {\n textArea.setText(textArea.getText(textLength - MAX_TEXT_LENGTH / 2, textLength));\n }\n });\n }\n }\n }",
"@Override\n public void add_content() {\n Scanner _thisText = new Scanner(System.in);\n System.out.println(\"Enter Ad text:\");\n _adContent = _thisText.nextLine();\n }",
"public void addText(String text) {\n\t\tthis.text = text;\n\t}",
"public void append(String newText) {\n getLock().getWriteLock();\n try {\n SelectionSetter noChange = new SelectionSetter(SelectionSetter.DO_NOT_CHANGE);\n PTextBuffer buffer = getTextBuffer();\n buffer.replace(noChange, buffer.length(), 0, newText, noChange);\n } finally {\n getLock().relinquishWriteLock();\n }\n }",
"public void run()//actualiza areaPantalla \n {\n areaPantalla.append(mensajeAMostrar);\n areaPantalla.setCaretPosition(\n areaPantalla.getText().length());\n\n }",
"public void Write_data() {\n // add-write text into file\n try {\n FileOutputStream fileout=openFileOutput(\"savedata11.txt\", MODE_PRIVATE);\n OutputStreamWriter outputWriter=new OutputStreamWriter(fileout);\n outputWriter.write(Integer.toString(_cnt));\n outputWriter.close();\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"public final void writeText(String[] data) {\n myRow.setText(data);\n writeRow(myRow);\n }",
"public void setTextToTextArea(String message) {\r\n\t\ttextArea.setText(textArea.getText() + System.lineSeparator() + message);\r\n\t}",
"@Override\n public void onReceivedData(byte[] arg0) {\n String data;\n try {\n data = new String(arg0, \"UTF-8\");\n data.concat(\"/n\");\n tvAppend(textView, data);\n\n\n\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n }\n\n\n }",
"private static void append(String text) {\n // Print the same text to STDOUT\n System.out.println(text);\n\n try {\n outputFileBuffer.write(text+\"\\n\");\n outputFileBuffer.flush();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"@Override\r\n\tpublic DTextArea addRaw(final String value) throws DOMException {\r\n\t\tsuper.addRaw(value) ;\r\n\t\treturn this ;\r\n\t}",
"public void addText(String text) {\n this.historyTextLog.append(text);\n }",
"protected void addmore() \n\t{\t\n\t\tcall();\n\t\tstrwadd=wadds.getText().toString();\n\t\tstrcompadd=comadd.getText().toString();\n\t\tstrpadd=epah.getText().toString();\n\t\tstrnname=nn.getText().toString();\n\t\tstrbirth=bir.getText().toString();\n\t\tstrani=aniv.getText().toString();\n\t\tstrorgcw=eorgwc.getText().toString();\n\t\tstrorgco=eorgoc.getText().toString();\n\t\tstrorgpw=eorgwp.getText().toString();\n\t\tstrorgpo=eorgop.getText().toString();\n\t\tstrpaw=epaw.getText().toString();\n\t\tstrpao=epao.getText().toString();\n\t\tif(strwadd==null)\n\t\t{\n\t\t\tstrwadd=\"\";\n\t\t}\n\t\tif(strcompadd==null)\n\t\t{\n\t\t\tstrcompadd=\"\";\n\t\t}\n\t\tif(strnname==null)\n\t\t{\n\t\t\tstrnname=\"\";\n\t\t}\n\t\tif(strpadd==null)\n\t\t{\n\t\t\tstrpadd=\"\";\n\t\t}\n\t\tif(strpaw==null)\n\t\t{\n\t\t\tstrpaw=\"\";\n\t\t}\n\t\tif(strani==null)\n\t\t{\n\t\t\tstrani=\"\";\n\t\t}\n\t\tif(strbirth==null)\n\t\t{\n\t\t\tstrbirth=\"\";\n\t\t}\n\t\tif(strorgcw==null)\n\t\t{\n\t\t\tstrorgcw=\"\";\n\t\t}\n\t\tif(strorgco==null)\n\t\t{\n\t\t\tstrorgco=\"\";\n\t\t}\n\t\tif(strorgpo==null)\n\t\t{\n\t\t\tstrorgpo=\"\";\n\t\t}\n\t\tif(strpao==null)\n\t\t{\n\t\t\tstrpao=\"\";\t\n\t\t}\n\t\t//Inserts more info of contact to database \n\t\tdata.InsertMore(id,strwadd,strorgcw,strorgco,strorgpw,strorgpo,strorgcust,strcompadd, strnname, strpadd,strpaw,strpao,strpacust, strbirth, strani);\n\t\tToast.makeText(AddContact.this, \"Added Successfully\",Toast.LENGTH_SHORT).show();\n\t\tCursor c5=data.getMoreInfoData();\n\t\twhile(c5.moveToNext())\n\t\t{\n\t\t\tint a=c5.getInt(0);\n\t\t\tString c1=c5.getString(1);\n\t\t\tString d=c5.getString(2);\n\t\t\tString e=c5.getString(3);\n\t\t\tString e1=c5.getString(4);\n\t\t\tString e2=c5.getString(5);\n\t\t\tString e3=c5.getString(6);\n\t\t\tString e4=c5.getString(7);\n\t\t\tSystem.out.println(\"Id....\"+a);\n\t\t\tSystem.out.println(\"wadd....\"+c1);\n\t\t\tSystem.out.println(\"Comp....\"+d);\n\t\t\tSystem.out.println(\"Com Add....\"+e);\n\t\t\tSystem.out.println(\"Job....\"+e1);\n\t\t\tSystem.out.println(\"Nick name....\"+e2);\n\t\t\tSystem.out.println(\"Bday....\"+e3);\n\t\t\tSystem.out.println(\"Ani....\"+e4);\n\t\t}\n c5.close();\n\t\t\n\t}",
"@Override\t\r\n\t\tpublic void insertUpdate(DocumentEvent e) {\n\t\t\tMessage = t.getText();\r\n\t\t\t//t.getText().length()>\r\n\t\t\tcanvas.repaint();\r\n\t\t\t\r\n\t\t}",
"public void ajouterTexteEnQueue(String texte) {\r\n\t\tif (zoneAffichage.getText().length() == 0)\r\n\t\t\tzoneAffichage.setText(texte);\r\n\t\telse\r\n\t\t\tzoneAffichage.setText(zoneAffichage.getText() + \"\\n\" + texte);\r\n\t}",
"public Boolean appendChangesToExistingText() {\n return this.appendChangesToExistingText;\n }",
"public void addText(String text) {\n\t\tNodeList frameList = maNoteElement.getElementsByTagNameNS(OdfDocumentNamespace.DRAW.getUri(), \"frame\");\n\t\tif (frameList.getLength() > 0) {\n\t\t\tDrawFrameElement frame = (DrawFrameElement) frameList.item(0);\n\t\t\tNodeList textBoxList = frame.getElementsByTagNameNS(OdfDocumentNamespace.DRAW.getUri(), \"text-box\");\n\t\t\tif (textBoxList.getLength() > 0) {\n\t\t\t\tDrawTextBoxElement textBox = (DrawTextBoxElement) textBoxList.item(0);\n\t\t\t\tTextPElement newPara = textBox.newTextPElement();\n\t\t\t\tnewPara.setTextContent(text);\n\t\t\t}\n\t\t}\n\t}",
"TEXTAREA createTEXTAREA();",
"public void addTag(ActionEvent e) {\n\t\tStringBuilder finalText = new StringBuilder();\n\t\tinputText = new StringBuilder();\n\t\tparameters = outputArea.getText().split(\", \");\n\t\t// Get InputArea Text\n\t\tinputText.append(MainController.oldInput);\n\t\tString[] lines = inputText.toString().split(\"\\\\n\");\n\t\t// For each line of inputText...\n\t\tfor (int i = 0; i < lines.length; i++) {\n\t\t\tfinalText.append(lines[i]);\n\t\t\tif (i == MainController.caretValue) {\n\t\t\t\tswitch(active) {\n\t\t\t\t\tcase \"character\": finalText.append(addCharacter()); break;\n\t\t\t\t\tcase \"mood\": finalText.append(addMood()); break;\n\t\t\t\t\tcase \"animation\": finalText.append(addAnimation()); break;\n\t\t\t\t\tcase \"background\": finalText.append(addBackground()); break;\n\t\t\t\t\tcase \"effect\": finalText.append(addEffect()); break;\n\t\t\t\t\tcase \"music\": finalText.append(addMusic()); break;\n\t\t\t\t\tcase \"display\": finalText.append(addDisplay()); break;\n\t\t\t\t\tcase \"options\": finalText.append(addOptions()); break;\n\t\t\t\t\tcase \"void\": finalText.append(addVoid()); break;\n\t\t\t\t\tcase \"end\": finalText.append(addEnd()); break;\n\t\t\t\t\tcase \"title\":\n\t\t\t\t\t\tfinalText.append(addTitle(finalText) + \"\\n\");\n\t\t\t\t\t\tfinalText.append(\"|endTitle:\" + parameters[0]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"goto\": finalText.append(addGoto()); break;\n\t\t\t\t\tcase \"extra\": finalText.append(addExtra()); break;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfinalText.append(\"\\n\");\n\n\t\t}\n\n\t\tif (MainController.caretValue == lines.length) {\n\t\t\tswitch(active) {\n\t\t\t\tcase \"character\": finalText.append(addCharacter()); break;\n\t\t\t\tcase \"mood\": finalText.append(addMood()); break;\n\t\t\t\tcase \"animation\": finalText.append(addAnimation()); break;\n\t\t\t\tcase \"background\": finalText.append(addBackground()); break;\n\t\t\t\tcase \"effect\": finalText.append(addEffect()); break;\n\t\t\t\tcase \"music\": finalText.append(addMusic()); break;\n\t\t\t\tcase \"display\": finalText.append(addDisplay()); break;\n\t\t\t\tcase \"options\": finalText.append(addOptions()); break;\n\t\t\t\tcase \"void\": finalText.append(addVoid()); break;\n\t\t\t\tcase \"end\": finalText.append(addEnd()); break;\n\t\t\t\tcase \"goto\": finalText.append(addGoto()); break;\n\t\t\t\tcase \"extra\": finalText.append(addExtra()); break;\n\t\t\t}\n\t\t}\n\n\t\tif (active == \"title\" && MainController.caretValue >= lines.length) {\n\t\t\tfinalText.append(addTitle(finalText) + \"\\n\");\n\t\t\tfinalText.append(\"|endTitle:\" + parameters[0]);\n\t\t}\n\n\t\t//\t Append the current line to finalText.\n\t\t//\t If the current line == the caret's paragraph value, go through the switch\n\t\t// Append to InputArea\n\t\tMainController.oldInput = finalText.toString();\n\t\tchangeView(e);\n\t}",
"public void addText(String texto) {\n Platform.runLater(() -> {\n try {\n camadas.setExpandedPane(this);//Expandindo a camada\n //Thread.sleep(100);\n seta.setVisible(true);//Deixando a imagem da seta visivel\n seta.setLayoutY(posYSeta);//Alterando a posicao Y da seta\n textArea.setText(textArea.getText() + texto);//Adicionando o texto\n textArea.appendText(\"\");//Movendo o scroll bar da Area de texto\n } catch (Exception e) {\n e.printStackTrace();\n }\n });\n // Platform.runLater(new Runnable(){\n // @Override\n // public void run() {\n // try {\n // seta.setVisible(true);//Deixando a imagem da seta visivel\n // seta.setLayoutY(posYSeta);//Alterando a posicao Y da seta\n // textArea.setText(textArea.getText() + texto);//Adicionando o texto\n // textArea.appendText(\"\");//Movendo o scroll bar da Area de texto\n // } catch (Exception e) {\n // System.out.println(\"[ERRO] - Adicionar texto na \" + titulo);\n // e.printStackTrace();\n // }\n // }\n // });\n }",
"public void addText(String newText) {\n lb.setText(newText + \"\\n\" + lb.getText());\n instance.setVvalue(0);\n }",
"public void addText(String str) {\r\n\t\tdialog.setText(dialog.getText()+str);\r\n\t}",
"public TextAreaOutputStream( JTextArea control ) {\r\n textControl = control;\r\n }",
"public native void appendData(String arg) /*-{\r\n\t\tvar jso = [email protected]::getJsObj()();\r\n\t\tjso.appendData(arg);\r\n }-*/;",
"public void store(ArrayList<String> text){\r\n\t\tcopyText(text);\r\n\t\treadData();\r\n\t}",
"@Override\n protected void onPostExecute(String result) {\n temptext.setText(result+data);\n }",
"public void setLinedText(JTextArea textbox, ArrayList<String> ppltolist){\n String list = \" \";\n for (String fl : ppltolist){\n list = list.concat( fl + \"\\n\");\n }\n textbox.setText(list);\n textbox.setBorder(BorderFactory.createEmptyBorder(3, 5, 5, 5));\n textbox.setPreferredSize(new Dimension(400,7+ 17*ppltolist.size()));\n }",
"public void append(String str) {\n\t\tta.append(str);\n\t\tta.setCaretPosition(ta.getText().length() - 1);\n\t}",
"public void newLine() {\n text.append(\"\\n\");\n }",
"public void saveData() {\n\t\t//place to save notes e.g to file\n\t}",
"private void addToOutput(String text)\n {\n // If we only have a 0 in output, clear it\n if(\"0\".equals(textOutput.getText()) )\n {\n textOutput.setText(\"\");\n }\n textOutput.setText(textOutput.getText() + text);\n }",
"public void appendModelEvent(String text) {\n try {\n DateFormat dateFormat = new java.text.SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\");\n Date date = new Date();\n StyledDocument doc = screenTP.getStyledDocument();\n doc.insertString(doc.getLength(), formatForPrint(dateFormat.format(date) + \" - \" + text), doc.getStyle(\"modelEvent\"));\n screenTP.setCaretPosition(doc.getLength());\n } catch (BadLocationException ex) {\n AdaptationSuperviser.logger.error(\"Error while trying to append incoming message in the \" + this.getName(), ex);\n }\n }",
"protected void shoAddNewDataEditor () {\n\t\t\n\t\t\n\t\tinstantiateDataForAddNewTemplate(new AsyncCallback< DATA>() {\n\t\t\t@Override\n\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\t// ini tidak mungkin gagal\n\t\t\t\t\n\t\t\t}\n\t\t\t@Override\n\t\t\tpublic void onSuccess(final DATA result) {\n\t\t\t\teditorGenerator.instantiatePanel(new ExpensivePanelGenerator<BaseDualControlDataEditor<PK,DATA>>() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onPanelGenerationComplete(\n\t\t\t\t\t\t\tBaseDualControlDataEditor<PK, DATA> widget) {\n\t\t\t\t\t\tconfigureAndPlaceEditorPanel(widget);\n\t\t\t\t\t\twidget.requestDoubleSubmitToken(null);\n\t\t\t\t\t\twidget.addAndEditNewData(result);\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\t\n\t\t\n\t}",
"public void Addtxt (String txt) {\n clearZero();\n lastNumber = true;\n displayResult.setText(displayResult.getText()+txt);\n }",
"public void afterTextChanged(Editable s) {\n String d = edit.getText().toString();\n Log.d(\"data\",\"data:::::\"+d);\n txt1.setText(d);\n }",
"public void getText(){\n\t\tnoteText.setText(note.getText());\n\t}",
"private void viewExtractedData() {\n txtViewer.setText(extractedData);\n }",
"@Override\n public void onReceivedData(byte[] arg0) {\n String data = null;\n try {\n data = new String(arg0, \"UTF-8\");\n data.concat(\"/n\");\n tvAppend(textView, data);\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n }\n\n\n }",
"public void append(String str, String sender) {\n\t\tchatView.appendText(sender + \":\" + \"\\n\");\n\t\tchatView.appendText(str + \"\\n\\n\");\n\t\tchatView.selectPositionCaret(chatView.getText().length()-1);\n\t\tchatBox.setText(\"\");\n\t}",
"void addData();",
"private void displayData(String data) {\n if (data != null) {\n mTerminal.append((\"\\n\" + data));\n setShareIntent(mTerminal.getText().toString());\n }\n }",
"public void addField()\n {\n DefaultMutableTreeNode node = (DefaultMutableTreeNode) availableFieldsComp.getTree().getLastSelectedPathComponent();\n if (node == null || !node.isLeaf() || !(node.getUserObject() instanceof DataObjDataFieldWrapper) )\n {\n return; // not really a field that can be added, just empty or a string\n }\n\n Object obj = node.getUserObject();\n if (obj instanceof DataObjDataFieldWrapper)\n {\n DataObjDataFieldWrapper wrapper = (DataObjDataFieldWrapper) obj;\n String sep = sepText.getText();\n if (StringUtils.isNotEmpty(sep))\n {\n try\n {\n DefaultStyledDocument doc = (DefaultStyledDocument) formatEditor.getStyledDocument();\n if (doc.getLength() > 0)\n {\n doc.insertString(doc.getLength(), sep, null);\n }\n }\n catch (BadLocationException ble) {}\n \n }\n insertFieldIntoTextEditor(wrapper);\n setHasChanged(true);\n }\n }",
"public static void addTextToLog(String str) {\n\t\tif(!isTestMode)\n\t\tPlatform.runLater(() -> txtMsgArea.appendText(str));\t\n\t}",
"public AddData() {\n\t\tsuper();\n\t\tfilled = false;\n\t}",
"@Override\n public void write(char[] cbuf, int off, int len) throws IOException {\n if (textArea == null) {\n throw new IOException(\"Writer has already been closed!\");\n }\n String toWrite = String.copyValueOf(cbuf, off, len);\n textArea.appendText(toWrite);\n\n }",
"private void textInfoBottom(JPanel panel_TextInfo) {\n\t\tcontentPane.setLayout(gl_contentPane_1);\n\t\ttxtrPreparing = new JTextArea();\n\t\ttxtrPreparing.setBackground(Color.WHITE);\n\t\ttxtrPreparing.setText(\"Preparing... \");\n\t\t\n\t\tJTextArea textArea = new JTextArea();\n\t\ttextArea.setBackground(Color.WHITE);\n\t\ttextArea.setText(\" $10\");\n\t\tGroupLayout gl_panel_TextInfo = new GroupLayout(panel_TextInfo);\n\t\tgl_panel_TextInfo.setHorizontalGroup(\n\t\t\tgl_panel_TextInfo.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(gl_panel_TextInfo.createSequentialGroup()\n\t\t\t\t\t.addContainerGap()\n\t\t\t\t\t.addComponent(txtrPreparing, GroupLayout.PREFERRED_SIZE, 232, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t.addGap(18)\n\t\t\t\t\t.addComponent(textArea, GroupLayout.DEFAULT_SIZE, 228, Short.MAX_VALUE))\n\t\t);\n\t\tgl_panel_TextInfo.setVerticalGroup(\n\t\t\tgl_panel_TextInfo.createParallelGroup(Alignment.LEADING)\n\t\t\t\t.addGroup(gl_panel_TextInfo.createSequentialGroup()\n\t\t\t\t\t.addGroup(gl_panel_TextInfo.createParallelGroup(Alignment.BASELINE)\n\t\t\t\t\t\t.addComponent(txtrPreparing, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)\n\t\t\t\t\t\t.addComponent(textArea, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))\n\t\t\t\t\t.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n\t\t);\n\t\tpanel_TextInfo.setLayout(gl_panel_TextInfo);\n\t}",
"private void setupTextArea() {\n\t\tcourseInfo = new JTextPane();\n\t\tinfoScrollPane = new JScrollPane(courseInfo);\n\t\tinfoScrollPane.setPreferredSize(new Dimension(350, 175));\n\t\tcourseInfo.setEditable(false);\n\t\tdisplay.add(infoScrollPane);\n\t}",
"public void appendLine() {\n\t\t\tmBuilder.append(NewLineChar);\n\t\t\tlastAppendNewLine = true;\n\t\t}",
"public void addText(String clientMessage) {\n\t\tif(clientMessage != null)\n\t\t\ttextArea.append(clientMessage + \"\\n\");\n\t}",
"private void flushImpl() {\r\n String s = null;\r\n\r\n // grab data from the buffer\r\n synchronized (this) {\r\n if (buffer.length() > 0) {\r\n s = buffer.toString();\r\n buffer.setLength(0);\r\n }\r\n }\r\n\r\n // don't do anything if buffer was empty\r\n if (s != null) {\r\n try {\r\n boolean scroll = false;\r\n Document d = textViewer.getDocument();\r\n int docLen = d.getLength();\r\n if (docLen > 0) {\r\n scroll = (textViewer.getCaretPosition() >= (docLen-1));\r\n }\r\n\r\n // Insert new text:\r\n d.insertString(d.getLength(), s, attributes);\r\n\r\n // Is number of lines limited?\r\n if (isSizeLimited() && docLen > getMaxSize()) {\r\n Element root = d.getDefaultRootElement();\r\n int i = root.getElementIndex(docLen - getMaxSize());\r\n if (i >= 0) {\r\n Element e = root.getElement(i);\r\n int offset = e.getEndOffset();\r\n d.remove(0,Math.min(offset,docLen));\r\n }\r\n }\r\n\r\n // Scroll view to the end only if cursor was at the end:\r\n if (scroll) {\r\n textViewer.setCaretPosition(d.getLength());\r\n }\r\n\r\n // Update summary view:\r\n if (summaryView != null && d.getLength() > 0) {\r\n Element root = d.getDefaultRootElement();\r\n int n = root.getElementCount();\r\n if (n > 0) {\r\n Element last = root.getElement(n-1);\r\n int start = last.getStartOffset();\r\n int end = last.getEndOffset();\r\n if ((end-start) <= 1 && n > 1) {\r\n last = root.getElement(n-2);\r\n start = last.getStartOffset();\r\n end = last.getEndOffset();\r\n }\r\n\r\n AttributeSet a = last.getAttributes();\r\n Object fg = a.getAttribute(StyleConstants.Foreground);\r\n Object bg = a.getAttribute(StyleConstants.Background);\r\n if (!(fg instanceof Color)) {\r\n fg = LookFactory.getCodeColorSet().foregroundColor;\r\n }\r\n if (!(bg instanceof Color)) {\r\n bg = LookFactory.getCodeColorSet().backgroundColor;\r\n }\r\n summaryView.setForeground((Color)fg);\r\n summaryView.setBackground((Color)bg);\r\n\r\n String text = d.getText(start,end-start);\r\n if (text.length() > 0) {\r\n summaryView.setText(text);\r\n } else {\r\n summaryView.clear();\r\n }\r\n }\r\n }\r\n\r\n // Write the file:\r\n if (fileWriter != null) {\r\n char lastChar = lastFileChar;\r\n int len = s.length();\r\n for (int i=0; i<len; i++) {\r\n char c = s.charAt(i);\r\n if (c == '\\n') {\r\n if (lastFileChar == '\\r') {\r\n fileWriter.write(c);\r\n } else {\r\n // Use platform-specific end of line seq\r\n fileWriter.println();\r\n }\r\n } else {\r\n fileWriter.write(c);\r\n }\r\n lastChar = c;\r\n }\r\n\r\n lastFileChar = lastChar;\r\n fileWriter.flush();\r\n }\r\n\r\n } catch(Exception ex) {\r\n ex.printStackTrace();\r\n }\r\n }\r\n }",
"public TextBuilder addStaticText(String text){\n if(lastText != null){\n lastText.clear();\n }\n lastText = new TextBuilder(text);\n return lastText;\n }",
"public final void addText(final String textContent) {\n\t\tthis.text = textContent.trim();\n\t\tif (this.text.length() == 0) {\n\t\t\tthis.text = null;\n\t\t}\n\t}",
"public void setAreaText(String text) {\n description.setText(text);\n }",
"public void setText(String text) {\n this.textData = text;\n }",
"Builder addText(Text value);"
]
| [
"0.7136216",
"0.7075024",
"0.6854716",
"0.65133756",
"0.64261025",
"0.626857",
"0.6255529",
"0.62172204",
"0.61878014",
"0.61807764",
"0.6175745",
"0.6152242",
"0.602664",
"0.5995581",
"0.5975765",
"0.5942714",
"0.59421164",
"0.5906028",
"0.5881664",
"0.5880486",
"0.5867352",
"0.58669245",
"0.5852489",
"0.582348",
"0.5813228",
"0.5811257",
"0.5806092",
"0.5750564",
"0.575013",
"0.5724168",
"0.571131",
"0.571131",
"0.5710236",
"0.5694372",
"0.5693782",
"0.56896406",
"0.56895334",
"0.5681035",
"0.5678897",
"0.56667984",
"0.56511885",
"0.56438184",
"0.5624066",
"0.56078154",
"0.55965954",
"0.5594788",
"0.5590004",
"0.5569818",
"0.5567383",
"0.556136",
"0.555251",
"0.5551039",
"0.55342364",
"0.5525757",
"0.5523679",
"0.5508745",
"0.55007905",
"0.55007625",
"0.54984164",
"0.549443",
"0.54870147",
"0.54785717",
"0.5477881",
"0.5474318",
"0.5471773",
"0.5462611",
"0.5459226",
"0.5459006",
"0.54544693",
"0.54375297",
"0.54300857",
"0.54250824",
"0.54246044",
"0.54103446",
"0.5404302",
"0.54036266",
"0.54026985",
"0.5401486",
"0.5401161",
"0.5393115",
"0.53810084",
"0.53697914",
"0.53695536",
"0.53678364",
"0.53628516",
"0.53505486",
"0.5349548",
"0.5329556",
"0.5317893",
"0.53081423",
"0.52962184",
"0.52939594",
"0.5292292",
"0.5291433",
"0.52851313",
"0.52837795",
"0.5278992",
"0.5263564",
"0.5260334",
"0.52544105"
]
| 0.6439548 | 4 |
Sole constructor of the class. It must provide a board with chips on it. The column represents the thrown attempt of the player that generated the state. | public BoardCandidate(Connect4Cell[][] board, int column, CellStatus player){
//Deep copy of the board.
this.board = new Connect4Cell[6][];
for(int x=0;x<6;x++){
this.board[x]=new Connect4Cell[7];
for(int y=0;y<7;y++){
this.board[x][y]=new Connect4Cell(null,x,board[x][y].getCellStatus());
if(board[x][y].isPlayed()){
this.board[x][y].setCellStatusPlayed(board[x][y].getCellStatus());
}
}
}
this.column=column;
this.player=player;
//simulates the play
play(column);
//calculates the grade of the current state of the board
this.grade = this.getStatusGrade(player);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Battleship(int row) {\r\n\t\tthis(row, 5);\r\n\t}",
"public Tile(int row, int column){\n this.row = row;\n this.column = column;\n this.piece = null;\n }",
"public Cell(int col, int row){ // constructor\n this.col = col;\n this.row = row;\n }",
"public Piece(int a_row, int a_col)\n {\n this.tileLocation = Pair.create(a_row,a_col);\n }",
"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 Cell(int row, int column){\r\n this.row = row;\r\n this.column = column;\r\n }",
"public ChessModel(int r, int c, ArrayList<Integer> s){\n Rows = r;\n Cols = c;\n start = s;\n curBoard = s;\n clearStack();\n }",
"public Board()\r\n\t{\r\n\t\tthis.grid = new CellState[GRID_SIZE][GRID_SIZE];\r\n\t\tthis.whiteMarblesCount = MARBLES_COUNT;\r\n\t\tthis.blackMarblesCount = MARBLES_COUNT;\r\n\t\t\r\n\t\t/**\r\n\t\t * Initializes the board with empty value\r\n\t\t */\r\n\t\tfor (int indexcol = 0; indexcol < GRID_SIZE; indexcol++)\r\n\t\t{\r\n\t\t\tfor (int indexrow = 0; indexrow < GRID_SIZE; indexrow++)\r\n\t\t\t{\r\n\t\t\t\tthis.grid[indexrow][indexcol] = CellState.EMPTY;\t\t\t\t\r\n\t\t\t}\t\r\n\t\t}\r\n\t\t\r\n\t\t/**\r\n\t\t * Sets marbles on the board with default style\r\n\t\t */\r\n\t\tfor (int indexcol = 0; indexcol < 5; indexcol++)\r\n\t\t{\r\n\t\t\tthis.grid[0][indexcol] = CellState.WHITE_MARBLE;\r\n\t\t\tthis.grid[8][8 - indexcol] = CellState.BLACK_MARBLE;\r\n\t\t}\r\n\t\tfor (int indexcol = 0; indexcol < 6; indexcol++)\r\n\t\t{\r\n\t\t\tthis.grid[1][indexcol] = CellState.WHITE_MARBLE;\r\n\t\t\tthis.grid[7][8 - indexcol] = CellState.BLACK_MARBLE;\r\n\t\t}\r\n\t\tfor (int indexcol = 2; indexcol < 5; indexcol++)\r\n\t\t{\r\n\t\t\tthis.grid[2][indexcol] = CellState.WHITE_MARBLE;\r\n\t\t\tthis.grid[6][8 - indexcol] = CellState.BLACK_MARBLE;\r\n\t\t}\r\n\t\tthis.grid[3][8] = CellState.INVALID;\r\n\t\tthis.grid[2][7] = CellState.INVALID;\r\n\t\tthis.grid[1][6] = CellState.INVALID;\r\n\t\tthis.grid[0][5] = CellState.INVALID;\r\n\t\tthis.grid[5][0] = CellState.INVALID;\r\n\t\tthis.grid[6][1] = CellState.INVALID;\r\n\t\tthis.grid[7][2] = CellState.INVALID;\r\n\t\tthis.grid[8][3] = CellState.INVALID;\r\n\t}",
"private MyGameState(int[][] board, int turn) {\n this.board = board;\n this.turn = turn;\n }",
"public Board(int x, int y){\n player1 = \"Player 1\";\n player2 = \"Player 2\";\n randomPlayer1 = \"CPU 1\";\n randomPlayer2 = \"CPU 2\";\n board = new Square[x][y];\n for (int i = 0; i < board.length;i++){\n row++;\n for(int j = 0; j < board.length; j++){\n if(column == y){\n column = 0;\n }\n column++;\n board[i][j] = new Square(row, column);\n }\n }\n row = x;\n column = y;\n }",
"public Board()\r\n\t{\r\n\t\tsuper(8, 8);\r\n\t}",
"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 Board(int rows, int columns) throws Exception {\n\t\tif (rows >= 8 && columns >= 8) {\n\t\t\tthis.rows = rows;\n\t\t\tthis.columns = columns;\n\t\t\tboard = new int[rows][columns];\n\t\t\tthis.bombs = (rows * columns) / 3;\n\t\t\tfillBoard();\n\t\t} else {\n\t\t\tthrow new Exception(\"Minesweeper dimensions invalid:\\nWidth: from 8 to 100\\nHeight: from 8 to 100\\nBombs: 1 to 1/3 of squares\");\n\t\t}\n\t}",
"Piece(int row, int col, int player) {\n this(row, col);\n if (player == 0 || player == 1)\n this.player = player;\n }",
"public BoardImpl() {\r\n List<Die> remainingDice = new ArrayList<Die>(Die.ALL_DICE);\r\n for (int row = 0; row < BOARD_ROWS; row++) {\r\n for (int column = 0; column < BOARD_COLUMNS; column++) {\r\n Die nextDie = remainingDice.remove(RAND.nextInt(remainingDice.size()));\r\n _cells[row][column] = nextDie.throwDie();\r\n }\r\n }\r\n }",
"public GameState(Cell[][] board, int difficulty, int mines) {\n\t\tthis.board = board;\n\t\tthis.dimensions = board.length;\n\t\tthis.difficulty = difficulty;\n\t\tthis.mines = mines;\n\t}",
"public Seat(int row, int col, Status status){\n this.row = row;\n this.col = col;\n this.status = status;\n }",
"public Cell(int state) {\n \t\tthis.state = state;\n \t}",
"public Board(int rows, int cols) {\n\t\t_board = new ArrayList<ArrayList<String>>();\n\t\t_rand = new Random();\n\t\t_colorFileNames = new ArrayList<String>();\n\t\tfor (int i=0; i<MAX_COLORS; i=i+1) {\n\t\t\t_colorFileNames.add(\"Images/Tile-\"+i+\".png\");\n\t\t}\n\t\tfor (int r=0; r<rows; r=r+1) {\n\t\t\tArrayList<String> row = new ArrayList<String>();\n\t\t\tfor (int c=0; c<cols; c=c+1) {\n\t\t\t\trow.add(_colorFileNames.get(_rand.nextInt(_colorFileNames.size())));\n\t\t\t}\n\t\t\t_board.add(row);\n\t\t\t\n\t\t\tif(_board.size()==rows) { //board is complete\n\t\t\t\tboolean istrue = false;\n\t\t\t\tif(match(3).size()>0 || end()){ //(1)there are match //(2)there is no valid move\n\t\t\t\t\tistrue = true;\n\t\t\t\t}\n\t\t\t\tif (istrue) {\n\t\t\t\t\t_board.clear();\t\t// if istrue clear the board\n\t\t\t\t\tr=-1;\t\t\t\t// restart; r=-1, at the end of loop will add 1\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\t\t\n\t}",
"public Game(int[][] chips) {\n board = new FourBoard();\n board.setChips(chips);\n }",
"public ColumnRow ()\r\n {\r\n super();\r\n }",
"public BoardCell(int x, int y){\n xCor=x;\n yCor=y;\n }",
"public Cell(int x,int y){\r\n this.x = x;\r\n this.y = y;\r\n level = 0;\r\n occupiedBy = null;\r\n }",
"public Cell(String state, int x, int y) {\n this.state = state;\n this.nextState = state;\n this.coordinate = new Point(x, y);\n }",
"public Board(int row, int column, int countToWin) {\n\t\tintializeBoard(row, column, countToWin);\n\t}",
"public Cell(int row, int col) {\n\t\talive = false;\n\t\tmyRow = row;\n\t\tmyCol = col;\n\t\tneighbors = new ArrayList<>();\n\t}",
"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 Board(Character[][] matrix) {\n this.matrix = matrix;\n }",
"public JumbleBoard()\n {\n }",
"public JumbleBoard(char[][] dice, int rows, int cols)\n {\n this.dice = dice;\n this.rows = rows;\n this.cols = cols;\n }",
"public Monster(Game game, int row, int col)\n\t{\n\t\tthis.game = game;\n\t\tthis.row = row;\n\t\tthis.col = col;\n\t}",
"public GameBoard() {\n this.gameStarted = false;\n this.turn = 1; \n this.boardState = new char[3][3];\n this.winner = 0; \n this.isDraw = false; \n\n }",
"public Board() {\n this.x = 0;\n this.o = 0;\n }",
"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 Board(int rows, int cols) { \n\t\tcaveArray = new Cave[rows][cols];\n\t\trow = rows;\n\t\tcolumns = cols;\n\t\tfor(int i = 0; i < row; i++) {\n\t\t\tfor (int j = 0; j < columns; j++) {\n\t\t\t\tdouble rand = Math.random() * 1001;\n\t\t\t\tif(rand <= 100) {\n\t\t\t\t\tcaveArray[i][j] = new Cave(i,j);\n\t\t\t\t\tcaveArray[i][j].makeOpen();\n\t\t\t\t}\n\t\t\t\telse if (rand >= 650) {\n\t\t\t\t\tcaveArray[i][j] = new Cave(i,j);\n\t\t\t\t\tcaveArray[i][j].makeBlocked();\n\t\t\t\t}\n\t\t\t\telse if (rand > 100 && rand < 500) {\n\t\t\t\t\tcaveArray[i][j] = new Cave(i,j);\n\t\t\t\t\tcaveArray[i][j].makePit();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcaveArray[i][j] = new Cave(i,j);\n\t\t\t\t\tcaveArray[i][j].makeTeleport();\t\n\t\t\t\t}\n\t\t\t\tcaveArray[0][0] = new Cave(0,0);\n\t\t\t\tcaveArray[row-1][columns-1] = new Cave(row-1,columns-1);\n\t\t\t\tcaveArray[0][0].makeOpen();\n\t\t\t\tcaveArray[row-1][columns-1].makeOpen(); \n\t\t\t}\n\t\t}\n\t\tcaveArray[0][0] = new Cave(0,0);\n\t\tcaveArray[row-1][columns-1] = new Cave(row-1,columns-1);\n\t\tcaveArray[0][0].makeOpen();\n\t\tcaveArray[row-1][columns-1].makeOpen(); \n\t}",
"public AIPlayer(Board board) {\n cells = board.squares;\n }",
"public Player(){\n\t\tthis.cell = 0;\n\t}",
"public Board(Board a)\n {\n mainBoard=false;\n squares = new Square[Chess.ROWS][Chess.COLUMNS];\n setLayout(new GridLayout(Chess.ROWS,Chess.COLUMNS,0,0));\n if (a.firstSelected==null)\n firstSelected=null;\n else\n firstSelected = new Piece(a.firstSelected);\n for (int i = 0; i < Chess.ROWS; i++)\n for (int j = 0; j < Chess.COLUMNS; j++)\n squares[i][j] = new Square(a.squares[i][j]);\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}",
"public Cell(){}",
"public Cell(){\n this.ship = null;\n this.hasBeenShot = false;\n }",
"public Cell()\n\t{\n\t}",
"Board() {\n this(INITIAL_PIECES, BLACK);\n _countBlack = 12;\n _countWhite = 12;\n _moveHistory = new ArrayList<Move>();\n _movesMade = 0;\n }",
"Board(int rows, int cols, double ratio) {\n\n colCount = cols;\n rowCount = rows;\n\n isRunning = true;\n isWon = false;\n\n board = new Cell[rowCount][colCount];\n\n do {\n boolean hasMine;\n Random r = new Random();\n r.setSeed(System.currentTimeMillis());\n for (int i = 0; i < rowCount; i++) {\n for (int j = 0; j < colCount; j++) {\n hasMine = (r.nextGaussian() > ratio);\n board[i][j] = new Cell(i, j, hasMine);\n }\n }\n\n int surroundingMineCount;\n for (int i = 0; i < rowCount; i++) {\n for (int j = 0; j < colCount; j++) {\n if (!board[i][j].hasMine()) {\n surroundingMineCount = 0;\n\n // check surrounding fields\n for (int m = -1; m <= 1; m++) {\n for (int n = -1; n <= 1; n++) {\n if (m != 0 || n != 0) { // ignore same cell\n if (i + m >= 0 && i + m < rowCount\n && j + n >= 0 && j + n < colCount) {\n if (board[i + m][j + n].hasMine()) surroundingMineCount++;\n }\n }\n }\n }\n\n board[i][j].setSurroundingMines(surroundingMineCount);\n }\n }\n }\n\n } while(!hasBlanks());\n\n setRandomCellActive();\n }",
"public Board() {\n\t\tthis.table = new int[Constants.SIZE][Constants.SIZE];\n\t\tthis.P1Movable = new boolean[Constants.SIZE][Constants.SIZE];\n\t\tthis.P2Movable = new boolean[Constants.SIZE][Constants.SIZE];\n\t\tP1turn = true;\n\t\tnumPieces = 0;\n\t\t\n\t\tfor(int i=0; i<table.length; i++) {\n\t\t\tfor(int j=0; j<table[i].length; j++) {\n\t\t\t\ttable[i][j] = Constants.EMPTY;\n\t\t\t\tP1Movable[i][j] = true;\n\t\t\t\tP2Movable[i][j] = true;\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"public Board(int boardHeight, int boardWidth) {\n this.boardWidth = boardHeight+1;\n this.boardHeight = boardWidth+1;\n this.board = new char[this.boardHeight][this.boardWidth];\n this.numShips = 0;\n boardInit();\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 Cell(int row, int col)\n\t{\n\t\tthis.row = row;\n\t\tthis.col = col;\n\t}",
"public Cell(){\n \tthis.shot=false;\n }",
"public Room(int row, int column){\n this.setPositionRow(row);\n this.setPositionColumn(column);\n this.setHasVacuum(false);\n this.setDirty(false);\n this.setVisited(false);\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 Gameboard() {\n\n\t\tturn = 0;\n\n\t\tboard = new Cell[4][4][4];\n\n\t\tfor (int i = 0; i < board.length; i++) {\n\t\t\tfor (int j = 0; j < board.length; j++) {\n\t\t\t\tfor (int k = 0; k < board.length; k++) {\n\n\t\t\t\t\tboard[i][j][k] = Cell.E;\n\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public Board() {\n\t\tintializeBoard(_RowCountDefault, _ColumnCountDefault, _CountToWinDefault);\n\t}",
"public ThirteensBoard()\n {\n super(BOARD_SIZE, RANKS, SUITS, POINT_VALUES);\n }",
"public Board(){\n for(int holeIndex = 0; holeIndex<holes.length; holeIndex++)\n holes[holeIndex] = new Hole(holeIndex);\n for(int kazanIndex = 0; kazanIndex<kazans.length; kazanIndex++)\n kazans[kazanIndex] = new Kazan(kazanIndex);\n nextToPlay = Side.WHITE;\n }",
"public Board()\r\n\t{\r\n\t\tfor(int x = 0; x < 9; x++)\r\n\t\t\tfor(int y = 0 ; y < 9; y++)\r\n\t\t\t{\r\n\t\t\t\tboard[x][y] = new Cell();\r\n\t\t\t\tboard[x][y].setBoxID( 3*(x/3) + (y)/3+1);\r\n\t\t\t}\r\n\t}",
"public PersonalBoard(){\n this(0);\n }",
"public Board(String blocks) { this(blocks, Heuristic.INT, null); }",
"public Board() {\r\n\t\tthis.size = 4;\r\n\t\tthis.gameBoard = createBoard(4);\r\n\t\tthis.openTiles = 16;\r\n\t\tthis.moves = 0;\r\n\t\tthis.xValues = new boolean[4][4];\r\n\t\tthis.yValues = new boolean[4][4];\r\n\t\tthis.complete = false;\r\n\t}",
"public Cell(int x, int y){\n\t\tif((x<0 || x>7) || (y<0 || y>7)){\n\t\t\tSystem.out.println(\"The provided coordinates for the cell are out of range.\");\n\t\t\treturn;\n\t\t}\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.placedPiece = null;\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 Board()\r\n {\r\n board = new Piece[8][8];\r\n xLength = yLength = 8;\r\n }",
"public Cell(final int indX, final int indY, int x, int y) {\r\n\t\tthis.stage = GameScreen.stage;\r\n\t\tthis.indX = indX;\r\n\t\tthis.indY = indY;\r\n\r\n\t\tthis.img = new Image(Assets.manager.get(Assets.SQUARE_TXT, Texture.class));\r\n\t\timg.setX(x);\r\n\t\timg.setY(y);\r\n\t\tstage.addActor(img);\r\n\t\timg.addListener(new InputListener() {\r\n\t\t\t@Override\r\n\t\t\tpublic boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {\r\n\t\t\t\t// Call gameLogic to find where piece belongs and check game state\r\n\t\t\t\tGameScreen.game.placePiece(indX, indY);\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t});\r\n\t}",
"public OthelloBoard (int height, int width){\n super(height, width);\n m_Pieces = new OthelloPiece[WIDTH][HEIGHT];\n m_PieceCount+=4;\n \n }",
"public MapCell(int row, int column){\n\t\tsetPosition(row, column);\n\t}",
"public MapCell(int row, int column, int e, int n, int w, int s){\n\t\tsetPosition(row,column);\n\t\tsetWalls(e,n,w,s);\n\t}",
"public TileFloor( int x, int y, int rows, int columns)\r\n {\r\n random = new Random(12345);\r\n ROWS = rows;\r\n COLUMNS= columns;\r\n this.x = x;\r\n this.y = y;\r\n }",
"public GameSquare(int r, int c)\n {\n super();\n setBorder(BorderFactory.createLineBorder(Color.BLACK));\n adjacentMines = 0;\n mine = false;\n revealed = false;\n flagged = false;\n this.row = r;\n this.col = c;\n addMouseListener(\n new MouseAdapter() //Yet another anonymous class, extending MouseAdapter, created in line here.\n {\n public void mousePressed(MouseEvent e) //Called whenever this square is clicked on.\n {\n if (gameWon || gameLost) {return;} //Clicking squares does nothing if the game is over.\n if (revealed) //Double clicking a revealed square, if it is already touching the correct\n {\t\t\t\t //number of flags, will reveal everything else around it.\n if (e.getClickCount() >= 2 && countAdjacentFlags() == adjacentMines)\n {\n for (GameSquare square : getAdjacentSquares())\n {\n square.reveal();\n }\n }\n }\n else if (e.isControlDown() || SwingUtilities.isRightMouseButton(e)) //right click\n {\n if (numRevealed == 0) {return;} //Game has not begun yet.\n flagged = !flagged;\n if (flagged) //just placed a flag\n {\n if (mine)\n {\t\n minesFound++;\n }\n mineCounter.reduceCount();\n }\n else //just removed a flag\n {\n if (mine)\n {\n minesFound--;\n }\n mineCounter.increaseCount();\n }\n repaint();\n }\n else //left click\n {\n if (numRevealed == 0) //The game begins here.\n {\n ArrayList<Integer> squares = new ArrayList<Integer>();\n for (int ii = 0; ii < grid.length * grid[0].length; ii++)\n {\n squares.add(ii); //This list contains an integer representing each square in the board.\n }\n squares.remove(row * grid[0].length + col); //This protects the first click from being a mine.\n for (int ii = 0; ii < numMines; ii++)\n {\n\t\t\t\t\t\t\t\t\t\t//Randomly select a mine, numMines times.\n Integer choice = squares.remove((int) (squares.size() * Math.random()));\n grid[choice / grid[0].length][choice % grid[0].length].setMine();\n }\n for (Integer notMine : squares)\n {\n\t\t\t\t\t\t\t\t\t\t//All non-mines must know how many mines they are touching.\n grid[notMine / grid[0].length][notMine % grid[0].length].countAdjacentMines();\n }\n countAdjacentMines(); //Including the one originally clicked.\n timerDisplay.start();\n }\n if (!flagged)\n {\n reveal();\n }\n }\n }\n });\t\t\t\t\n }",
"public Board()\r\n\t{\r\n\t\treset();\r\n\t}",
"public Board() {\n playerNumber = 2;\n deadBlackCount = 0;\n deadWhiteCount = 0;\n deadRedCount = 0;\n deadBlueCount = 0;\n\n fields = new Field[DIMENSION][DIMENSION];\n // init fields\n for (int i = 0; i < DIMENSION; i++) {\n for (int j = 0; j < DIMENSION; j++) {\n fields[i][j] = new Field();\n fields[i][j].setX(i);\n fields[i][j].setY(j);\n }\n }\n }",
"public Cell(int playerNumber) {\n\t\tthis.playerNumber = playerNumber;\n\t}",
"public Board() {\n initialize(3, null);\n }",
"public TicTacToeBoard() {\n grid = new Cell[N][N];\n\n for (int i = 0; i < N; i++) {\n for (int j = 0; j < N; j++)\n grid[i][j] = new Cell(i, j, '-');\n }\n }",
"public Board() {\n this.board = new Piece[16];\n }",
"public TicTacToeBoard() {board = new int[rows][columns];}",
"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 ChessBoard() {\n initComponents();\n createChessBoard();\n\n }",
"public Ship(int colCount, int rowCount, int shipSize) {\n\t\tshipPositions = new ArrayList<Coordinate>();\n\t\tthis.shipSize = shipSize;\n\n\t\t//sets the starting point of the ship\n\t\tshipPositions.add(new Coordinate((int) (Math.random() * rowCount), (int) (Math.random() * colCount), false,\tfalse));\n\t\tdirection = Directions.getRandom();\n\t\t\n\t\t//constructs the rest of the ship\n\t\tsetShipPositionsGivenDirectionStartingPoint();\n\t}",
"public Board(int lines, int columns, List<String> board) {\r\n\t\tif (lines == 0 || lines % 2 != 0 || lines < 2 || lines > 98) {\r\n\t\t\tthrow new IllegalArgumentException(\"Error! Line length is invalid.\");\r\n\t\t} else if (columns == 0 || columns % 2 != 0 || columns < 2 || columns > 26) {\r\n\t\t\tthrow new IllegalArgumentException(\r\n\t\t\t\t\t\"Error! Column length is invalid.\");\r\n\t\t} else if (board != null) {\r\n\r\n\t\t\tfor (String s : board) {\r\n\t\t\t\tif (!s.matches(\"[W,B,#,,-]+\")) {\r\n\t\t\t\t\tthrow new IllegalArgumentException(\r\n\t\t\t\t\t\t\t\"Error! Invalid board parameters.\");\r\n\t\t\t\t} else if (s.length() != columns) {\r\n\t\t\t\t\tthrow new IllegalArgumentException(\r\n\t\t\t\t\t\t\t\"Error! Board columns not equal to columns.\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (board.size() != lines) {\r\n\t\t\t\tthrow new IllegalArgumentException(\r\n\t\t\t\t\t\t\"Error! Board lines not equal to lines.\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.playBoard = new char[lines][columns];\r\n\t\tthis.possibleMoves = new ArrayList<PossibleMove>();\r\n\r\n\t\tif (board == null) {\r\n\t\t\tthis.init();\r\n\t\t} else {\r\n\t\t\tfor (int i = 0; i < playBoard.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < playBoard[0].length; j++) {\r\n\t\t\t\t\tplayBoard[i][j] = board.get(i).charAt(j);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public SudokuCell(int row, int column){\n\t\tthis.row = row;\n\t\tthis.column = column;\n\t\tsetBox();\n\t\tvalue = 0;\n\t}",
"public Board() {\n for (int y = 0; y < spaces.length; y++) {\n for (int x = 0; x < spaces[0].length; x++) {\n spaces[y][x] = new SubBoard();\n wonBoards[y][x] = ' ';\n }\n }\n }",
"public Cell(int row, int col, int startingState, int[] neighborRowIndexes,\n int[] neighborColIndexes) {\n myState = startingState;\n myRow = row;\n myCol = col;\n neighborRowIndex = neighborRowIndexes;\n if (hexagon) {\n neighborEvenColIndex = new int[]{-1, -1, 0, 1, 0, -1};\n neighborOddColIndex = new int[]{-1, 0, 1, 1, 1, 0};\n neighborRowIndex = new int[]{0, -1, -1, 0, 1, 1};\n } else {\n neighborEvenColIndex = neighborColIndexes;\n neighborOddColIndex = neighborColIndexes;\n }\n }",
"public Board() {\n\t\tboardState = new Field[DIMENSION][DIMENSION];\n\t\tfor(int i = 0; i < DIMENSION; i++) {\n\t\t\tfor(int j = 0; j < DIMENSION; j++) {\n\t\t\t\tboardState[i][j] = new Field();\n\t\t\t}\n\t\t}\n\t}",
"public BSState() {\n this.playerTurn=1;\n this.p1TotalHits=0;\n this.p2TotalHits=0;\n this.shipsAlive=10;\n this.shipsSunk=0;\n this.isHit=false;\n this.phaseOfGame=\"SetUp\";\n this.shotLocations=null;\n this.shipLocations=null;\n this.shipType=1;\n this.board=new String[10][20];\n //this.player1=new HumanPlayer;\n //this.player2=new ComputerPlayer;\n\n }",
"public ChessRunner(){\n\t\taddMouseListener(this);\n\t\tfor(int i=0;i<8;i++){\n\t\t\tfor (int j=1;j<7;j++)\n\t\t\t\tif(j==1)\n\t\t\t\t\tboard[i][j] = new BlackPawn();\n\t\t\t\telse if(j==6)\n\t\t\t\t\tboard[i][j] = new WhitePawn();\n\t\t\t\telse\n\t\t\t\t\tboard[i][j]= new BlankPiece();\n\t\t}\n\t\tboard[1][0] = new BlackKnight();\n\t\tboard[6][0] = new BlackKnight();\n\t\tboard[0][0] = new BlackRook();\n\t\tboard[7][0] = new BlackRook();\n\t\tboard[2][0] = new BlackBishop();\n\t\tboard[5][0] = new BlackBishop();\n\t\tboard[4][0] = new BlackKing();\n\t\tboard[3][0] = new BlackQueen();\n\t\t\n\t\tboard[1][7] = new WhiteKnight();\n\t\tboard[6][7] = new WhiteKnight();\n\t\tboard[0][7] = new WhiteRook();\n\t\tboard[7][7] = new WhiteRook();\n\t\tboard[2][7] = new WhiteBishop();\n\t\tboard[5][7] = new WhiteBishop();\n\t\tboard[4][7] = new WhiteKing();\n\t\tboard[3][7] = new WhiteQueen();\n\t\t\n\t}",
"public WarGame(int rounds, WarBoard board){\n super(rounds, board);\n }",
"public Tile(int x, int y){\n this.gameX = x;\n this.gameY = y;\n state = State.OPEN;\n this.color = this.state.getColor();\n }",
"public Sudoku(int[][] board){\n setBoard(board);\n }",
"public TicTacToe(){ \r\n\t\tboard = new char[3][3];\r\n\t}",
"public Sentry(int column, int row) {\r\n\t\t\r\n\t\tthis.row = row;\r\n\t\tthis.col = column;\r\n \r\n\t\tRandom rand = new Random();\r\n this.rotSpeed = rand.nextInt(3)-2; // Picks a random rotation speed\r\n \r\n if (this.rotSpeed >= 0) rotSpeed++;\r\n \r\n this.degree = rand.nextInt(360); \r\n }",
"public State(Square tractor, int k, int max, int rows, int columns) {\n\t\tthis.tractor = tractor;\n\t\tthis.k = k;\n\t\tthis.max = max;\n\t\tthis.rows = rows;\n\t\tthis.columns = columns;\n\t\tcells = new Square [rows][columns]; \n\t}",
"public Board() {\n\t\tthis.myBoard = new BlockFor2048[4][4];\n\t\tint randomInserted = 0;\n\t\tint colInd = 0;\n\t\tint rowInd = 0;\n\t\twhile (randomInserted != 2){\n\t\t\tcolInd = (int)(Math.random() * 4);\n\t\t\trowInd = (int)(Math.random() * 4);\n\t\t\tif (this.myBoard[colInd][rowInd] == null){\n\t\t\t\tthis.myBoard[colInd][rowInd] = new BlockFor2048(2);\n\t\t\t\trandomInserted++;\n\t\t\t}\n\t\t}\t\t\n\t\tthis.ScoreValue = 0;\n\t}",
"public Board() {\n this.board = new byte[][] { new byte[3], new byte[3], new byte[3] };\n }",
"public Player() { \n grid = new Cell[GRID_DIMENSIONS][GRID_DIMENSIONS]; //size of grid\n for (int i = 0; i < GRID_DIMENSIONS; i++) {\n for (int j = 0; j < GRID_DIMENSIONS; j++) {\n grid[i][j] = new Cell(); //creating all Cells for a new grid\n }\n }\n \n fleet = new LinkedList<Boat>(); //number of boats in fleet\n for (int i = 0; i < NUM_BOATS; i++) {\n Boat temp = new Boat(BOAT_LENGTHS[i]); \n fleet.add(temp);\n }\n shipsSunk = new LinkedList<Boat>();\n }",
"private GameBoard() {}",
"public TicTacToe() {\n\t\tinitialiazeBoard();\n\t\tthis.currentPlayer = Player.X;\n\t\tthis.winner = null;\n\t}",
"public Coordinate() { row = col = -1; }",
"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 CoupleSeat() {\n\t\tsuper();\n\t}",
"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 }"
]
| [
"0.7069462",
"0.6849083",
"0.662601",
"0.6580979",
"0.6562862",
"0.64809924",
"0.64350176",
"0.64082664",
"0.6383368",
"0.6373783",
"0.63490105",
"0.63403624",
"0.63118666",
"0.6304898",
"0.6253623",
"0.6239823",
"0.62189066",
"0.6175462",
"0.61592484",
"0.6155137",
"0.6151632",
"0.6142284",
"0.6139592",
"0.6136572",
"0.61320686",
"0.6120024",
"0.6114473",
"0.6111691",
"0.61096996",
"0.60993606",
"0.60900587",
"0.6080085",
"0.60604817",
"0.604305",
"0.60406315",
"0.6039205",
"0.6037097",
"0.60265934",
"0.60258454",
"0.6025363",
"0.60189295",
"0.6016859",
"0.6008688",
"0.60076094",
"0.6006241",
"0.5997993",
"0.59949595",
"0.59836817",
"0.5977001",
"0.5975685",
"0.59678334",
"0.5963281",
"0.59631604",
"0.59576243",
"0.5956985",
"0.59432906",
"0.5943237",
"0.59401053",
"0.59395874",
"0.593676",
"0.59323543",
"0.5911736",
"0.59008306",
"0.58966863",
"0.5895028",
"0.5890989",
"0.58888894",
"0.58866996",
"0.588522",
"0.5884942",
"0.5883423",
"0.5883166",
"0.58769923",
"0.5873365",
"0.5873201",
"0.58641815",
"0.58591235",
"0.58531076",
"0.58492076",
"0.58403176",
"0.5837032",
"0.58237743",
"0.58117616",
"0.5810501",
"0.5802656",
"0.57985824",
"0.5792454",
"0.5791705",
"0.5769845",
"0.57698196",
"0.57688624",
"0.5764538",
"0.576223",
"0.5759602",
"0.57565415",
"0.5743273",
"0.5741781",
"0.57397103",
"0.5736913",
"0.57253605"
]
| 0.6353481 | 10 |
Method that calculates the grade of the board. In general, looking for having 4 in line has higher priority, but, it also verifies if the opponent has chips getting connected. | protected int getStatusGrade(CellStatus player){
int grade=0;
int opponentGrade=0;
int maxRow=0;
int[] consecutivesTotal=new int[]{0,0,0,0,0,0,0,0};
int[] consecutives={0,0,0,0,0,0,0,0};
int countNotPlayed=0;
for(int y=5;y>=0;y--){
countNotPlayed=0;
maxRow++;
for(int x=6;x>=0;x--){
//if the cell is not played on that row, count it but continue
if(!board[y][x].isPlayed()){
countNotPlayed++;
continue;
}
consecutives = countConsecutives(y,x,player);
if(board[y][x].getCellStatus()==player){
consecutivesTotal[0]+=consecutives[0];
consecutivesTotal[1]+=consecutives[1];
consecutivesTotal[2]+=consecutives[2];
consecutivesTotal[3]+=consecutives[3];
}
/*else{
consecutivesTotal[4]+=consecutives[4];
consecutivesTotal[5]+=consecutives[5];
consecutivesTotal[6]+=consecutives[6];
consecutivesTotal[7]+=consecutives[7];
} */
}
if(countNotPlayed==7){
break;
}
}
grade = /*consecutivesTotal[7]*90+
consecutivesTotal[6]*80+
consecutivesTotal[5]*5+
consecutivesTotal[4]*1+*/
consecutivesTotal[3]*100+
consecutivesTotal[2]*20+
consecutivesTotal[1]*10+
consecutivesTotal[0]*2;
//logger.info("Col:"+column+",Grade:"+grade);
//return ((int)grade/maxRow);
return grade;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static int ratePieceAvailability(){\n\t\tint rating=0, bishopCount=0;\n for (int i=0;i<64;i++) {\n switch (AlphaBeta.chessBoard[i/8][i%8]) {\n case \"P\": rating+=100;\n break;\n case \"R\": rating+=500;\n break;\n case \"K\": rating+=300;\n break;\n case \"B\": bishopCount++;\n break;\n case \"Q\": rating+=900;\n break;\n }\n }\n if (bishopCount>=2) {\n \trating+=300*bishopCount;\n } else {\n if (bishopCount==1) {rating+=250;}\n }\n return rating;\n\t}",
"private float getQScore(Stone[][] board, int line, int col,\n int depth, int initialDepth){\n Chain chain = new Chain();\n Stone stone;\n if(depth % 2 == 1) stone = new Stone(color ? \"black\" : \"white\", chain);\n else stone = new Stone(color ? \"white\" : \"black\", chain);\n stone.setPosition(line, col);\n int nrStonesRemoved, chainSize, chainLiberties, score;\n board[line][col] = stone;\n //verific daca am luat pietre detinute de oponent\n nrStonesRemoved = Control.verifyNeighbourStones(board, stone.getColor(),\n line, col, false);\n //efectuez eventualele modificari ale lanturilor proprii ce pot aparea in urma plasarii pietrei\n Control.combineChains(board, stone, stone.getColor(), line, col);\n chainSize = stone.getChain().getStones().size();\n chainLiberties = stone.getChain().getLibertiesNumber();\n //aflu scorul starii\n score = nrStonesRemoved * 10 + chainSize * 30 + chainLiberties * 50;\n\n if(depth == 0){\n return (initialDepth % 2 == 1) ? -score : score;\n }\n\n float currentScore, max = 0;\n for(int i = 0; i < size; i++)\n for(int j = 0; j < size; j++){\n chain = new Chain();\n if(depth % 2 == 1) stone = new Stone(color ? \"white\" : \"black\", chain);\n else stone = new Stone(color ? \"black\" : \"white\", chain);\n stone.setPosition(i, j);\n int[] lib = Control.verifyLiberties(board, stone, i, j);\n if(board[i][j] == null && lib[0] + lib[1] != 0){\n currentScore = getQScore(board, i, j, depth - 1, initialDepth);\n if(currentScore > max){\n max = currentScore;\n }\n }\n }\n\n score += max * (depth / initialDepth);\n return (depth % 2 == 1) ? score : -score;\n }",
"public int getScore() {\n\t\tint darkDisks = 0;\r\n\t\tint lightDisks = 0;\r\n\r\n\t\tfor(Character c : board){\r\n\t\t\tif(c == '1'){\r\n\t\t\t\tdarkDisks++;\r\n\t\t\t}\r\n\t\t\telse if(c == '2'){\r\n\t\t\t\tlightDisks++;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t//If dark wins\r\n\t\tif(darkDisks > lightDisks){\r\n\t\t\treturn 1;\r\n\t\t}\r\n\r\n\t\t//If light wins\r\n\t\telse if(darkDisks < lightDisks){\r\n\t\t\treturn -1;\r\n\t\t}\r\n\r\n\t\t//For a tie\r\n\t\telse if(darkDisks == lightDisks){\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t//Return 0 on a tie\r\n\t\treturn 0;\r\n\t}",
"public double computeHeuristicGrade();",
"public int whichPrize() {\n if (blueWinNum == 1 && redWinNum == 6) {\n return 1;\n } else if (blueWinNum == 0 && redWinNum == 6) {\n return 2;\n } else if (blueWinNum == 1 && redWinNum == 5) {\n return 3;\n } else if ((blueWinNum == 0 && redWinNum == 5) || (blueWinNum == 1 && redWinNum == 4)) {\n return 4;\n } else if ((blueWinNum == 0 && redWinNum == 4) || (blueWinNum == 1 && redWinNum == 3)) {\n return 5;\n } else if ((blueWinNum == 1 && redWinNum == 2) || (blueWinNum == 1 && redWinNum == 1) || (blueWinNum == 1 && redWinNum == 0)) {\n return 6;\n } else {\n return -1;\n }\n }",
"private int updataChessBoardScoreBinary(Point x, final int[][] chessData,\r\n\t\t\tint color) {\n\t\tint res = 0;\r\n\t\tint combo = 0;\r\n\t\t// System.out.println(\"\"+x.x+\",\"+x.y);\r\n\t\tfor (int i = 0; i < 4; i++) {\r\n\t\t\tLineState pre = getLineStateBinary(x, chessData, i, color, 2, true);\r\n\t\t\tLineState las = getLineStateBinary(x, chessData, i + 4, color, 2,\r\n\t\t\t\t\tfalse);\r\n\r\n\t\t\tint ax = (pre.line << (las.length)) | las.line;\r\n\t\t\tint buf[] = tanslateStateToScoreBinary(new LineState(ax, las.length\r\n\t\t\t\t\t+ pre.length));\r\n\t\t\tres += calculateScore2(buf);\r\n\t\t\tcombo += buf[0] < 0 ? buf[0] : 0;\r\n\r\n\t\t}\r\n\t\tcombo *= -1;\r\n\t\tres += combo > 600 ? combo : 0;\r\n\t\t// System.out.println(\"res:\"+res);\r\n\t\treturn res;\r\n\r\n\t}",
"@Override\r\n\tpublic double evaluate(int[][] board, int currentPlayer) {\n\t\r\n\tdouble score;\t\r\n\tfinal int RANDOM_WEIGHT=5; // weight factor\r\n\t\r\n\tMaximumDisksEvaluation ob = new MaximumDisksEvaluation();\r\n\tCornerEvaluation ob1 = new CornerEvaluation();\r\n\tCornerClosenessEvaluation ob2 = new CornerClosenessEvaluation();\r\n\tFrontierEvaluation ob3 = new FrontierEvaluation();\r\n\tStabilityEvaluation ob4 = new StabilityEvaluation();\r\n\tPositionalEvaluation ob5 = new PositionalEvaluation();\r\n\tMobilityEvaluation ob6 = new MobilityEvaluation();\r\n\t\r\n\tscore = ob.evaluate(board, currentPlayer) + ob1.evaluate(board, currentPlayer) + ob2.evaluate(board, currentPlayer) + ob6.evaluate(board, currentPlayer) + ob3.evaluate(board, currentPlayer) + ob5.evaluate(board, currentPlayer) ; \r\n\t\r\n\treturn score;\r\n\t\r\n\t}",
"public int evaluate(PentagoBoardState pbs) {\n PentagoBoardState.Piece[][] pieces = pbs.getBoard();\n\n\n int whitescore =0; //keep track of white's total score\n int blackscore = 0;//keep track of black's total score\n\n //Check rows\n for (int x = 0; x <6 ; x++) {\n int countWHori = 0;\n int countBHori = 0;\n\n int blacks = 0;\n int whites = 0;\n\n\n for (int y = 0; y <5 ; y++) {\n //Count how many black and white pieces\n if (pieces[x][y].ordinal() == 0 ) {\n\n //countBHori = countBHori + countvalue;\n blacks++;\n }\n if (pieces[x][y].ordinal() == 1) {\n\n //countWHori = countWHori +countvalue;\n whites++;\n }\n\n //Check for consecutive\n if (pieces[x][y].ordinal() == 0 && pieces[x][y+1].ordinal() == 0 ) {\n\n countBHori = countBHori +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 0 && pieces[x][y+1].ordinal() == 2 ) {\n\n countBHori = countBHori + blankspaceconsec;\n }\n else if (pieces[x][y].ordinal() == 2 && pieces[x][y+1].ordinal() == 0 ) {\n\n countBHori = countBHori + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x][y+1].ordinal() == 1 ) {\n\n countWHori = countWHori +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x][y+1].ordinal() == 2 ) {\n\n countWHori = countWHori + blankspaceconsec;\n }\n else if (pieces[x][y].ordinal() == 2 && pieces[x][y+1].ordinal() == 1 ) {\n\n countWHori = countWHori + blankspaceconsec;\n }\n\n //Check for disjoint and joint set If * B B W * * then disjoint and * B B * B * Then joint set for B * B\n if (y!=4){\n if (pieces[x][y].ordinal() == 0 && pieces[x][y+1].ordinal() == 0 && pieces[x][y+2].ordinal() == 1){\n countBHori = countBHori +disjointset;\n }\n else if (pieces[x][y].ordinal() == 1 && pieces[x][y+1].ordinal() == 1 && pieces[x][y+2].ordinal() == 0){\n countWHori = countWHori +disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x][y+1].ordinal() == 2 && pieces[x][y+2].ordinal() == 0){\n countBHori = countBHori +jointset;\n }\n else if (pieces[x][y].ordinal() == 1 && pieces[x][y+1].ordinal() == 2 && pieces[x][y+2].ordinal() == 1){\n countWHori = countWHori +jointset;\n }\n }\n }\n //check if unwinnable\n if (blacks == 4 && whites==2){\n countBHori += unwinnable;\n }\n if (blacks == 2 && whites==4){\n countWHori += unwinnable;\n }\n if (blacks == 3 && whites==3){\n countWHori += unwinnable;\n countBHori += unwinnable;\n }\n\n\n //Run value for row in evaluation scheme and add to total score\n int valuew = consecutivevalue(countWHori);\n whitescore = whitescore +valuew;\n int valueb = consecutivevalue(countBHori);\n blackscore = blackscore + valueb;\n //System.out.println(\"Black consec hori \" + valueb + \"White consec hori \" + valuew);\n\n }\n\n //Check Verticals\n for (int y = 0; y <6 ; y++) {\n int countWvert = 0;\n int countBvert = 0;\n int blacks = 0;\n int whites = 0;\n\n\n for (int x = 0; x <5 ; x++) {\n if (pieces[x][y].ordinal() == 0) {\n\n //countBvert = countBvert +1;\n blacks++;\n }\n if (pieces[x][y].ordinal() == 1) {\n\n //countWvert = countWvert +1;\n whites++;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y].ordinal() == 0 ) {\n\n countBvert = countBvert +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y].ordinal() == 2 ) {\n\n countBvert = countBvert + blankspaceconsec;\n }\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y].ordinal() == 0 ) {\n\n countBvert = countBvert + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y].ordinal() == 1 ) {\n\n countWvert = countWvert +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y].ordinal() == 2 ) {\n\n countWvert = countWvert + blankspaceconsec;\n }\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y].ordinal() == 1 ) {\n\n countWvert = countWvert + blankspaceconsec;\n }\n\n if (x!=4){\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y].ordinal() == 0 && pieces[x+1][y].ordinal() == 1){\n countBvert = countBvert +disjointset;\n }\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y].ordinal() == 1 && pieces[x+1][y].ordinal() == 0){\n countWvert = countWvert +disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y].ordinal() == 2 && pieces[x+1][y].ordinal() == 0){\n countBvert = countBvert +jointset;\n }\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y].ordinal() == 2 && pieces[x+1][y].ordinal() == 1){\n countWvert = countWvert +jointset;\n }\n }\n }\n\n if (blacks == 4 && whites==2){\n countBvert += unwinnable;\n }\n if (blacks == 3 && whites==3){\n countBvert += unwinnable;\n countWvert += unwinnable;\n }\n if (blacks == 2 && whites==4){\n countWvert += unwinnable;\n }\n //System.out.println(\"Black consec vert \" + countBvert + \"White consec \" + countWvert);\n int valuew = consecutivevalue(countWvert);\n whitescore = whitescore +valuew;\n int valueb = consecutivevalue(countBvert);\n blackscore = blackscore + valueb;\n //System.out.println(\"Black consec VERT \" + valueb + \"White consec hori \" + valuew);\n }\n\n //S West N EAST Top\n for (int a = 1; a <6 ; a++) { //loop through all diagonal lines\n int countWdiagSoNe = 0;\n int countBdiagSoNe = 0;\n int x=0;\n int blacks = 0;\n int whites = 0;\n\n\n for (int y = a; y !=0 ; y--) { //loop through one diagonal line\n\n int r = pieces[x][y].ordinal();\n int s =pieces[x+1][y-1].ordinal();\n //System.out.println(\"x \" + x+ \" y \" +y);\n //System.out.println(\"first \" + r+ \" second \" +s);\n if (pieces[x][y].ordinal() == 0) {\n\n //countBdiagSoNe = countBdiagSoNe +2;\n blacks++;\n }\n if (pieces[x][y].ordinal() == 1 ) {\n\n //countWdiagSoNe = countWdiagSoNe +2;\n whites++;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 ) {\n\n countBdiagSoNe = countBdiagSoNe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 ) {\n\n countBdiagSoNe = countBdiagSoNe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y-1].ordinal() == 0 ) {\n\n countBdiagSoNe = countBdiagSoNe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 ) {\n\n countWdiagSoNe = countWdiagSoNe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 ) {\n\n countWdiagSoNe = countWdiagSoNe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y-1].ordinal() == 1 ) {\n\n countWdiagSoNe = countWdiagSoNe + blankspaceconsec;\n }\n\n // check for joint and disjoint set at these x y coordinates by looking 2 pieces ahead\n if (x==0 && y==4){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==1 && y==3){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==2 && y==2){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==0 && y==5){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==1 && y==4){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==2 && y==3){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==3 && y==2){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n\n x++;\n\n\n }\n if (blacks == 4 && whites==2){\n countBdiagSoNe += unwinnable;\n }\n if (blacks == 3 && whites==3){\n countBdiagSoNe += unwinnable;\n countWdiagSoNe += unwinnable;\n }\n if (blacks == 2 && whites==4){\n countWdiagSoNe += unwinnable;\n }\n if (a==4 && blacks == 4 && whites==1){\n countBdiagSoNe += unwinnable;\n }\n if (a==4 && blacks == 1 && whites==4){\n countWdiagSoNe += unwinnable;\n }\n\n //System.out.println(\"Black consec vert \" + countBdiagSoNe + \"White consec \" + countWdiagSoNe);\n int valuew = consecutivevalue(countWdiagSoNe);\n whitescore = whitescore +valuew;\n int valueb = consecutivevalue(countBdiagSoNe);\n blackscore = blackscore + valueb;\n //System.out.println(\"Black consec DIAGOMAAL \" + valueb + \" \" + countBdiagSoNe + \"White consec hori \" + valuew + \" \" + countWdiagSoNe);\n }\n //S West N EAST Bot\n for (int a = 1; a <5 ; a++) {\n int countWdiagSoNe = 0;\n int countBdiagSoNe = 0;\n int y=5;\n int blacks = 0;\n int whites = 0;\n\n for (int x = a; x <5 ; x++) {\n\n int r = pieces[x][y].ordinal();\n int s =pieces[x+1][y-1].ordinal();\n //System.out.println(\"x \" + x+ \" y \" +y);\n //System.out.println(\"first \" + r+ \" second \" +s);\n if (pieces[x][y].ordinal() == 0) {\n\n //countBdiagSoNe = countBdiagSoNe +\n blacks++;\n }\n if (pieces[x][y].ordinal() == 1 ) {\n\n //countWdiagSoNe = countWdiagSoNe +2;\n whites++;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 ) {\n\n countBdiagSoNe = countBdiagSoNe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 ) {\n\n countBdiagSoNe = countBdiagSoNe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y-1].ordinal() == 0 ) {\n\n countBdiagSoNe = countBdiagSoNe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 ) {\n\n countWdiagSoNe = countWdiagSoNe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 ) {\n\n countWdiagSoNe = countWdiagSoNe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y-1].ordinal() == 1 ) {\n\n countWdiagSoNe = countWdiagSoNe + blankspaceconsec;\n }\n if (x==1 && y==5){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==2 && y==4){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==3 && y==3){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n //System.out.println(x + \" y:\" + y +\" Black consec DIAGOMAAL \" + countBdiagSoNe + \"White consec hori \" + countWdiagSoNe);\n y--;\n\n\n }\n if (a==1 && blacks == 4 && whites==1){\n countBdiagSoNe += unwinnable;\n }\n /*if (blacks == 3 && whites==3){\n countBdiagSoNe += unwinnable;\n countWdiagSoNe += unwinnable;\n }*/\n if (a==1&& blacks == 1 && whites==4){\n countWdiagSoNe += unwinnable;\n }\n //System.out.println(\"Black consec vert \" + countBdiagSoNe + \"White consec \" + countWdiagSoNe);\n int valuew = consecutivevalue(countWdiagSoNe);\n whitescore = whitescore +valuew;\n int valueb = consecutivevalue(countBdiagSoNe);\n blackscore = blackscore + valueb;\n //System.out.println(\"Black consec DIAGOMAAL \" + valueb + \" \" + countBdiagSoNe + \"White consec hori \" + valuew + \" \" + countWdiagSoNe);\n }\n\n //NorthWest S EAST Left\n for (int a = 0; a <5 ; a++) {\n int countWdiagNoSe = 0;\n int countBdiagNoSe = 0;\n int y=0;\n int blacks = 0;\n int whites = 0;\n\n for (int x = a; x <5 ; x++) {\n //System.out.println(pbs+\"x \" + x+ \" y \" +y);\n int r = pieces[x][y].ordinal();\n int s =pieces[x+1][y+1].ordinal();\n //System.out.println(\"x \" + x+ \" y \" +y);\n //System.out.println(\"first \" + r+ \" second \" +s);\n if (pieces[x][y].ordinal() == 0) {\n blacks++;\n //countBdiagNoSe = countBdiagNoSe +2;\n }\n if (pieces[x][y].ordinal() == 1) {\n whites++;\n //countWdiagNoSe = countWdiagNoSe +2;\n }\n\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 ) {\n\n countBdiagNoSe = countBdiagNoSe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 ) {\n\n countBdiagNoSe = countBdiagNoSe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y+1].ordinal() == 0 ) {\n\n countBdiagNoSe = countBdiagNoSe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 ) {\n\n countWdiagNoSe = countWdiagNoSe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 ) {\n\n countWdiagNoSe= countWdiagNoSe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y+1].ordinal() == 1 ) {\n\n countWdiagNoSe = countWdiagNoSe + blankspaceconsec;\n }\n\n if (x==0 && y==0){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==1 && y==1){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==2 && y==2){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==3 && y==3){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==1 && y==0){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==2 && y==1){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==3 && y==2){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n y++;\n\n\n }\n //System.out.println(\"Black consec vert \" + countBdiagSoNe + \"White consec \" + countWdiagSoNe);\n if (blacks == 4 && whites==2){\n countBdiagNoSe += unwinnable;\n }\n if (a==1 && blacks == 4 && whites==1){\n countBdiagNoSe += unwinnable;\n }\n if (blacks == 3 && whites==3){\n countBdiagNoSe += unwinnable;\n countWdiagNoSe += unwinnable;\n }\n if (blacks == 2 && whites==4){\n countWdiagNoSe += unwinnable;\n }\n if (a==1 && blacks == 1 && whites==4){\n countWdiagNoSe += unwinnable;\n }\n\n int valuew = consecutivevalue(countWdiagNoSe);\n whitescore = whitescore +valuew;\n int valueb = consecutivevalue( countBdiagNoSe);\n blackscore = blackscore + valueb;\n //System.out.println(\"Black consec DIAGOMAAL \" + valueb + \" \" + countBdiagNoSe + \"White consec hori \" + valuew + \" \" + countWdiagNoSe);\n }\n //NorthWest S EAST Right\n for (int a = 1; a <5 ; a++) {\n int countWdiagNoSe = 0;\n int countBdiagNoSe = 0;\n int x=0;\n int blacks = 0;\n int whites = 0;\n\n for (int y = a; y <5 ; y++) {\n //System.out.println(\"x \" + x+ \" y \" +y);\n int r = pieces[x][y].ordinal();\n int s =pieces[x+1][y+1].ordinal();\n //System.out.println(\"x \" + x+ \" y \" +y);\n //System.out.println(\"first \" + r+ \" second \" +s);\n if (pieces[x][y].ordinal() == 0 ) {\n blacks++;\n //countBdiagNoSe = countBdiagNoSe +2;\n }\n if (pieces[x][y].ordinal() == 1) {\n whites++;\n //countWdiagNoSe = countWdiagNoSe +2;\n }\n\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 ) {\n\n countBdiagNoSe = countBdiagNoSe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 ) {\n\n countBdiagNoSe = countBdiagNoSe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y+1].ordinal() == 0 ) {\n\n countBdiagNoSe = countBdiagNoSe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 ) {\n\n countWdiagNoSe = countWdiagNoSe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 ) {\n\n countWdiagNoSe= countWdiagNoSe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y+1].ordinal() == 1 ) {\n\n countWdiagNoSe = countWdiagNoSe + blankspaceconsec;\n }\n\n if (x==0 && y==1){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==1 && y==2){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==2 && y==3){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n x++;\n\n\n }\n if (a==1 && blacks == 1 && whites==4){\n countWdiagNoSe += unwinnable;\n }\n if (a==1 && blacks == 4 && whites==1){\n countBdiagNoSe += unwinnable;\n }\n //System.out.println(\"Black consec vert \" + countBdiagSoNe + \"White consec \" + countWdiagSoNe);\n int valuew = consecutivevalue(countWdiagNoSe);\n whitescore = whitescore +valuew;\n int valueb = consecutivevalue( countBdiagNoSe);\n blackscore = blackscore + valueb;\n //System.out.println(\"Black consec DIAGOMAAL \" + valueb + \" \" + countBdiagNoSe + \"White consec hori \" + valuew + \" \" + countWdiagNoSe);\n }\n\n\n\n\n\n //System.out.println(\"Black consec score \" + blackscore +\" \" + \"White consec scpre \" + whitescore);\n //System.out.println(\"max player is \" + maxplayer + \"My colour is \" + mycolour);\n int i = -123456789;\n if (mycolour == 0){\n //System.out.println(blackscore-whitescore +\" I am black\");\n\n\n i= blackscore-whitescore;\n return i;\n\n }\n else {\n //System.out.println(whitescore-blackscore +\" I am white\");\n i= whitescore-blackscore;\n return i;\n }\n /*\n if(i>0 && i<1000){\n return 100; //i*2;\n }\n else if(i>=1000 && i<10000){\n return 1000; //i*10;\n }\n else if(i>=10000 && i<100000){\n return 10000; //i*50;\n }\n else if(i>=100000){\n return 100000;//i*500;\n }\n else if(i<=0 && i>-100){\n return -100; //i*2;\n }\n else if(i<=-100 && i>-1000){\n return -1000; //i*10;\n }\n else if(i<=-1000 && i>-10000){\n return -10000; //i*50;\n }\n else if(i<=0 && i>-100000){\n return -100000;//i*500;\n }\n\n */\n\n\n }",
"public double heuristic(Bitboard board) {\n double h = 0;\n\n // mobility\n int p1Mobility = 0;\n int p2Mobility = 0;\n // strength of piece positions\n double p1Position = 0;\n double p2Position = 0;\n // number of pieces\n int p1Pieces = 0;\n int p2Pieces = 0;\n // number of connected components\n int p1CC = 0;\n int p2CC = 0;\n // number of isolated circle pieces\n int p1Isolated = 0;\n int p2Isolated = 0;\n\n double weight;\n\n visited = 0;\n // check p1's pieces\n int posMasks = board.getPieces(0);\n int posMask;\n while (posMasks != 0) {\n posMask = posMasks & ~(posMasks - 1);\n posMasks ^= posMask;\n if ((visited & posMask) == 0) {\n if (exploreCC(board, posMask, 0) == 1)\n if (!board.isSquare(posMask))\n p1Isolated++;\n p1CC++;\n }\n weight = board.isSquare(posMask) ? weights[0] : weights[1];\n if (!boardValues.containsKey(posMask)) {\n System.out.println(\"I don't have \" + (int) (Math.log(posMask) / Math.log(2)));\n board.show();\n }\n p1Position += weight * boardValues.get(posMask);\n p1Pieces++;\n }\n // check p2's pieces\n visited = 0;\n posMasks = board.getPieces(1);\n while (posMasks != 0) {\n posMask = posMasks & ~(posMasks - 1);\n posMasks ^= posMask;\n if ((visited & posMask) == 0) {\n if (exploreCC(board, posMask, 1) == 1)\n if (!board.isSquare(posMask))\n p2Isolated++;\n p2CC++;\n }\n weight = board.isSquare(posMask) ? weights[0] : weights[1];\n p2Position += weight * boardValues.get(posMask);\n p2Pieces++;\n }\n\n // perform connected component analysis on empty spaces\n posToAdjCCID.clear();\n ccIDToOwner.clear();\n ownerToCCs.clear();\n int toCheck = (BitMasks.valid & (~board.getPieces()));\n int check;\n int ccId = 0;\n while (toCheck != 0) {\n check = toCheck & ~(toCheck - 1);\n toCheck ^= SearchUtils.checkSpaces(board, check, ccId++, posToAdjCCID, ccIDToOwner,\n ownerToCCs);\n }\n\n // check how close each player's circles are to an \"owned\" connected component\n int circles, circleMask, searchDistance;\n boolean adjacent;\n for (int turn = 0; turn < 2; turn++) {\n circles = board.getCircles(turn);\n while (circles != 0) {\n adjacent = false;\n circleMask = circles & ~(circles - 1);\n circles ^= circleMask;\n if (posToAdjCCID.containsKey(circleMask)) {\n for (int id : posToAdjCCID.get(circleMask)) {\n if (ccIDToOwner.get(id) == turn) {\n adjacent = true;\n break;\n }\n }\n }\n if (!adjacent) {\n searchDistance = search(board, circleMask, turn);\n if (turn == 0 && searchDistance > GameUtils.NUM_SLIDES) {\n h += -weights[6] * searchDistance;\n } else if (turn == 1 && searchDistance > GameUtils.NUM_SLIDES) {\n h += weights[6] * searchDistance;\n }\n }\n }\n }\n\n // a player missing a piece is the ultimate bad position\n if (p1Pieces != 5) {\n return -10000.0;\n }\n if (p2Pieces != 5) {\n return 10000.0;\n }\n // weight the components of the heuristic\n h += weights[2] * p1Mobility;\n h += -weights[2] * p2Mobility;\n h += weights[3] * p1Position;\n h += -weights[3] * p2Position;\n\n // make it so only > 1 connected components impacts heuristic\n h += -weights[4] * (p1CC - 1);\n h += weights[4] * (p2CC - 1);\n\n h += -weights[5] * p1Isolated;\n h += weights[5] * p2Isolated;\n\n h /= 6200; // normalize\n return h;\n }",
"private static double upLeftScore(char piece, State state, int row, int col) {\n\t\tif(row != 0 && col != 0 && state.getGrid()[row-1][col-1] == piece) {\n\t\t\treturn DIAGONAL;\n\t\t}\n\t\telse {\n\t\t\treturn ZERO;\n\t\t}\n\t}",
"static int waysToGiveACheck(char[][] board) {\n\t\tint[] pawnPos = new int[2];\n\t\tint[] bkPos = new int[2];\n\t\tint[] wkPos = new int[2];\n\t\tint[] forthPos = new int[2];\n\t\tchar fourth = 'x';\n\t\tint answerCount = 0;\n\t\tint hashCount = 0;\n\t\tfor(int board_i = 0; board_i < 8; board_i++){\n\t\t\tfor(int board_j = 0; board_j < 8; board_j++){\n\t\t\t\tswitch(board[board_i][board_j]){\n\t\t\t\tcase 35:\n\t\t\t\t\thashCount++;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 80:\n\t\t\t\t\t{pawnPos[0] = board_i;\n\t\t\t\t\tpawnPos[1] = board_j;\n\t\t\t\t\tbreak;}\n\t\t\t\tcase 107:\n\t\t\t\t\t{bkPos[0] = board_i;\n\t\t\t\t\tbkPos[1] = board_j;\n\t\t\t\t\tbreak;}\n\t\t\t\tcase 75:\n\t\t\t\t\t{wkPos[0] = board_i;\n\t\t\t\t\twkPos[1] = board_j;\n\t\t\t\t\tbreak;}\n\t\t\t\tdefault:\n\t\t\t\t\t{forthPos[0] = board_i;\n\t\t\t\t\tforthPos[1] = board_j;\n\t\t\t\t\tfourth = board[board_i][board_j];\n\t\t\t\t\tbreak;}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tint xdistPk = Math.abs(pawnPos[0] - bkPos[0]);\n\t\tint ydistPk = Math.abs(pawnPos[1] - bkPos[1]);\n\n\t\tif(xdistPk == ydistPk)\n\t\t\tanswerCount = answerCount+2;\n\t\tif(xdistPk==0)\n\t\t\tanswerCount++;\n\t\tif(ydistPk ==0)\n\t\t\tanswerCount++;\n\t\tif((xdistPk == 2 && ydistPk==1) || (xdistPk == 1 && ydistPk==2) )\n\t\t\tanswerCount++;\n\n\t\treturn answerCount;\n\n\t}",
"private static int getMaxScore(char[][] board){\n\n\t\tString result = gameStatus(board);\n\n\t\tif (result.equals(\"true\") && winner == 'X') return 1; //if x won\n\t\telse if (result.equals(\"true\") && winner == 'O') return -1;//if O won\n\t\telse if (result.equals(\"tie\")) return 0; //if tie\n\t\telse { \n\n\t\t\tint bestScore = -10;\n\t\t\tHashSet<Integer> possibleMoves = findPossibleMoves(board);\n\n\t\t\tfor (Integer move: possibleMoves){\n\n\t\t\t\tchar[][] modifiedBoard = new char[3][3];\n\n\t\t\t\tfor (int row = 0; row < 3; row++){\n\t\t\t\t\tfor (int col = 0; col < 3; col++){\n\t\t\t\t\t\tmodifiedBoard[row][col] = board[row][col];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tmodifiedBoard[move/3][move%3]='X';\n\n\t\t\t\tint currentScore = getMinScore(modifiedBoard);\n\n\t\t\t\tif (currentScore > bestScore){\n\t\t\t\t\tbestScore = currentScore;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\treturn bestScore;\n\t\t}\n\t}",
"private int getScoreForPiecePosition(int row, int column) {\r\n\t\tbyte[][] positionWeight =\r\n\t\t{ {1,1,1,1,1,1,1,1}\r\n\t\t ,{2,2,2,2,2,2,2,2}\r\n\t\t ,{2,2,3,3,3,3,2,2}\r\n\t\t ,{2,2,3,4,4,3,2,2}\r\n\t\t ,{2,2,3,4,4,3,2,2}\r\n\t\t ,{2,2,3,3,3,3,2,2}\r\n\t\t ,{2,2,2,2,2,2,2,2}\r\n\t\t ,{1,1,1,1,1,1,1,1}\r\n\t\t };\r\n\t\treturn positionWeight[row][column];\r\n\t}",
"private static double downLeftScore(char piece, State state, int row, int col) {\n\t\tif(row != state.getGrid().length-1 && col != 0 && state.getGrid()[row+1][col-1] == piece) {\n\t\t\treturn DIAGONAL;\n\t\t}\n\t\telse {\n\t\t\treturn ZERO;\n\t\t}\n\t}",
"private int getHeuristic(Player player) {\n int whitePieces = 0;\n int blackPieces = 0;\n\n for (int r = 0; r < Board.MAX_ROW; r++) {\n for (int c = 0; c < Board.MAX_COLUMN; c++) {\n if (boardObject.getSlot(r, c).getColor() == Slot.WHITE) {\n whitePieces++;\n } else if (boardObject.getSlot(r, c).getColor() == Slot.BLACK) {\n blackPieces++;\n }\n }\n }\n\n if (player.equals(playerBlack)) {\n return blackPieces - whitePieces;\n } else {\n return whitePieces - blackPieces;\n }\n }",
"private static double score(char piece, State state, int row, int col) {\n\t\treturn upScore(piece, state, row, col) + upRightScore(piece, state, row, col) + rightScore(piece, state, row, col) +\n\t\t\t\tdownRightScore(piece, state, row, col) + downScore(piece, state, row, col) + downLeftScore(piece, state, row, col) + \n\t\t\t\tleftScore(piece, state, row, col) + upLeftScore(piece, state, row, col);\n\t}",
"public int generateScore(List<Integer> line){\r\n\t\tif (line.get(0)+line.get(1)+line.get(2)==2 ) {\r\n\t\t\treturn 10;\r\n\t\t}\r\n\t\telse if (line.get(0)==line.get(1)&&line.get(1)==line.get(2) && line.get(0)==line.get(2)) {\r\n\t\t\treturn 5;\r\n\t\t}\r\n\t\telse if (line.get(0)!=line.get(1)&&line.get(0)!=line.get(2)) {\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\t\r\n\t\r\n\t}",
"public int determineWinner() {\n\t\tif(board[1][1] != 0 && (\n\t\t\t(board[1][1] == board[0][0] && board[1][1] == board[2][2]) ||\n\t\t\t(board[1][1] == board[0][2] && board[1][1] == board[2][0]) ||\n\t\t\t(board[1][1] == board[0][1] && board[1][1] == board[2][1]) ||\n\t\t\t(board[1][1] == board[1][0] && board[1][1] == board[1][2]))){\n\t\t\treturn board[1][1];\n\t\t}\n\t\telse if (board[0][0] != 0 &&(\n\t\t\t(board[0][0] == board[0][1] && board[0][0] == board[0][2]) ||\n\t\t\t(board[0][0] == board[1][0] && board[0][0] == board[2][0]))){\n\t\t\treturn board[0][0];\n\t\t}\n\t\telse if (board [2][2] != 0 && (\n\t\t\t(board[2][2] == board[2][0] && board[2][2] == board[2][1]) ||\n\t\t\t(board[2][2] == board[0][2] && board[2][2] == board[1][2]))) {\n\t\t\treturn board[2][2];\n\t\t}\n\t\t\n\t\t//See if every square has been marked, return still in progress if not\n\t\tfor(int i = 0; i < 3; ++i) {\n\t\t\tfor(int j = 0; j < 3; ++j) {\n\t\t\t\tif (board[i][j] == 0)\n\t\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Return tie\n\t\treturn 3;\n\t}",
"private int evaluate(Board board)\n {\n if (computerWin(board))\n return 4*size;\n else if (playerWin(board))\n return -4*size;\n else if (draw(board))\n return 3*size;\n else\n return count(board, COMPUTER);\n }",
"private static double upRightScore(char piece, State state, int row, int col) {\n\t\tif(row != 0 && col != state.getGrid()[row].length-1 && state.getGrid()[row-1][col+1] == piece) {\n\t\t\treturn DIAGONAL;\n\t\t}\n\t\telse {\n\t\t\treturn ZERO;\n\t\t}\n\t}",
"private static int evaluateBoard(final int[][] givenBoard) {\n final int[][] board = cloneBoard(givenBoard);\n\n final int numRows = givenBoard.length;\n final int numCols = givenBoard[0].length;\n\n \n // If the game is complete\n if (!Utils.hasMove(board)) {\n // Find largest absolute move value for player and opponent\n int playerScore = 0;\n int opponentScore = 0;\n for (final int[] row : board) {\n for (final int val : row) {\n if (val > playerScore) playerScore = val;\n if (val < opponentScore) opponentScore = val;\n } \n }\n // Give a big reward + the ammount we won the game by\n return WIN_REWARD + playerScore + opponentScore;\n }\n boardsEvaluated++;\n\n \n // If the game is incomplete, return the diference between the average \n // distance that the player and opponent are from each empty square\n int[][] playerDistances = distanceGrid(board);\n int[][] opponentDistances = distanceGrid(flipBoard(board));\n \n int totalPlayerDistance = 0;\n int totalOpponentDistance = 0;\n \n int maxPlayerDistance = 0;\n int maxOpponentDistance = 0;\n \n \n int largestPlayerMove = 0;\n int smallestOpponentMove = 0;\n \n int numEmptySpaces = 0;\n \n for (int r = 0; r < numRows; r++) {\n for (int c = 0; c < numCols; c++) {\n if (playerDistances[r][c] > 0) {\n totalPlayerDistance += playerDistances[r][c];\n numEmptySpaces++;\n }\n if (opponentDistances[r][c] > 0) {\n totalOpponentDistance += opponentDistances[r][c];\n }\n \n int boardVal = board[r][c];\n if (largestPlayerMove < boardVal) largestPlayerMove = boardVal;\n if (smallestOpponentMove > boardVal) smallestOpponentMove = boardVal;\n \n } \n }\n int averageDistanceDifference = totalOpponentDistance - totalPlayerDistance;\n\n int largestMoveDifference = largestPlayerMove + smallestOpponentMove;\n\n\n return averageDistanceDifference + largestMoveDifference;\n }",
"private int evaluateState() {\r\n\r\n\t\t// add up score\r\n\t\t//\r\n\t\tint scoreWhite = 0;\r\n\t\tint scoreBlack = 0;\r\n\t\tfor (Piece piece : this.chessGame.getPieces()) {\r\n\t\t\tif(piece.getColor() == Piece.COLOR_BLACK){\r\n\t\t\t\tscoreBlack +=\r\n\t\t\t\t\tgetScoreForPieceType(piece.getType());\r\n\t\t\t\tscoreBlack +=\r\n\t\t\t\t\tgetScoreForPiecePosition(piece.getRow(),piece.getColumn());\r\n\t\t\t}else if( piece.getColor() == Piece.COLOR_WHITE){\r\n\t\t\t\tscoreWhite +=\r\n\t\t\t\t\tgetScoreForPieceType(piece.getType());\r\n\t\t\t\tscoreWhite +=\r\n\t\t\t\t\tgetScoreForPiecePosition(piece.getRow(),piece.getColumn());\r\n\t\t\t}else{\r\n\t\t\t\tthrow new IllegalStateException(\r\n\t\t\t\t\t\t\"unknown piece color found: \"+piece.getColor());\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// return evaluation result depending on who's turn it is\r\n\t\tint gameState = this.chessGame.getGameState();\r\n\t\t\r\n\t\tif( gameState == ChessGame.GAME_STATE_BLACK){\r\n\t\t\treturn scoreBlack - scoreWhite;\r\n\t\t\r\n\t\t}else if(gameState == ChessGame.GAME_STATE_WHITE){\r\n\t\t\treturn scoreWhite - scoreBlack;\r\n\t\t\r\n\t\t}else if(gameState == ChessGame.GAME_STATE_END_WHITE_WON\r\n\t\t\t\t|| gameState == ChessGame.GAME_STATE_END_BLACK_WON){\r\n\t\t\treturn Integer.MIN_VALUE + 1;\r\n\t\t\r\n\t\t}else{\r\n\t\t\tthrow new IllegalStateException(\"unknown game state: \"+gameState);\r\n\t\t}\r\n\t}",
"private static int leftScore(char piece, State state, int row, int col) {\n\t\tif(col != 0 && state.getGrid()[row][col-1] == piece) {\n\t\t\treturn NEXT_TO;\n\t\t}\n\t\telse {\n\t\t\treturn ZERO;\n\t\t}\n\t}",
"private static int upScore(char piece, State state, int row, int col) {\n\t\tif(row != 0 && state.getGrid()[row-1][col] == piece) {\n\t\t\treturn NEXT_TO;\n\t\t}\n\t\telse {\n\t\t\treturn ZERO;\n\t\t}\n\t}",
"private float getGrade(ExamPerformance examPerformance) {\n if (examPerformance.isReexamination()) {\n return (examPerformance.getGrade() <= 3) ? 4 : 5;\n } else {\n return examPerformance.getGrade();\n }\n }",
"private int evalutateLine(int row,int col,int r,int c,int combo,SharedConstants.PlayableItem player){\n\t\tint score = 1;\n\t\tint maxRow = board.getROWS() -1;\n\t\tint maxCol = board.getCOLS() -1;\n\t\tint boundRow = row-r;\n\t\tint boundCol = col-c;\n\t\n\t\tif(!((boundRow <0 || boundRow >maxRow)||(boundCol <0|| boundCol >maxCol)))\n\t\t{\n\t\t\tif(board.getPlayField()[boundRow][boundCol].getGamePiece().equals(player)){\n\t\t\t\tscore = 10;\n\t\t\t}\n\t\t\telse if(board.getPlayField()[boundRow][boundCol].getGamePiece().equals(SharedConstants.PlayableItem.EMPTY)){\n\t\t\t\tscore = 1;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tscore = 0;\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tscore = 0;\n\t\t}\n\t\tif(combo >= 3){\n\t\t\treturn score;\n\t\t}\n\t\telse{\n\t\t\treturn score*evalutateLine(boundRow,boundCol,r,c,combo+1,player);\t\t\t\n\t\t}\n\t}",
"public int checkWin(Piece piece) {\n\t\t//check winning and losing\n\t\tint color=piece.getColor();\n\t\tif(piece.isRabbit()) {\n\t\t\tif(((Rabbit)piece).isOtherSide()) {\n\t\t\t\treturn color;\n\t\t\t}\n\t\t}\n\t\tif(rabbitcount[color]<=0) {\n\t\t\treturn 3-color;//the opponent wins\n\t\t}\n\t\treturn 0;\n\t}",
"private int getScoreForPieceType(int type){\r\n\t\tswitch (type) {\r\n\t\t\tcase Piece.TYPE_BISHOP: return 30;\r\n\t\t\tcase Piece.TYPE_KING: return 99999;\r\n\t\t\tcase Piece.TYPE_KNIGHT: return 30;\r\n\t\t\tcase Piece.TYPE_PAWN: return 10;\r\n\t\t\tcase Piece.TYPE_QUEEN: return 90;\r\n\t\t\tcase Piece.TYPE_ROOK: return 50;\r\n\t\t\tdefault: throw new IllegalArgumentException(\"unknown piece type: \"+type);\r\n\t\t}\r\n\t}",
"public String computeGrade(double quality) {\n\t\tString grade = \"\";\n\t\t\t\t\n\t\tif (quality < -3)\n\t\t\tgrade = \"C-\";\n\t\telse if (quality < -2)\n\t\t\tgrade = \"C+\";\n\t\telse if (quality < -1)\n\t\t\tgrade = \"C+\";\n\t\telse if (quality < -1)\n\t\t\tgrade = \"B-\";\n\t\telse if (quality < 0)\n\t\t\tgrade = \"B\";\n\t\telse if (quality < 1)\n\t\t\tgrade = \"B+\";\n\t\telse if (quality < 2)\n\t\t\tgrade = \"A-\";\n\t\telse if (quality < 3)\n\t\t\tgrade = \"A\";\n\t\telse //if (quality < 4)\n\t\t\tgrade = \"A+\";\n\t\t\t\t\n\t\treturn grade;\n\t}",
"public void calculateScores()\r\n {\r\n for(int i = 0; i < gameBoard.getBoardRows(); i++)\r\n for(int j = 0; j < gameBoard.getBoardCols(); j++)\r\n {\r\n if(gameBoard.tilePlayer(i,j) == 0)\r\n currentRedScore = currentRedScore + gameBoard.tileScore(i,j);\r\n if(gameBoard.tilePlayer(i,j) == 1)\r\n currentBlueScore = currentBlueScore + gameBoard.tileScore(i,j);\r\n }\r\n }",
"@Override\n public boolean checkRequirement(PlayerContext playerContext) {\n int sumOfRightColourAndLevelCard = 0;\n for (DevelopmentCard developmentCard : playerContext.getAllDevelopmentCards()){\n if (developmentCard.getColour() == cardColour && developmentCard.getLevel() == cardLevel)\n sumOfRightColourAndLevelCard ++;\n }\n return sumOfRightColourAndLevelCard >= numberOfCards;\n }",
"private float getStateCost(int[] board) {\r\n\t\tfloat cost = 0;\r\n\t\tfor (int i = 0; i < this.checkBoardSide; i++) {\r\n\t\t\tif (isQueenAttacked(i, board[i], board)) {\r\n\t\t\t\tcost++;\r\n\t\t\t\t// System.out.println(\"row: \" + i + \" attacked\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn cost;\r\n\r\n\t}",
"private static int rightScore(char piece, State state, int row, int col) {\n\t\tif(col != state.getGrid().length-1 && state.getGrid()[row][col+1] == piece) {\n\t\t\treturn NEXT_TO;\n\t\t}\n\t\telse {\n\t\t\treturn ZERO;\n\t\t}\n\t}",
"private static double downRightScore(char piece, State state, int row, int col) {\n\t\tif(row != state.getGrid().length-1 && col != state.getGrid()[row].length-1 && state.getGrid()[row+1][col+1] == piece) {\n\t\t\treturn DIAGONAL;\n\t\t}\n\t\telse {\n\t\t\treturn ZERO;\n\t\t}\n\t}",
"private static int downScore(char piece, State state, int row, int col) {\n\t\tif(row != state.getGrid().length-1 && state.getGrid()[row+1][col] == piece) {\n\t\t\treturn NEXT_TO;\n\t\t}\n\t\telse {\n\t\t\treturn ZERO;\n\t\t}\n\t}",
"private void chooseBestPiece() {\n\n int maxKillCount = 0;\n int tempKillCount;\n int piecesWithEqualMaxCount = 0;\n\n int bestPieceX = 0;\n int bestPieceY = 0;\n\n for (int y = 0; y < boardSize; y++) {\n for (int x = 0; x < boardSize; x++) {\n //check every piece\n Field field = board[y][x];\n if (field.getPiece() != null && field.getPiece().getPieceColor() == round) {\n tempKillCount = countAvailableKills(x, y, 0, this.board);\n //count piece kill score\n if (tempKillCount > maxKillCount) {\n maxKillCount = tempKillCount;\n piecesWithEqualMaxCount = 1;\n bestPieceX = x;\n bestPieceY = y;\n } else if (tempKillCount == maxKillCount) {\n piecesWithEqualMaxCount += 1;\n }\n }\n }\n }\n\n if (piecesWithEqualMaxCount == 1 && maxKillCount != 0) {\n bestPieceToMove = board[bestPieceY][bestPieceX].getPiece();\n bestPieceFound = true;\n\n findOptimalMove(bestPieceX, bestPieceY);\n\n System.out.println(\"Best piece found, kill score = \" + maxKillCount);\n } else if (piecesWithEqualMaxCount > 1) {\n bestPieceToMove = null;\n bestPieceFound = false;\n\n if (maxKillCount == 0) {\n //if every piece has same kill score equal to 0 there is no kill available\n killAvailable = false;\n System.out.println(\"No piece can kill\");\n } else {\n killAvailable = true;\n System.out.println(\"Some pieces has same kill score = \" + maxKillCount + \", user can choose which to move\");\n }\n }\n }",
"@Override\n public int compareTo(Object o) { \n if(this.getGrade()==((BoardCandidate)o).getGrade()){\n return (int)(Math.random()*10-Math.random()*10);\n }\n return this.getGrade()-((BoardCandidate)o).getGrade();\n }",
"protected double tripodEval(Gameboard board, int player) {\n\t\t\n\t\tList<List<Hexagon>> hexBoard = board.getBoard();\n\t\t\n\t\tWinChecker winCheck = new WinChecker();\n\t\t\n\t\tint minIndex = 0;\n\t\tint minPriority = Integer.MAX_VALUE;\n\t\tint counter = 0;\n\n\t\t//board.printBoard(System.out);\n\t\t\n\t\tinitialisePriorityValues(hexBoard, player);\n\t\t\n//\t\tfor(List<Hexagon> tempList : hexBoard){\n//\t\t\tfor(Hexagon tempHex : tempList){\n//\t\t\t\tif(tempHex == null){\n//\t\t\t\t\tcontinue;\n//\t\t\t\t}\n//\t\t\t\t\n//\t\t\t\tSystem.out.print(\" \" + tempHex.getPriorityValue());\n//\t\t\t\t\n//\t\t\t}\n//\t\t\tSystem.out.println();\n//\t\t}\n\n\t\tif (winCheck.tripodWin(board, player)) {\n\t\t\tSystem.out.println(\"A tripod win has been detected for \" + \n\t\t\t\t\tplayer);\n//\t\t\tboard.printBoard(System.out);\n\t\t\tMove toForce = board.getUpdatedMove();\n\t\t\ttoForce.P = swapPlayer(toForce.P);\n\t\t\tthis.forcedMove = toForce;\n\n\t\t\treturn 100000;\n\t\t}\n\n\t\tint opponent = 0;\n\n\t\t// Determining the colour of the opponent\n\t\tif (player == WHITE) {\n\t\t\topponent = BLACK;\n\t\t} else if (player == BLACK) {\n\t\t\topponent = WHITE;\n\t\t}\n\n\t\tint number = 0, minNum = Integer.MAX_VALUE, order = 1;\n\n\t\t//Variable for counting the number of edges that have been hit so far\n\t\tint[] edgeCounter = new int[6];\n\t\tfor (int i = 0; i < 6; i++) {\n\t\t\tedgeCounter[i] = 0;\n\t\t}\n\n\t\t//A queue of possible hexagons\n\t\tArrayList<Hexagon> hexQueue = new ArrayList<Hexagon>();\n\n\t\tfor (List<Hexagon> tempList : hexBoard) {\n\t\t\tinnerloop: for (Hexagon tempHex : tempList) {\n\n\t\t\t\tif (tempHex == null) {\n\t\t\t\t\tcontinue innerloop;\n\t\t\t\t}\n\n\t\t\t\tif (tempHex.getValue() != player) {\n\t\t\t\t\tcontinue innerloop;\n\t\t\t\t} else if (tempHex.getChecked() != 0) {\n\t\t\t\t\tcontinue innerloop;\n\t\t\t\t} else if(tempHex.isCorner()){\n\t\t\t\t\tcontinue innerloop;\n\t\t\t\t}\n\n\t\t\t\tif (tempHex.getValue() == player) {\n\t\t\t\t\thexQueue.add(tempHex);\n//\t\t\t\t\tSystem.out.println(\"The hex we are adding is at \" + \n\t\t\t\t\t//tempHex.getRow() + \" , \" + tempHex.getColumn());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(tempHex.getIsEdge() && !tempHex.isCorner()){\n\t\t\t\t\tint index1 = tempHex.whichEdge();\n\t\t\t\t\tif (index1 != -1) {\n\t\t\t\t\t\tedgeCounter[index1] = 1;\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println(index1 + \",\" + edgeCounter[index1]);\n\t\t\t\t}\n\n\t\t\t\t\n\n\t\t\t\twhile (!hexQueue.isEmpty()) {\n\t\t\t\t\t\n\t\t\t\t\t//Finding the next hexagon with the highest priority\n\t\t\t\t\tcounter = 0;\n\t\t\t\t\tminIndex = 0;\n\t\t\t\t\tminPriority = Integer.MAX_VALUE;\n\t\t\t\t\tfor(Hexagon minHex: hexQueue){\n\t\t\t\t\t\tif(minHex.getPriorityValue() < minPriority){\n\t\t\t\t\t\t\tminPriority = minHex.getPriorityValue();\n\t\t\t\t\t\t\tminIndex = counter;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcounter++;\n\t\t\t\t\t}\n\t\t\t\t\tHexagon currentHex = hexQueue.get(minIndex);\n\t\t\t\t\thexQueue.remove(minIndex);\n\t\t\t\t\t\n\t\t\t\t\t//\"Increasing\" the priority of the surrounding hexagons\n\t\t\t\t\tif(currentHex.getValue() == EMPTY){\n\t\t\t\t\t\tcurrentHex.updatePriorityValue(player, hexBoard, \n\t\t\t\t\t\t\t\thexQueue);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//Finding if the current hexagon is on the edge\n\t\t\t\t\tint loc1 = 0;\n\t\t\t\t\tif(currentHex.getIsEdge()){\n\t\t\t\t\t\tint k = currentHex.whichEdge();\n\t\t\t\t\t\tloc1 = k;\n\t\t\t\t\t\tif(k != -1){\n\t\t\t\t\t\t\tif(currentHex.getValue() == EMPTY && \n\t\t\t\t\t\t\t\t\tedgeCounter[k] == 1){\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tedgeCounter[k] = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n//\t\t\t\t\tSystem.out.println(\"loc = \"+ loc1 + \" \" + \"edgeCounter = \"\n//\t\t\t\t\t\t\t+ edgeCounter[loc1]);\n\t\t\t\t\tadjLoop : for (Coordinate coords : currentHex.adjacencies)\n\t\t\t\t\t{\n\n\t\t\t\t\t\tif (coords.getRow() == 999 || coords.getColumn() \n\t\t\t\t\t\t\t\t== 999) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tHexagon nextHex = hexBoard.get(coords.getRow()).get(\n\t\t\t\t\t\t\t\tcoords.getColumn());\n\n\t\t\t\t\t\tif(nextHex.getValue() == opponent){\n\t\t\t\t\t\t\tcontinue adjLoop;\n\t\t\t\t\t\t} else if(nextHex.isCorner()){\n\t\t\t\t\t\t\tcontinue adjLoop;\n\t\t\t\t\t\t} else if(nextHex.getChecked() != 0){\n\t\t\t\t\t\t\tcontinue adjLoop;\n\t\t\t\t\t\t} else if(hexQueue.contains(nextHex)){\n\t\t\t\t\t\t\tcontinue adjLoop;\n\t\t\t\t\t\t} else if(nextHex.getIsEdge()){\n\t\t\t\t\t\t\tint loc = nextHex.whichEdge();\n\t\t\t\t\t\t\tif(loc != -1){\n\t\t\t\t\t\t\t\tif(edgeCounter[loc] == 1){\n\t\t\t\t\t\t\t\t\tcontinue adjLoop;\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\thexQueue.add(nextHex);\n\n\t\t\t\t\t}// End of adjacency loop\n\n\t\t\t\t\t//Finding the number of empty hexagons we have traversed\n\t\t\t\t\tif (currentHex.getValue() == EMPTY) {\n\t\t\t\t\t\tnumber++;\n\t\t\t\t\t}\n\n//\t\t\t\t\tSystem.out.println(\"CurrentHex: \" + currentHex.getRow() + \n//\t\t\t\t\t\t\t\",\" + currentHex.getColumn() + \",\" + \n//\t\t\t\t\t\t\tcurrentHex.getValue());\n\t\t\t\t\t\n\t\t\t\t\tcurrentHex.setChecked(order);\n\t\t\t\t\torder++;\n\t\t\t\t\t\n\n\n\t\t\t\t\t//Finding the number of edges that have been hit \n\t\t\t\t\t//for this search\n\t\t\t\t\tint sum = 0;\n\t\t\t\t\tfor (int i = 0; i < 6; i++) {\n\t\t\t\t\t\tsum += edgeCounter[i];\n\t\t\t\t\t}\n\n\t\t\t\t\tif (sum >= 3) {\n\t\t\t\t\t\t// Possible tripod\n\t\t\t\t\t\twhile (!hexQueue.isEmpty()) {\n\t\t\t\t\t\t\thexQueue.clear();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t}// End of While Loop\n\t\t\t\t\n\t\t\t\t//Reseting the edge counter for the next search\n\t\t\t\tfor(int x = 0; x < 6; x++){\n\t\t\t\t\tedgeCounter[x] = 0;\n\t\t\t\t}\n\n\t\t\t\tif (number < minNum) {\n//\t\t\t\t\tSystem.out.println(number);\n\t\t\t\t\tminNum = number;\n\t\t\t\t}\n\t\t\n\t\t\t\t\n//\t\t\t\tfor(List<Hexagon> tempList1 : hexBoard){\n//\t\t\t\t\tfor(Hexagon tempHex1 : tempList1){\n//\t\t\t\t\t\tif(tempHex1 == null){\n//\t\t\t\t\t\t\tcontinue;\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\t\n//\t\t\t\t\t\tSystem.out.print(\" \" + tempHex1.getPriorityValue());\n//\t\t\t\t\t\t\n//\t\t\t\t\t}\n//\t\t\t\t\tSystem.out.println();\n//\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Re-initisalising Priority Values\n\t\t\t\tinitialisePriorityValues(hexBoard, player);\n\t\t\t\t\n\t\t\t\tnumber = 0;\n\n\t\t\t}// End of inner for loop\n\t\t}// End of outer for loop\n\n\t\tSystem.out.println(\"minnum = \" + minNum);\n\n\t\t\n\t\t\n//\t\tresetTreeEval(hexBoard);\n\t\tif (minNum == 0)\n\t\t\treturn 0;\n\t\telse\n\t\t\treturn 100.0 / minNum;\n\t}",
"@Override\r\n\tpublic BoardEvaluation evaluate(IBoard board, PlayerColor color) {\n\t\tBoardAnalyzer analyzer = board.getAnalyzer();\r\n\r\n\t\tBoardEvaluation e = new BoardEvaluation();\r\n\r\n\t\tint white = 0;\r\n\t\tint black = 0;\r\n\r\n\t\tList<IPiece> pieces = board.getAllPieces();\r\n\r\n\t\tint[] pawnCount = new int[2];\r\n\t\tint[] bishopCount = new int[2];\r\n\t\tint[] knightCount = new int[2];\r\n\t\tfor (IPiece piece : pieces) {\r\n\t\t\tif (piece.getColor() == PlayerColor.WHITE) {\r\n\t\t\t\twhite += piece.getPieceValue();\r\n\t\t\t} else {\r\n\t\t\t\tblack += piece.getPieceValue();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tint index = piece.getColor().ordinal();\r\n\t\t\tif (piece instanceof Pawn) {\r\n\t\t\t\tpawnCount[index]++;\r\n\t\t\t} else if (piece instanceof Bishop) {\r\n\t\t\t\tbishopCount[index]++;\r\n\t\t\t} else if (piece instanceof Knight) {\r\n\t\t\t\tknightCount[index]++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tint totalPieceValue = white + black;\r\n\t\tint blackIndex = PlayerColor.BLACK.ordinal();\r\n\t\tint whiteIndex = PlayerColor.WHITE.ordinal();\r\n\t\tblack += extraBishopValue(totalPieceValue, bishopCount[blackIndex]);\r\n\t\tblack += extraKnightValue(totalPieceValue, bishopCount[blackIndex]);\r\n\t\tblack += extraPawnValue(totalPieceValue, bishopCount[blackIndex]);\r\n\t\twhite += extraBishopValue(totalPieceValue, bishopCount[whiteIndex]);\r\n\t\twhite += extraKnightValue(totalPieceValue, bishopCount[whiteIndex]);\r\n\t\twhite += extraPawnValue(totalPieceValue, bishopCount[whiteIndex]);\r\n\r\n\t\t// Stalemate\r\n\t\tif (analyzer.isStalemate()) {\r\n\t\t\te.draw = true;\r\n\t\t\tblack += 90;\r\n\t\t} else if (analyzer.canClaimDraw()) {\r\n\t\t\tif (board.getTurn() == PlayerColor.WHITE) {\r\n\t\t\t\t// White can stop black from claiming draw\r\n\t\t\t\t//black += 50;\r\n\t\t\t} else {\r\n\t\t\t\t// Black can claim draw immediately!\r\n\t\t\t\te.draw = true;\r\n\t\t\t\tblack += 4;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Checkmate ?\r\n\t\tif (analyzer.isCheckmate(PlayerColor.BLACK)) {\r\n\t\t\twhite += 100;\r\n\t\t\te.checkmate = true;\r\n\t\t}\r\n\r\n\t\tif (analyzer.isCheckmate(PlayerColor.WHITE)) {\r\n\t\t\tblack += 100;\r\n\t\t\te.checkmate = true;\r\n\t\t}\r\n\r\n\t\tif (color == null) {\r\n\t\t\te.value = white - black;\r\n\t\t} else if (color == PlayerColor.BLACK) {\r\n\t\t\te.value = Math.abs(white - FULL_BOARD_VALUE);\r\n\t\t} else {\r\n\t\t\te.value = Math.abs(black - FULL_BOARD_VALUE);\r\n\t\t}\r\n\r\n\t\treturn e;\r\n\t}",
"public int evalBoard(){\n if (wins('o')){\n return 3;\n }\n // Return 0 if human wins\n else if (wins('b')){\n return 0;\n }\n //Return 2 if game is draw\n else if (isDraw()){\n return 2;\n }\n // Game is not a draw and no player has won. Game is still undecided.\n else {\n return 1;\n }\n }",
"private int getCost(Game game) {\n\n // Represents the sum of each tile value multiplied by its column index (Gives a tendency to move to the left)\n int weightedSum = 0;\n\n // Represents the number of diagonal pairs of matching value on the board.\n int diagCount = 0;\n\n // The number of tiles on the grid\n int tileCount = 0;\n\n Tile[][] tiles = game.tiles;\n\n for (int x = 0; x < BOARD_X; x++) {\n for (int y = 0; y < BOARD_Y; y++) {\n Tile tile = tiles[x][y];\n\n // Skip empty squares\n if (tile == null) {\n continue;\n }\n\n // Increment the weighted sum with product of the row index and the tile's value\n weightedSum += x * tile.getValue();\n tileCount++;\n\n // If all squares are occupied, return an arbitrarily large value such that this option is not picked.\n if (tileCount == maxTileCount) {\n return 100000;\n }\n\n // Since only up right and down right diagonals are computed, ignore the last row as this would push\n // index's out of range.\n if (x == BOARD_X - 1) {\n continue;\n }\n\n // Retrieve the upper right tile and updates the diagonal counter\n if (y > 0) {\n Tile ur = tiles[x + 1][y - 1];\n if (ur != null) {\n diagCount += (ur.getValue() == tile.getValue()) ? 1 : 0;\n }\n }\n\n // Retrieve the lower right tile and updates the diagonal counter\n if (y < BOARD_Y - 1) {\n Tile dr = tiles[x + 1][y + 1];\n if (dr != null) {\n if (dr.getValue() == tile.getValue()) {\n diagCount += (dr.getValue() == tile.getValue()) ? 1 : 0;\n }\n }\n }\n }\n }\n\n return weightedSum + diagCount;\n }",
"public int getHeuristicScore() {\n \tCell cell=curMap.getCell(nodePos[0], nodePos[1]);\r\n \tint cost=cell.getCost();\r\n \tint[] goal=curMap.getTerminal();\r\n \t//System.out.println(cost);\r\n \tint heuristic=Math.abs(nodePos[0] - goal[0]) + Math.abs(nodePos[1] - goal[1]);\r\n \treturn heuristic + cost;\r\n }",
"public int getHeuristicScore2() {\n \tCell cell=curMap.getCell(nodePos[0], nodePos[1]);\r\n \t//int cost=cell.getCost();\r\n \tint[] goal=curMap.getTerminal();\r\n \t//System.out.println(cost);\r\n \tint heuristic=Math.abs(nodePos[0] - goal[0]) + Math.abs(nodePos[1] - goal[1]);\r\n \treturn heuristic; //+ cost;\r\n }",
"public byte score() {\n\t\tbyte score = 0;\n\t\t\n\t\tfor (byte r = 0; r < b.length; r++) {\n\t\t\tfor (byte c = 0; c < b[r].length; c++) {\n\t\t\t\tif (b[r][c].getSide()) {\n\t\t\t\t\tscore += (b[r][c]).getValue();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse {\n\t\t\t\t\tscore -= (b[r][c]).getValue();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn score;\n\t}",
"public void findMaxComb() {\n\t\tHashMap<Integer, HashSet<Integer>> adj = new HashMap<Integer, HashSet<Integer>>();\n\t\tfor (int row=0; row< w; row++) {\n\t\t\tfor (int col=0; col<l; col++) {\n\t\t\t\tHashSet<Integer> hs = new HashSet<Integer>();\n\t\t\t\t//go left\n\t\t\t\tif (inBoard(row, col-1) && visited[row][col-1] != visited[row][col]) //in board and not equal\n\t\t\t\t\ths.add(visited[row][col-1]);\n\n\t\t\t\t//go up\n\t\t\t\tif (inBoard(row-1, col) && visited[row-1][col] != visited[row][col])\n\t\t\t\t\ths.add(visited[row-1][col]);\n\n\t\t\t\t//go right\n\t\t\t\tif (inBoard(row, col+1) && visited[row][col+1] != visited[row][col])\n\t\t\t\t\ths.add(visited[row][col+1]);\n\n\t\t\t\t//go down\n\t\t\t\tif (inBoard(row+1, col) && visited[row+1][col] != visited[row][col])\n\t\t\t\t\ths.add(visited[row+1][col]);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif (adj.containsKey(visited[row][col])) {\n\t\t\t\t\tHashSet<Integer> tt = adj.get(visited[row][col]);\n\t\t\t\t\ttt.addAll(hs);//union, return boolen\n\t\t\t\t\tadj.put(visited[row][col], tt); \n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tadj.put(visited[row][col], hs);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tint tempMax = 0;\n\t\tfor (Integer key : adj.keySet()) {\n\t\t\tfor (Integer ele : adj.get(key)) {\n\t\t\t\ttempMax = Math.max(tempMax, map.get(key) + map.get(ele));\n\t\t\t}\n\t\t}\n\t\tmaxComb = tempMax;\n\t}",
"public static int P4C4Score (Graph<Integer,String> g) {\n\t\t\r\n\t\tint totalP4C4s = 0;\r\n\t\t\r\n\t\t//Integer V[] = new Integer[g.getVertexCount()];\r\n\t\t//g.getVertices().toArray(V);\r\n\t\t\r\n\t\tfor (Integer a: g.getVertices()) {\r\n\t\t\tfor (Integer b: g.getVertices()) {\r\n\t\t\t\tif (b <= a) continue;\r\n\t\t\t\tfor (Integer c: g.getVertices()) {\r\n\t\t\t\t\tif (c <= a) continue;\r\n\t\t\t\t\tif (c <= b) continue;\r\n\t\t\t\t\tfor (Integer d: g.getVertices()) {\r\n\t\t\t\t\t\tif (d<=a) continue;\r\n\t\t\t\t\t\tif (d<=b) continue;\r\n\t\t\t\t\t\tif (d<=c) continue;\r\n\t\t\t\t\t\ttotalP4C4s += IsA.isP4orC4(g, a, b, c, d);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\treturn totalP4C4s;\r\n\t}",
"private int GetBestCard(Card[] card) {\n\t int iPos = 0;\n\t int iWeightTemp = 0;\n\t int iWeight[] = new int[8];\n\t for (int i = 0; i < 8; i++){\n\t\t iWeight[i] = -1;\n\t }\n\t // For each selectable card, work out a weight, the highest weight is the one selected.\n\t // The weight is worked out by the distance another of the players cards is from playable ones, with no playable cards in between\n\t Card myCard, nextCard;\n\t for (int i = 0; i < 8; i++){\n\t\t if (card[i] != null){\n\t\t\t // if card value > 7\n\t\t\t if (card[i].GetValue() > 7){\n\t\t\t\t // do you have cards that are higher than this card\n\t\t\t\t myCard = card[i];\n\t\t\t\t iWeightTemp = 0;\n\t\t\t \tfor (int j = 0; j < mCardCount; j++){\n\t\t\t \t\tnextCard = mCard[j];\n\t\t\t \t\tif (nextCard != null && nextCard.GetSuit() == myCard.GetSuit() && nextCard.GetValue() > myCard.GetValue()){\n\t\t\t \t\t\tif (nextCard.GetValue() - myCard.GetValue() > iWeightTemp)\n\t\t\t \t\t\t\tiWeightTemp = nextCard.GetValue() - myCard.GetValue();\n\t\t\t \t\t\tmyCard = nextCard;\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t \tiWeight[i] = iWeightTemp;\n\t\t\t \t\t\n\t\t\t }\n\t\t\t if (card[i].GetValue() < 7){\n\t\t\t\t // do you have cards that are lower than this card\n\t\t\t\t myCard = card[i];\n\t\t\t\t iWeightTemp = 0;\n\t\t\t \tfor (int j = mCardCount-1; j >=0; j--){\n\t\t\t \t\tnextCard = mCard[j];\n\t\t\t \t\tif (nextCard != null && nextCard.GetSuit() == myCard.GetSuit() && nextCard.GetValue() < myCard.GetValue()){\n\t\t\t \t\t\tif (myCard.GetValue() - nextCard.GetValue() > iWeightTemp)\n\t\t\t \t\t\t\tiWeightTemp = myCard.GetValue() - nextCard.GetValue();\n\t\t\t \t\t\tmyCard = nextCard;\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t \tiWeight[i] = iWeightTemp;\n\t\t\t \t\t\n\t\t\t }\t\n\t\t\t if (card[i].GetValue() == 7){\n\t\t\t\t // do you have cards that are in this suit\n\t\t\t\t myCard = card[i];\n\t\t\t\t int iWeightTemp1;\n\t\t\t\t iWeightTemp = 0;\n\t\t\t\t iWeightTemp1 = 0;\n\t\t\t\t // do you have cards that are higher than this card\n\t\t\t \tfor (int j = 0; j < mCardCount; j++){\n\t\t\t \t\tnextCard = mCard[j];\n\t\t\t \t\tif (nextCard != null && nextCard.GetSuit() == myCard.GetSuit() && nextCard.GetValue() > myCard.GetValue()){\n\t\t\t \t\t\tif (nextCard.GetValue() - myCard.GetValue() > iWeightTemp)\n\t\t\t \t\t\t\tiWeightTemp = nextCard.GetValue() - myCard.GetValue();\n\t\t\t \t\t\tmyCard = nextCard;\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t \tmyCard = card[i];\n\t\t\t \t// do you have cards that are lower than this card\n\t\t\t \tfor (int j = mCardCount-1; j >=0; j--){\n\t\t\t \t\tnextCard = mCard[j];\n\t\t\t \t\tif (nextCard != null && nextCard.GetSuit() == myCard.GetSuit() && nextCard.GetValue() < myCard.GetValue()){\n\t\t\t \t\t\tif (myCard.GetValue() - nextCard.GetValue() > iWeightTemp1)\n\t\t\t \t\t\t\tiWeightTemp1 = myCard.GetValue() - nextCard.GetValue();\n\t\t\t \t\t\tmyCard = nextCard;\n\t\t\t \t\t}\n\t\t\t \t} \t\n\t\t\t \tiWeight[i] = iWeightTemp + iWeightTemp1;\n\t\t\t \t\t\n\t\t\t }\t\t\t \n\t\t }\n\t\t \t \n\t }\n\t boolean bLoopAceKing = true;\n\t int iMaxTemp = 0;\n\t int iMaxCount = 0;\t\n\t int[] iMaxs;\n\t iMaxs = new int[8];\n\t while (bLoopAceKing){\n\t\t for (int i = 0; i < 8; i++){\n\t\t\t if (iWeight[i] >= iMaxTemp){\n\t\t\t\t if (iWeight[i] == iMaxTemp){\n\t\t\t\t\t iMaxs[iMaxCount] = i;\n\t\t\t\t\t iMaxCount++;\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t\t\t iMaxTemp = iWeight[i];\n\t\t\t\t\t iMaxs = new int[8];\n\t\t\t\t\t iMaxCount = 0;\n\t\t\t\t\t iMaxs[iMaxCount] = i;\n\t\t\t\t\t iMaxCount++;\n\t\t\t\t }\t\t\t \n\t\t\t }\t \n\t\t }\n\t\t boolean bAceKing = false;\n\t\t // If the top weight is zero, meaning your options don't help you, then play the one that is closest to ace/king\n\t\t if (iMaxTemp == 0 && iMaxCount > 1){\n\t\t\t for (int k = 0; k < iMaxCount; k++){\n\t\t\t\t\t iWeight[iMaxs[k]] = Math.abs(card[iMaxs[k]].GetValue()-7);\n\t\t\t\t\t bAceKing = true;\t\t\t\t \n\t\t\t } \t\t \n\t\t }\n\t\t if (bAceKing){\n\t\t\t bLoopAceKing = true;\n\t\t\t iMaxs = new int[8];\n\t\t\t iMaxTemp = 0;\n\t\t\t iMaxCount = 0;\t\t\t \n\t\t }\n\t\t else \n\t\t\t bLoopAceKing = false;\n\t }\n\t if (iMaxCount == 1)\n\t\t iPos = iMaxs[iMaxCount-1];\n\t else {\n\t\t Random generator = new Random();\n\t\t int randomIndex = generator.nextInt( iMaxCount );\n\t\t iPos = iMaxs[randomIndex];\n\t }\n\t\t \n\t return iPos;\n\t \n }",
"public int calcRank() {\n sortCardsInHand();\n\n // check Royal flush\n if (this.areCardsInStraight() && this.cards[0].getValue() == 10 && areCardsInSameSuite()) return 10;\n\n // Straight flush: All five cards in consecutive value order, with the same suit\n if (areCardsInSameSuite() && areCardsInStraight()) return 9;\n\n int pairCheck = CardOperations.numberOfPairs(this.getHashMapOfValues());\n\n // Four of a kind: Four cards of the same value\n if (pairCheck == 4) return 8;\n\n // Full house: Three of a kind and a Pair\n if (pairCheck == 5) return 7;\n\n // Flush: All five cards having the same suit\n if (areCardsInSameSuite()) return 6;\n\n // Straight: All five cards in consecutive value order\n if (areCardsInStraight()) return 5;\n\n // Three of a kind: Three cards of the same value\n if (pairCheck == 3) return 4;\n\n // Two pairs: Two different pairs\n if (pairCheck == 2) return 3;\n\n // A pair: Two cards of same value\n if (pairCheck == 1) return 2;\n\n // High card: Highest value card\n return 1;\n }",
"public static void validationcheck2(int row, int column, String piecevalue){\n\t\tString oppositepiece;\n\t\tif(piecevalue.equals(\"x\")){\n\t\t\toppositepiece=\"o\";\n\t\t}\n\t\telse if(piecevalue.equals(\"o\")){\n\t\t\toppositepiece=\"x\";\n\t\t}\n\t\telse{\n\t\t\toppositepiece=\"-\";\n\t\t}\n\t\t//R=right, L=left, T=top, B=bottom, and there are diagonals such as TL=top left.\n\t\tboolean foundR=false,foundL=false,foundT=false,foundB=false,foundTL=false,foundTR=false,foundBL=false,foundBR=false;\n\t\tint checkfurtherR=1,checkfurtherL=1,checkfurtherT=1,checkfurtherB=1,checkfurtherTL=1,checkfurtherTR=1,checkfurtherBL=1,checkfurtherBR=1;\n\t\twhile(board[row][column+checkfurtherR].equals(oppositepiece)){\n\t\t\tcheckfurtherR++;\n\t\t}\n\t\tif(board[row][column+checkfurtherR].equals(piecevalue)&&checkfurtherR>1){\n\t\t\tfoundR=true;\n\t\t}\n\t\twhile(board[row][column-checkfurtherL].equals(oppositepiece)){\n\t\t\tcheckfurtherL++;\n\t\t}\n\t\tif(board[row][column-checkfurtherL].equals(piecevalue)&&checkfurtherL>1){\n\t\t\tfoundL=true;\n\t\t}\n\t\twhile(board[row+checkfurtherB][column].equals(oppositepiece)){\n\t\t\tcheckfurtherB++;\n\t\t}\n\t\tif(board[row+checkfurtherB][column].equals(piecevalue)&&checkfurtherB>1){\n\t\t\tfoundB=true;\n\t\t}\n\t\twhile(board[row-checkfurtherT][column].equals(oppositepiece)){\n\t\t\tcheckfurtherT++;\n\t\t}\n\t\tif(board[row-checkfurtherT][column].equals(piecevalue)&&checkfurtherT>1){\n\t\t\tfoundT=true;\n\t\t}\n\t\twhile(board[row-checkfurtherTR][column+checkfurtherTR].equals(oppositepiece)){\n\t\t\tcheckfurtherTR++;\n\t\t}\n\t\tif(board[row-checkfurtherTR][column+checkfurtherTR].equals(piecevalue)&&checkfurtherTR>1){\n\t\t\tfoundTR=true;\n\t\t}\n\t\twhile(board[row-checkfurtherTL][column-checkfurtherTL].equals(oppositepiece)){\n\t\t\tcheckfurtherTL++;\n\t\t}\n\t\tif(board[row-checkfurtherTL][column-checkfurtherTL].equals(piecevalue)&&checkfurtherTL>1){\n\t\t\tfoundTL=true;\n\t\t}\n\t\twhile(board[row+checkfurtherBL][column-checkfurtherBL].equals(oppositepiece)){\n\t\t\tcheckfurtherBL++;\n\t\t}\n\t\tif(board[row+checkfurtherBL][column-checkfurtherBL].equals(piecevalue)&&checkfurtherBL>1){\n\t\t\tfoundBL=true;\n\t\t}\n\t\twhile(board[row+checkfurtherBR][column+checkfurtherBR].equals(oppositepiece)){\n\t\t\tcheckfurtherBR++;\n\t\t}\n\t\tif(board[row+checkfurtherBR][column+checkfurtherBR].equals(piecevalue)&&checkfurtherBR>1){\n\t\t\tfoundBR=true;\n\t\t}\n\t\tif(foundR==true||foundL==true||foundT==true||foundB==true||foundTL==true||foundTR==true||foundBL==true||foundBR==true){\n\t\t\tvalidation=true;\n\t\t}\n\t\telse{\n\t\t\tvalidation=false;\n\t\t}\n\t}",
"public static int P4Score (Graph<Integer,String> g) {\n\t\tint totalP4s = 0;\r\n\t\t\r\n\t\tfor (Integer a: g.getVertices()) {\r\n\t\t\tfor (Integer b: g.getVertices()) {\r\n\t\t\t\tif (b <= a) continue;\r\n\t\t\t\tfor (Integer c: g.getVertices()) {\r\n\t\t\t\t\tif (c <= a) continue;\r\n\t\t\t\t\tif (c <= b) continue;\r\n\t\t\t\t\tfor (Integer d: g.getVertices()) {\r\n\t\t\t\t\t\tif (d<=a) continue;\r\n\t\t\t\t\t\tif (d<=b) continue;\r\n\t\t\t\t\t\tif (d<=c) continue;\r\n\t\t\t\t\t\ttotalP4s += IsA.isP4(g, a, b, c, d);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\treturn totalP4s;\r\n\t}",
"public int score() {\n int sum = 0;\n for (Candidate c : chosen) {\n sum += c.score(compatibilityScoreSet);\n }\n return sum;\n }",
"public int checkRiskLevelCornerTL() {\n if (board[0][1] != null && board[1][0] != null &&\n board[0][0] == null)\n if ((board[0][1].getPlayerNumber() ==\n board[1][0].getPlayerNumber()) && board[0][1].getPlayerNumber() != getCurrentPlayer()) {\n return 1;\n }\n\n //top-left corner case YELLOW\n if ((board[0][1] != null && board[0][0] == null)\n && board[0][1].getPlayerNumber() != getCurrentPlayer())\n return 2;\n else if ((board[1][0] != null &&\n board[0][0] == null) && board[1][0].getPlayerNumber() != getCurrentPlayer()) {\n return 2;\n }\n return 9;\n }",
"private int getBestMove(int[] board, int depth, boolean turn) {\n int boardCopy[];\n if (depth <= 0) {\n return 0;\n }\n if (depth > STEP_BACK_DEPTH) {\n try {\n Thread.sleep(3);\n } catch (InterruptedException e) {\n e.printStackTrace();\n if (shouldStop()) {\n Log.d(Constants.MY_TAG,\"out CalculatingBot\");\n unlock();\n return 0;\n }\n }\n }\n if (turn) {\n int minimum = MAXIMUM_POSSIPLE_SCORE_DIFFERENCE;\n for (int i = 0; i < 5; i++) {\n if (board[i] < 2) {\n continue;\n }\n boardCopy = board.clone();\n int x = playMove(boardCopy, i);\n int y = 0;\n if (!hasPlayer2Move(boardCopy)) {\n if (hasPlayer1Move(boardCopy)) {\n y = getBestMove(boardCopy, depth - 1, turn);\n } else {\n for (int j = 0; j < 5; j++) {\n y = y - boardCopy[j];\n }\n for (int j = 5; j < 10; j++) {\n y = y + boardCopy[j];\n }\n }\n } else {\n y = getBestMove(boardCopy, depth - 1, ! turn);\n }\n int z = y - x;\n if (z < minimum) {\n minimum = z;\n }\n }\n int i = 10;\n if (board[2] < 2) {\n return minimum;\n }\n boardCopy = board.clone();\n int x = playMove(boardCopy, i);\n int y = 0;\n if (!hasPlayer2Move(boardCopy)) {\n if (hasPlayer1Move(boardCopy)) {\n y = getBestMove(boardCopy, depth - 1, turn);\n } else {\n for (int j = 0; j < 5; j++) {\n y = y - boardCopy[j];\n }\n for (int j = 5; j < 10; j++) {\n y = y + boardCopy[j];\n }\n }\n } else {\n y = getBestMove(boardCopy, depth - 1, !turn);\n }\n int z = y - x;\n if (z < minimum) {\n minimum = z;\n }\n return minimum;\n } else {\n int maximum = MINIMUM_POSSIPLE_SCORE_DIFFERENCE;\n for (int i = 5; i < 10; i++) {\n if (board[i] < 2) {\n continue;\n }\n boardCopy = board.clone();\n int x = playMove(boardCopy, i);\n int y = 0;\n if (!hasPlayer1Move(boardCopy)) {\n if (hasPlayer2Move(boardCopy)) {\n y = getBestMove(boardCopy, depth - 1, turn);\n } else {\n for (int j = 0; j < 5; j++) {\n y = y - boardCopy[j];\n }\n for (int j = 5; j < 10; j++) {\n y = y + boardCopy[j];\n }\n }\n } else {\n y = getBestMove(boardCopy, depth - 1, !turn);\n }\n int z = y + x;\n if (z > maximum) {\n maximum = z;\n }\n }\n int i = 11;\n if (board[7] < 2) {\n return maximum;\n }\n boardCopy = board.clone();\n int x = playMove(boardCopy, i);\n int y = 0;\n if (!hasPlayer1Move(boardCopy)) {\n if (hasPlayer2Move(boardCopy)) {\n y = getBestMove(boardCopy, depth - 1, turn);\n } else {\n for (int j = 0; j < 5; j++) {\n y = y - boardCopy[j];\n }\n for (int j = 5; j < 10; j++) {\n y = y + boardCopy[j];\n }\n }\n } else {\n y = getBestMove(boardCopy, depth - 1, !turn);\n }\n int z = y + x;\n if (z > maximum) {\n maximum = z;\n }\n return maximum;\n }\n }",
"@Override\n public int getWinner() {\n /*\n * To please the test as well as the game\n * Temporarily change the turn colour\n */\n int temp;\n if (whoseTurn() == RED) {\n temp = YELLOW;\n } else {\n temp = RED;\n }\n\n //test horizontally\n //set x to 1 as the placed counter will always be correct\n int x = 1;\n int i = 1;\n //to check if zero has been found\n boolean leftZeroFound = false;\n boolean rightZeroFound = false;\n while (!rightZeroFound || !leftZeroFound) {\n //check to right of last placed\n if (!rightZeroFound && inBounds(0, i)\n && board[lastPlacedRow][lastPlacedCol + i] == temp) {\n x++;\n } else {\n rightZeroFound = true;\n }\n\n //check to left of last placed\n if (!leftZeroFound && inBounds(0, -i)\n && board[lastPlacedRow][lastPlacedCol - i] == temp) {\n x++;\n } else {\n leftZeroFound = true;\n }\n\n i++;\n }\n //return the winning colour if a row has been found\n if (x >= NUM_IN_A_ROW_TO_WIN) {\n return temp;\n }\n\n //check vertically\n //reset x to 1 as the placed counter will always be correct\n x = 1;\n i = 1;\n //to check if zero has been found\n boolean zeroFound = false;\n while (!zeroFound) {\n //check below last placed\n if (inBounds(-i, 0) && board[lastPlacedRow - i][lastPlacedCol] == temp) {\n x++;\n } else {\n zeroFound = true;\n }\n\n i++;\n }\n //return the winning colour if a row has been found\n if (x >= NUM_IN_A_ROW_TO_WIN) {\n return temp;\n }\n\n //check top right diagonal\n //reset x to 1 as the placed counter will always be correct\n x = 1;\n i = 1;\n //to check if zero has been found\n leftZeroFound = false;\n rightZeroFound = false;\n while (!rightZeroFound || !leftZeroFound) {\n //check top right diagonal\n if (!rightZeroFound && inBounds(i, i)\n && board[lastPlacedRow + i][lastPlacedCol + i] == temp) {\n x++;\n } else {\n rightZeroFound = true;\n }\n\n //check bottom left\n if (!leftZeroFound && inBounds(-i, -i)\n && board[lastPlacedRow - i][lastPlacedCol - i] == temp) {\n x++;\n } else {\n leftZeroFound = true;\n }\n\n i++;\n }\n if (x >= NUM_IN_A_ROW_TO_WIN) {\n return temp;\n }\n\n //check top left\n //set x to 1 as the placed counter will always be correct\n x = 1;\n i = 1;\n //to check if zero has been found\n leftZeroFound = false;\n rightZeroFound = false;\n while (!rightZeroFound || !leftZeroFound) {\n //check top left\n if (!leftZeroFound && inBounds(i, -i)\n && board[lastPlacedRow + i][lastPlacedCol - i] == temp) {\n x++;\n } else {\n leftZeroFound = true;\n }\n\n //check bottom right\n if (!rightZeroFound && inBounds(-i, i)\n && board[lastPlacedRow - i][lastPlacedCol + i] == temp) {\n x++;\n } else {\n rightZeroFound = true;\n }\n\n i++;\n }\n //return the winning colour if a row has been found\n if (x >= NUM_IN_A_ROW_TO_WIN) {\n return temp;\n }\n\n //return Empty if a winner has not been found\n return EMPTY;\n }",
"private int[] getBestMoveAndScoreDifference(int[] board, int depth, boolean turn) {\n int boardCopy[];\n if (depth <= 0) {\n return new int[] {0,-1};\n }\n if (turn) {\n int minimum = MAXIMUM_POSSIPLE_SCORE_DIFFERENCE;\n int move = -1;\n for (int i = 0; i < 5; i++) {\n if (board[i] < 2) {\n continue;\n }\n boardCopy = board.clone();\n int x = playMove(boardCopy, i);\n int y = 0;\n if (!hasPlayer2Move(boardCopy)) {\n if (hasPlayer1Move(boardCopy)) {\n y = getBestMove(boardCopy, depth - 1, turn);\n } else {\n for (int j = 0; j < 5; j++) {\n y = y - boardCopy[j];\n }\n for (int j = 5; j < 10; j++) {\n y = y + boardCopy[j];\n }\n }\n } else {\n y = getBestMove(boardCopy, depth - 1, ! turn);\n }\n int z = y - x;\n if (z < minimum) {\n minimum = z;\n move = i;\n }\n }\n int i = 10;\n if (board[2] < 2) {\n return new int[] {minimum,move};\n }\n boardCopy = board.clone();\n int x = playMove(boardCopy, i);\n int y = 0;\n if (!hasPlayer2Move(boardCopy)) {\n if (hasPlayer1Move(boardCopy)) {\n y = getBestMove(boardCopy, depth - 1, turn);\n } else {\n for (int j = 0; j < 5; j++) {\n y = y - boardCopy[j];\n }\n for (int j = 5; j < 10; j++) {\n y = y + boardCopy[j];\n }\n }\n } else {\n y = getBestMove(boardCopy, depth - 1, !turn);\n }\n int z = y - x;\n if (z < minimum) {\n minimum = z;\n move = i;\n }\n return new int[] {minimum,move};\n } else {\n int maximum = MINIMUM_POSSIPLE_SCORE_DIFFERENCE;\n int move = -1;\n for (int i = 5; i < 10; i++) {\n if (board[i] < 2) {\n continue;\n }\n boardCopy = board.clone();\n int x = playMove(boardCopy, i);\n int y = 0;\n if (!hasPlayer1Move(boardCopy)) {\n if (hasPlayer2Move(boardCopy)) {\n y = getBestMove(boardCopy, depth - 1, turn);\n } else {\n for (int j = 0; j < 5; j++) {\n y = y - boardCopy[j];\n }\n for (int j = 5; j < 10; j++) {\n y = y + boardCopy[j];\n }\n }\n } else {\n y = getBestMove(boardCopy, depth - 1, !turn);\n }\n int z = y + x;\n if (z > maximum) {\n maximum = z;\n move = i;\n }\n }\n int i = 11;\n if (board[7] < 2) {\n return new int[] {maximum,move};\n }\n boardCopy = board.clone();\n int x = playMove(boardCopy, i);\n int y = 0;\n if (!hasPlayer1Move(boardCopy)) {\n if (hasPlayer2Move(boardCopy)) {\n y = getBestMove(boardCopy, depth - 1, turn);\n } else {\n for (int j = 0; j < 5; j++) {\n y = y - boardCopy[j];\n }\n for (int j = 5; j < 10; j++) {\n y = y + boardCopy[j];\n }\n }\n } else {\n y = getBestMove(boardCopy, depth - 1, !turn);\n }\n int z = y + x;\n if (z > maximum) {\n maximum = z;\n move = i;\n }\n return new int[] {maximum,move};\n }\n }",
"public void calculateHighscores(){\n if((newPlayer.getScore() > (getRecord())) && (newPlayer.getScore() > getRecord2()) && (newPlayer.getScore() > getRecord3())){\n setRecord3(getRecord2());\n setRecord2(getRecord());\n setRecord(newPlayer.getScore());\n newPlayer.resetScore();\n }\n if((newPlayer.getScore() > getRecord2()) && (newPlayer.getScore() > getRecord3()) && (newPlayer.getScore() < getRecord())){\n setRecord3(getRecord2());\n setRecord2(newPlayer.getScore());\n newPlayer.resetScore();\n }\n if((newPlayer.getScore() > getRecord3()) && newPlayer.getScore() < getRecord2()){\n setRecord3(newPlayer.getScore());\n newPlayer.resetScore();\n }else{\n newPlayer.resetScore();\n\n }\n }",
"private String calcFinalGrade() {\n\t\tString finalGrade;\n\t\t\n\t\tif (scorePercent >= .895)\n\t\t\tfinalGrade = \"A\";\n\t\telse if(scorePercent >= .795 && scorePercent < .895)\n\t\t\tfinalGrade = \"B\";\n\t\telse if(scorePercent >= .685 && scorePercent < .795)\n\t\t\tfinalGrade = \"C\";\n\t\telse if (scorePercent > .585 && scorePercent < .685)\n\t\t\tfinalGrade = \"D\";\n\t\telse\n\t\t\tfinalGrade = \"F\";\n\n\t\treturn finalGrade;\n\t}",
"public float calculateGrade() {\r\n\t\t// Creating variables for correct answers, total questions and the grade itself.\r\n\t\tint correct = 0;\r\n\t\tint total = correctAnswers.size();\r\n\t\tfloat grade = 0;\r\n\t\t// Loop that goes around the list with user's answers and correct answers.\r\n\t\tfor (int i = 0; i < correctAnswers.size(); i++) {\r\n\t\t\t// Creating variable result which compare the elements from the two list index\r\n\t\t\t// by index.\r\n\t\t\tint result = (userAnswers.get(i).compareTo(correctAnswers.get(i)));\r\n\t\t\t// Condition that increments the variable correct with one every time when there\r\n\t\t\t// is match between the lists' elements by index.\r\n\t\t\tif (result == 0) {\r\n\t\t\t\tcorrect++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Calculating the grade of the student.\r\n\t\tgrade = (float) ((double) correct / total * 100);\r\n\t\treturn grade;\r\n\t}",
"public int gameStatus() {\n \t\tfor(int x = 0;x<3;x++) {\n \t\t\tif((Grid[x][0] == Grid[x][1]) && (Grid[x][1] == Grid[x][2]))\n \t\t\t\tif(Grid[x][0] != 0 && Grid[x][1] != 0 && Grid[x][2] != 0)\n \t\t\t\t\treturn Grid[x][0];\n \t\t}\n \t\tfor(int y=0;y<3;y++) {\n \t\t\tif((Grid[0][y] == Grid[1][y]) && (Grid[1][y] == Grid[2][y])) \n \t\t\t\tif(Grid[0][y] != 0 && Grid[1][y] != 0 && Grid[2][y] != 0)\n \t\t\t\t\treturn Grid[0][y];\n \t\t}\n \t\tif(Grid[0][0] == Grid[1][1] && Grid[1][1] == Grid[2][2]) \n \t\t\tif(Grid[0][0] != 0 && Grid[1][1] != 0 && Grid[2][2] != 0)\n \t\t\t\treturn Grid[0][0];\n \t\tif(Grid[2][0] == Grid[1][1] && Grid[1][1] == Grid[0][2])\n \t\t\tif(Grid[2][0] != 0 && Grid[1][1] != 0 && Grid[0][2] != 0)\n \t\t\t\treturn Grid[0][0];\n \t\tfor(int x = 0;x<3;x++) {\n \t\t\tfor(int y = 0;y<3;y++) {\n \t\t\t\tif(Grid[x][y] == 0)\n \t\t\t\t\treturn 0;\n \t\t\t}\n \t\t}\n \t\treturn 3;\t\t\n \t}",
"public Map<Color, Integer> getScores( Board board) {\n Map<Color, Integer> num_of_disks = new TreeMap<Color, Integer>();\n for (Color c : Color.values()) {\n num_of_disks.put(c, 0);\n }\n //count disks of each color\n for (int i = 0; i < board.getRows(); i++) {\n for (int j = 0; j < board.getCols(); j++) {\n if (board.getCell(i,j).getDisk() != null) {\n for (Color c : Color.values()) {\n if (board.getCell(i,j).getDisk().getColor() == c) {\n num_of_disks.put(c, num_of_disks.get(c) + 1);\n }\n }\n }\n }\n }\n return num_of_disks;\n }",
"private double getUnadjustedFitness(Computer computer){\n double score = 0;\n score += 6 * getMatchPercent(computer);\n if(computer.compatible() && sizeCompatability(computer))\n score += 9.5;\n int ramAmount =computer.ramAmount();\n if(ramAmount < 8)\n score -= (8 - ramAmount) * 2;\n else if(ramAmount > 8 && ramAmount < 17)\n score += .06 * (ramAmount - 8);\n else if(ramAmount > 17)\n score += .03 * (ramAmount - 8);\n\n if(computer.cpu.name.contains(\"Intel\") && computer.cpu.name.endsWith(\"K\")){\n if (!computer.motherboard.overclock()){\n score -= 6;\n }\n }\n\n if(computer.cpu.name.contains(\"Intel\") && !(computer.cpu.shortname.contains(\"-5\") || computer.cpu.shortname.contains(\"-6\"))){\n score -= 2;\n }\n if(computer.cpu.name.contains(\"GeForce\") && !(computer.gpu.name.contains(\"GTX 9\") || computer.gpu.name.contains(\"GTX 1\"))){\n score -= 2;\n }\n if(computer.bootDrive.size < 240)\n score -= settings.diskSize * 0.33;\n if(computer.bootDrive.size > 700)\n score += settings.diskSize * 5;\n else\n score += settings.diskSize * computer.bootDrive.size / 140;\n if(computer.secondaryDrive != null)\n score += settings.diskSize * computer.secondaryDrive.size / 1000;\n\n //Now ensure there's enough power, and give a bonus for there being ~300 watts more than needed;\n //there are 4.5 points to gain in powersupply, 10 points to lose\n int basePower = computer.powerConsumption();\n int ideal = basePower + 65;\n if(computer.power.watts < basePower)\n score -= 10;\n else if(computer.power.watts < ideal)\n score += (basePower - computer.power.watts) / 100;\n else\n score += 2.5 - (computer.power.watts - basePower) / 250;\n score += (3 - computer.power.tier) * .6;\n\n // Now motherboard, one point to gain, one to lose\n score += 2 - computer.motherboard.getQuality();\n\n double driveScore = ((computer.bootDrive.reads + computer.bootDrive.writes) / 2) / 88;\n driveScore -= 2;\n if(driveScore > 7.5){\n driveScore = 7.5;\n }\n score += driveScore;\n double rawCpu = ((1 - settings.multicore) / 3) * computer.cpu.singlecore + ((settings.multicore / 3) * (computer.cpu.multicore));\n double adjustedCpu = 26 + 40* ((settings.cpuIntensity / (settings.cpuIntensity + settings.gpuIntensity))* rawCpu - lowCpuScore()) / (maxCpuScore() - lowCpuScore());\n double rawGpu = computer.gpu.fps + (computer.gpu.threedmark / 100);\n double adjustedGpu = 17 + 40 * ((settings.gpuIntensity / (settings.cpuIntensity + settings.gpuIntensity)) * rawGpu - lowGpuScore()) / (maxGpuScore() - lowGpuScore());\n //Inflate the GPU score slightly\n // adjustedGpu * ((35 - adjustedGpu) / 35);\n score += adjustedGpu;\n score += adjustedCpu;\n\n return score;\n }",
"public void calculateThreats(Piece piece, Piece[][] board) {\n Location one = new Location(piece.getLocation().getX() + 1, piece.getLocation().getY() - 2);\n Location two = new Location(piece.getLocation().getX() + 2, piece.getLocation().getY() - 1);\n Location three = new Location(piece.getLocation().getX() + 2, piece.getLocation().getY() + 1);\n Location four = new Location(piece.getLocation().getX() + 1, piece.getLocation().getY() + 2);\n Location five = new Location(piece.getLocation().getX() - 1, piece.getLocation().getY() + 2);\n Location six = new Location(piece.getLocation().getX() - 2, piece.getLocation().getY() + 1);\n Location seven = new Location(piece.getLocation().getX() - 2, piece.getLocation().getY() - 1);\n Location eight = new Location(piece.getLocation().getX() - 1, piece.getLocation().getY() - 2);\n\n if (one.isLegalIndex() && board[one.getX()][one.getY()] != null && board[one.getX()][one.getY()].getColor() != piece.getColor()) {\n // Sets the pieces point to half\n board[one.getX()][one.getY()].setPoint();\n // Sets the pieces threatened situation is true.\n // So, we do not calculate point again for this piece\n board[one.getX()][one.getY()].isThreatened = true;\n }\n if (two.isLegalIndex() && board[two.getX()][two.getY()] != null && board[two.getX()][two.getY()].getColor() != piece.getColor()) {\n board[two.getX()][two.getY()].setPoint();\n board[two.getX()][two.getY()].isThreatened = true;\n }\n if (three.isLegalIndex() && board[three.getX()][three.getY()] != null && board[three.getX()][three.getY()].getColor() != piece.getColor()) {\n board[three.getX()][three.getY()].setPoint();\n board[three.getX()][three.getY()].isThreatened = true;\n }\n if (four.isLegalIndex() && board[four.getX()][four.getY()] != null && board[four.getX()][four.getY()].getColor() != piece.getColor()) {\n board[four.getX()][four.getY()].setPoint();\n board[four.getX()][four.getY()].isThreatened = true;\n }\n if (five.isLegalIndex() && board[five.getX()][five.getY()] != null && board[five.getX()][five.getY()].getColor() != piece.getColor()) {\n board[five.getX()][five.getY()].setPoint();\n board[five.getX()][five.getY()].isThreatened = true;\n }\n if (six.isLegalIndex() && board[six.getX()][six.getY()] != null && board[six.getX()][six.getY()].getColor() != piece.getColor()) {\n board[six.getX()][six.getY()].setPoint();\n board[six.getX()][six.getY()].isThreatened = true;\n }\n if (seven.isLegalIndex() && board[seven.getX()][seven.getY()] != null && board[seven.getX()][seven.getY()].getColor() != piece.getColor()) {\n board[seven.getX()][seven.getY()].setPoint();\n board[seven.getX()][seven.getY()].isThreatened = true;\n }\n if (eight.isLegalIndex() && board[eight.getX()][eight.getY()] != null && board[eight.getX()][eight.getY()].getColor() != piece.getColor()) {\n board[eight.getX()][eight.getY()].setPoint();\n board[eight.getX()][eight.getY()].isThreatened = true;\n }\n }",
"public int AI(){\n for(int i=0; i<3; i++){\n for(int j=0; j<7; j++){\n if(board[i][j]==0 && board[i+1][j]==2 && board[i+2][j]==2 && board[i+3][j]==2){\n return j;\n \n }\n }\n }\n //checks for horizontals (Y-YY)\n for(int i=0; i<6; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==2 && board[i][j+1]==0 && board[i][j+2]==2 && board[i][j+3]==2){\n if((i==5)||\n (i==4&&board[5][j+1]!=0) ||\n (i==3&&board[5][j+1]!=0&&board[4][j+1]!=0) ||\n (i==2&&board[5][j+1]!=0&&board[4][j+1]!=0&&board[3][j+1]!=0) ||\n (i==1&&board[5][j+1]!=0&&board[4][j+1]!=0&&board[3][j+1]!=0&&board[2][j+1]!=0) ||\n (i==0&&board[5][j+1]!=0&&board[4][j+1]!=0&&board[3][j+1]!=0&&board[2][j+1]!=0&&board[1][j+1]!=0) ||\n (i==0&&board[5][j+1]!=0&&board[4][j+1]!=0&&board[3][j+1]!=0&&board[2][j+1]!=0&&board[1][j+1]!=0&&board[0][j+1]!=0)){\n return j+1;\n }\n }\n }\n }\n //checks for horizontals (YY-Y)\n for(int i=0; i<6; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==2 && board[i][j+1]==2 && board[i][j+2]==0 && board[i][j+3]==2){\n if((i==5)||\n (i==4&&board[5][j+2]!=0) ||\n (i==3&&board[5][j+2]!=0&&board[4][j+2]!=0) ||\n (i==2&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0) ||\n (i==1&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0&&board[2][j+2]!=0) ||\n (i==0&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0&&board[2][j+2]!=0&&board[1][j+2]!=0) ||\n (i==0&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0&&board[2][j+2]!=0&&board[1][j+2]!=0&&board[0][j+2]!=0)){\n return j+2;\n }\n }\n }\n }\n //checks for horizontals (-YYY)\n for(int i=0; i<6; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==0 && board[i][j+1]==2 && board[i][j+2]==2 && board[i][j+3]==2){\n if((i==5)||\n (i==4&&board[5][j]!=0) ||\n (i==3&&board[5][j]!=0&&board[4][j]!=0) ||\n (i==2&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0) ||\n (i==1&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0&&board[2][j]!=0) ||\n (i==0&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0&&board[2][j]!=0&&board[1][j]!=0) ||\n (i==0&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0&&board[2][j]!=0&&board[1][j]!=0&&board[0][j]!=0)){\n return j;\n }\n }\n }\n }\n //checks for horizontals (YYY-)\n for(int i=0; i<6; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==2 && board[i][j+1]==2 && board[i][j+2]==2 && board[i][j+3]==0){\n if((i==5)||\n (i==4&&board[5][j+3]!=0) ||\n (i==3&&board[5][j+3]!=0&&board[4][j+3]!=0) ||\n (i==2&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0) ||\n (i==1&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0&&board[0][j+3]!=0)){\n return j+3;\n }\n }\n }\n }\n //checks for diagonal (-YYY)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i+3][j]==0 && board[i+2][j+1]==2 && board[i+1][j+2]==2 && board[i][j+3]==2){\n if((i+3==5)||\n (i+2==4&&board[5][j]!=0)||\n (i+1==3&&board[5][j]!=0&&board[4][j]!=0)||\n (i==2&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0)||\n (i==1&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0&&board[2][j]!=0)||\n (i==0&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0&&board[2][j]!=0&&board[1][j]!=0)){\n return j;\n }\n }\n }\n }\n //checks for diagonal (Y-YY)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i+3][j]==2 && board[i+2][j+1]==0 && board[i+1][j+2]==2 && board[i][j+3]==2){\n if((i==2&&board[5][j+1]!=0)||\n (i==1&&board[5][j+1]!=0&&board[4][j+1]!=0)||\n (i==0&&board[5][j+1]!=0&&board[4][j+1]!=0&&board[3][j+1]!=0)){\n return j+1;\n }\n }\n }\n }\n //checks for diagonal (YY-Y)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i+3][j]==2 && board[i+2][j+1]==2 && board[i+1][j+2]==0 && board[i][j+3]==2){\n if((i==2&&board[5][j+2]!=0&&board[4][j+2]!=0)||\n (i==1&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0)||\n (i==0&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0&&board[2][j+2]!=0)){\n return j+2;\n }\n }\n }\n }\n //checks for diagonal (YYY-)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i+3][j]==2 && board[i+2][j+1]==2 && board[i+1][j+2]==2 && board[i][j+3]==0){\n if((i==2&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0)||\n (i==1&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0)||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0)){\n return j+3;\n }\n }\n }\n }\n //checks for subdiagonal (-YYY)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==0 && board[i+1][j+1]==2 && board[i+2][j+2]==2 && board[i+3][j+3]==2){\n if((i==0&&board[1][j]!=0)||\n (i==1&&board[2][j]!=0)||\n (i==2&&board[3][j]!=0)){\n return j;\n }\n }\n }\n }\n //checks for subdiagonal (Y-YY)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==2 && board[i+1][j+1]==0 && board[i+2][j+2]==2 && board[i+3][j+3]==2){\n if((i==0&&board[2][j+1]!=0)||\n (i==1&&board[3][j+1]!=0)||\n (i==2&&board[4][j+1]!=0)){\n return j+1;\n }\n }\n }\n }\n //checks for subdiagonal (YY-Y)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==2 && board[i+1][j+1]==2 && board[i+2][j+2]==0 && board[i+3][j+3]==2){\n if((i==0&&board[3][j+2]!=0)||\n (i==1&&board[4][j+2]!=0)||\n (i==2&&board[5][j+2]!=0)){\n return j+2;\n }\n }\n }\n }\n //checks for subdiagonal (YYY-)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==2 && board[i+1][j+1]==2 && board[i+2][j+2]==2 && board[i+3][j+3]==0){\n if((i==0&&board[4][j+3]!=0)||\n (i==1&&board[5][j+3]!=0)||\n (i==2)){\n return j+3;\n }\n }\n }\n }\n //BLOCK CHECKER\n //columns\n for(int i=0; i<3; i++){\n for(int j=0; j<7; j++){\n if(board[i][j]==0 && board[i+1][j]==1 && board[i+2][j]==1 && board[i+3][j]==1){\n return j; \n }\n }\n }\n //Checks for blocks horizontal (R-RR)\n for(int i=0; i<6; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==1 && board[i][j+1]==0 && board[i][j+2]==1 && board[i][j+3]==1){\n if((i==5)||\n (i==4&&board[5][j+1]!=0) ||\n (i==3&&board[5][j+1]!=0&&board[4][j+1]!=0) ||\n (i==2&&board[5][j+1]!=0&&board[4][j+1]!=0&&board[3][j+1]!=0) ||\n (i==1&&board[5][j+1]!=0&&board[4][j+1]!=0&&board[3][j+1]!=0&&board[2][j+1]!=0) ||\n (i==0&&board[5][j+1]!=0&&board[4][j+1]!=0&&board[3][j+1]!=0&&board[2][j+1]!=0&&board[1][j+1]!=0) ||\n (i==0&&board[5][j+1]!=0&&board[4][j+1]!=0&&board[3][j+1]!=0&&board[2][j+1]!=0&&board[1][j+1]!=0&&board[0][j+1]!=0)){\n return j+1;\n }\n }\n }\n }\n //checks for horizontal blocks (RR-R)\n for(int i=0; i<6; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==1 && board[i][j+1]==1 && board[i][j+2]==0 && board[i][j+3]==1){\n if((i==5)||\n (i==4&&board[5][j+2]!=0) ||\n (i==3&&board[5][j+2]!=0&&board[4][j+2]!=0) ||\n (i==2&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0) ||\n (i==1&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0&&board[2][j+2]!=0) ||\n (i==0&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0&&board[2][j+2]!=0&&board[1][j+2]!=0) ||\n (i==0&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0&&board[2][j+2]!=0&&board[1][j+2]!=0&&board[0][j+2]!=0)){\n return j+2;\n }\n }\n }\n }\n \n //checks for horizontals (-RRR)\n for(int i=0; i<6; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==0 && board[i][j+1]==1 && board[i][j+2]==1 && board[i][j+3]==1){\n if((i==5)||\n (i==4&&board[5][j]!=0) ||\n (i==3&&board[5][j]!=0&&board[4][j]!=0) ||\n (i==2&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0) ||\n (i==1&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0&&board[2][j]!=0) ||\n (i==0&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0&&board[2][j]!=0&&board[1][j]!=0) ||\n (i==0&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0&&board[2][j]!=0&&board[1][j]!=0&&board[0][j]!=0)){\n return j;\n }\n }\n }\n }\n //checks for horizontals (RRR-)\n for(int i=0; i<6; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==1 && board[i][j+1]==1 && board[i][j+2]==1 && board[i][j+3]==0){\n if((i==5)||\n (i==4&&board[5][j+3]!=0) ||\n (i==3&&board[5][j+3]!=0&&board[4][j+3]!=0) ||\n (i==2&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0) ||\n (i==1&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0&&board[0][j+3]!=0)){\n return j+3;\n }\n }\n }\n }\n //checks for diagonal (-RRR)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i+3][j]==0 && board[i+2][j+1]==1 && board[i+1][j+2]==1 && board[i][j+3]==1){\n if((i+3==5)||\n (i+2==4&&board[i+3][j]!=0)||\n (i+1==3&&board[i+3][j]!=0&&board[i+2][j]!=0)||\n (i==2&&board[i+3][j]!=0&&board[i+2][j]!=0&&board[i+1][j]!=0)||\n (i==1&&board[i+3][j]!=0&&board[i+2][j]!=0&&board[i+1][j]!=0&&board[i][j]!=0)||\n (i==0&&board[i+3][j]!=0&&board[i+2][j]!=0&&board[i+1][j]!=0&&board[i][j]!=0&&board[i-1][j]!=0)){\n return j;\n }\n }\n }\n }\n //checks for diagonal (R-RR)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i+3][j]==1 && board[i+2][j+1]==0 && board[i+1][j+2]==1 && board[i][j+3]==1){\n if((i+2==4&&board[i+3][j+1]!=0)||\n (i+1==3&&board[i+3][j+1]!=0&&board[i+2][j+1]!=0)||\n (i==2&&board[i+3][j+1]!=0&&board[i+2][j+1]!=0&&board[i+1][j+1]!=0)||\n (i==1&&board[i+3][j+1]!=0&&board[i+2][j+1]!=0&&board[i+1][j+1]!=0&&board[i][j+1]!=0)||\n (i==0&&board[i+3][j+1]!=0&&board[i+2][j+1]!=0&&board[i+1][j+1]!=0&&board[i][j+1]!=0&&board[i-1][j+1]!=0)){\n return j+1;\n }\n }\n }\n }\n //checks for diagonal (RR-R)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i+3][j]==1 && board[i+2][j+1]==1 && board[i+1][j+2]==0 && board[i][j+3]==1){\n if((i==2&&board[i+2][j+2]!=0)){//||\n return j+2;\n }\n }\n }\n }\n //checks for diagonal (RRR-)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i+3][j]==1 && board[i+2][j+1]==1 && board[i+1][j+2]==1 && board[i][j+3]==0){\n if((i==0&&board[1][j+3]!=0)||\n (i==1&&board[2][j+3]!=0)||\n (i==2&&board[3][j+3]!=0)){\n return j+3;\n }\n }\n }\n }\n //checks for subdiagonal blocks(-RRR)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==0 && board[i+1][j+1]==1 && board[i+2][j+2]==1 && board[i+3][j+3]==1){\n if((i==0&&board[1][j]!=0)||\n (i==1&&board[2][j]!=0)||\n (i==2&&board[3][j]!=0)){\n return j;\n }\n }\n }\n }\n //checks for subdiagonal blocks(Y-YY)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==1 && board[i+1][j+1]==0 && board[i+2][j+2]==1 && board[i+3][j+3]==1){\n if((i==0&&board[2][j+1]!=0)||\n (i==1&&board[3][j+1]!=0)||\n (i==2&&board[4][j+1]!=0)){\n return j+1;\n }\n }\n }\n }\n //checks for subdiagonal blocks(YY-Y)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==1 && board[i+1][j+1]==1 && board[i+2][j+2]==0 && board[i+3][j+3]==1){\n if((i==0&&board[3][j+2]!=0)||\n (i==1&&board[4][j+2]!=0)||\n (i==2&&board[5][j+2]!=0)){\n return j+2;\n }\n }\n }\n }\n //checks for subdiagonal blocks(YYY-)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==1 && board[i+1][j+1]==1 && board[i+2][j+2]==1 && board[i+3][j+3]==0){\n if((i==0&&board[4][j+3]!=0)||\n (i==1&&board[5][j+3]!=0)||\n (i==2)){\n return j+3;\n }\n }\n }\n }\n //INTERMEDIATE BLOCKING\n //If horizontal (RR--) make it (RRY-)\n for(int i=0; i<6; i++){\n for(int j=0; j<3; j++){\n if(board[i][j]==1 && board[i][j+1]==1 && board[i][j+2]==0){\n if((i==5)||\n (i==4&&board[5][j+3]!=0) ||\n (i==3&&board[5][j+3]!=0&&board[4][j+3]!=0) ||\n (i==2&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0) ||\n (i==1&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0&&board[0][j+3]!=0)){\n return j+2;\n }\n }\n }\n }\n //If horizontal (--RR) make it (-YRR)\n for(int i=0; i<6; i++){\n for(int j=0; j<3; j++){\n if(board[i][j+1]==0 && board[i][j+2]==1 && board[i][j+3]==1){\n if((i==5)||\n (i==4&&board[5][j+3]!=0) ||\n (i==3&&board[5][j+3]!=0&&board[4][j+3]!=0) ||\n (i==2&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0) ||\n (i==1&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0&&board[0][j+3]!=0)){\n return j+1;\n }\n }\n }\n }\n //The following attempts to set the computer up for a win, instead of first just generating a random number\n for(int i=0; i<3; i++){\n for(int j=0; j<7; j++){\n if(board[i+1][j]==0 && board[i+2][j]==2 && board[i+3][j]==2){\n return j;\n \n }\n }\n }\n //If horizontal (-YY-) make it (-YYY)\n for(int i=0; i<6; i++){\n for(int j=0; j<3; j++){\n if(board[i][j]==0 && board[i][j+1]==2 && board[i][j+2]==2 && board[i][j+3]==0){\n if((i==5)||\n (i==4&&board[5][j+3]!=0) ||\n (i==3&&board[5][j+3]!=0&&board[4][j+3]!=0) ||\n (i==2&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0) ||\n (i==1&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0&&board[0][j+3]!=0)){\n return j+3;\n }\n }\n }\n }\n //If horizontal (YY--) make it (YYY-)\n for(int i=0; i<6; i++){\n for(int j=0; j<3; j++){\n if(board[i][j]==2 && board[i][j+1]==2 && board[i][j+2]==0 && board[i][j+3]==0){\n if((i==5)||\n (i==4&&board[5][j+3]!=0) ||\n (i==3&&board[5][j+3]!=0&&board[4][j+3]!=0) ||\n (i==2&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0) ||\n (i==1&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0&&board[0][j+3]!=0)){\n return j+2;\n }\n }\n }\n }\n //If horizontal (--YY) make it (-YYY)\n for(int i=0; i<6; i++){\n for(int j=0; j<3; j++){\n if(board[i][j]==0 && board[i][j+1]==0 && board[i][j+2]==2 && board[i][j+3]==2){\n if((i==5)||\n (i==4&&board[5][j+3]!=0) ||\n (i==3&&board[5][j+3]!=0&&board[4][j+3]!=0) ||\n (i==2&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0) ||\n (i==1&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0&&board[0][j+3]!=0)){\n return j+1;\n }\n }\n }\n }\n boolean sent = false;\n //The following code will simply generate a random number.\n int x = (int)((Math.random())*7);\n if(!wonYet){ \n while(!sent){\n if(board[0][x]!=0)\n x = (int)((Math.random())*7);\n else if(board[1][x]!=0)\n x = (int)((Math.random())*7);\n else if(board[2][x]!=0)\n x = (int)((Math.random())*7);\n else if(board[3][x]!=0)\n x = (int)((Math.random())*7);\n else if(board[4][x]!=0)\n x = (int)((Math.random())*7);\n else if(board[5][x]!=0)\n x = (int)((Math.random())*7);\n sent = true;\n } \n return x;\n }\n return -1; \n }",
"public static int computeGameSituation(int[][] paraCheckerboard) {\n\t\t// Indicate whether or not the row/column/slope is the same.\n\t\tboolean tempSame = false;\n\n\t\t// Step 1. Horizontal\n\t\tfor (int i = 0; i < SIZE; i++) {\n\t\t\tif (paraCheckerboard[i][0] == EMPTY) {\n\t\t\t\tcontinue;\n\t\t\t} // Of if\n\n\t\t\t// A whole row is the same.\n\t\t\ttempSame = true;\n\t\t\tfor (int j = 1; j < SIZE; j++) {\n\t\t\t\tif (paraCheckerboard[i][j] != paraCheckerboard[i][0]) {\n\t\t\t\t\ttempSame = false;\n\t\t\t\t\tbreak;\n\t\t\t\t} // Of if\n\t\t\t} // Of for j\n\n\t\t\tif (tempSame) {\n\t\t\t\treturn paraCheckerboard[i][0];\n\t\t\t} // Of if\n\t\t} // Of for i\n\n\t\t// Step 2. Vertical\n\t\tfor (int j = 0; j < SIZE; j++) {\n\t\t\tif (paraCheckerboard[0][j] == EMPTY) {\n\t\t\t\tcontinue;\n\t\t\t} // Of if\n\n\t\t\t// A whole column is the same.\n\t\t\ttempSame = true;\n\t\t\tfor (int i = 1; i < SIZE; i++) {\n\t\t\t\tif (paraCheckerboard[i][j] != paraCheckerboard[0][j]) {\n\t\t\t\t\ttempSame = false;\n\t\t\t\t\tbreak;\n\t\t\t\t} // Of if\n\t\t\t} // Of for i\n\n\t\t\tif (tempSame) {\n\t\t\t\treturn paraCheckerboard[0][j];\n\t\t\t} // Of if\n\t\t} // Of for i\n\n\t\t// Step 3. Slope: Left-top to right-bottom.\n\t\tif (paraCheckerboard[0][0] != EMPTY) {\n\t\t\ttempSame = true;\n\t\t\tfor (int i = 1; i < SIZE; i++) {\n\t\t\t\tif (paraCheckerboard[i][i] != paraCheckerboard[0][0]) {\n\t\t\t\t\ttempSame = false;\n\t\t\t\t\tbreak;\n\t\t\t\t} // Of if\n\t\t\t} // Of for i\n\n\t\t\tif (tempSame) {\n\t\t\t\treturn paraCheckerboard[0][0];\n\t\t\t} // Of if\n\t\t} // Of if\n\n\t\t// Step 4. Slope: Right-top to left-bottom.\n\t\tif (paraCheckerboard[0][SIZE - 1] != EMPTY) {\n\t\t\tfor (int i = 1; i < SIZE; i++) {\n\t\t\t\ttempSame = true;\n\t\t\t\tif (paraCheckerboard[i][SIZE - i\n\t\t\t\t\t\t- 1] != paraCheckerboard[0][SIZE - 1]) {\n\t\t\t\t\ttempSame = false;\n\t\t\t\t\tbreak;\n\t\t\t\t} // Of if\n\t\t\t} // Of for i\n\n\t\t\tif (tempSame) {\n\t\t\t\treturn paraCheckerboard[0][SIZE - 1];\n\t\t\t} // Of if\n\t\t} // Of if\n\n\t\t// Step 5. Checkboard full\n\t\tboolean tempHasEmpty = false;\n\t\tfor (int i = 0; i < paraCheckerboard.length; i++) {\n\t\t\tfor (int j = 0; j < paraCheckerboard.length; j++) {\n\t\t\t\tif (paraCheckerboard[i][j] == EMPTY) {\n\t\t\t\t\ttempHasEmpty = true;\n\t\t\t\t\tbreak;\n\t\t\t\t} // Of if\n\t\t\t} // Of for j\n\n\t\t\tif (tempHasEmpty) {\n\t\t\t\tbreak;\n\t\t\t} // Of if\n\t\t} // Of for i\n\t\tif (!tempHasEmpty) {\n\t\t\treturn TIE;\n\t\t} // Of if\n\n\t\treturn UNFINISHED;\n\t}",
"private boolean checkGreedyWinRate() {\r\n return myTotal.get(0) > enTotal.get(0)+2 && (myself.health > 50 || myself.health > opponent.health);\r\n }",
"public int calculateLineBonus()\r\n {\r\n int bonus = 0;\r\n \r\n switch(line[0])\r\n {\r\n case 1:\r\n bonus = gameBoard.getTile(0,0).getTileValue() + gameBoard.getTile(0,1).getTileValue() + gameBoard.getTile(0,2).getTileValue();\r\n break;\r\n case 2:\r\n bonus = gameBoard.getTile(1,0).getTileValue() + gameBoard.getTile(1,1).getTileValue() + gameBoard.getTile(1,2).getTileValue();\r\n break;\r\n case 3:\r\n bonus = gameBoard.getTile(2,0).getTileValue() + gameBoard.getTile(2,1).getTileValue() + gameBoard.getTile(2,2).getTileValue();\r\n break;\r\n case 4: \r\n bonus = gameBoard.getTile(0,0).getTileValue() + gameBoard.getTile(1,0).getTileValue() + gameBoard.getTile(2,0).getTileValue();\r\n break;\r\n case 5:\r\n bonus = gameBoard.getTile(0,1).getTileValue() + gameBoard.getTile(1,1).getTileValue() + gameBoard.getTile(2,1).getTileValue();\r\n break;\r\n case 6: \r\n bonus = gameBoard.getTile(0,2).getTileValue() + gameBoard.getTile(1,2).getTileValue() + gameBoard.getTile(2,2).getTileValue();\r\n break;\r\n case 7: \r\n bonus = gameBoard.getTile(0,0).getTileValue() + gameBoard.getTile(1,1).getTileValue() + gameBoard.getTile(2,2).getTileValue();\r\n break;\r\n case 8:\r\n bonus = gameBoard.getTile(2,0).getTileValue() + gameBoard.getTile(1,1).getTileValue() + gameBoard.getTile(0,2).getTileValue();\r\n break;\r\n }\r\n \r\n return bonus;\r\n }",
"public int getHeuristic(){\n\t\tint count = 0;\n\t\tfor (int i = 0; i < getRows(); i++) {\n\t\t\tfor (int j = 0; j < getColumns(); j++) {\n\t\t\t\tif (cells[i][j].getSand() != getK()) \n\t\t\t\t\tcount++;\n\t\t\t}\n\t\t} \n\t\treturn count;\n\t}",
"public Chip checkFour(int row, int col, int ord) {\n Chip checker = (ord == 1) ? Chip.RED : Chip.BLUE;\n // check vertically\n if (row <= (this.getRows() - 4)) {\n if (this.getBoard()[row+1][col].equals(checker) && this.getBoard()[row+2][col].equals(checker) &&\n this.getBoard()[row+3][col].equals(checker)) {\n return checker;\n }\n }\n // check horizontally\n if (col <= (this.getColumns() - 4)) {\n if (this.getBoard()[row][col+1].equals(checker) && this.getBoard()[row][col+2].equals(checker) &&\n this.getBoard()[row][col+3].equals(checker)) {\n return checker;\n }\n }\n // check diagonally: top left to bottom right\n if (row <= (this.getRows() - 4) && col <= (this.getColumns() - 4)) {\n if (this.getBoard()[row+1][col+1].equals(checker) && this.getBoard()[row+2][col+2].equals(checker) &&\n this.getBoard()[row+3][col+3].equals(checker)) {\n return checker;\n }\n }\n // check diagonally: top right to bottom left\n if (row <= (this.getRows() - 4) && col >= 3) {\n if (this.getBoard()[row+1][col-1].equals(checker) && this.getBoard()[row+2][col-2].equals(checker) &&\n this.getBoard()[row+3][col-3].equals(checker)) {\n return checker;\n }\n }\n\n // if none of the checks is satisfied, return EMPTY;\n return Chip.EMPTY;\n }",
"public char calculate(){\n int total = 0;\n char grade;\n for(int i = 0; i<this.testScores.length; i++){\n total += this.testScores[i];\n }\n total = (total/this.testScores.length);\n \n if(total>=90 && total<=100)\n grade = 'O';\n else if(total<90 && total>=80)\n grade = 'E';\n else if(total<80 && total>=70)\n grade = 'A';\n else if(total<70 && total>=55)\n grade = 'P';\n else if(total<55 && total>=40)\n grade = 'D';\n else\n grade = 'T';\n \n return grade;\n }",
"@Test\r\n public void calculateScore() {\r\n board3.swapTiles(0,0,1,1);\r\n board3.getSlidingScoreBoard().setTime(2);\r\n board3.getSlidingScoreBoard().calculateScore();\r\n assertEquals(496, board3.getSlidingScoreBoard().getScore());\r\n }",
"public int getCompleteSquare(ArrayList<Line> drawnLines) {\r\n\t\tint square1LinesDrawn = 0;\r\n\t\tint square2LinesDrawn = 0;\r\n\t\t\r\n\t\tfor (Line line : drawnLines) {\r\n\t\t\tif (square1Partners.contains(line) && square1LinesDrawn < 3) {\r\n\t\t\t\tsquare1LinesDrawn++;\r\n\t\t\t}\r\n\t\t\tif (square2Partners.contains(line) && square2LinesDrawn < 3) {\r\n\t\t\t\tsquare2LinesDrawn++;\r\n\t\t\t}\r\n\t\t\tif (square1LinesDrawn == 3 && square2LinesDrawn == 3) {\r\n\t\t\t\treturn 3;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (square1LinesDrawn < 3 && square2LinesDrawn < 3) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\treturn square1LinesDrawn == 3 ? 1 : 2;\r\n\t}",
"private String calcGrade(String perc)\r\n\t {\r\n\t\t float percentage = Float.parseFloat(perc);\r\n\t\t if (percentage > 75) return \"A\";\r\n\t\t else if (percentage>=60 && percentage < 75) return \"B\";\r\n\t\t else if (percentage>=45 && percentage < 60) return \"c\";\r\n\t\t else if (percentage>=35 && percentage < 45) return \"D\";\r\n\t\t else \r\n\t\t\t return \"F\";\r\n\t }",
"public PriorityColor recalculateBranchColors(long level) {\n if (currentColor == null) {\n currentColor = new PriorityColor(nodeColor);\n }\n level++;\n if (children.size() == 0) {\n Context.getInstance().getEventQueue().add(new EventCandidate(nodeId, currentColor, level));\n return new PriorityColor(currentColor);\n }\n PriorityColor topPriorityColor = new PriorityColor(nodeColor);\n for (Node child : children) {\n PriorityColor childPriorityColor = child.recalculateBranchColors(level);\n if (childPriorityColor.getPriority() > topPriorityColor.getPriority()) {\n topPriorityColor = new PriorityColor(childPriorityColor);\n }\n }\n currentColor = topPriorityColor;\n Context.getInstance().getEventQueue().add(new EventCandidate(nodeId, currentColor, level));\n return topPriorityColor;\n }",
"private int calculateScore(ArrayList<HexCell> stack){\n int score = 0;\n for(HexCell current: stack){\n score += current.score;\n }\n return score;\n }",
"public double heuristic(game Game){\n // int l[] = {0,1};\n // board b = Game.getBoard();\n // tic smallBoard = b.getState(l); \n \n /* if O wins the game */\n if(Game.getState() == 2){return 99;}\n \n /* X wins the game */\n if(Game.getState() == 1){return -99;}\n \n return 0;\n }",
"public int checkForWin() \r\n {\r\n \twinner = null;\r\n \tint winrole = -1;\r\n \tif(isBoardFull()){\r\n \t\tint white = 0;\r\n \t\tint black = 0;\r\n\t\t\tfor(int i = 0; i < boardsize; ++i){\r\n\t\t\t\tfor(int j = 0; j<boardsize; ++j){\r\n\t\t\t\t\tif(board[i][j] == 0){\r\n\t\t\t\t\t\twhite++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(board[i][j] == 1){\r\n\t\t\t\t\t\tblack++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(white > black){\r\n\t\t\t\twinrole = 0;\r\n\t\t\t\twinner = agent[winrole];\r\n\t\t\t}\t\r\n\t\t\telse if(black > white){\r\n\t\t\t\twinrole = 1;\r\n\t\t\t\twinner = agent[winrole];\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\twinrole=2;\r\n\t\t\t}\r\n\t\t\treturn winrole;\r\n \t}\r\n \treturn -1;\r\n }",
"public void ruleOutPos(){\n for(int i=0;i<scores.length;i++) {\n for(int j=0;j<scores[i].length;j++) {\n scores[i][j][13] = 0;//0=pass, >0 is fail, set to pass initially\n\n //check Ns - bit crude - what to discount regions with high N\n double ns = (double) scores[i][j][14] / (double) pLens[j];\n if (ns >= minPb | ns >= minPm)//\n scores[i][j][13] += 4;\n\n //probe\n if (hasProbe){\n if (j == 1 | j == 4) {\n double perc = (double) scores[i][j][0] / (double) primers[j].length();\n if (perc >= minPb) {\n scores[i][j][12] = 1;//flag for failed % test\n scores[i][j][13] += 2;\n }\n }\n }\n //primer\n else {\n //if more than 2 mismatches in 1-4nt at 3'\n if(scores[i][j][11]>max14nt) {\n scores[i][j][13]+=1;\n }\n //use mLen (combined F and R length) initially to find initial candidates - filter later\n double perc=(double)scores[i][j][0]/(double)mLen;\n double percI=(double)scores[i][j][0]/(double)pLens[j];\n\n if(perc>=minPm | percI>=minPmI) {\n scores[i][j][12]=1;//flag for failed % test\n scores[i][j][13]+=2;\n }\n }\n }\n }//end of finding positions that prime loop\n }",
"public int conflicts() {\n int total = 0;\n int dist;\n if (!isValid()) return 0;\n for (int r = 0; r < Board.dim; r++) {\n int row = r*Board.dim; \n for (int i = row; i < row + Board.dim; i++)\n for (int j = i + 1; j < row + Board.dim; j++) \n if (Board.rowOf[state[i]] == r && \n Board.rowOf[state[j]] == r &&\n state[i] != 0 && state[j] != 0 &&\n state[i] > state[j])\n total = total + 1;\n }\n for (int col = 0; col < Board.dim; col++) \n for (int i = col; i < state.length - Board.dim; i+= Board.dim) {\n for (int j = i + Board.dim; j < state.length; j+= Board.dim) \n if (Board.colOf[state[i]] == col &&\n Board.colOf[state[j]] == col &&\n state[i] != 0 && state[j] != 0 &&\n state[i] > state[j])\n total = total + 1;\n } \n return total; \n }",
"public int checkForWinner() {\n\n // Check horizontal wins\n for (int i = 0; i <= 6; i += 3)\t{\n if (mBoard[i] == HUMAN_PLAYER &&\n mBoard[i+1] == HUMAN_PLAYER &&\n mBoard[i+2]== HUMAN_PLAYER)\n return 2;\n if (mBoard[i] == COMPUTER_PLAYER &&\n mBoard[i+1]== COMPUTER_PLAYER &&\n mBoard[i+2] == COMPUTER_PLAYER)\n return 3;\n }\n\n // Check vertical wins\n for (int i = 0; i <= 2; i++) {\n if (mBoard[i] == HUMAN_PLAYER &&\n mBoard[i+3] == HUMAN_PLAYER &&\n mBoard[i+6]== HUMAN_PLAYER)\n return 2;\n if (mBoard[i] == COMPUTER_PLAYER &&\n mBoard[i+3] == COMPUTER_PLAYER &&\n mBoard[i+6]== COMPUTER_PLAYER)\n return 3;\n }\n\n // Check for diagonal wins\n if ((mBoard[0] == HUMAN_PLAYER &&\n mBoard[4] == HUMAN_PLAYER &&\n mBoard[8] == HUMAN_PLAYER) ||\n (mBoard[2] == HUMAN_PLAYER &&\n mBoard[4] == HUMAN_PLAYER &&\n mBoard[6] == HUMAN_PLAYER))\n return 2;\n if ((mBoard[0] == COMPUTER_PLAYER &&\n mBoard[4] == COMPUTER_PLAYER &&\n mBoard[8] == COMPUTER_PLAYER) ||\n (mBoard[2] == COMPUTER_PLAYER &&\n mBoard[4] == COMPUTER_PLAYER &&\n mBoard[6] == COMPUTER_PLAYER))\n return 3;\n\n // Check for tie\n for (int i = 0; i < BOARD_SIZE; i++) {\n // If we find a number, then no one has won yet\n if (mBoard[i] != HUMAN_PLAYER && mBoard[i] != COMPUTER_PLAYER)\n return 0;\n }\n\n // If we make it through the previous loop, all places are taken, so it's a tie\n return 1;\n }",
"private Color updateYourBoardHelper(int i, int j) {\n if (i == 0 && j == 0) {\n return Color.BLACK;\n }\n if (i == 0 || j == 0) {\n return Color.GRAY;\n }\n if (arePlayerShipsInitialized()) {\n try{\n TileStatus[][] b = p2.getPlayerStatusBoard();\n Color c = new Color(0);\n switch (b[j][i]) {\n case SHIP:\n case SUBSCANSHIP:\n case AIRCRAFTSCAN:\n switch (p2.getPlayerShipBoard()[j][i][0]) {\n case AIRCRAFTCARRIER:\n c = CARRIER_COLOR;\n break;\n case BATTLESHIP:\n c = BATTLESHIP_COLOR;\n break;\n case DESTROYER:\n c = DESTROYER_COLOR;\n break;\n case SUBMARINE:\n c = SUBMARINE_COLOR;\n break;\n case PATROLBOAT:\n c = PATROLBOAT_COLOR;\n break;\n default:\n break;\n }\n switch (p2.getPlayerShipBoard()[j][i][1]) {\n case AIRCRAFT1:\n if (!(((Aircraft) p2.getShip(5)).launched())) {\n c = AIRCRAFT1_COLOR;\n }\n break;\n case AIRCRAFT2:\n if (!(((Aircraft) p2.getShip(6)).launched())) {\n c = AIRCRAFT2_COLOR;\n }\n break;\n default:\n break;\n }\n break;\n case HIT:\n c = Color.RED;\n break;\n case MISS:\n c = Color.WHITE;\n break;\n case SUBSCANEMPTY:\n c = Color.CYAN;\n break;\n default:\n c = Color.DARK_GRAY;\n break;\n }\n return c;\n }catch(java.lang.NullPointerException n){\n System.err.println(\"Null pointer where p2 should be\");\n for(int ii=0; ii<7; ii++){\n for(int jj=0; jj<3; jj++){\n System.out.print(playerShips[ii][jj]+ \" \");\n }\n System.out.println();\n }\n// System.exit(1);\n return Color.DARK_GRAY;\n }\n } else{\n Color c = Color.DARK_GRAY;\n switch (yourBoard[i][j][0]) {\n case CR:\n if(yourBoard[i][j][1]==Statuses.AC1){\n c = AIRCRAFT1_COLOR;\n }else if(yourBoard[i][j][1]==Statuses.AC2){\n c = AIRCRAFT2_COLOR;\n }else{\n c = CARRIER_COLOR;\n }\n break;\n case BS:\n c = BATTLESHIP_COLOR;\n break;\n case DES:\n c = DESTROYER_COLOR;\n break;\n case SUB:\n c = SUBMARINE_COLOR;\n break;\n case PB:\n c = PATROLBOAT_COLOR;\n break;\n default:\n c = Color.DARK_GRAY;\n break;\n }\n return c;\n }\n }",
"public static int findTheLeader(int[][] board) {\r\n\t\t\r\n\t\tint ans = 0;\r\n\t\tint REDDiscs = playerDiscs(board,1).length;\r\n\t\tint BLUEDiscs = playerDiscs(board,-1).length;\r\n\t\t\r\n\t\tfor (int line=0;line<8;line=line+1){\r\n\t\t\tfor (int column=0;column<8;column=column+1){\r\n\t\t\t\tif (board[line][column]==2){REDDiscs=REDDiscs+1;}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (int line=0;line<8;line=line+1){\r\n\t\t\tfor (int column=0;column<8;column=column+1){\r\n\t\t\t\tif (board[line][column]==-2){BLUEDiscs=BLUEDiscs+1;}\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\tif (REDDiscs>BLUEDiscs){ans = 1;}\r\n\t\tif (REDDiscs<BLUEDiscs){ans = -1;}\r\n\r\n\t\treturn ans;\r\n\t}",
"public int score() {\n\t\tint result = 0;\n\t\tArrayList<Tile> a = g.getQueue();\n\t\tCollections.reverse(a);\n\t\tint index = 0;\n\t\twhile (a.get(index) == null)\n\t\t\tindex++;\n\t\tfor (int i = index; i < a.size() - 1; i++) {\n\t\t\tif (a.get(i) == null)\n\t\t\t\tcontinue;\n\t\t\tint cmp = a.get(i).compareTo(a.get(i + 1));\n\t\t\tresult -= cmp;\n\t\t}\n\t\treturn result;\n\t}",
"public boolean isWinner() {\n\t\t//initialize row, column, and depth\n\t\tint row = 0;\n\t\tint col = 0;\n\t\tint dep = 0;\n\t\t\n\t\t//Checks for a vertical four in a row\n\t\t//row is restriced from the full size to >=3 to avoid\n\t\t//an out of bounds exception\n\t\tfor(row = size - 1; row >= 3; row --)\n\t\t\tfor(col = 0; col < size; col ++)\n\t\t\t\tfor(dep = 0; dep < size; dep ++) {\n\t\t\t\t\t//a variable check is made to save lines\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\t//checks if the value is a player, and it\n\t\t\t\t\t//qualifies as a vertical win. If it does,\n\t\t\t\t\t//the for loop returns true.\n\t\t\t\t\tif (check != -1\n\t\t\t\t\t\t && check == board[row - 1][col][dep] &&\n\t\t\t\t\t\t\tcheck == board[row - 2][col][dep] &&\n\t\t\t\t\t\t\tcheck == board[row - 3][col][dep] )\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t//check for horizontal four in a row\n\t\t//col is restriced and increasing (+)\n\t\tfor (dep = 0; dep < size; dep ++)\n\t\t\tfor(row = size - 1; row >= 0; row --)\n\t\t\t\tfor(col = 0; col < size - 3; col ++) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t\t&& check == board[row][col + 1][dep]\n\t\t\t\t\t\t\t&& check == board[row][col + 2][dep] \n\t\t\t\t\t\t\t&& check == board[row][col + 3][dep])\n\t\t\t\t\t\treturn true;\n\n\t\t\t\t}\n\t\t//check for x,y upDiagnol four in a row on each depth\n\t\t//row is restricted and decreasing (-)\n\t\t//col is restricted and increasing (+)\n\t\tfor (dep = 0; dep < size; dep ++)\n\t\t\tfor(row = size - 1; row >= 3; row --)\n\t\t\t\tfor(col = 0; col < size - 3; col ++) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t\t&& check == board[row - 1][col + 1][dep]\n\t\t\t\t\t\t\t&& check == board[row - 2][col + 2][dep]\n\t\t\t\t\t\t\t&& check == board[row - 3][col + 3][dep])\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t//check for x,y downDiagnol four in a row on each depth\n\t\t//row is restricted and increasing (+)\n\t\t//col is restricted and increasing (+)\n\t\tfor (dep = 0; dep < size; dep ++)\n\t\t\tfor(row = 0; row < size - 3; row ++)\n\t\t\t\tfor(col = 0; col < size - 3; col ++) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t\t&& check == board[row + 1][col + 1][dep]\n\t\t\t\t\t\t\t&& check == board[row + 2][col + 2][dep]\n\t\t\t\t\t\t\t&& check == board[row + 3][col + 3][dep])\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t//check for x,z horizontal four in a row on each column\n\t\t//dep is restricted and increasing (+)\n\t\tfor(col = 0; col < size; col ++)\n\t\t\tfor(row = size - 1; row >= 0; row --)\n\t\t\t\tfor(dep = 0; dep < size - 3; dep ++) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t\t&& check == board[row][col][dep + 1]\n\t\t\t\t\t\t\t&& check == board[row][col][dep + 2]\n\t\t\t\t\t\t\t&& check == board[row][col][dep + 3])\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t//check for x,z upDiagnol four in a row on ecah column\n\t\t//row is restricted and decreasing (-)\n\t\t//dep is restricted and increasing (+)\n\t\tfor(col = 0; col < size; col ++)\n\t\t\tfor(row = size - 1; row >= 3; row --)\n\t\t\t\tfor(dep = 0; dep < size - 3; dep ++) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t\t&& check == board[row - 1][col][dep + 1]\n\t\t\t\t\t\t\t&& check == board[row - 2][col][dep + 2]\n\t\t\t\t\t\t\t&& check == board[row - 3][col][dep + 3])\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t//check for x,z downDiagnol four in a row\n\t\t// dep +, row +\n\t\tfor(col = 0; col < size; col ++)\n\t\t\tfor(row = 0; row > size - 3; row ++)\n\t\t\t\tfor(dep = 0; dep < size - 3; dep ++) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t\t&& check == board[row + 1][col][dep + 1]\n\t\t\t\t\t\t\t&& check == board[row + 2][col][dep + 2]\n\t\t\t\t\t\t\t&& check == board[row + 3][col][dep + 3])\n\t\t\t\t\t\treturn true;\n\n\t\t\t\t}\n\t\t//check for x,y,z up diagnol to the top right\n\t\t//row -, col +, dep +\n\t\tfor(row = size - 1; row >= 3; row --)\n\t\t\tfor(col = 0; col < size - 3; col ++)\n\t\t\t\tfor(dep = 0; dep < size - 3; dep ++) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t&& check == board[row - 1][col + 1][dep + 1]\n\t\t\t\t\t\t&& check == board[row - 2][col + 2][dep + 2]\n\t\t\t\t\t\t&& check == board[row - 3][col + 3][dep + 3])\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t//check for x,y,z up diagnol to the top left\n\t\t//row -, col -, dep +\n\t\tfor(row = size - 1; row >= 3; row --)\n\t\t\tfor(col = size -1; col >= 3; col --)\n\t\t\t\tfor(dep = 0; dep < size - 3; dep ++) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t&& check == board[row - 1][col - 1][dep + 1]\n\t\t\t\t\t\t&& check == board[row - 2][col - 2][dep + 2]\n\t\t\t\t\t\t&& check == board[row - 3][col - 3][dep + 3])\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t//check for x,y,z up diagnol to the down left\n\t\t//row -, col -, dep -\n\t\tfor(row = size - 1; row >= 3; row --)\n\t\t\tfor(col = size -1; col >= 3; col --)\n\t\t\t\tfor(dep = size - 1; dep >= 3; dep --) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t&& check == board[row - 1][col - 1][dep - 1]\n\t\t\t\t\t\t&& check == board[row - 2][col - 2][dep - 2]\n\t\t\t\t\t\t&& check == board[row - 3][col - 3][dep - 3])\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t//check for x,y,z up diagnol to the down right\n\t\t//row -, col +, dep -\n\t\tfor(row = size - 1; row >= 3; row --)\n\t\t\tfor(col = 0; col < size - 3; col ++)\n\t\t\t\tfor(dep = size - 1; dep >= 3; dep --) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t&& check == board[row - 1][col + 1][dep - 1]\n\t\t\t\t\t\t&& check == board[row - 2][col + 2][dep - 2]\n\t\t\t\t\t\t&& check == board[row - 3][col + 3][dep - 3])\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t//Same as above, but now row increases rather than decreasing\n\t\t//check for down diagnol from top left to center\n\t\t//row +, col +, dep +\n\t\tfor(row = 0; row > size - 3; row ++)\n\t\t\tfor(col = 0; col < size - 3; col ++)\n\t\t\t\tfor(dep = 0; dep < size - 3; dep ++) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1\n\t\t\t\t\t\t&& check == board[row + 1][col + 1][dep + 1]\n\t\t\t\t\t\t&& check == board[row + 2][col + 2][dep + 2]\n\t\t\t\t\t\t&& check == board[row + 3][col + 3][dep + 3])\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t//check for down diagnol from top right to center\n\t\t//row + , col -, dep +\n\t\tfor(row = 0; row > size - 3; row ++)\n\t\t\tfor(col = size -1; col >= 3; col --)\n\t\t\t\tfor(dep = 0; dep < size - 3; dep ++) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t&& check == board[row + 1][col - 1][dep + 1]\n\t\t\t\t\t\t&& check == board[row + 2][col - 2][dep + 2]\n\t\t\t\t\t\t&& check == board[row + 3][col - 3][dep + 3])\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t//check for down diagnol from bottom left to center\n\t\t//row +, col -, dep -\n\t\tfor(row = 0; row > size - 3; row ++)\n\t\t\tfor(col = size -1; col >= 3; col --)\n\t\t\t\tfor(dep = size - 1; dep >= 3; dep --) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t&& check == board[row + 1][col - 1][dep - 1]\n\t\t\t\t\t\t&& check == board[row + 2][col - 2][dep - 2]\n\t\t\t\t\t\t&& check == board[row + 3][col - 3][dep - 3])\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t//check for down diagnol from bottom right to center\n\t\t//row +, col +, dep -\n\t\tfor(row = 0; row > size - 3; row ++)\n\t\t\tfor(col = 0; col < size - 3; col ++)\n\t\t\t\tfor(dep = size - 1; dep >= 3; dep --) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t&& check == board[row + 1][col + 1][dep - 1]\n\t\t\t\t\t\t&& check == board[row + 2][col + 2][dep - 2]\n\t\t\t\t\t\t&& check == board[row + 3][col + 3][dep - 3])\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\n\t\t//check for diagonals where row stays the same, but x,z change\n\t\t//depth up diagnol, col +, dep +\n\t\tfor(row = size - 1; row >= 0 ; row --)\n\t\t\tfor(col = 0; col < size - 3; col ++)\n\t\t\t\tfor(dep = 0; dep < size - 3; dep ++) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t&& check == board[row][col + 1][dep + 1]\n\t\t\t\t\t\t&& check == board[row][col + 2][dep + 2]\n\t\t\t\t\t\t&& check == board[row][col + 3][dep + 3])\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\n\t\t//depth down diagnol, col +, dep -\n\t\tfor(row = size - 1; row >= 0 ; row --)\n\t\t\tfor(col = 0; col < size - 3; col ++)\n\t\t\t\tfor(dep = size - 1; dep >= 3; dep --) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t&& check == board[row][col + 1][dep - 1]\n\t\t\t\t\t\t&& check == board[row][col + 2][dep - 2]\n\t\t\t\t\t\t&& check == board[row][col + 3][dep - 3])\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\n\t\t// depth down left diagnol, col -, dep +\n\t\tfor(row = size - 1; row >= 0 ; row --)\n\t\t\tfor(col = size - 1; col >= 3; col --)\n\t\t\t\tfor(dep = 0; dep < size - 3; dep ++) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t&& check == board[row][col - 1][dep + 1]\n\t\t\t\t\t\t&& check == board[row][col - 2][dep + 2]\n\t\t\t\t\t\t&& check == board[row][col - 3][dep + 3])\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\n\t\t//depth down right diagnol, col -, dep -\n\t\tfor(row = size - 1; row >= 0 ; row --)\n\t\t\tfor(col = size - 1; col >= 3; col --)\n\t\t\t\tfor(dep = size - 1; dep >= 3; dep --) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t&& check == board[row][col - 1][dep - 1]\n\t\t\t\t\t\t&& check == board[row][col - 2][dep - 2]\n\t\t\t\t\t\t&& check == board[row][col - 3][dep - 3])\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t//returns false if none of the above return true\n\t\treturn false;\n\t}",
"public static int adjacentPenalties(int[][] matrix){\n\t\t\n\t\tint penalty = 0;\n\t\t\n\n\t\tfor (int i = 0; i < matrix.length; ++i) {\n\t\t\tint adjacentCountRow = 1;\n\t\t\tboolean previousBitRow = matrix[0][i] == B;\n\t\t\tint adjacentCountCol = 1;\n\t\t\tboolean previousBitCol = matrix[i][0] == B;\n\n\t\t\t// Row penalty checking\n\t\t\tfor (int j = 1; j < matrix.length; ++j) {\n\t\t\t\tboolean bitRow = matrix[j][i] == B;\n\t\t\t\t\n\t\t\t\tif (bitRow == previousBitRow) {\n\t\t\t\t\t++adjacentCountRow;\n\t\t\t\t\t\n\t\t\t\t\tif (adjacentCountRow == 5) {\n\t\t\t\t\t\tpenalty += 3;\n\t\t\t\t\t} else if (adjacentCountRow > 5) {\n\t\t\t\t\t\t++penalty;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tpreviousBitRow = bitRow;\n\t\t\t\t\tadjacentCountRow = 1;\n\t\t\t\t}\n\n\t\t\t\t// Column penalty checking\n\t\t\t\tboolean bitCol = matrix[i][j] == B;\n\n\t\t\t\tif (bitCol == previousBitCol) {\n\t\t\t\t\t++adjacentCountCol;\n\n\t\t\t\t\tif (adjacentCountCol == 5) {\n\t\t\t\t\t\tpenalty += 3;\n\t\t\t\t\t} else if (adjacentCountCol > 5) {\n\t\t\t\t\t\t++penalty;\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\tpreviousBitCol = bitCol;\n\t\t\t\t\tadjacentCountCol = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn penalty;\n\t}",
"private int heuristic(Node node, int currentDepth) {\n\n int ef, w1 = 1, w2 = 1, w3 = 0, w4 = 10, w5 = 1, w6 = 35, e1 = 0, e2 = 0, e3 = 0, e4 = 0, e5 = 0, e6 = 0;\n\n int ourSeedsInStore = node.getBoard().getSeedsInStore(ourSide);\n int oppSeedsInStore = node.getBoard().getSeedsInStore(ourSide.opposite());\n\n\n // hardcode fix.\n int parentOurSeedsInStore = 0;\n int parentOppSeedsInStore = 0;\n int parentMove = 0;\n int parentOurSeedsInHouse = 0;\n int parentOppSeedsInHouse = 0;\n\n if (currentDepth != 1) {\n parentOurSeedsInStore = node.getParent().getBoard().getSeedsInStore(ourSide);\n parentOppSeedsInStore = node.getParent().getBoard().getSeedsInStore(ourSide.opposite());\n parentMove = node.getName();\n parentOurSeedsInHouse = node.getParent().getBoard().getSeeds(ourSide, parentMove);\n parentOppSeedsInHouse = node.getParent().getBoard().getSeeds(ourSide.opposite(), parentMove);\n }\n\n int ourFreeHouse = 0;\n int oppFreeHouse = 0;\n int ourSeeds = ourSeedsInStore;\n int oppSeeds = oppSeedsInStore;\n\n int asdf1 = ourSeedsInStore - parentOurSeedsInStore;\n int asdf2 = oppSeedsInStore - parentOppSeedsInStore;\n\n e6 = asdf1 - asdf2;\n\n for (int i = 1; i <= 7; i++) {\n ourSeeds += node.getBoard().getSeeds(ourSide, i);\n oppSeeds += node.getBoard().getSeeds(ourSide.opposite(), i);\n }\n\n for (int i = 1; i <= 7; i++) {\n if (node.getBoard().getSeeds(ourSide, i) == 0)\n ourFreeHouse++;\n if (node.getBoard().getSeeds(ourSide.opposite(), i) == 0)\n oppFreeHouse++;\n }\n\n e1 = ourSeeds - oppSeeds;\n e2 = ourFreeHouse - oppFreeHouse;\n\n // hardcode fix.\n if (currentDepth != 1) {\n if (node.getParent().getPlayerSide() == this.getOurSide()) {\n // if last move puts seed into store\n if ((parentMove + parentOurSeedsInHouse) % 8 == 0) {\n e4 = 1;\n e3 = (parentMove + parentOurSeedsInHouse) / 8;\n } else if (parentMove + parentOurSeedsInStore > 8) {\n e4 = 0;\n e3 = (parentMove + parentOurSeedsInStore) / 8;\n }\n\n for (int i = 1; i <= 7; i++) {\n int parentOurSeedsInCurrentHouse = node.getParent().getBoard().getSeeds(ourSide, i);\n int parentOppSeedsInFrontHouse = node.getParent().getBoard().getSeeds(ourSide.opposite(), 8 - i);\n int oppSeedsInFrontHouse = node.getBoard().getSeeds(ourSide.opposite(), 8 - i);\n // if there's no seed in current house && there is seed right in front of us\n if ((parentOurSeedsInCurrentHouse == 0 || parentOurSeedsInCurrentHouse == 15) && parentOppSeedsInFrontHouse != 0 && oppSeedsInFrontHouse == 0) {\n if (currentDepth != 2) {\n if (node.getParent().getParent().getPlayerSide() == this.getOurSide()) {\n w5 = 5;\n e5 = parentOppSeedsInFrontHouse;\n break;\n }\n }\n e5 = parentOppSeedsInFrontHouse;\n break;\n }\n\n }\n } else if (node.getParent().getPlayerSide() == this.getOurSide().opposite()) {\n\n if (parentMove + parentOppSeedsInHouse == 8) {\n e4 = -1;\n e3 = -1 * (parentMove + parentOppSeedsInHouse) / 8;\n } else if (parentMove + parentOppSeedsInStore > 8) {\n e4 = 0;\n e3 = -(parentMove + parentOppSeedsInStore) / 8;\n }\n\n\n for (int i = 1; i <= 7; i++) {\n int parentOppSeedsInCurrentHouse = node.getParent().getBoard().getSeeds(ourSide.opposite(), i);\n int parentOurSeedsInFrontHouse = node.getParent().getBoard().getSeeds(ourSide, 8 - i);\n int oppSeedsInCurrentHouse = node.getBoard().getSeeds(ourSide, 8 - i);\n\n if ((parentOppSeedsInCurrentHouse == 0 || parentOppSeedsInCurrentHouse == 15) && parentOurSeedsInFrontHouse != 0 && oppSeedsInCurrentHouse == 0) {\n if (currentDepth != 2) {\n if (node.getParent().getParent().getPlayerSide() == this.getOurSide()) {\n w5 = 5;\n e5 = -parentOurSeedsInFrontHouse;\n break;\n }\n }\n w5 = 5;\n e5 = -parentOurSeedsInFrontHouse;\n break;\n }\n }\n }\n }\n ef = w1 * e1 + w2 * e2 + w3 * e3 + w4 * e4 + w5 * e5 + w6 * e6;\n return ef;\n }",
"public Result determineOutcome() {\n for (int row = 0; row < TicTacToeModel.BOARD_DIMENSION; row++) {\n if (rowScore[row] == TicTacToeModel.BOARD_DIMENSION){\n return Result.WIN;\n } else if (rowScore[row] == -TicTacToeModel.BOARD_DIMENSION) {\n return Result.LOSE;\n }\n }\n\n for (int col = 0; col < TicTacToeModel.BOARD_DIMENSION; col++) {\n if (colScore[col] == TicTacToeModel.BOARD_DIMENSION){\n return Result.WIN;\n } else if (colScore[col] == -TicTacToeModel.BOARD_DIMENSION) {\n return Result.LOSE;\n }\n }\n\n if (leftDiagScore == TicTacToeModel.BOARD_DIMENSION) return Result.WIN;\n if (rightDiagScore == TicTacToeModel.BOARD_DIMENSION) return Result.WIN;\n if (leftDiagScore == -TicTacToeModel.BOARD_DIMENSION) return Result.LOSE;\n if (rightDiagScore == -TicTacToeModel.BOARD_DIMENSION) return Result.LOSE;\n\n if (freeSpace == 0) return Result.DRAW;\n\n return Result.INCOMPLETE;\n }",
"public void checkLevel(){\n if(score<50){\n level = 1;\n asteroidsMaxNumber = 5;\n }\n if(score>50 && level == 1){\n level = 2;\n asteroidsMaxNumber = 7;\n }\n if(score>100 && level == 2){\n level = 3;\n asteroidsMaxNumber = 10;\n }\n if(score>200 && level == 3){\n level = 4;\n asteroidsMaxNumber = 13;\n }\n if(score>350 && level == 4){\n level = 5;\n asteroidsMaxNumber = 15;\n }\n }",
"protected abstract boolean gradeable();",
"private String calculateColourBoard(int col, int row) {\n // ORANGE\n if (col == 0 && row == 0 ||\n col == 1 && row == 1 ||\n col == 2 && row == 2 ||\n col == 3 && row == 3 ||\n col == 4 && row == 4 ||\n col == 5 && row == 5 ||\n col == 6 && row == 6 ||\n col == 7 && row == 7) {\n return \"#FFA500\";\n }\n\n // BLUE\n if (col == 1 && row == 0 ||\n col == 4 && row == 1 ||\n col == 7 && row == 2 ||\n col == 2 && row == 3 ||\n col == 5 && row == 4 ||\n col == 0 && row == 5 ||\n col == 3 && row == 6 ||\n col == 6 && row == 7) {\n return \"#0000FF\";\n }\n\n // PURPLE\n if (col == 2 && row == 0 ||\n col == 7 && row == 1 ||\n col == 4 && row == 2 ||\n col == 1 && row == 3 ||\n col == 6 && row == 4 ||\n col == 3 && row == 5 ||\n col == 0 && row == 6 ||\n col == 5 && row == 7) {\n return \"#7D3C98\";\n }\n\n // PINK\n if (col == 3 && row == 0 ||\n col == 2 && row == 1 ||\n col == 1 && row == 2 ||\n col == 0 && row == 3 ||\n col == 7 && row == 4 ||\n col == 6 && row == 5 ||\n col == 5 && row == 6 ||\n col == 4 && row == 7) {\n return \"#FFB6C1\";\n }\n\n // YELLOW\n if (col == 4 && row == 0 ||\n col == 5 && row == 1 ||\n col == 6 && row == 2 ||\n col == 7 && row == 3 ||\n col == 0 && row == 4 ||\n col == 1 && row == 5 ||\n col == 2 && row == 6 ||\n col == 3 && row == 7) {\n return \"#FFFF00\";\n }\n\n // RED\n if (col == 5 && row == 0 ||\n col == 0 && row == 1 ||\n col == 3 && row == 2 ||\n col == 6 && row == 3 ||\n col == 1 && row == 4 ||\n col == 4 && row == 5 ||\n col == 7 && row == 6 ||\n col == 2 && row == 7) {\n return \"#FF0000\";\n }\n\n // GREEN\n if (col == 6 && row == 0 ||\n col == 3 && row == 1 ||\n col == 0 && row == 2 ||\n col == 5 && row == 3 ||\n col == 2 && row == 4 ||\n col == 7 && row == 5 ||\n col == 4 && row == 6 ||\n col == 1 && row == 7) {\n return \"#008000\";\n }\n\n // BROWN\n if (col == 7 && row == 0 ||\n col == 6 && row == 1 ||\n col == 5 && row == 2 ||\n col == 4 && row == 3 ||\n col == 3 && row == 4 ||\n col == 2 && row == 5 ||\n col == 1 && row == 6 ||\n col == 0 && row == 7) {\n return \"#641E16\";\n }\n\n\n return \"meh\";\n }",
"public int getEnergy(){\n\t\tEnumeration students = table.keys(); \n\t\tint totalEnergy=0;\n\t\tHashtable<String,String> assignedProjects= new Hashtable<String,String>();\n\t\tint totalpenalties =0;\n\t while(students.hasMoreElements()) {\n\t CandidateAssignment cand = table.get((String) students.nextElement()); \n\t totalEnergy+=cand.getEnergy();\n\t \n\t String project = cand.getAssignedProject(); \n\t if(!assignedProjects.containsKey(project)){\n\t \t assignedProjects.put(project, project);\n\t }else{\n\t \t totalpenalties+=penalty; \n\t }\n\t }\n\t\treturn totalEnergy+ totalpenalties;\n\t}",
"private static float computeScore(GameModel model) {\n\n float score = 0;\n int numEmptyCells = 0;\n for (byte b : model.getGrid()) {\n if (b < 0) {\n numEmptyCells++;\n } else {\n score += 1 << b;\n }\n }\n return score * (1 + numEmptyCells * EMPTY_CELL_SCORE_BONUS);\n }",
"public static void main(String[] args)\n\t{\n\t\tdouble mine = (29 + 27 + 29 + /*24*/ 28 + 30 + 50 + 55 + 17 + 19 + 16 + 18 + 17 + 17 + 20 + 18 + 20 + 82 + 81 + 87 + 215);\n\t\t\n\t\tdouble pote = (30 + 30 + 30 + 30 + 30 + 60 + 30 + 30 + 20 + 20 + 20 + 20 + 20 + 20 + 20 + 20 + 20 + 100 + 100 + 100 + 250);\n\t\t\n\t\tdouble grade = (mine / pote) * 100;\n\t\tSystem.out.println(grade);\n\t\t\n\t\tPriorityQueue<String> pq = new PriorityQueue<String>();\n\t\tPriorityQueue<String> pq2 = new PriorityQueue<String>();\n\t\tPriorityQueue<Character> pq3 = new PriorityQueue<Character>();\n\t\t/*\n\t\tPriorityQueue pq4 = new PriorityQueue();\n\t\tpq4.enqueuePQ(2, \"F\");\n\t\tpq4.enqueuePQ(2, 32);\n\t\tSystem.out.println(pq4.toString());\n\t\t*/\n\t\t\n\t\t\n\t\tpq3.enqueuePQ(3, 'A');\n\t\tpq3.enqueuePQ(3, 'B');\n\t\tpq3.enqueuePQ(3, 'C');\n\t\tSystem.out.println(pq3.toString());\n\t\t\n\t\tSystem.out.println(pq3.dequeuePQ());\n\t\tSystem.out.println(pq3.peekPQ());\n\t\t\n\t\tpq2.enqueuePQ(2, \"two\");\n\t\tpq2.enqueuePQ(3, \"three\");\n\t\tpq2.enqueuePQ(1, \"one\");\n\t\t//pq2.enqueuePQ(-2, \"neg two\");\n\t\t//pq2.enqueuePQ(3, \"three 2\");\n\t\t//pq2.enqueuePQ(-2, \"neg two 2\");\n\t\t//pq2.enqueuePQ(1, \"one 2\");\n\t\tSystem.out.println(pq2.toString());\n\t\t\n\t\tSystem.out.println(pq2.dequeuePQ());\n\t\tSystem.out.println(pq2.peekPQ());\n\t\tSystem.out.println(pq2.toString());\n\t\t\n\t\tSystem.out.println(pq.isEmpty());\n\t\tpq.enqueuePQ(3, \"three\");\n\t\tSystem.out.println(pq.toString());\n\t\tpq.enqueuePQ(5, \"five\");\n\t\tSystem.out.println(pq.isEmpty());\n\t\tSystem.out.println(pq.toString());\n\t\tSystem.out.println(pq.dequeuePQ());\n\t\tSystem.out.println(pq.isEmpty());\n\t\tSystem.out.println(pq.dequeuePQ());\n\t\t\n\t\ttry\n\t\t{\n\t\t\tSystem.out.println(pq.peekPQ());\n\t\t}\n\t\tcatch (PQException ex)\n\t\t{\n\t\t\tSystem.out.println(\"PEEK EXCEPTION CAUGHT\");\n\t\t}\n\t\t\n\t\ttry\n\t\t{\n\t\t\tSystem.out.println(pq.dequeuePQ());\n\t\t}\n\t\tcatch (PQException ex)\n\t\t{\n\t\t\tSystem.out.println(\"Dequeue EXCEPTION CAUGHT\");\n\t\t\t\n\t\t}\n\t\t\n\t\tSystem.out.println(pq.isEmpty());\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(\"DONE\");\n\t\t\n\t\t\n\t\t\n\t}",
"@Override\n public int compare(Pen p1, Pen p2) {\n int r1 = p1.remaining();\n int r2 = p2.remaining();\n if(r1 == 1) r1 = 7;\n if(r2 == 1) r2 = 7;\n return Integer.compare(r1,r2);\n }",
"private int fourOfaKind() {\n\t\tif (hand[1].getValueIndex() == hand[2].getValueIndex() && hand[2].getValueIndex() == hand[3].getValueIndex()) {\n\t\t\tif (hand[0].getValueIndex() == hand[1].getValueIndex()\n\t\t\t\t\t|| hand[4].getValueIndex() == hand[3].getValueIndex()) {\n\t\t\t\tresult.setPrimaryValuePos(hand[3].getValueIndex());\n\t\t\t\t\n\t\t\t\tif( result.getPrimaryValuePos() == hand[4].getValueIndex()) {\n\t\t\t\t\tresult.setSecondaryValuePos(hand[0].getValueIndex());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tresult.setSecondaryValuePos(hand[4].getValueIndex());\n\t\t\t\t}\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\treturn 0;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}",
"private void getWinner() {\r\n int nWhite = 0, nBlack = 0;\r\n if(nextPlayer.getChecks() == 0 && nextPlayer.getQueens() == 0){\r\n winner = currentPlayer;\r\n }\r\n else if(currentPlayer.getQueens() == nextPlayer.getQueens()){\r\n for (int i = 1; i<8; i++){\r\n for (int x = 0; x<8; x++) {\r\n if (checks[i][x] == 1) nBlack++;\r\n if (checks[7 - i][x] == 2) nWhite++;\r\n }\r\n if (nWhite>nBlack) winner = getPlayer(WHITE);\r\n else if(nBlack>nWhite)winner = getPlayer(BLACK);\r\n nWhite = 0;\r\n nBlack = 0;\r\n }\r\n }\r\n else if (currentPlayer.getQueens() > nextPlayer.getQueens()){ winner = currentPlayer;}\r\n else{winner = nextPlayer; }\r\n }",
"@Override\n public int howManyActivatedExceptBaseProduction(){\n return (gameboardPanel.howManyActivatedExceptBaseProduction() + leaderCardsPanel.howManyActivated());\n }",
"private int calculateQuality() {\n\t\t\n\t\tint quality = inconsistencyCount;\n\t\t\n\t\t/* found solution */\n\t\tif (inconsistencyCount == 0)\n\t\t\treturn 0; \n\t\t\n\t\t/* add cost for each unsupported precondition*/\n\t\tfor(InconsistencyIterator iterator = new InconsistencyIterator(); iterator.hasNext();) {\n\t\t\tLPGInconsistency inconsistency = iterator.next();\n\t\t\tquality += inconsistency.getCurrentLevel();\n\t\t\tif (inconsistency instanceof UnsupportedPrecondition) {\n\t\t\t\tint currentLevel = inconsistency.getCurrentLevel();\n\t\t\t\tPlanGraphLiteral unsupportedPrecondition = ((UnsupportedPrecondition) inconsistency).getUnsupportedPrecondition();\n\t\t\t\tquality += costToSupport(unsupportedPrecondition, currentLevel);\n\t\t\t\tquality += inconsistency.getInitialLevel();\n\t\t\t}\n\t\t}\n\t\t/* check steps, penalize levels with no real steps */\n\t\tfor( int i = 1; i < steps.size() - 1; i++) {\n\t\t\tboolean foundStep = false;\n\t\t\tfor(Iterator<PlanGraphStep> it = steps.get(i).iterator(); it.hasNext();) {\n\t\t\t\tPlanGraphStep next = it.next();\n\t\t\t\tif(!next.isPersistent()){\n\t\t\t\t\tfoundStep = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// increase quality if we have found no real steps \n\t\t\tif (!foundStep)\n\t\t\t\tquality++;\n\t\t}\n\t\t\n\t\treturn quality;\n\t}",
"void seeIfTrue() {\n\t\tfor (int i = 0; i < boardSize; i++) {\n\t\t\tfor (int j = 0; j < boardSize; j++) {\n\t\t\t\tint tempCounter = 0;\n\t\t\t\tfor (int k = 0; k < boardSize; k++) {\n\t\t\t\t\tif (availMoves[i][j][k] == true) {\n\t\t\t\t\t\ttempCounter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (tempCounter == 1) {\n\t\t\t\t\tSystem.out.println(\"FOUND A SQUARE WITH ONLY ONE POSSIBLE OPTION\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//checking every vertical line if there is some number that has only one number available\n\t\t//for every number\n\t\tfor (int i = 0; i < boardSize; i++) {\n\t\t\t//for every line\n\t\t\tfor (int j = 0; j < boardSize; j++) {\n\t\t\t\t//for every square\n\t\t\t\tint tempCounter = 0;\n\t\t\t\tfor (int k = 0; k < boardSize; k++) {\n\t\t\t\t\tif (availMoves[j][k][i] == true) {\n\t\t\t\t\t\ttempCounter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (tempCounter == 1) {\n\t\t\t\t\tSystem.out.println(\"found a vertical line that had an optional input the number \" + (i + 1) + \" at line: \" + j);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//checking every vertical line if there is some number that has only one number available\n\t\t//for every number\n\t\tfor (int i = 0; i < boardSize; i++) {\n\t\t\t//for every line\n\t\t\tfor (int j = 0; j < boardSize; j++) {\n\t\t\t\t//for every square\n\t\t\t\tint tempCounter = 0;\n\t\t\t\tfor (int k = 0; k < boardSize; k++) {\n\t\t\t\t\tif (availMoves[k][j][i] == true) {\n\t\t\t\t\t\ttempCounter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (tempCounter == 1) {\n\t\t\t\t\tSystem.out.println(\"found a horizontal line that had an optional input the number \" + (i + 1) + \" at line: \" + j);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"void goOverLines() {\n\t\t//checking every vertical line if there is some number that has only one number available\n\t\t//for every number\n\t\tfor (int i = 0; i < boardSize; i++) {\n\t\t\t//for every line\n\t\t\tfor (int j = 0; j < boardSize; j++) {\n\t\t\t\t//for every square\n\t\t\t\tint tempCounter = 0;\n\t\t\t\tint tempK = 0;\n\t\t\t\tfor (int k = 0; k < boardSize; k++) {\n\t\t\t\t\tif (availMoves[j][k][i] == true) {\n\t\t\t\t\t\ttempCounter++;\n\t\t\t\t\t\ttempK = k;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (tempCounter == 1) {\n\t\t\t\t\tmoveQueue.add(new int[] {j, tempK, (i + 1)});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//checking every vertical line if there is some number that has only one number available\n\t\t//for every number\n\t\tfor (int i = 0; i < boardSize; i++) {\n\t\t\t//for every line\n\t\t\tfor (int j = 0; j < boardSize; j++) {\n\t\t\t\t//for every square\n\t\t\t\tint tempCounter = 0;\n\t\t\t\tint tempK = 0;\n\t\t\t\tfor (int k = 0; k < boardSize; k++) {\n\t\t\t\t\tif (availMoves[k][j][i] == true) {\n\t\t\t\t\t\ttempCounter++;\n\t\t\t\t\t\ttempK = k;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (tempCounter == 1) {\n\t\t\t\t\tmoveQueue.add(new int[] {tempK, j, (i + 1)});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (!moveQueue.isEmpty()) {\n\t\t\tdoMove();\n\t\t}\n\t}",
"public int borrow(int pref) {\n\n\t\tswitch (pref) {\n\t\tcase 1:\n\t\t\tif (courseA != 0 && courseA >= courseB && courseA >= courseC && courseA >= courseD && courseA >= courseE\n\t\t\t\t\t&& courseA >= courseF && courseA >= courseG) {\n\t\t\t\tcourseA--;\n\t\t\t\treturn 0;\n\t\t\t} else {\n\t\t\t\tif (courseA == 0) {\n\t\t\t\t\t// System.out.println(\"Course A is filled...!\");\n\t\t\t\t}\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\tcase 2:\n\t\t\tif (courseB != 0 && courseB >= courseA && courseB >= courseC && courseB >= courseD && courseB >= courseE\n\t\t\t\t\t&& courseB >= courseF && courseB >= courseG) {\n\t\t\t\tcourseB--;\n\t\t\t\treturn 0;\n\t\t\t} else {\n\t\t\t\tif (courseB == 0) {\n\t\t\t\t\t// System.out.println(\"Course B is filled...!\");\n\t\t\t\t}\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\tcase 3:\n\t\t\tif (courseC != 0 && courseC >= courseB && courseC >= courseA && courseC >= courseD && courseC >= courseE\n\t\t\t\t\t&& courseC >= courseF && courseC >= courseG) {\n\t\t\t\tcourseC--;\n\t\t\t\treturn 0;\n\t\t\t} else {\n\t\t\t\tif (courseC == 0) {\n\t\t\t\t\t// System.out.println(\"Course C is filled...!\");\n\t\t\t\t}\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\tcase 4:\n\t\t\tif (courseD != 0 && courseD >= courseB && courseD >= courseC && courseD >= courseA && courseD >= courseE\n\t\t\t\t\t&& courseD >= courseF && courseD >= courseG) {\n\t\t\t\tcourseD--;\n\t\t\t\treturn 0;\n\t\t\t} else {\n\t\t\t\tif (courseD == 0) {\n\t\t\t\t\t// System.out.println(\"Course D is filled...!\");\n\t\t\t\t}\n\t\t\t\treturn 1;\n\t\t\t}\n\t\tcase 5:\n\t\t\tif (courseE != 0 && courseE >= courseA && courseE >= courseB && courseE >= courseC && courseE >= courseD\n\t\t\t\t\t&& courseE >= courseF && courseE >= courseG) {\n\t\t\t\tcourseE--;\n\t\t\t\treturn 0;\n\t\t\t} else {\n\t\t\t\tif (courseE == 0) {\n\t\t\t\t\t// System.out.println(\"CourseE is filled...!\");\n\t\t\t\t}\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\tcase 6:\n\t\t\tif (courseF != 0 && courseF >= courseA && courseF >= courseB && courseF >= courseC && courseF >= courseD\n\t\t\t\t\t&& courseF >= courseE && courseF >= courseG) {\n\t\t\t\tcourseF--;\n\t\t\t\treturn 0;\n\t\t\t} else {\n\t\t\t\tif (courseF == 0) {\n\t\t\t\t\t// System.out.println(\"Course F is filled...!\");\n\t\t\t\t}\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\tcase 7:\n\t\t\tif (courseG != 0 && courseG >= courseB && courseG >= courseA && courseG >= courseD && courseG >= courseC\n\t\t\t\t\t&& courseG >= courseE && courseG >= courseF) {\n\t\t\t\tcourseG--;\n\t\t\t\treturn 0;\n\t\t\t} else {\n\t\t\t\tif (courseG == 0) {\n\t\t\t\t\t// System.out.println(\"Course G is filled...!\");\n\t\t\t\t}\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t}\n\t\treturn -1;\n\n\t}"
]
| [
"0.66191787",
"0.65730274",
"0.6207813",
"0.60769355",
"0.6073672",
"0.6046995",
"0.5953947",
"0.5945108",
"0.5901089",
"0.587188",
"0.58258575",
"0.5784673",
"0.5750217",
"0.56848586",
"0.5678623",
"0.5632065",
"0.5616152",
"0.5614821",
"0.5609043",
"0.5581846",
"0.55795836",
"0.55406445",
"0.55214417",
"0.55158025",
"0.5512956",
"0.55117863",
"0.5493725",
"0.5484064",
"0.54764366",
"0.5472359",
"0.5470854",
"0.54625434",
"0.54488975",
"0.5440542",
"0.5435766",
"0.5416371",
"0.5415575",
"0.5401549",
"0.5399618",
"0.53995466",
"0.5392109",
"0.5386024",
"0.5358168",
"0.5348405",
"0.53396755",
"0.53384465",
"0.5337889",
"0.5323067",
"0.53219146",
"0.53157383",
"0.53080404",
"0.5306148",
"0.5288386",
"0.5277739",
"0.5252236",
"0.5239881",
"0.5237868",
"0.5237348",
"0.52365977",
"0.5229567",
"0.5225664",
"0.5225036",
"0.5215932",
"0.5209882",
"0.51986754",
"0.51971066",
"0.51963437",
"0.5189697",
"0.5181055",
"0.5177201",
"0.51747733",
"0.51726276",
"0.5166846",
"0.51634526",
"0.5158461",
"0.5153734",
"0.51497054",
"0.51466393",
"0.51464486",
"0.514576",
"0.51414245",
"0.5137925",
"0.5134738",
"0.51298714",
"0.51259637",
"0.51236457",
"0.5121145",
"0.51019675",
"0.51007473",
"0.5099661",
"0.509797",
"0.5095282",
"0.5093438",
"0.50932443",
"0.50891227",
"0.5079981",
"0.5078202",
"0.5075619",
"0.5071918",
"0.5071838"
]
| 0.6910716 | 0 |
Get the column that the state of the board represents | public int getColumn(){
return this.column;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"int getColumn(int x, int y){\n return board[x][y].getColumn();\n }",
"public int getCurrentPawnColumn(){\r\n GamePosition curPos = currentGame.getCurrentPosition();\n\t\tPlayer white = currentGame.getWhitePlayer();\n\t\tif(curPos.getPlayerToMove().equals(white)) {\n\t\t\treturn curPos.getWhitePosition().getTile().getColumn();\n\t\t\n\t\t} else {\n\t\t\treturn curPos.getBlackPosition().getTile().getColumn();\n\t\t}\r\n }",
"int getColumn();",
"int getCol();",
"public int getCol() {\n\t\treturn column; \n\t}",
"public int getColumn();",
"public int getColumn()\n\t{\n\t\treturn col;\n\t}",
"public int getColumn() {\n return col;\n }",
"public int getColumn() {\r\n\t\treturn this.col;\r\n\t}",
"public int getCol(){\r\n\t\treturn this.column;\r\n\t}",
"public int getColumn() {\n return mCol;\n }",
"protected int getCol() {\r\n\t\treturn this.col;\r\n\t}",
"public int getColumn()\r\n\t{\r\n\t\treturn this.column;\r\n\t}",
"String getColumn();",
"public int getColumn()\n\t\t{\n\t\t\treturn m_col;\n\t\t}",
"public int getColumn()\t \t\t{ return column; \t}",
"public final int getColumn() {\n/* 368 */ return this.bufcolumn[this.bufpos];\n/* */ }",
"public int getColumn() {\r\n\t\treturn column;\r\n\t}",
"public int getColumn() {\n\t\treturn column;\n\t}",
"public int getColumn() {\r\n return column;\r\n }",
"public int getColumn() {\r\n return column;\r\n }",
"public int getColumn() {\n return this.column;\n }",
"public int getCol() {\n return col;\n }",
"public final int getColumn() {\n return column;\n }",
"public int getCol() {\r\n return this.col;\r\n }",
"public int getColumn() {\n return column;\n }",
"public int getColumn() {\n return column;\n }",
"public int getColumn() {\n return column;\n }",
"public int getColumn()\n {\n return column;\n }",
"public int getColumn() {\n\t\t\treturn column;\n\t\t}",
"public int col() {\r\n return col;\r\n }",
"@Override\r\n public int getCol() {\r\n return this.col;\r\n }",
"public int getCol() {\n\t\treturn j;\n\t}",
"public int col() {\r\n\t\treturn col;\r\n\t}",
"public int getCol()\n\t{\n\t\treturn col;\n\t}",
"public int getCol()\n\t{\n\t\treturn col;\n\t}",
"public int getCol() { return _col; }",
"private int getColumn() {\n return binaryPartition(column);\n }",
"public char getColumn() {\n\t\treturn column;\n\t}",
"public int getColumn()\n {\n return col;\n }",
"public int getCol() {\n\t\t\treturn col;\n\t\t}",
"public Column getColumn(int pos) { return columns[pos]; }",
"Column getCol();",
"@Override\n public int getCol() {\n return getLayout().getCol();\n }",
"@Override\n\tpublic int getColunmForMove() {\n\t\treturn this.dropCol;\n\t}",
"public int getcolumn()\n\t{\n\t\tif(orderflag)\n\t\t{\n\t\t\treturn width;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn height;\n\t\t}\n\t}",
"public int[] getNeighborColIndex() {\n if (myRow % 2 == 0) {\n return neighborEvenColIndex;\n } else {\n return neighborOddColIndex;\n }\n }",
"public int getColumn() { return cc; }",
"public int getColumn() {\n // YOUR CODE HERE\n return this.column;\n }",
"public int[] getCol() { return _col; }",
"private int checkColumn() {\n for (int i = 0; i < 3; i++) {\n if ((this.board[i][0] == this.board[i][1]) && (this.board[i][0] == this.board[i][2])) {\n return this.board[i][0];\n }\n }\n return 0;\n }",
"int getColumnIndex();",
"int getColumnIndex();",
"int getColumnIndex();",
"public abstract int getColumn();",
"public int getCurrentColumn() {\n return buffer.columnNumber();\n }",
"public int getCol() {\n return this.col; \n }",
"public int getColumn() {\r\n\t\treturn slot % 9;\r\n\t}",
"public int getColumnNumber() {\n return column;\n }",
"public int getState(int row, int col) throws ArrayIndexOutOfBoundsException {\r\n return board[row][col];\r\n }",
"public CellCoord nextColumn() {\n return new CellCoord(column + 1, row);\n }",
"String getColumn(int index);",
"String getColumn(int index);",
"int atColumn();",
"private int getColumn(char columnName) {\r\n\t\tint result = -1;\r\n\t\tif (columnName > 64 && columnName < 91) {\r\n\t\t\tresult = columnName - 65;\r\n\t\t}\r\n\t\treturn result;\r\n\t}",
"public abstract int findColForWindow(int x);",
"@Override\n\tpublic int getColumn() {\n\t\treturn delegate.getColumn();\n\t}",
"public CellCoord previousColumn() {\n return new CellCoord(column - 1, row);\n }",
"java.lang.String getColumn();",
"private int getCol(int index) {\n return index & (chunkSize - 1);\n }",
"private char getColumnName(int column) {\r\n\t\tchar result = '0';\r\n\t\tif (column >= 0 && column <= playBoard[0].length) {\r\n\t\t\tresult = (char) (column + 65);\r\n\t\t}\r\n\t\treturn result;\r\n\t}",
"public int getColumna() {\r\n\t\treturn columna;\r\n\t}",
"public int getColumna() {\n\t\treturn columna;\n\t}",
"public Col getCol() {\n\treturn new Col(colIndex); \n }",
"public int visibleCell(int row, int column) {\n return column;\n }",
"private int getLifeFormCol(LifeForm lf)\r\n\t{\r\n\t\tfor(int i = 0; i < rows; i++)\r\n\t\t\tfor(int j = 0; j < columns; j++)\r\n\t\t\t\tif(cells[i][j].getLifeForm() == lf)\r\n\t\t\t\t\treturn j;\r\n\t\treturn -1;\r\n\t}",
"public int getColumna(){\n\t\treturn columna;\n\t}",
"public int getColumnIndex() {\n return 57;\n }",
"public char[][] getBoardState(){\n\t\treturn board;\n\t}",
"public int getColIndex() {\r\n\t\treturn colIndex;\r\n\t}",
"private int getColumnHeight(int column){\n int r = 0;\n for (; r<boardHeight && !boardStatus.get(column).get(r).isOccupied(); r++);\n return boardHeight - r;\n }",
"public ColumnIdentifier getColumn() {\n return this.column;\n }",
"public String getCol()\n {\n return color;\n }",
"public char[][] getBoardState(){\n return board;\n }",
"public int markedCol() {\r\n return markedCol;\r\n }",
"private HasCell<T, ?> getColumn(Element elem) {\n String cellId = getCellId(elem);\n return (cellId == null) ? null : idToCellMap.get(cellId);\n }",
"public int getColumn(){ return (Integer)args[1]; }",
"public int getPositionColumn(){return this.positionColumn;}",
"public Column getColumn(int column) throws Exception{\n\t\tif(column >= size)\n\t\t\tthrow new Exception(\"Index out of bounds\");\n\n\t\treturn columns[column];\n\t}",
"public abstract int getLastCageCol(int row, int col);",
"private int toColChar(int column)\n\t{\n\t\tint theCol;\n\t\tswitch (column)\n\t\t{\n\t\tcase 0: theCol = 1; break;\n\t\tcase 1: theCol = 2; break;\n\t\tcase 2: theCol = 3; break;\n\t\tdefault: theCol = -1;\n\t\t}\n\t\t\n\t\treturn theCol;\n\t}",
"public int getProbeColumn(int column, int row);",
"@Override\n\tpublic List<T> getCol(MatrixCoordinate coordIn) {\n\t\treturn this.getCol(coordIn.getX());\n\t}",
"public int getColumnIndex() {\n return table.findColumnIndex(getName());\n }",
"private static int ColumnNumber(int x, short puzzleValue) {\r\n\t\tint retVal = 81+x*9+puzzleValue;\r\n\t\treturn retVal;\r\n\t}",
"public int columnMove() {\r\n return cSign;\r\n }",
"public Integer getColIndex() {\r\n\t\treturn colIndex;\r\n\t}",
"public int getXColumn() {\n\t\t\treturn xColumn;\n\t\t}",
"public int getColumnNumber()\n {\n return parser.getColumnNumber();\n }",
"public int calculateGridCellColumn(int x)\n {\n float leftEdge = miniGame.getBoundaryLeft();\n x = (int)(x - leftEdge);\n return x / TILE_IMAGE_WIDTH;\n }"
]
| [
"0.76102406",
"0.76000386",
"0.7561996",
"0.74998677",
"0.7460258",
"0.74533296",
"0.7438312",
"0.74182796",
"0.7409249",
"0.740171",
"0.7378185",
"0.73768187",
"0.7356361",
"0.73503745",
"0.7331027",
"0.73169875",
"0.7316425",
"0.73077285",
"0.7303062",
"0.7297403",
"0.7297403",
"0.7293099",
"0.72857213",
"0.7275591",
"0.7270968",
"0.7264732",
"0.7264732",
"0.7264732",
"0.72565234",
"0.72534794",
"0.72528595",
"0.7236443",
"0.72341484",
"0.7233472",
"0.72321784",
"0.72321784",
"0.72298235",
"0.720837",
"0.71900165",
"0.7162862",
"0.71291214",
"0.71005243",
"0.7072675",
"0.7036628",
"0.6957587",
"0.69521755",
"0.69508624",
"0.69260573",
"0.69017357",
"0.68999434",
"0.6899624",
"0.68966144",
"0.68966144",
"0.68966144",
"0.68843",
"0.68754023",
"0.68244785",
"0.68111247",
"0.67758995",
"0.6775614",
"0.6750014",
"0.6729622",
"0.6729622",
"0.67054445",
"0.6691134",
"0.66876864",
"0.66251534",
"0.6617249",
"0.66114336",
"0.661053",
"0.6595723",
"0.6577618",
"0.6576591",
"0.65473664",
"0.65421516",
"0.65415114",
"0.653958",
"0.65326434",
"0.6478543",
"0.64688134",
"0.6438161",
"0.64241385",
"0.6421178",
"0.6416773",
"0.64113694",
"0.639231",
"0.6387462",
"0.637565",
"0.6375423",
"0.63610137",
"0.63311785",
"0.6298041",
"0.6296055",
"0.62866783",
"0.6275928",
"0.62684923",
"0.6249749",
"0.6248465",
"0.6245186",
"0.62359524"
]
| 0.7223312 | 37 |
A value that is comparable across BoardCandidates. The highest the value the better is players possibilities of winning | public int getGrade(){
return grade;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int determineHighestVal() {\n if (playerCards[0].value > playerCards[1].value) {\n return playerCards[0].value;\n }\n return playerCards[1].value;\n\n }",
"public int whoWin(){\r\n int winner = -1;\r\n \r\n int highest = 0;\r\n \r\n for(Player player : discWorld.getPlayer_HASH().values()){\r\n if(getPlayerPoints(player) > highest){\r\n highest = getPlayerPoints(player);\r\n winner = player.getID();\r\n }\r\n \r\n }\r\n \r\n return winner;\r\n }",
"private static int maximum() {\n\t\tint popSize = 0;\n\t\tChromosome thisChromo = null;\n\t\tChromosome thatChromo = null;\n\t\tint winner = 0;\n\t\tboolean foundNewWinner = false;\n\t\tboolean done = false;\n\n\t\twhile (!done) {\n\t\t\tfoundNewWinner = false;\n\t\t\tpopSize = population.size();\n\t\t\tfor (int i = 0; i < popSize; i++) {\n\t\t\t\tif (i != winner) { // Avoid self-comparison.\n\t\t\t\t\tthisChromo = population.get(i);\n\t\t\t\t\tthatChromo = population.get(winner);\n\t\t\t\t\tif (thisChromo.conflicts() > thatChromo.conflicts()) {\n\t\t\t\t\t\twinner = i;\n\t\t\t\t\t\tfoundNewWinner = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (foundNewWinner == false) {\n\t\t\t\tdone = true;\n\t\t\t}\n\t\t}\n\t\treturn winner;\n\t}",
"private static int getMaxScore(char[][] board){\n\n\t\tString result = gameStatus(board);\n\n\t\tif (result.equals(\"true\") && winner == 'X') return 1; //if x won\n\t\telse if (result.equals(\"true\") && winner == 'O') return -1;//if O won\n\t\telse if (result.equals(\"tie\")) return 0; //if tie\n\t\telse { \n\n\t\t\tint bestScore = -10;\n\t\t\tHashSet<Integer> possibleMoves = findPossibleMoves(board);\n\n\t\t\tfor (Integer move: possibleMoves){\n\n\t\t\t\tchar[][] modifiedBoard = new char[3][3];\n\n\t\t\t\tfor (int row = 0; row < 3; row++){\n\t\t\t\t\tfor (int col = 0; col < 3; col++){\n\t\t\t\t\t\tmodifiedBoard[row][col] = board[row][col];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tmodifiedBoard[move/3][move%3]='X';\n\n\t\t\t\tint currentScore = getMinScore(modifiedBoard);\n\n\t\t\t\tif (currentScore > bestScore){\n\t\t\t\t\tbestScore = currentScore;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\treturn bestScore;\n\t\t}\n\t}",
"private Player compareTopCards() {\n // COMPARE CARDS\n int bestValue = activePlayer.getTopMostCard().getCardPropertyValue(activeCategory);\n // assume activePlayer will win the round and then test if this is true\n // if no other card beats or equals the ActivePlayer's card\n // the activePlayer will be returned as the winner\n Player currentWinner = activePlayer;\n for (Player player : players) {\n // if not the active player\n if (!(player == activePlayer)) {\n // check specific player value for the active category\n int value = player.getTopMostCard().getCardPropertyValue(activeCategory);\n if (bestValue < value) {\n bestValue = value;\n currentWinner = player;\n }\n // if value matches top value then there is a tie\n else if (bestValue == value) {\n currentWinner = null;\n }\n }\n }\n return currentWinner;\n }",
"private static int eval(Board board) {\n if (board.piecesContiguous(board.turn())) {\n return Integer.MAX_VALUE;\n } else if (board.piecesContiguous(board.turn().opposite())) {\n return Integer.MIN_VALUE;\n } else {\n Random r = new Random();\n return r.nextInt();\n }\n }",
"public int eval()\n\t\t{\n\t\t\tif (p[BLACK]==0) return MAX+1;\t//black=0 then white win then return max\n\t\t\tif (p[WHITE]==0) return MIN-1;\t//white=0 then black win then return min\n\t\t\tint bl=getNumberOne(p[0]);int wh=getNumberOne(p[1]);\n\t\t\treturn wh-bl;\n\t\t}",
"public int winner() {\n if(humanPlayerHits == 17) {\n return 1;\n }\n if(computerPlayerHits == 17){\n return 2;\n }\n return 0;\n }",
"private static int minimum() {\n\t\tint popSize = 0;\n\t\tChromosome thisChromo = null;\n\t\tChromosome thatChromo = null;\n\t\tint winner = 0;\n\t\tboolean foundNewWinner = false;\n\t\tboolean done = false;\n\n\t\twhile (!done) {\n\t\t\tfoundNewWinner = false;\n\t\t\tpopSize = population.size();\n\t\t\tfor (int i = 0; i < popSize; i++) {\n\t\t\t\tif (i != winner) { // Avoid self-comparison.\n\t\t\t\t\tthisChromo = population.get(i);\n\t\t\t\t\tthatChromo = population.get(winner);\n\t\t\t\t\tif (thisChromo.conflicts() < thatChromo.conflicts()) {\n\t\t\t\t\t\twinner = i;\n\t\t\t\t\t\tfoundNewWinner = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (foundNewWinner == false) {\n\t\t\t\tdone = true;\n\t\t\t}\n\t\t}\n\t\treturn winner;\n\t}",
"private TeamId findWinningTeam(){\n if (state.score().totalPoints(TeamId.TEAM_1)>=Jass.WINNING_POINTS) {\n return TeamId.TEAM_1;\n }\n else {\n return TeamId.TEAM_2;\n }\n }",
"int tournament() {\r\n \tint ch1,ch2;\r\n\t\tch1 = (int)Math.floor(Math.random()*SIZE);\r\n\t\tdo {\r\n\t\t\tch2 = (int)Math.floor(Math.random()*SIZE);\r\n\t\t} while (ch1==ch2);\r\n\t\tif (fit[ch1]<fit[ch2]) return ch1;\r\n\t\telse return ch2;\r\n }",
"public int winner(){\n getValidMoves();\n if(check(1)!=0) return 1;\n else if(check(-1)!=0) return -1;\n else if(validX.size()==0) return 2;\n else return 0;\n }",
"public int best(){\n List<Integer> points = count();\n Integer max = 0;\n for (Integer p: points){\n if (p <= 21 && max < p){\n max = p;\n }\n }\n return max;\n }",
"public int getBestValue() {\n return bestValue;\n }",
"public static void compareCombos() {\n\t\tint currentTotal = 0;\n\t\tint pastTotal = 0;\n\n\t\tcost++;\n\t\tfor (int i = 0; i < numPeople; i++) {\n\t\t\tcurrentTotal += board[i][currentCombo[i]];\n\t\t\tpastTotal += board[i][bestCombo[i]];\n\t\t}\n\t\t\n\t\tif (currentTotal >= pastTotal) {\n\t\t\tbestTotal = 0;\n\t\t\tfor (int i = 0; i < numPeople; i++) {\n\t\t\t\tbestCombo[i] = currentCombo[i];\n\t\t\t\tbestTotal += board[i][currentCombo[i]];\n\t\t\t}\n\t\t}\n\n\t}",
"private int GetBestCard(Card[] card) {\n\t int iPos = 0;\n\t int iWeightTemp = 0;\n\t int iWeight[] = new int[8];\n\t for (int i = 0; i < 8; i++){\n\t\t iWeight[i] = -1;\n\t }\n\t // For each selectable card, work out a weight, the highest weight is the one selected.\n\t // The weight is worked out by the distance another of the players cards is from playable ones, with no playable cards in between\n\t Card myCard, nextCard;\n\t for (int i = 0; i < 8; i++){\n\t\t if (card[i] != null){\n\t\t\t // if card value > 7\n\t\t\t if (card[i].GetValue() > 7){\n\t\t\t\t // do you have cards that are higher than this card\n\t\t\t\t myCard = card[i];\n\t\t\t\t iWeightTemp = 0;\n\t\t\t \tfor (int j = 0; j < mCardCount; j++){\n\t\t\t \t\tnextCard = mCard[j];\n\t\t\t \t\tif (nextCard != null && nextCard.GetSuit() == myCard.GetSuit() && nextCard.GetValue() > myCard.GetValue()){\n\t\t\t \t\t\tif (nextCard.GetValue() - myCard.GetValue() > iWeightTemp)\n\t\t\t \t\t\t\tiWeightTemp = nextCard.GetValue() - myCard.GetValue();\n\t\t\t \t\t\tmyCard = nextCard;\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t \tiWeight[i] = iWeightTemp;\n\t\t\t \t\t\n\t\t\t }\n\t\t\t if (card[i].GetValue() < 7){\n\t\t\t\t // do you have cards that are lower than this card\n\t\t\t\t myCard = card[i];\n\t\t\t\t iWeightTemp = 0;\n\t\t\t \tfor (int j = mCardCount-1; j >=0; j--){\n\t\t\t \t\tnextCard = mCard[j];\n\t\t\t \t\tif (nextCard != null && nextCard.GetSuit() == myCard.GetSuit() && nextCard.GetValue() < myCard.GetValue()){\n\t\t\t \t\t\tif (myCard.GetValue() - nextCard.GetValue() > iWeightTemp)\n\t\t\t \t\t\t\tiWeightTemp = myCard.GetValue() - nextCard.GetValue();\n\t\t\t \t\t\tmyCard = nextCard;\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t \tiWeight[i] = iWeightTemp;\n\t\t\t \t\t\n\t\t\t }\t\n\t\t\t if (card[i].GetValue() == 7){\n\t\t\t\t // do you have cards that are in this suit\n\t\t\t\t myCard = card[i];\n\t\t\t\t int iWeightTemp1;\n\t\t\t\t iWeightTemp = 0;\n\t\t\t\t iWeightTemp1 = 0;\n\t\t\t\t // do you have cards that are higher than this card\n\t\t\t \tfor (int j = 0; j < mCardCount; j++){\n\t\t\t \t\tnextCard = mCard[j];\n\t\t\t \t\tif (nextCard != null && nextCard.GetSuit() == myCard.GetSuit() && nextCard.GetValue() > myCard.GetValue()){\n\t\t\t \t\t\tif (nextCard.GetValue() - myCard.GetValue() > iWeightTemp)\n\t\t\t \t\t\t\tiWeightTemp = nextCard.GetValue() - myCard.GetValue();\n\t\t\t \t\t\tmyCard = nextCard;\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t \tmyCard = card[i];\n\t\t\t \t// do you have cards that are lower than this card\n\t\t\t \tfor (int j = mCardCount-1; j >=0; j--){\n\t\t\t \t\tnextCard = mCard[j];\n\t\t\t \t\tif (nextCard != null && nextCard.GetSuit() == myCard.GetSuit() && nextCard.GetValue() < myCard.GetValue()){\n\t\t\t \t\t\tif (myCard.GetValue() - nextCard.GetValue() > iWeightTemp1)\n\t\t\t \t\t\t\tiWeightTemp1 = myCard.GetValue() - nextCard.GetValue();\n\t\t\t \t\t\tmyCard = nextCard;\n\t\t\t \t\t}\n\t\t\t \t} \t\n\t\t\t \tiWeight[i] = iWeightTemp + iWeightTemp1;\n\t\t\t \t\t\n\t\t\t }\t\t\t \n\t\t }\n\t\t \t \n\t }\n\t boolean bLoopAceKing = true;\n\t int iMaxTemp = 0;\n\t int iMaxCount = 0;\t\n\t int[] iMaxs;\n\t iMaxs = new int[8];\n\t while (bLoopAceKing){\n\t\t for (int i = 0; i < 8; i++){\n\t\t\t if (iWeight[i] >= iMaxTemp){\n\t\t\t\t if (iWeight[i] == iMaxTemp){\n\t\t\t\t\t iMaxs[iMaxCount] = i;\n\t\t\t\t\t iMaxCount++;\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t\t\t iMaxTemp = iWeight[i];\n\t\t\t\t\t iMaxs = new int[8];\n\t\t\t\t\t iMaxCount = 0;\n\t\t\t\t\t iMaxs[iMaxCount] = i;\n\t\t\t\t\t iMaxCount++;\n\t\t\t\t }\t\t\t \n\t\t\t }\t \n\t\t }\n\t\t boolean bAceKing = false;\n\t\t // If the top weight is zero, meaning your options don't help you, then play the one that is closest to ace/king\n\t\t if (iMaxTemp == 0 && iMaxCount > 1){\n\t\t\t for (int k = 0; k < iMaxCount; k++){\n\t\t\t\t\t iWeight[iMaxs[k]] = Math.abs(card[iMaxs[k]].GetValue()-7);\n\t\t\t\t\t bAceKing = true;\t\t\t\t \n\t\t\t } \t\t \n\t\t }\n\t\t if (bAceKing){\n\t\t\t bLoopAceKing = true;\n\t\t\t iMaxs = new int[8];\n\t\t\t iMaxTemp = 0;\n\t\t\t iMaxCount = 0;\t\t\t \n\t\t }\n\t\t else \n\t\t\t bLoopAceKing = false;\n\t }\n\t if (iMaxCount == 1)\n\t\t iPos = iMaxs[iMaxCount-1];\n\t else {\n\t\t Random generator = new Random();\n\t\t int randomIndex = generator.nextInt( iMaxCount );\n\t\t iPos = iMaxs[randomIndex];\n\t }\n\t\t \n\t return iPos;\n\t \n }",
"private void whoIsTheWinner() {\n\t\t// at first we say let the number for winner and the maximal score be 0.\n\t\tint winnerName = 0;\n\t\tint maxScore = 0;\n\t\t// then, for each player, we check if his score is more than maximal\n\t\t// score, and if it is we let that score to be our new maximal score and\n\t\t// we generate the player number by it and we let that player number to\n\t\t// be the winner, in other way maximal scores doen't change.\n\t\tfor (int i = 1; i <= nPlayers; i++) {\n\t\t\tif (totalScore[i] > maxScore) {\n\t\t\t\tmaxScore = totalScore[i];\n\t\t\t\twinnerName = i - 1;\n\t\t\t}\n\t\t}\n\t\t// finally, program displays on screen who is the winner,and what score\n\t\t// he/she/it got.\n\t\tdisplay.printMessage(\"Congratulations, \" + playerNames[winnerName]\n\t\t\t\t+ \", you're the winner with a total score of \" + maxScore + \"!\");\n\t}",
"public int selectionFunctionBiggestCoin(MyList<Integer> candidates){\n\n\t\t//-----------------------------\n\t\t//Output Variable --> InitialValue\n\t\t//-----------------------------\n\t\tint res = -1;\n\n\t\t//-----------------------------\n\t\t//SET OF OPS\n\t\t//-----------------------------\n\t\tint maxWeight = Integer.MIN_VALUE;\n\t\tint index = candidates.length() - 1;\n\n\n\t\twhile (index >= 0) {\n\t\t\t// OP1.1. Auxiliary variables:\n\t\t\t// We use 'e0' to compute the first item of 'candidate' just once.\n\t\t\tint e0 = candidates.getElement(index);\n\n\t\t\t// OP1.1. If a not previously considered item improves minWeight, we\n\t\t\t// update 'res' and 'minWeight'\n\t\t\tif (e0 > maxWeight) {\n\t\t\t\tres = index;\n\t\t\t\tmaxWeight = e0;\n\t\t\t}\n\n\t\t\t// OP1.2. We decrease 'index' so as to try the previous item of\n\t\t\t// 'candidates'\n\t\t\tindex--;\n\t\t}\n\n\t\t//-----------------------------\n\t\t//Output Variable --> Return FinalValue\n\t\t//-----------------------------\t\t\n\t\treturn res;\t\t\n\t}",
"@Override\n public int compareTo(Object o) { \n if(this.getGrade()==((BoardCandidate)o).getGrade()){\n return (int)(Math.random()*10-Math.random()*10);\n }\n return this.getGrade()-((BoardCandidate)o).getGrade();\n }",
"private long opponent_winning_position() {\r\n return compute_winning_position(bitboard ^ mask, mask);\r\n }",
"public int getResult() {\n whiteTotal = 0;\n blackTotal = 0;\n rest = 0;\n for (int row = 0; row < BOARD_SIZE; row++) {\n for (int column = 0; column < BOARD_SIZE; column++) {\n if (board[row][column] == BLACK) {\n blackTotal++;\n } else if (board[row][column] == WHITE) {\n whiteTotal++;\n } else {\n rest++;\n }\n }\n }\n int winner = -1;\n if (rest == 0) {\n if (blackTotal < whiteTotal) {\n winner = 1;\n } else if (blackTotal > whiteTotal) {\n winner = 2;\n } else {\n winner = 0;\n }\n }\n\n if (blackTotal == 0 || whiteTotal == 0) {\n\n if (blackTotal != 0) {\n winner = 2;\n } else if (whiteTotal != 0) {\n winner = 1;\n }\n }\n\n if (getValidateMoveList('W', 'B').isEmpty() && getValidateMoveList('B', 'W').isEmpty()) {\n\n if (blackTotal < whiteTotal) {\n winner = 1;\n } else if (blackTotal > whiteTotal) {\n winner = 2;\n } else {\n winner = 0;\n }\n }\n return winner;\n }",
"private void getWinner() {\r\n int nWhite = 0, nBlack = 0;\r\n if(nextPlayer.getChecks() == 0 && nextPlayer.getQueens() == 0){\r\n winner = currentPlayer;\r\n }\r\n else if(currentPlayer.getQueens() == nextPlayer.getQueens()){\r\n for (int i = 1; i<8; i++){\r\n for (int x = 0; x<8; x++) {\r\n if (checks[i][x] == 1) nBlack++;\r\n if (checks[7 - i][x] == 2) nWhite++;\r\n }\r\n if (nWhite>nBlack) winner = getPlayer(WHITE);\r\n else if(nBlack>nWhite)winner = getPlayer(BLACK);\r\n nWhite = 0;\r\n nBlack = 0;\r\n }\r\n }\r\n else if (currentPlayer.getQueens() > nextPlayer.getQueens()){ winner = currentPlayer;}\r\n else{winner = nextPlayer; }\r\n }",
"public int determineWinner() {\n\t\tif(board[1][1] != 0 && (\n\t\t\t(board[1][1] == board[0][0] && board[1][1] == board[2][2]) ||\n\t\t\t(board[1][1] == board[0][2] && board[1][1] == board[2][0]) ||\n\t\t\t(board[1][1] == board[0][1] && board[1][1] == board[2][1]) ||\n\t\t\t(board[1][1] == board[1][0] && board[1][1] == board[1][2]))){\n\t\t\treturn board[1][1];\n\t\t}\n\t\telse if (board[0][0] != 0 &&(\n\t\t\t(board[0][0] == board[0][1] && board[0][0] == board[0][2]) ||\n\t\t\t(board[0][0] == board[1][0] && board[0][0] == board[2][0]))){\n\t\t\treturn board[0][0];\n\t\t}\n\t\telse if (board [2][2] != 0 && (\n\t\t\t(board[2][2] == board[2][0] && board[2][2] == board[2][1]) ||\n\t\t\t(board[2][2] == board[0][2] && board[2][2] == board[1][2]))) {\n\t\t\treturn board[2][2];\n\t\t}\n\t\t\n\t\t//See if every square has been marked, return still in progress if not\n\t\tfor(int i = 0; i < 3; ++i) {\n\t\t\tfor(int j = 0; j < 3; ++j) {\n\t\t\t\tif (board[i][j] == 0)\n\t\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Return tie\n\t\treturn 3;\n\t}",
"public ArrayList<Integer> compChoice(ArrayList<ArrayList<String>> board) {\n // winning move available\n if (this.aboutToWin(board, 1) != null) {\n return this.aboutToWin(board, 1);\n\n // threat winning pay\n } else if (playerCanWin(board) != null) {\n return playerCanWin(board);\n\n // center square \n } else if (board.size() % 2 == 1 && board.get(board.size()/2).get(board.size()/2).isEmpty()) {\n return new ArrayList<Integer>(Arrays.asList(board.size()/2, board.size()/2));\n \n // random\n } else {\n Random rand = new Random();\n String text = \"temp\";\n int r1 = 0, r2 = 0;\n while (!text.isEmpty()) {\n r1 = rand.nextInt(board.size());\n r2 = rand.nextInt(board.size());\n text = board.get(r1).get(r2);\n }\n return new ArrayList<Integer>(Arrays.asList(r1, r2));\n }\n }",
"private int getHeuristic(Player player) {\n int whitePieces = 0;\n int blackPieces = 0;\n\n for (int r = 0; r < Board.MAX_ROW; r++) {\n for (int c = 0; c < Board.MAX_COLUMN; c++) {\n if (boardObject.getSlot(r, c).getColor() == Slot.WHITE) {\n whitePieces++;\n } else if (boardObject.getSlot(r, c).getColor() == Slot.BLACK) {\n blackPieces++;\n }\n }\n }\n\n if (player.equals(playerBlack)) {\n return blackPieces - whitePieces;\n } else {\n return whitePieces - blackPieces;\n }\n }",
"public static Player whoWonGame() {\r\n\t\tint highest = Main.winScoreNumb;\r\n\t\tPlayer winner = null;\r\n\t\t\r\n\t\t//Three handed play.\r\n\t\tif (Main.isThreeHanded){\r\n\t\t\tif (Utils.stringToInt(Main.player1Score) >= highest) {\r\n\t\t\t\thighest = Utils.stringToInt(Main.player1Score);\r\n\t\t\t\twinner = Main.playerOne;\r\n\t\t\t}\r\n\t\t\tif (Utils.stringToInt(Main.player2Score) >= highest) {\r\n\t\t\t\thighest = Utils.stringToInt(Main.player2Score);\r\n\t\t\t\twinner = Main.playerTwo;\r\n\t\t\t}\r\n\t\t\tif (Utils.stringToInt(Main.player3Score) >= highest) {\r\n\t\t\t\thighest = Utils.stringToInt(Main.player3Score);\r\n\t\t\t\twinner = Main.playerThree;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Four handed play with no teams.\r\n\t\tif (Main.isFourHandedSingle){\r\n\t\t\tif (Utils.stringToInt(Main.player1Score) >= highest) {\r\n\t\t\t\thighest = Utils.stringToInt(Main.player1Score);\r\n\t\t\t\twinner = Main.playerOne;\r\n\t\t\t}\r\n\t\t\tif (Utils.stringToInt(Main.player2Score) >= highest) {\r\n\t\t\t\thighest = Utils.stringToInt(Main.player2Score);\r\n\t\t\t\twinner = Main.playerTwo;\r\n\t\t\t}\r\n\t\t\tif (Utils.stringToInt(Main.player3Score) >= highest) {\r\n\t\t\t\thighest = Utils.stringToInt(Main.player3Score);\r\n\t\t\t\twinner = Main.playerThree;\r\n\t\t\t}\r\n\t\t\tif (Utils.stringToInt(Main.player4Score) >= highest) {\r\n\t\t\t\thighest = Utils.stringToInt(Main.player4Score);\r\n\t\t\t\twinner = Main.playerFour;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn winner;\r\n\t}",
"public int evalBoard(){\n if (wins('o')){\n return 3;\n }\n // Return 0 if human wins\n else if (wins('b')){\n return 0;\n }\n //Return 2 if game is draw\n else if (isDraw()){\n return 2;\n }\n // Game is not a draw and no player has won. Game is still undecided.\n else {\n return 1;\n }\n }",
"static int getComputerCard(Card playerCard) {\n //The computer will iterate through different possible cards it might choose to play.\n //This represents a chosen card at any given time.\n Card possibleCard = null;\n //The position in the computer's hand where the possibleCard is stored.\n int cardPosition = 0;\n //True if the computer has a card of higher value than the player's.\n boolean hasHigherCard = false;\n //Iterate through the computer's hand, trying to find a card higher than the player's\n for (int i = 0; i < highCardGame.getHand(0).getNumCards(); i++) {\n if (playerCard.compareTo(highCardGame.getHand(0).inspectCard(i)) < 0) {\n //The computer has a higher card.\n if (possibleCard != null) {\n //If this card is lower than the possible card, but can still beat the player, then replace possible card.\n if (possibleCard.compareTo(highCardGame.getHand(0).inspectCard(i)) > 0) {\n possibleCard = new Card(highCardGame.getHand(0).inspectCard(i));\n cardPosition = i;\n }\n } else {\n //If the computer has not yet chosen a possible card, choose this one.\n possibleCard = new Card(highCardGame.getHand(0).inspectCard(i));\n hasHigherCard = true;\n cardPosition = i;\n }\n }\n }\n if (!hasHigherCard) {\n //If the computer does not have a card that can beat the player, then feed the lowest card\n //that the computer has to the player.\n for (int i = 0; i < highCardGame.getHand(0).getNumCards(); i++)\n if (playerCard.compareTo(highCardGame.getHand(0).inspectCard(i)) >= 0) {\n if (possibleCard != null) {\n if (possibleCard.compareTo(highCardGame.getHand(0).inspectCard(i)) > 0) {\n possibleCard = new Card(highCardGame.getHand(0).inspectCard(i));\n cardPosition = i;\n }\n } else {\n possibleCard = highCardGame.getHand(0).inspectCard(i);\n cardPosition = i;\n }\n }\n }\n return cardPosition;\n }",
"private int highestPossibleValue(List<Card> cards) {\n int value = 0;\n int assCounter = 0;\n\n // Calculate the value without taking * into account\n for (Card card : cards) {\n value += card.getValue();\n if (card.getName().equals(\"*\")) assCounter++;\n }\n\n // Subtracts value of *\n for (int i = 0; i < assCounter; i++) {\n if (value <= 21)\n break;\n value -= 10;\n }\n\n return value;\n }",
"private int tournament()\r\n {\r\n\tint out = spinTheWheel();\r\n\tdouble max = ff.evaluate(chromos.get(out),generation());\r\n\tdouble temp_fitness = 0;\r\n\tint temp_index = 0;\r\n\r\n\tfor(int i = 0; i < selPara - 1 + tourStep*generation(); i++)\r\n\t {\r\n\t\ttemp_index = spinTheWheel();\r\n\t\ttemp_fitness = ff.evaluate(chromos.get(temp_index),generation());\r\n\t\tif(temp_fitness > max)\r\n\t\t {\r\n\t\t\tmax = temp_fitness;\r\n\t\t\tout = temp_index;\r\n\t\t }\r\n\t }\r\n\treturn out;\r\n }",
"private int determineWinning(GamePlayerInterface player, GamePlayerInterface dealer)\n {\n \n int playerValue = player.getTotalCardsValue();\n int dealerValue = dealer.getTotalCardsValue();\n int result = 0;\n \n if(dealerValue > playerValue)\n {\n \t view.print(\"Dealer Wins\");\n \t view.printLine();\n \t result = 1;\n }\n \n else if(dealerValue < playerValue)\n {\n \t view.print(\"Player Wins\");\n \t view.printLine();\n \t result = 2;\n }\n \n else{\n \t view.print(\"Match Draw!\");\n \t view.printLine();\n }\n \n return result;\n }",
"public int checkForWinner() {\n\n // Check horizontal wins\n for (int i = 0; i <= 6; i += 3)\t{\n if (mBoard[i] == HUMAN_PLAYER &&\n mBoard[i+1] == HUMAN_PLAYER &&\n mBoard[i+2]== HUMAN_PLAYER)\n return 2;\n if (mBoard[i] == COMPUTER_PLAYER &&\n mBoard[i+1]== COMPUTER_PLAYER &&\n mBoard[i+2] == COMPUTER_PLAYER)\n return 3;\n }\n\n // Check vertical wins\n for (int i = 0; i <= 2; i++) {\n if (mBoard[i] == HUMAN_PLAYER &&\n mBoard[i+3] == HUMAN_PLAYER &&\n mBoard[i+6]== HUMAN_PLAYER)\n return 2;\n if (mBoard[i] == COMPUTER_PLAYER &&\n mBoard[i+3] == COMPUTER_PLAYER &&\n mBoard[i+6]== COMPUTER_PLAYER)\n return 3;\n }\n\n // Check for diagonal wins\n if ((mBoard[0] == HUMAN_PLAYER &&\n mBoard[4] == HUMAN_PLAYER &&\n mBoard[8] == HUMAN_PLAYER) ||\n (mBoard[2] == HUMAN_PLAYER &&\n mBoard[4] == HUMAN_PLAYER &&\n mBoard[6] == HUMAN_PLAYER))\n return 2;\n if ((mBoard[0] == COMPUTER_PLAYER &&\n mBoard[4] == COMPUTER_PLAYER &&\n mBoard[8] == COMPUTER_PLAYER) ||\n (mBoard[2] == COMPUTER_PLAYER &&\n mBoard[4] == COMPUTER_PLAYER &&\n mBoard[6] == COMPUTER_PLAYER))\n return 3;\n\n // Check for tie\n for (int i = 0; i < BOARD_SIZE; i++) {\n // If we find a number, then no one has won yet\n if (mBoard[i] != HUMAN_PLAYER && mBoard[i] != COMPUTER_PLAYER)\n return 0;\n }\n\n // If we make it through the previous loop, all places are taken, so it's a tie\n return 1;\n }",
"private Outcome minMax(PossibleBoard posBoard, Icon icon, int depth) {\n Outcome outcome = new Outcome();\n Result result = posBoard.determineOutcome();\n boolean maximiseWin = icon == getIcon();\n\n // BASE CASE\n if (result.gameComplete()) {\n outcome.score = result.getBonus();\n outcome.moveToMake = posBoard.coor;\n outcome.depth = depth;\n return outcome;\n }\n\n ArrayList<PossibleBoard> posNextBoards = getPossibleNextBoards(posBoard, icon);\n int optimalScore = (maximiseWin ? Integer.MIN_VALUE : Integer.MAX_VALUE);\n Coordinate optimalCoor = new Coordinate(0,0);\n int optimalDepth = Integer.MAX_VALUE;\n\n for (PossibleBoard posNextBoard : posNextBoards) {\n Outcome nextOutcome = minMax(posNextBoard, (icon == Icon.CROSSES ? Icon.NOUGHTS : Icon.CROSSES), depth + 1);\n\n if (maximiseWin && nextOutcome.score >= optimalScore) {\n if (nextOutcome.score == optimalScore && nextOutcome.depth < optimalDepth) continue;\n optimalScore = nextOutcome.score;\n optimalCoor = posNextBoard.coor;\n optimalDepth = nextOutcome.depth;\n\n } else if (!maximiseWin && nextOutcome.score <= optimalScore){\n if (nextOutcome.score == optimalScore && nextOutcome.depth < optimalDepth) continue;\n optimalScore = nextOutcome.score;\n optimalCoor = posNextBoard.coor;\n optimalDepth = nextOutcome.depth;\n\n }\n }\n\n outcome.moveToMake = optimalCoor;\n outcome.score = optimalScore;\n outcome.depth = optimalDepth;\n return outcome;\n }",
"public int getBestScore() {\n\t\tInteger score = this.hand.countValue().lower(22);\n\t\tif(score!=null) {\n\t\t\treturn score;\n\t\t}\n\t\telse {\n\t\t\treturn this.hand.countValue().higher(21);\n\t\t}\n\t}",
"public int trickWinner(){\n Card.NUMBER one = player1Play.getValue();\n Card.NUMBER two = player2Play.getValue();\n Card.NUMBER three = player3Play.getValue();\n Card.NUMBER four = player4Play.getValue();\n Card.SUIT oneSuit = player1Play.getSuit();\n Card.SUIT twoSuit = player2Play.getSuit();\n Card.SUIT threeSuit = player3Play.getSuit();\n Card.SUIT fourSuit = player4Play.getSuit();\n int[] value = new int[4];\n value[0] = Card.getValsVal(one, oneSuit, currentTrumpSuit);\n value[1] = Card.getValsVal(two, twoSuit, currentTrumpSuit);\n value[2] = Card.getValsVal(three, threeSuit, currentTrumpSuit);\n value[3] = Card.getValsVal(four, fourSuit, currentTrumpSuit);\n if(player1Play.getSuit() == firstPlayedSuit && firstPlayedSuit != currentTrumpSuit && value[0] != 7){\n value[0] += 10;\n }\n if(player2Play.getSuit() == firstPlayedSuit && firstPlayedSuit != currentTrumpSuit && value[0] != 7){\n value[1] += 10;\n }\n if(player3Play.getSuit() == firstPlayedSuit && firstPlayedSuit != currentTrumpSuit && value[0] != 7){\n value[2] += 10;\n }\n if(player4Play.getSuit() == firstPlayedSuit && firstPlayedSuit != currentTrumpSuit && value[0] != 7){\n value[3] += 10;\n }\n if(player1Play.getSuit() == currentTrumpSuit || value[0] == 7){\n value[0] += 20;\n }\n if(player2Play.getSuit() == currentTrumpSuit || value[1] == 7){\n value[1] += 20;\n }\n if(player3Play.getSuit() == currentTrumpSuit || value[2] == 7){\n value[2] += 20;\n }\n if(player4Play.getSuit() == currentTrumpSuit || value[3] == 7){\n value[3] += 20;\n }\n int winner = 0;\n int winVal = 0;\n for(int i = 0; i < 4; i++){\n if(value[i] > winVal){\n winVal = value[i];\n winner = i;\n }\n }\n return winner;\n }",
"public Result determineOutcome() {\n for (int row = 0; row < TicTacToeModel.BOARD_DIMENSION; row++) {\n if (rowScore[row] == TicTacToeModel.BOARD_DIMENSION){\n return Result.WIN;\n } else if (rowScore[row] == -TicTacToeModel.BOARD_DIMENSION) {\n return Result.LOSE;\n }\n }\n\n for (int col = 0; col < TicTacToeModel.BOARD_DIMENSION; col++) {\n if (colScore[col] == TicTacToeModel.BOARD_DIMENSION){\n return Result.WIN;\n } else if (colScore[col] == -TicTacToeModel.BOARD_DIMENSION) {\n return Result.LOSE;\n }\n }\n\n if (leftDiagScore == TicTacToeModel.BOARD_DIMENSION) return Result.WIN;\n if (rightDiagScore == TicTacToeModel.BOARD_DIMENSION) return Result.WIN;\n if (leftDiagScore == -TicTacToeModel.BOARD_DIMENSION) return Result.LOSE;\n if (rightDiagScore == -TicTacToeModel.BOARD_DIMENSION) return Result.LOSE;\n\n if (freeSpace == 0) return Result.DRAW;\n\n return Result.INCOMPLETE;\n }",
"public int theHighest() {\r\n\t\tint highest = 0;\r\n\t\tfor(int i = 0; i < rows_size; i++) {\r\n\t\t\tfor(int j = 0; j < columns_size; j++) {\r\n\t\t\t\tif(game[i][j].getValue() > highest)\r\n\t\t\t\t\thighest = game[i][j].getValue();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn highest;\r\n\t}",
"public int getWinner() {return winner();}",
"public static Pair<Integer, PentagoMove> miniMaxAlgo(PentagoBoardState boardState, int depth, int playerTurn) {\n\t\t\n\t\tArrayList<PentagoMove> possibleMoves = boardState.getAllLegalMoves();\n\t\tint score = 0;\n\t\t\n\t\t//assign a high or low value to begin with, no move can have that high/low a value\n\t\tif (playerTurn == 1) {\n\t\t\tscore = Integer.MIN_VALUE;\n\t\t}\n\t\telse {\n\t\t\tscore = Integer.MAX_VALUE;\n\t\t}\n\t\t\n\t\tint currentScore;\n\t\tPentagoMove chosenMove = null;\n\t\t\n\t\t//when all moves have been propagated up to the depth desired, find the most valuated move\n\t\tif (possibleMoves.size() == 0 || depth == 0) {\n\t\t\tscore = heuristic(boardState);\n\t\t}\n\t\telse {\n\t\t\t//iterating through all possible moves\n\t\t\tfor(int i = 0; i < possibleMoves.size(); i++) {\n\t\t\t\t\n\t\t\t\t//cloning board to predict 2 moves ahead (depth is 2)\n\t\t\t\tPentagoBoardState clone = (PentagoBoardState) boardState.clone();\n\t\t\t\tclone.processMove(possibleMoves.get(i));\n\t\t\t\tint player = 1 - playerTurn;\n\t\t\t\t\n\t\t\t\t//0 = white, trying to maximize\n\t\t\t\tif (player == 0) {\n\t\t\t\t\t\n\t\t\t\t\t//if a found score is higher, make it the new current score, then use minimize at the lower depth\n\t\t\t\t\t//player will be \"swapped\" (if opponent is current player, we'll simulate the player's turn) when making the recursive call\n\t\t\t\t\tcurrentScore = miniMaxAlgo(clone, depth - 1, player).getKey();\n\t\t\t\t\t\n\t\t\t\t\tif (currentScore >= score) {\n\t\t\t\t\t\tchosenMove = possibleMoves.get(i);\n\t\t\t\t\t\tscore = currentScore;\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t\t\n\t\t\t\t//1 = black, trying to minimize\n\t\t\t\telse if (player == 1) {\n\t\t\t\t\t\n\t\t\t\t\t//if a found score is lower, make it the new current score, then use maximize at the lower depth\n\t\t\t\t\t//player will be \"swapped\" (if opponent is current player, we'll simulate the player's turn) when making the recursive call\n\t\t\t\t\tcurrentScore = miniMaxAlgo(clone, depth - 1, player).getKey();\n\t\t\t\t\t\n\t\t\t\t\tif (currentScore <= score) {\n\t\t\t\t\t\tchosenMove = possibleMoves.get(i);\n\t\t\t\t\t\tscore = currentScore;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//decided to go with pair to avoid having separated methods for the score and the move\n\t\t//it is easy to extract the required value using .getKey() or .getValue()\n\t\tPair<Integer, PentagoMove> answer = new Pair<>(score, chosenMove);\n\t\treturn answer;\n\t}",
"public int score() {\n int sum = 0;\n for (Candidate c : chosen) {\n sum += c.score(compatibilityScoreSet);\n }\n return sum;\n }",
"int compareValue(Card c);",
"public int getComputerMove()\n {\n int move;\n\n // First see if there's a move O can make to win\n for (int i = 0; i < BOARD_SIZE; i++) {\n if (mBoard[i] != HUMAN_PLAYER && mBoard[i] != COMPUTER_PLAYER) {\n char curr = mBoard[i];\n mBoard[i] = COMPUTER_PLAYER;\n if (checkForWinner() == 3) {\n mBoard[i] = curr;\n return i;\n }\n else\n mBoard[i] = curr;\n }\n }\n\n // See if there's a move O can make to block X from winning\n for (int i = 0; i < BOARD_SIZE; i++) {\n if (mBoard[i] != HUMAN_PLAYER && mBoard[i] != COMPUTER_PLAYER) {\n char curr = mBoard[i]; // Save the current number\n mBoard[i] = HUMAN_PLAYER;\n if (checkForWinner() == 2) {\n //mBoard[i] = COMPUTER_PLAYER;\n mBoard[i] = curr;\n return i;\n }\n else\n mBoard[i] = curr;\n }\n }\n\n // Generate random move\n do\n {\n move = mRand.nextInt(BOARD_SIZE);\n } while (mBoard[move] == HUMAN_PLAYER || mBoard[move] == COMPUTER_PLAYER);\n\n return move;\n }",
"public int compareTo(Candidate c) {\r\n\t\treturn this.fitness_ < c.fitness_ ? -1 : this.fitness_ > c.fitness_ ? 1\r\n\t\t\t\t: 0;\r\n\t}",
"private int getBestMove(int[] board, int depth, boolean turn) {\n int boardCopy[];\n if (depth <= 0) {\n return 0;\n }\n if (depth > STEP_BACK_DEPTH) {\n try {\n Thread.sleep(3);\n } catch (InterruptedException e) {\n e.printStackTrace();\n if (shouldStop()) {\n Log.d(Constants.MY_TAG,\"out CalculatingBot\");\n unlock();\n return 0;\n }\n }\n }\n if (turn) {\n int minimum = MAXIMUM_POSSIPLE_SCORE_DIFFERENCE;\n for (int i = 0; i < 5; i++) {\n if (board[i] < 2) {\n continue;\n }\n boardCopy = board.clone();\n int x = playMove(boardCopy, i);\n int y = 0;\n if (!hasPlayer2Move(boardCopy)) {\n if (hasPlayer1Move(boardCopy)) {\n y = getBestMove(boardCopy, depth - 1, turn);\n } else {\n for (int j = 0; j < 5; j++) {\n y = y - boardCopy[j];\n }\n for (int j = 5; j < 10; j++) {\n y = y + boardCopy[j];\n }\n }\n } else {\n y = getBestMove(boardCopy, depth - 1, ! turn);\n }\n int z = y - x;\n if (z < minimum) {\n minimum = z;\n }\n }\n int i = 10;\n if (board[2] < 2) {\n return minimum;\n }\n boardCopy = board.clone();\n int x = playMove(boardCopy, i);\n int y = 0;\n if (!hasPlayer2Move(boardCopy)) {\n if (hasPlayer1Move(boardCopy)) {\n y = getBestMove(boardCopy, depth - 1, turn);\n } else {\n for (int j = 0; j < 5; j++) {\n y = y - boardCopy[j];\n }\n for (int j = 5; j < 10; j++) {\n y = y + boardCopy[j];\n }\n }\n } else {\n y = getBestMove(boardCopy, depth - 1, !turn);\n }\n int z = y - x;\n if (z < minimum) {\n minimum = z;\n }\n return minimum;\n } else {\n int maximum = MINIMUM_POSSIPLE_SCORE_DIFFERENCE;\n for (int i = 5; i < 10; i++) {\n if (board[i] < 2) {\n continue;\n }\n boardCopy = board.clone();\n int x = playMove(boardCopy, i);\n int y = 0;\n if (!hasPlayer1Move(boardCopy)) {\n if (hasPlayer2Move(boardCopy)) {\n y = getBestMove(boardCopy, depth - 1, turn);\n } else {\n for (int j = 0; j < 5; j++) {\n y = y - boardCopy[j];\n }\n for (int j = 5; j < 10; j++) {\n y = y + boardCopy[j];\n }\n }\n } else {\n y = getBestMove(boardCopy, depth - 1, !turn);\n }\n int z = y + x;\n if (z > maximum) {\n maximum = z;\n }\n }\n int i = 11;\n if (board[7] < 2) {\n return maximum;\n }\n boardCopy = board.clone();\n int x = playMove(boardCopy, i);\n int y = 0;\n if (!hasPlayer1Move(boardCopy)) {\n if (hasPlayer2Move(boardCopy)) {\n y = getBestMove(boardCopy, depth - 1, turn);\n } else {\n for (int j = 0; j < 5; j++) {\n y = y - boardCopy[j];\n }\n for (int j = 5; j < 10; j++) {\n y = y + boardCopy[j];\n }\n }\n } else {\n y = getBestMove(boardCopy, depth - 1, !turn);\n }\n int z = y + x;\n if (z > maximum) {\n maximum = z;\n }\n return maximum;\n }\n }",
"private double[] chooseBestMove(List<double[]> possibleMoves) {\n double bestScore = 0;\n int indexBest = 0;\n for (int i = 0; i < possibleMoves.size(); i++) {\n if (possibleMoves.get(i)[4] > bestScore) {\n bestScore = possibleMoves.get(i)[4];\n indexBest = i;\n }\n }\n return possibleMoves.get(indexBest);\n }",
"public static int findBestMove(Board board, PieceType playerPiece) {\n int bestVal = -1000;\n int row = -1;\n int col = -1;\n\n // Traverse all cells, evaluate minimax function\n // for all empty cells. And return the cell\n // with optimal value.\n for (int i = 0; i < 3; i++) {\n for (int j = 0; j < 3; j++) {\n // Check if cell is empty\n if (board.getBoard()[i][j] == 0) {\n // Make the move\n board.getBoard()[i][j] = playerPiece.getValue();\n\n // compute evaluation function for this\n // move.\n int moveVal = minimax(board, playerPiece, 0, false);\n\n // Undo the move\n board.getBoard()[i][j] = 0;\n\n // If the value of the current move is\n // more than the best value, then update\n // best/\n if (moveVal > bestVal) {\n row = i;\n col = j;\n bestVal = moveVal;\n }\n }\n }\n }\n return (col + 1) + (row * board.getGame().getGridType().getSize());\n }",
"private static int maxVal(int[][] board, boolean[][] covered, int row, int col){\n if(row == 6)\n return boardScore(board, covered);\n \n // recursive case\n // choices for current position: 1. cover if allowed or 2. leave uncovered.\n int nextCol = (col + 1) % 6;\n int nextRow = row + (col + 1) / 6;\n int doNotCoverCurrent = maxVal(board, covered, nextRow, nextCol);\n int coverCurrent = 0;\n if( canCoverCurrent(covered, row, col) ){\n covered[row][col] = true;\n coverCurrent = maxVal(board, covered, nextRow, nextCol);\n covered[row][col] = false;\n }\n return Math.max(doNotCoverCurrent, coverCurrent);\n }",
"private static int evaluateBoard(final int[][] givenBoard) {\n final int[][] board = cloneBoard(givenBoard);\n\n final int numRows = givenBoard.length;\n final int numCols = givenBoard[0].length;\n\n \n // If the game is complete\n if (!Utils.hasMove(board)) {\n // Find largest absolute move value for player and opponent\n int playerScore = 0;\n int opponentScore = 0;\n for (final int[] row : board) {\n for (final int val : row) {\n if (val > playerScore) playerScore = val;\n if (val < opponentScore) opponentScore = val;\n } \n }\n // Give a big reward + the ammount we won the game by\n return WIN_REWARD + playerScore + opponentScore;\n }\n boardsEvaluated++;\n\n \n // If the game is incomplete, return the diference between the average \n // distance that the player and opponent are from each empty square\n int[][] playerDistances = distanceGrid(board);\n int[][] opponentDistances = distanceGrid(flipBoard(board));\n \n int totalPlayerDistance = 0;\n int totalOpponentDistance = 0;\n \n int maxPlayerDistance = 0;\n int maxOpponentDistance = 0;\n \n \n int largestPlayerMove = 0;\n int smallestOpponentMove = 0;\n \n int numEmptySpaces = 0;\n \n for (int r = 0; r < numRows; r++) {\n for (int c = 0; c < numCols; c++) {\n if (playerDistances[r][c] > 0) {\n totalPlayerDistance += playerDistances[r][c];\n numEmptySpaces++;\n }\n if (opponentDistances[r][c] > 0) {\n totalOpponentDistance += opponentDistances[r][c];\n }\n \n int boardVal = board[r][c];\n if (largestPlayerMove < boardVal) largestPlayerMove = boardVal;\n if (smallestOpponentMove > boardVal) smallestOpponentMove = boardVal;\n \n } \n }\n int averageDistanceDifference = totalOpponentDistance - totalPlayerDistance;\n\n int largestMoveDifference = largestPlayerMove + smallestOpponentMove;\n\n\n return averageDistanceDifference + largestMoveDifference;\n }",
"private Move guessBestMove(Piece player, Board board, double cutoff) {\n Board newBoard = new Board(board);\n Move bestSoFar;\n Iterator<Move> moveIterator = board.iterator();\n bestSoFar = moveIterator.next();\n newBoard.retract();\n while (moveIterator.hasNext()) {\n Move nextMove = moveIterator.next();\n int val = eval(newBoard);\n newBoard.makeMove(nextMove);\n if (eval(newBoard) > val) {\n bestSoFar = nextMove;\n val = eval(newBoard);\n if (val >= cutoff) {\n break;\n }\n }\n newBoard.retract();\n }\n return bestSoFar;\n }",
"public int getScore() {\n\t\tint darkDisks = 0;\r\n\t\tint lightDisks = 0;\r\n\r\n\t\tfor(Character c : board){\r\n\t\t\tif(c == '1'){\r\n\t\t\t\tdarkDisks++;\r\n\t\t\t}\r\n\t\t\telse if(c == '2'){\r\n\t\t\t\tlightDisks++;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t//If dark wins\r\n\t\tif(darkDisks > lightDisks){\r\n\t\t\treturn 1;\r\n\t\t}\r\n\r\n\t\t//If light wins\r\n\t\telse if(darkDisks < lightDisks){\r\n\t\t\treturn -1;\r\n\t\t}\r\n\r\n\t\t//For a tie\r\n\t\telse if(darkDisks == lightDisks){\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t//Return 0 on a tie\r\n\t\treturn 0;\r\n\t}",
"private int[] getBestMoveAndScoreDifference(int[] board, int depth, boolean turn) {\n int boardCopy[];\n if (depth <= 0) {\n return new int[] {0,-1};\n }\n if (turn) {\n int minimum = MAXIMUM_POSSIPLE_SCORE_DIFFERENCE;\n int move = -1;\n for (int i = 0; i < 5; i++) {\n if (board[i] < 2) {\n continue;\n }\n boardCopy = board.clone();\n int x = playMove(boardCopy, i);\n int y = 0;\n if (!hasPlayer2Move(boardCopy)) {\n if (hasPlayer1Move(boardCopy)) {\n y = getBestMove(boardCopy, depth - 1, turn);\n } else {\n for (int j = 0; j < 5; j++) {\n y = y - boardCopy[j];\n }\n for (int j = 5; j < 10; j++) {\n y = y + boardCopy[j];\n }\n }\n } else {\n y = getBestMove(boardCopy, depth - 1, ! turn);\n }\n int z = y - x;\n if (z < minimum) {\n minimum = z;\n move = i;\n }\n }\n int i = 10;\n if (board[2] < 2) {\n return new int[] {minimum,move};\n }\n boardCopy = board.clone();\n int x = playMove(boardCopy, i);\n int y = 0;\n if (!hasPlayer2Move(boardCopy)) {\n if (hasPlayer1Move(boardCopy)) {\n y = getBestMove(boardCopy, depth - 1, turn);\n } else {\n for (int j = 0; j < 5; j++) {\n y = y - boardCopy[j];\n }\n for (int j = 5; j < 10; j++) {\n y = y + boardCopy[j];\n }\n }\n } else {\n y = getBestMove(boardCopy, depth - 1, !turn);\n }\n int z = y - x;\n if (z < minimum) {\n minimum = z;\n move = i;\n }\n return new int[] {minimum,move};\n } else {\n int maximum = MINIMUM_POSSIPLE_SCORE_DIFFERENCE;\n int move = -1;\n for (int i = 5; i < 10; i++) {\n if (board[i] < 2) {\n continue;\n }\n boardCopy = board.clone();\n int x = playMove(boardCopy, i);\n int y = 0;\n if (!hasPlayer1Move(boardCopy)) {\n if (hasPlayer2Move(boardCopy)) {\n y = getBestMove(boardCopy, depth - 1, turn);\n } else {\n for (int j = 0; j < 5; j++) {\n y = y - boardCopy[j];\n }\n for (int j = 5; j < 10; j++) {\n y = y + boardCopy[j];\n }\n }\n } else {\n y = getBestMove(boardCopy, depth - 1, !turn);\n }\n int z = y + x;\n if (z > maximum) {\n maximum = z;\n move = i;\n }\n }\n int i = 11;\n if (board[7] < 2) {\n return new int[] {maximum,move};\n }\n boardCopy = board.clone();\n int x = playMove(boardCopy, i);\n int y = 0;\n if (!hasPlayer1Move(boardCopy)) {\n if (hasPlayer2Move(boardCopy)) {\n y = getBestMove(boardCopy, depth - 1, turn);\n } else {\n for (int j = 0; j < 5; j++) {\n y = y - boardCopy[j];\n }\n for (int j = 5; j < 10; j++) {\n y = y + boardCopy[j];\n }\n }\n } else {\n y = getBestMove(boardCopy, depth - 1, !turn);\n }\n int z = y + x;\n if (z > maximum) {\n maximum = z;\n move = i;\n }\n return new int[] {maximum,move};\n }\n }",
"public int score() {\n ArrayList<Integer> scores = possibleScores();\n int maxUnder = Integer.MIN_VALUE;\n int minOver = Integer.MAX_VALUE;\n for (int score : scores) {\n if (score > 21 && score < minOver) {\n minOver = score;\n } else if (score <= 21 && score > maxUnder) {\n maxUnder = score;\n }\n }\n return maxUnder == Integer.MIN_VALUE ? minOver : maxUnder;\n }",
"public Move chooseMove(TablutBoardState boardState) {\n \n \tList<TablutMove> options = boardState.getAllLegalMoves();\n\n \n bestMove = options.get(((int) MyTools.getSomething())% (options.size()));\n\n int depth = DEPTH;\n int opponent = boardState.getOpponent();\n boolean isMax;\n if(opponent==1){\n \tisMax = true;\n \t//System.out.println(\"I'm max\");\n }\n else{\n \tisMax = false;\n \t//System.out.println(\"I'm min\");\n }\n //bestMove = \n \n int bestvalue = minimax(boardState,isMax, depth,-10000,10000);\n \n \n //int minNumberOfOpponentPieces = boardState.getNumberPlayerPieces(opponent);\n //boolean moveCaptures = false;\n //System.out.println(\"minimax return value: \"+bestvalue);\n \n \n \n \n return bestMove;\n }",
"public long getWinner() {\n long winner = member_1_id;\n if (getMember2Score() > getMember1Score()) {\n winner = member_2_id;\n }\n return winner;\n }",
"public PlayerController calculateWinner()\n {\n // This function will find the winner based on the move that is made by player\n // Here we are checking only the two players who are leading the match\n PlayerController player1 = this.playerControllerList.poll();\n PlayerController player2 = this.playerControllerList.poll();\n this.playerControllerList.add(player1);\n this.playerControllerList.add(player2);\n if(player1.getPoints() >= player2.getPoints()+GameConfiguration.MINIMUM_DIFF_POINTS && player1.getPoints() >= GameConfiguration.MINIMUM_POINTS_REQUIRED)\n {\n return player1;\n }\n else if(this.gameController.isBoardEmpty() == true)\n {\n if(player1.getPoints() >= player2.getPoints()+GameConfiguration.MINIMUM_DIFF_POINTS || player1.getPoints() >= GameConfiguration.MINIMUM_POINTS_REQUIRED)\n {\n return player1;\n }\n }\n return null;\n }",
"public void findMaxComb() {\n\t\tHashMap<Integer, HashSet<Integer>> adj = new HashMap<Integer, HashSet<Integer>>();\n\t\tfor (int row=0; row< w; row++) {\n\t\t\tfor (int col=0; col<l; col++) {\n\t\t\t\tHashSet<Integer> hs = new HashSet<Integer>();\n\t\t\t\t//go left\n\t\t\t\tif (inBoard(row, col-1) && visited[row][col-1] != visited[row][col]) //in board and not equal\n\t\t\t\t\ths.add(visited[row][col-1]);\n\n\t\t\t\t//go up\n\t\t\t\tif (inBoard(row-1, col) && visited[row-1][col] != visited[row][col])\n\t\t\t\t\ths.add(visited[row-1][col]);\n\n\t\t\t\t//go right\n\t\t\t\tif (inBoard(row, col+1) && visited[row][col+1] != visited[row][col])\n\t\t\t\t\ths.add(visited[row][col+1]);\n\n\t\t\t\t//go down\n\t\t\t\tif (inBoard(row+1, col) && visited[row+1][col] != visited[row][col])\n\t\t\t\t\ths.add(visited[row+1][col]);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif (adj.containsKey(visited[row][col])) {\n\t\t\t\t\tHashSet<Integer> tt = adj.get(visited[row][col]);\n\t\t\t\t\ttt.addAll(hs);//union, return boolen\n\t\t\t\t\tadj.put(visited[row][col], tt); \n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tadj.put(visited[row][col], hs);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tint tempMax = 0;\n\t\tfor (Integer key : adj.keySet()) {\n\t\t\tfor (Integer ele : adj.get(key)) {\n\t\t\t\ttempMax = Math.max(tempMax, map.get(key) + map.get(ele));\n\t\t\t}\n\t\t}\n\t\tmaxComb = tempMax;\n\t}",
"public Jogo jogoComMaiorScore() {\r\n\t\tJogo jogoComMaiorScore = listaDeJogosComprados.get(0);\r\n\r\n\t\tfor (Jogo jogo : listaDeJogosComprados) {\r\n\t\t\tif (jogo.getMaiorScore() >= jogoComMaiorScore.getMaiorScore()) {\r\n\t\t\t\tjogoComMaiorScore = jogo;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn jogoComMaiorScore;\r\n\t}",
"private boolean CompareValues(int oldValue, int value)\n {\n if (playerType == PlayerType.White)\n {\n if (turn == 1)\n return oldValue > value;\n else\n return oldValue < value;\n }\n else\n if (turn == 1)\n return oldValue < value;\n else\n return oldValue > value;\n }",
"private static int max_value(State curr_state) {\n\t\tcounterMinimax++; \r\n\r\n\r\n\t\t//Check if the current state is a terminal state, if it is, return\r\n\t\t//its terminal value\r\n\t\tif(curr_state.isTerminal()){\r\n\t\t\treturn curr_state.getScore();\r\n\t\t}\r\n\r\n\t\tint max_value = Integer.MIN_VALUE;\r\n\t\tState[] successors = curr_state.getSuccessors('1');\r\n\r\n\t\tif(successors.length == 0 && curr_state.isTerminal() == false){\r\n\t\t\tmax_value = Math.max(max_value, min_value(curr_state));\r\n\t\t}\r\n\t\t//\t\telse if(successors.length != 0 && curr_state.isTerminal() == false){\r\n\r\n\t\t//Get the successors of the current state, as dark always runs first\r\n\t\t//it will call maxValue;\r\n\r\n\r\n\t\t//Select the successor that returns the biggest value\r\n\t\tfor(State state : successors){\r\n\t\t\tmax_value = Math.max(max_value, min_value(state));\r\n\t\t}\t\r\n\t\t//\t\t}\r\n\t\treturn max_value;\r\n\t}",
"public boolean winner(){\n\t\treturn goals1 > goals2;\n\t}",
"public int winner() {\n if (player1Wins())\n return 1;\n if (player2Wins())\n return 2;\n return -1; // No one has won\n }",
"public static Player.PlayerTeam getWinningTeam(List<Player> players) {\n int sumForPaper = players.stream()\n .filter(player -> player.getTeam() == Player.PlayerTeam.PAPER)\n .mapToInt(Player::getCurrentScore)\n .sum();\n\n int sumForRock = players.stream()\n .filter(player -> player.getTeam() == Player.PlayerTeam.ROCK)\n .mapToInt(Player::getCurrentScore)\n .sum();\n\n int sumForScissors = players.stream()\n .filter(player -> player.getTeam() == Player.PlayerTeam.SCISSORS)\n .mapToInt(Player::getCurrentScore)\n .sum();\n\n Map<Player.PlayerTeam, Integer> finalList = new HashMap<>();\n finalList.put(Player.PlayerTeam.PAPER, sumForPaper);\n finalList.put(Player.PlayerTeam.ROCK, sumForRock);\n finalList.put(Player.PlayerTeam.SCISSORS, sumForScissors);\n\n int max = Collections.max(finalList.values());\n\n List<Player.PlayerTeam> collect = finalList.entrySet().stream()\n .filter(entry -> entry.getValue() == max)\n .map(entry -> entry.getKey())\n .collect(Collectors.toList());\n\n Player.PlayerTeam winningTeam = collect.get(0);\n\n return winningTeam;\n\n }",
"private int minimax(TicTacToeBoard board, Cell thisTeam) throws TicTacToeException {\n\t\tint maxScore = -1;\n\t\tint multiplyer = 1;\n\t\tif(thisTeam != team) {\n\t\t\tmultiplyer = -1;\n\t\t}\n\t\tTicTacToeWinner winner = board.winner();\n\t\tif(winner != null) {\n\t\t\treturn evaluateWinner(winner.getCell());\n\t\t}\n\t\t\n\t\tList<Location> possibleMoves = board.emptySlots();\n\t\tint thisScore;\n\t\tTicTacToeBoard currentBoard;\n\t\t\n\t\tfor(Location l: possibleMoves) {\n\t\t\tcurrentBoard = board.copy();\n\t\t\tcurrentBoard.makeMove(thisTeam, l);\n\t\t\tthisScore = multiplyer*minimax(currentBoard, TicTacToeBoard.oppositePlayer(thisTeam));\n\t\t\tif(thisScore >= maxScore) {\n\t\t\t\tmaxScore = thisScore;\n\t\t\t}\n\t\t}\n\t\treturn multiplyer*maxScore;\n\t}",
"private int evaluate(Board board)\n {\n if (computerWin(board))\n return 4*size;\n else if (playerWin(board))\n return -4*size;\n else if (draw(board))\n return 3*size;\n else\n return count(board, COMPUTER);\n }",
"public Card getHighestCard() {\n Card rtrnCard = cardsPlayed[0];\n int i;\n int tempInt;\n int currentHighestRank = cardsPlayed[0].getIntValue();\n for(i = 0; i < cardsPlayed.length; i++){\n if(cardsPlayed[i].getSuit().equals(suit)){\n tempInt = cardsPlayed[i].getIntValue();\n if((currentHighestRank < tempInt)&&(!(cardsPlayed[i].equals(rtrnCard)))){\n rtrnCard = cardsPlayed[i];\n currentHighestRank = cardsPlayed[i].getIntValue();\n }\n }\n }\n return rtrnCard;\n }",
"PrioritizedMove getBestMoveFor(int player, int desiredLength);",
"private List<Player> calculatePoints()\n\t{\n\t\tthis.systemDataInput.printMessage(\"Calculating points...\");\n\t\t\n\t\tArrayList<Player> winningPlayers = new ArrayList<Player>();\n\t\tint maxPoints = 0;\n\t\tint maxBuilding = 0;\n\t\t\n\t\tfor(Player player : playerList)\n\t\t{\n\t\t\tint points = 0;\n\t\t\tint bestBuilding = 0;\n\t\t\t\n\t\t\tfor(Area area : board.getAreaList())\n\t\t\t{\n\t\t\t\tif (!area.hasDemon())\n\t\t\t\t{\n\t\t\t\t\tif (area.hasBuilding(player))\n\t\t\t\t\t{\n\t\t\t\t\t\tpoints += area.getCost();\n\t\t\t\t\t\tif (area.getCost() > bestBuilding)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbestBuilding = area.getCost();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tpoints += 5 * area.getMinionList(player).size();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tint playerMoney = player.getMoneyAmount();\n\t\t\tpoints += playerMoney;\n\t\t\t\n\t\t\tfor(Card card : player.getInFrontOfHimDeck())\n\t\t\t{\n\t\t\t\tfor(Action action : card.getActions(BorrowMoneyFromTheBank.class))\n\t\t\t\t{\n\t\t\t\t\tint moneyToPayBack = ((BorrowMoneyFromTheBank)action).getMoneyToPayBack();\n\t\t\t\t\tif (playerMoney >= moneyToPayBack)\n\t\t\t\t\t{\n\t\t\t\t\t\tpoints -= moneyToPayBack;\n\t\t\t\t\t\tplayerMoney -= moneyToPayBack;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tpoints -= ((BorrowMoneyFromTheBank)action).getPointsToLose();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tplayer.addPoints(points);\n\t\t\tplayer.getDataInput().printMessage(points + \" points\");\n\t\t\t\n\t\t\tif (points > maxPoints || (points == maxPoints && bestBuilding > maxBuilding))\n\t\t\t{\n\t\t\t\tmaxPoints = points;\n\t\t\t\tmaxBuilding = bestBuilding;\n\t\t\t\twinningPlayers.clear();\n\t\t\t\twinningPlayers.add(player);\n\t\t\t}\n\t\t\telse if (points == maxPoints && bestBuilding == maxBuilding)\n\t\t\t{\n\t\t\t\twinningPlayers.add(player);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn winningPlayers;\n\t}",
"private void chooseBestPiece() {\n\n int maxKillCount = 0;\n int tempKillCount;\n int piecesWithEqualMaxCount = 0;\n\n int bestPieceX = 0;\n int bestPieceY = 0;\n\n for (int y = 0; y < boardSize; y++) {\n for (int x = 0; x < boardSize; x++) {\n //check every piece\n Field field = board[y][x];\n if (field.getPiece() != null && field.getPiece().getPieceColor() == round) {\n tempKillCount = countAvailableKills(x, y, 0, this.board);\n //count piece kill score\n if (tempKillCount > maxKillCount) {\n maxKillCount = tempKillCount;\n piecesWithEqualMaxCount = 1;\n bestPieceX = x;\n bestPieceY = y;\n } else if (tempKillCount == maxKillCount) {\n piecesWithEqualMaxCount += 1;\n }\n }\n }\n }\n\n if (piecesWithEqualMaxCount == 1 && maxKillCount != 0) {\n bestPieceToMove = board[bestPieceY][bestPieceX].getPiece();\n bestPieceFound = true;\n\n findOptimalMove(bestPieceX, bestPieceY);\n\n System.out.println(\"Best piece found, kill score = \" + maxKillCount);\n } else if (piecesWithEqualMaxCount > 1) {\n bestPieceToMove = null;\n bestPieceFound = false;\n\n if (maxKillCount == 0) {\n //if every piece has same kill score equal to 0 there is no kill available\n killAvailable = false;\n System.out.println(\"No piece can kill\");\n } else {\n killAvailable = true;\n System.out.println(\"Some pieces has same kill score = \" + maxKillCount + \", user can choose which to move\");\n }\n }\n }",
"public int checkForWin() \r\n {\r\n \twinner = null;\r\n \tint winrole = -1;\r\n \tif(isBoardFull()){\r\n \t\tint white = 0;\r\n \t\tint black = 0;\r\n\t\t\tfor(int i = 0; i < boardsize; ++i){\r\n\t\t\t\tfor(int j = 0; j<boardsize; ++j){\r\n\t\t\t\t\tif(board[i][j] == 0){\r\n\t\t\t\t\t\twhite++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(board[i][j] == 1){\r\n\t\t\t\t\t\tblack++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(white > black){\r\n\t\t\t\twinrole = 0;\r\n\t\t\t\twinner = agent[winrole];\r\n\t\t\t}\t\r\n\t\t\telse if(black > white){\r\n\t\t\t\twinrole = 1;\r\n\t\t\t\twinner = agent[winrole];\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\twinrole=2;\r\n\t\t\t}\r\n\t\t\treturn winrole;\r\n \t}\r\n \treturn -1;\r\n }",
"public double getBestScore();",
"public List<Player> winnerWhenBlocked(Player p) {\r\n System.out.println(\"The game is blocked\");\r\n Map<Integer, Integer> aux = new HashMap<>();\r\n for (Player player : players) {\r\n if (p.getTeam() == player.getTeam()) {\r\n aux.put(player.getTeam(), aux.get(player.getTeam()) + player.getDominoPoints());\r\n } else {\r\n aux.put(player.getTeam(), aux.get(player.getTeam()) + player.getDominoPoints());\r\n }\r\n }\r\n int winnerkey = 0;\r\n int winnervalue = aux.get(winnerkey);\r\n int loserKey = 1;\r\n int loserValue = aux.get(loserKey);\r\n\r\n System.out.println(\"Winner is\" + aux.get(winnerkey));\r\n if (aux.get(winnerkey) > aux.get(loserKey)) {\r\n winnerkey = 1;\r\n winnervalue = aux.get(winnerkey);\r\n loserKey = 0;\r\n loserValue = aux.get(loserKey);\r\n System.out.println(\"Loser is\" + aux.get(loserKey));\r\n\r\n } else if (aux.size() > 2) {\r\n if (aux.get(winnerkey) > aux.get(2)) {\r\n winnerkey = 1;\r\n winnervalue = 0;\r\n }\r\n if (aux.get(2) < aux.get(loserKey)) {\r\n loserKey = 2;\r\n loserValue = aux.get(loserKey);\r\n }\r\n }\r\n\r\n //We sum the points for the winner\r\n List<Player> winners = new ArrayList<>();\r\n for (Player player : players) {\r\n if (p.getTeam() == winnerkey) {\r\n p.sumPoints(aux.get(loserKey));\r\n winners.add(p);\r\n }\r\n }\r\n return winners;\r\n }",
"public Winner whoWins(){\r\n\r\n /* transfer the matrix to an array */\r\n Sign[] flatBoard = flattenBoard();\r\n\r\n /* check if someone has won */\r\n if (CompPlayer.compWon(flatBoard))\r\n return Winner.COMPUTER;\r\n else if (CompPlayer.playerWon(flatBoard))\r\n return Winner.PLAYER;\r\n else\r\n return Winner.NON;\r\n }",
"public positionTicTacToe myAIAlgorithm(List<positionTicTacToe> board, int player) {\n List<Help> rec = new ArrayList<>();\n List<Help> rec_2 = new ArrayList<>();\n int max = -1;\n for (int i = 0; i < 4; i++) {\n for (int j = 0; j < 4; j++) {\n for (int k = 0; k < 4; k++) {\n int location = i * 16 + j * 4 + k;\n positionTicTacToe temp = board.get(location);\n if (temp.state == 0){\n Help help = new Help(temp,board);\n if(max <= help.value) {\n max = help.value;\n rec.add(help);\n }\n }\n }\n }\n }\n for(Help h:rec){\n if(h.value == max) {\n //h.pos.printPosition();\n //System.out.println(\"value:\" + h.value);\n rec_2.add(h);\n }\n }\n\n if(rec_2.size()<2){\n return rec_2.get(0).pos;\n }\n rec.clear();\n //System.out.println(rec.size());\n int minMax = 99999;\n for(Help h:rec_2){\n if(h.getNextMax()<=minMax) {\n minMax = h.nextMax;\n rec.add(h);\n }\n }\n rec_2.clear();\n for(Help h:rec){\n if(h.nextMax == minMax)\n rec_2.add(h);\n }\n Random random = new Random();\n return rec_2.get(random.nextInt(rec_2.size())).pos;\n\t\t\t\n\t\t\n\t}",
"public int evaluate(int[][] gameBoard) {\n for (int r = 0; r < 3; r++) {\n if (gameBoard[r][0] == gameBoard[r][1] && gameBoard[r][1] == gameBoard[r][2]) {\n if (gameBoard[r][0] == ai)\n return +10;\n else if (gameBoard[r][0] == human)\n return -10;\n }\n }\n // Checking for Columns for victory.\n for (int c = 0; c < 3; c++) {\n if (gameBoard[0][c] == gameBoard[1][c] && gameBoard[1][c] == gameBoard[2][c]) {\n //gameLogic.getWinType();\n if (gameBoard[0][c] == ai)\n return +10;\n else if (gameBoard[0][c] == human)\n return -10;\n }\n }\n // Checking for Diagonals for victory.\n if (gameBoard[0][0] == gameBoard[1][1] && gameBoard[1][1] == gameBoard[2][2]) {\n if (gameBoard[0][0] == ai)\n return +10;\n else if (gameBoard[0][0] == human)\n return -10;\n }\n if (gameBoard[0][2] == gameBoard[1][1] && gameBoard[1][1] == gameBoard[2][0]) {\n if (gameBoard[0][2] == ai)\n return +10;\n else if (gameBoard[0][2] == human)\n return -10;\n }\n // Else if none of them have won then return 0\n return 0;\n }",
"private String whoIsMVP() {\n int highestValue = 0;\n String mvp = null;\n for (String player : mvpPlayersMap.keySet()) {\n if (highestValue < mvpPlayersMap.get(player)) {\n highestValue = mvpPlayersMap.get(player);\n mvp = player;\n }\n }\n log.info(\"MVP player: {} with {} points\", mvp, highestValue);\n return mvp;\n }",
"private int heuristicValue(String boardString) {\n String[] tokens = boardString.split(\"\\n\");\n int blackScore = Integer.parseInt(tokens[0].split(\",\")[9]);\n int whiteScore = Integer.parseInt(tokens[1].split(\",\")[9]);\n\n return blackScore - whiteScore;\n }",
"Move getBestMove() {\n //System.out.println(\"AI chooses: \" + m.toString());\n return moves.get((int) (Math.random() * moves.size()));\n }",
"private int mostNumOfCards(WarPlayer[] players) {\n int i;\n\n // Initialize maximum element\n int max = 0;\n\n // Traverse array elements from second and\n // compare every element with current max\n for (i = 1; i < players.length; i++)\n if (players[i].getPoints() > players[max].getPoints())\n max = i;\n\n return max;\n }",
"@Override\r\n public void defaultGameComparison(int playerOne, int playerTwo, \r\n int plDeckPosition, int valuePosition) {\r\n // Get player one's card\r\n Card plOneCard = this.getPlayerCard(playerOne, plDeckPosition);\r\n Card plTwoCard = this.getPlayerCard(playerTwo, plDeckPosition);\r\n Card higherCard = this.compareCards(plOneCard, plTwoCard);\r\n \r\n // See who owned that card and distribute points\r\n if (higherCard == plOneCard) {\r\n this.givePlayerPoints(playerOne, valuePosition, 1);\r\n }\r\n else if (higherCard == plTwoCard) {\r\n this.givePlayerPoints(playerTwo, valuePosition, 1);\r\n }\r\n \r\n // Send the cards to the players discard\r\n this.giveCardToPlayer(plOneCard, playerOne, plDeckPosition+1);\r\n this.giveCardToPlayer(plTwoCard, playerTwo, plDeckPosition+1);\r\n \r\n // Add return values to current game action\r\n this.currentAction.addActionReturnValue(plOneCard, \r\n plTwoCard);\r\n }",
"public int getWinner() {\n return winner;\n }",
"public MoveEvaluation computeBest (int ply, IGameState s, IPlayer player, IPlayer opponent) {\n\t\tthis.original = player;\n\t\tthis.state = s.copy();\n\t\tMoveEvaluation move = minimax(ply, IComparator.MAX, player, opponent);\n\t\treturn move;\n\t}",
"private int maxValue(Node state, int alpha, int beta) {\n\t\t\n\t\t\n\t\tthis.nodesExplored++;\n\t\tthis.nodesExploredThisTurn++;\n\t\t\n\t\tif (this.cutoffTest(state)) {\n\t\t\treturn state.eval(this.player);\n\t\t}\n\t\t\n\t\tArrayList<Move> legalMoves = state.getGame().getLegalMoves();\n\t\n\t\tif (this.moveOrdering) {\n\t\t\tthis.quickSort(state, legalMoves, 0, legalMoves.size() - 1, false);\n\t\t}\n\t\t\n\t\tint v = Integer.MIN_VALUE;\n\t\tMove bestMove = null;\n\t\tfor (Move move : legalMoves) {\n\t\t\t\n\t\t\tif (System.currentTimeMillis() - startMili > this.maxTime * 1000) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\t\n\t\t\tint value = this.minValue(state.result(move), alpha, beta);\n\t\t\tif (v < value) { //\n\t\t\t\tv = value;\n\t\t\t\tbestMove = move;\n\t\t\t}\n\t\t\t\n\t\t\tif (v >= beta) {\n\t\t\t\tstate.setBestMove(bestMove);\n\t\t\t\t\n\t\t\t\treturn v;\n\t\t\t}\n\t\t\talpha = Math.max(v, alpha);\n\t\t}\n\t\tstate.setBestMove(bestMove);\n\t\treturn v;\n\t}",
"public int getWorstScore()\n {\n return -1;\n }",
"public String getStrongestCountryConqueredByPlayer(HashMap<String, ArrayList<String>> potentialScenarios) {\r\n\t\t\r\n \tString strongestCountry = null;\r\n \tInteger maxArmyCountEncountered = 1;\r\n \r\n // find the strongest country conquered by the player, knowing it would be contained as a key \r\n for (String country : potentialScenarios.keySet()){\r\n \tInteger currentCountryArmyCount = gameData.gameMap.getCountry(country).getCountryArmyCount();\r\n \tif (currentCountryArmyCount > maxArmyCountEncountered) {\r\n \t\tstrongestCountry = country;\r\n \t\tmaxArmyCountEncountered = currentCountryArmyCount;\r\n \t} \r\n }\r\n \r\n \treturn strongestCountry;\r\n }",
"@Override\r\n\tpublic double max_value(GameState s, int depthLimit) \r\n\t{\r\n\t\tdouble stateEvaluationValue = stateEvaluator(s);\r\n\r\n\t\tif (depthLimit == 0)\r\n\t\t{\r\n\t\t\treturn stateEvaluationValue;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tdouble currMax = Double.NEGATIVE_INFINITY;\r\n\t\t\tint bestMove = 0;\r\n\t\t\tArrayList <Integer> succList = generateSuccessors(s.lastMove, s.takenList);\r\n\t\t\tif (succList.isEmpty())\r\n\t\t\t{\r\n\t\t\t\ts.bestMove = -1;\r\n\t\t\t\ts.leaf = true;\r\n\t\t\t\treturn -1;\r\n\t\t\t}\r\n\t\t\tIterator <Integer> myItr = succList.iterator();\r\n\t\t\twhile (myItr.hasNext())\r\n\t\t\t{\r\n\t\t\t\tdouble tempMax = currMax;\r\n\t\t\t\tint currNumber = myItr.next();\r\n\t\t\t\tint [] newList = s.takenList;\r\n\t\t\t\tnewList [currNumber] = 1; //assign it to player 1\r\n\t\t\t\tGameState newGameState = new GameState(newList, currNumber);\r\n\t\t\t\tcurrMax = Math.max(currMax, min_value(newGameState, depthLimit - 1));\r\n\r\n\t\t\t\tif (tempMax < currMax)\r\n\t\t\t\t{\r\n\t\t\t\t\tbestMove = currNumber;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ts.bestMove = bestMove;\t\t\t\r\n\t\t\treturn currMax;\r\n\t\t}\r\n\r\n\r\n\t}",
"@Override\r\n\tpublic double evaluate(int[][] board, int currentPlayer) {\n\t\r\n\tdouble score;\t\r\n\tfinal int RANDOM_WEIGHT=5; // weight factor\r\n\t\r\n\tMaximumDisksEvaluation ob = new MaximumDisksEvaluation();\r\n\tCornerEvaluation ob1 = new CornerEvaluation();\r\n\tCornerClosenessEvaluation ob2 = new CornerClosenessEvaluation();\r\n\tFrontierEvaluation ob3 = new FrontierEvaluation();\r\n\tStabilityEvaluation ob4 = new StabilityEvaluation();\r\n\tPositionalEvaluation ob5 = new PositionalEvaluation();\r\n\tMobilityEvaluation ob6 = new MobilityEvaluation();\r\n\t\r\n\tscore = ob.evaluate(board, currentPlayer) + ob1.evaluate(board, currentPlayer) + ob2.evaluate(board, currentPlayer) + ob6.evaluate(board, currentPlayer) + ob3.evaluate(board, currentPlayer) + ob5.evaluate(board, currentPlayer) ; \r\n\t\r\n\treturn score;\r\n\t\r\n\t}",
"public String getWinner(){\n\tif (p1.getPoints()==p2.getPoints()){\n\t return \"Tie. Good food, bad outcome.\";\n\t}\n\treturn (p1.getPoints()>p2.getPoints()?\"Player Row\":\"Player Column\")+\" is the winner!\";\n }",
"public int compareWith(GameResult other){\n\t\tif(score > other.getScore())\n\t\t\treturn 1;\n\t\telse if(score < other.getScore())\n\t\t\treturn -1;\n\t\telse if(level > other.getLevel())\n\t\t\treturn 1;\n\t\telse if(level < other.getLevel())\n\t\t\treturn -1;\n\t\telse if(duration > other.getDuration())\n\t\t\treturn 1;\n\t\telse if(duration < other.getDuration())\n\t\t\treturn -1;\n\t\telse\n\t\t\treturn 0;\n\t}",
"int getPokeballValue();",
"public char getWinner() {\n if (this.getPlayerHand().getActualValue() == this.getDealerHand().getActualValue()) {\n this.getDealerHand().setActualValue(0);\n this.getPlayerHand().setActualValue(0);\n return '2';\n } else if (this.playerHand.getblack()) {\n this.getDealerHand().setActualValue(0);\n this.getPlayerHand().setActualValue(0);\n return '0';\n } else if (this.getDealerHand().getblack()) {\n this.getDealerHand().setActualValue(0);\n this.getPlayerHand().setActualValue(0);\n return '1';\n } else{\n if (this.getPlayerHand().getblack()) {\n this.getDealerHand().setActualValue(0);\n this.getPlayerHand().setActualValue(0);\n return '0';\n }else if (this.getDealerHand().getActualValue() > 21) {\n this.getDealerHand().setActualValue(0);\n this.getPlayerHand().setActualValue(0);\n return '0';\n } else if(this.getPlayerHand().getActualValue() > 21) {\n this.getDealerHand().setActualValue(0);\n this.getPlayerHand().setActualValue(0);\n return '1';\n } else if (this.getPlayerHand().getActualValue() > this.getDealerHand().getActualValue()) {\n this.getDealerHand().setActualValue(0);\n this.getPlayerHand().setActualValue(0);\n return '0';\n } else {\n this.getDealerHand().setActualValue(0);\n this.getPlayerHand().setActualValue(0);\n return '1';\n }\n }\n }",
"public int topCardVal(){\n if(pile.size() == 0)\n return 0;\n int val = pile.get(pile.size() - 1).getVal();\n return val;\n }",
"private int highCard() {\n\t\tint highCard = 0;\n\t\tfor (int counter = 0; counter < Constants.HAND_SIZE; counter++) {\n\t\t\tif (hand[counter].getValueIndex() > highCard) {\n\t\t\t\thighCard = hand[counter].getValueIndex();\n\t\t\t}\n\t\t}\n\t\tresult.setPrimaryValuePos(highCard);\n\t\treturn highCard;\n\t}",
"public int getOptimalNumNearest();",
"public int getWinner();",
"public char findWinner() {\n char[] winners = {\n checkRowVictory(getTopRow()),\n checkRowVictory(getMidRow()),\n checkRowVictory(getLowRow()),\n checkRowVictory(getVerticalMidRow()),\n checkRowVictory(getVerticalLeftRow()),\n checkRowVictory(getVerticalRightRow()),\n checkDiagonalVictory()\n };\n\n for (char winner : winners) {\n if (winner != 0) {\n return winner;\n }\n }\n\n return 0;\n }",
"private int runValue() {\n int rValue = 0;\n int maxLength = 0;\n \n CribbageRank[] rank = new CribbageRank[cards.length];\n CribbageRank[][] combos;\n \n for (int i = 0; i < cards.length; i++) {\n for (CribbageRank card : CribbageRank.values()) {\n if (cards[i].charAt(0) == card.abbrev()) {\n rank[i] = card;\n }\n }\n }\n \n /** Find the maximum length for the combination which can form a run.\n */\n combos = Combinations.combinations(rank);\n \n for (int i = 0; i < combos.length; i++) {\n Arrays.sort(combos[i]); \n if(combos[i].length>=3 && isRun(combos[i])){\n if (combos[i].length > maxLength) {\n maxLength = combos[i].length;\n }\n } \n } \n\n /** Add up the scores if the maximum length combination is a run.\n */\n for (int i = 0; i < combos.length; i++) {\n if (combos[i].length == maxLength && isRun(combos[i])) {\n rValue += combos[i].length;\n }\n } \n return rValue;\n }",
"public int value(){\r\n\t\t\r\n\t\tthis.sort();\r\n\t\t\r\n\t\tint result = 0;\r\n\t\t\r\n\t\tfor(int i = this.cardCount()-1; i >= 0; i--){\r\n\t\t\tif(this.getCard(i).getValue().compareTo(CardValue.ACE) == 0){\r\n\t\t\t\tif(result <= 10 - i)\r\n\t\t\t\t\tresult += 11;\r\n\t\t\t\telse\r\n\t\t\t\t\tresult += 1;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.getCard(i).getValue().compareTo(CardValue.TEN) == 0 ||\r\n\t\t\t\tthis.getCard(i).getValue().compareTo(CardValue.JACK) == 0 ||\r\n\t\t\t\tthis.getCard(i).getValue().compareTo(CardValue.QUEEN) == 0 ||\r\n\t\t\t\tthis.getCard(i).getValue().compareTo(CardValue.KING) == 0 ){\r\n\t\t\t\tresult += 10;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.getCard(i).getValue().compareTo(CardValue.TWO) == 0){\r\n\t\t\t\tresult += 2;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.getCard(i).getValue().compareTo(CardValue.THREE) == 0){\r\n\t\t\t\tresult += 3;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.getCard(i).getValue().compareTo(CardValue.FOUR) == 0){\r\n\t\t\t\tresult += 4;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.getCard(i).getValue().compareTo(CardValue.FIVE) == 0){\r\n\t\t\t\tresult += 5;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.getCard(i).getValue().compareTo(CardValue.SIX) == 0){\r\n\t\t\t\tresult += 6;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.getCard(i).getValue().compareTo(CardValue.SEVEN) == 0){\r\n\t\t\t\tresult += 7;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.getCard(i).getValue().compareTo(CardValue.EIGHT) == 0){\r\n\t\t\t\tresult += 8;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(this.getCard(i).getValue().compareTo(CardValue.NINE) == 0){\r\n\t\t\t\tresult += 9;\r\n\t\t\t}\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn result;\r\n\t}",
"public Double getMaxMoveValue(Chessboard chessboard, PieceColor pieceColor,\n EvaluationFunction evaluationFunction, int callsLimit, double alpha, double beta) {\n if (callsLimit <= 0) {\n double eval = evaluatePosition(chessboard, evaluationFunction);\n // System.out.println(pieceColor + \":\" + eval);\n return eval;\n }\n List<Move> possibleMoves = chessboard.getPossibleMoves(pieceColor);\n if (possibleMoves.isEmpty()) {\n //System.out.println(pieceColor.getOpponentColor() + \" could be winner!\");\n if (pieceColor == player) {\n return Double.MAX_VALUE;\n } else {\n return -Double.MAX_VALUE;\n }\n }\n if (pieceColor == player) {\n Double newAlpha = alpha;\n for (Move move : possibleMoves) {\n Chessboard evaluationChessboard = chessboard.copyOf();\n Move copyMove = move.copyOf();\n copyMove.doMove(evaluationChessboard);\n Double value = getMaxMoveValue(chessboard, pieceColor.getOpponentColor(),\n evaluationFunction, callsLimit - 1, newAlpha, beta);\n if (value != null && value > newAlpha) {\n newAlpha = value;\n }\n if (newAlpha >= beta) {\n return null;\n }\n }\n return newAlpha;\n } else {\n Double newBeta = beta;\n for (Move move : possibleMoves) {\n Chessboard evaluationChessboard = chessboard.copyOf();\n Move copyMove = move.copyOf();\n copyMove.doMove(evaluationChessboard);\n Double value = getMaxMoveValue(chessboard, pieceColor.getOpponentColor(),\n evaluationFunction, callsLimit - 1, alpha, newBeta);\n if (value != null && value < newBeta) {\n newBeta = value;\n }\n if (newBeta <= alpha) {\n return null;\n }\n }\n return newBeta;\n }\n }",
"public int chooseVTD(){\n int min=0;\n //this loop is used to avoid a bug\n for(int i=0;i<heuristicArrayTD.length;i++){\n if(heuristicArrayTD[i]< heuristicArrayTD[min]){\n min=i;\n }\n }\n int max=min;\n //returns highest scoring and unused var\n for(int i=0;i<heuristicArrayTD.length;i++){\n if(heuristicArrayTD[i]>= heuristicArrayTD[max] && usageArray[i%variableLength]==0){\n max=i;\n }\n }\n return max%variableLength;\n }",
"private int[] maxValue(int[][] currentState, int[] alpha, int[] beta, int depth) {\n int[] bestMove = new int[]{MinimaxUtilties.freeCentralColumn(currentState), Integer.MIN_VALUE, 0};\n\n if (terminalTest(currentState) != 0) {\n return new int[]{0, utility(currentState), maxDepth - depth};\n }\n\n if (depth < 1){\n return new int[]{0, utility(currentState), maxDepth};\n }\n\n if (terminalTest(currentState) == 0 && depth > 0) {\n // find all possible actions for this player from the current game state\n ArrayList<Integer> possibleActions = actions(currentState, 1);\n\n // check if each possible action is better than the best action so far\n for (int i = 0; i < possibleActions.size(); i++) {\n int column = possibleActions.get(i);\n int[][] resultOfAction = result(currentState, column, 1);\n\n // returns [column that was chosen, utility of choosing it]\n int[] currentResult = new int[]{column, minValue(resultOfAction, alpha, beta, depth - 1)[1], maxDepth - depth};\n\n // found a new best action\n // new move is better, or equal to best move but has shallower depth\n if (currentResult[1] > bestMove[1] || (currentResult[1] == bestMove[1] && currentResult[2] < bestMove[2])) {\n bestMove = currentResult;\n }\n\n if (bestMove[1] > alpha[1] || (bestMove[1] == alpha[1] && bestMove[2] < alpha[2])) alpha = bestMove; // new best action is better than the current alpha action\n\n if (alpha[1] >= beta[1]) return alpha; // beta cut-off\n }\n }\n\n return bestMove;\n }",
"public Player roundWinner() {\n\t\tfor(Player player : gamePlayers){\n\t\t\tEvaluator eval = new Evaluator(player, communityCards);\n\t\t\t\n\t\t\tplayer.setHandRank(eval.evaluate());\n\t\t\tplayersByHandRank.add(player);\n\t\t}\n\t\t\n\t\t//lambdas are magic. Sorts players from lowest to highest rank starting with the lowest at the first\n\t\t//index, and the highest at the last.\n\t\tCollections.sort(playersByHandRank, (p1, p2) -> p1.getHandRank().compareTo(p2.getHandRank()));\n\t\t\n\t\t//TODO: Needs to evaluate high card in case of two or more players have the same high hand rank.\n\t\t//the evaluate method in Evaluator sets high card == to the highest card in a pairSet, flush, or straight,\n\t\t//but needs to be able to add it in the event HIGH_CARD is the highest hand a player has.\n\n\t\treturn playersByHandRank.get(playersByHandRank.size() -1);\n\t}"
]
| [
"0.7104729",
"0.6874598",
"0.66042525",
"0.6426412",
"0.6414517",
"0.6402456",
"0.63723975",
"0.63623184",
"0.6355472",
"0.6297948",
"0.6290161",
"0.6287399",
"0.62501204",
"0.6233478",
"0.61702853",
"0.6141213",
"0.61336344",
"0.6122554",
"0.60904187",
"0.60805",
"0.60800225",
"0.6068766",
"0.60639936",
"0.6060626",
"0.605227",
"0.6036711",
"0.60165733",
"0.600337",
"0.59688985",
"0.59616923",
"0.59539306",
"0.5941048",
"0.5925805",
"0.59243405",
"0.5920084",
"0.5873608",
"0.5870704",
"0.58678234",
"0.58658177",
"0.58477193",
"0.58461773",
"0.5836112",
"0.5835626",
"0.5833021",
"0.58272064",
"0.58251584",
"0.5824536",
"0.5823057",
"0.5817297",
"0.5814066",
"0.5810298",
"0.5802251",
"0.5800986",
"0.5786848",
"0.5777869",
"0.5773841",
"0.57703316",
"0.5766702",
"0.5761213",
"0.5752699",
"0.57456404",
"0.5742237",
"0.5728658",
"0.5723971",
"0.57237995",
"0.5704984",
"0.57035065",
"0.56994444",
"0.5698339",
"0.5697775",
"0.569763",
"0.56957996",
"0.5674706",
"0.5665508",
"0.5656496",
"0.56417334",
"0.5638758",
"0.563588",
"0.56332535",
"0.563318",
"0.5629522",
"0.562834",
"0.56231207",
"0.56194335",
"0.56162226",
"0.56117654",
"0.56093144",
"0.55955994",
"0.55883855",
"0.5587036",
"0.5577079",
"0.5577021",
"0.55668616",
"0.5564912",
"0.55587775",
"0.55573857",
"0.5555122",
"0.5549504",
"0.5545636",
"0.55434316",
"0.5540552"
]
| 0.0 | -1 |
Return whether or not a particular column on top is played already on the current status | public boolean isColumnPlayed(int column){
return board[0][column].isPlayed();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean hasCol();",
"private boolean checkColumnForWinner(String mark,int buttonId)\n {\n \t//2) check columns\n \tint rows =3;\n \tint columns = 3;\n \tboolean winStatus=false;\n \tint columnNumber = buttonId%columns;\n \tint rowIndex= 0;\n \tint columnIndex = columnNumber;\n \tint index; \n \twhile (rowIndex<rows)\n \t{\n \t\tindex = getIndex(rowIndex,columnIndex,columns);\n \t\tif(movesPlayed[index]!=mark|| movesPlayed[index]==\"\")\n \t\t{\n \t\t\treturn winStatus;\n \t\t}\n \t\telse\n \t\t{\n \t\t\trowIndex++;\n \t\t}\n \t}\n \twinStatus=true;\n \treturn winStatus;\n }",
"boolean hasRow();",
"public boolean checkColumn() {\n\t\t// conditions fo player X\n\t\tif ((bt[0].getText().equals(\"X\") && bt[3].getText().equals(\"X\") && bt[6].getText().equals(\"X\"))\n\t\t\t\t|| (bt[1].getText().equals(\"X\") && bt[4].getText().equals(\"X\") && bt[7].getText().equals(\"X\"))\n\t\t\t\t|| (bt[2].getText().equals(\"X\") && bt[5].getText().equals(\"X\") && bt[8].getText().equals(\"X\"))) {\n\t\t\tjtf.setText(\" PLAYER X WON!\");\n\t\t\tjtf.setForeground(Color.red);\n\t\t\tjtf.setFont(new Font(\"Arial Black\", Font.BOLD, 50));\n\t\t\tfor (i = 0; i < xo.length; i++) {\n\t\t\t\tbt[i].setEnabled(false);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\t// conditions fo player O\n\t\tif ((bt[0].getText().equals(\"O\") && bt[3].getText().equals(\"O\") && bt[6].getText().equals(\"O\"))\n\t\t\t\t|| (bt[1].getText().equals(\"O\") && bt[4].getText().equals(\"O\") && bt[7].getText().equals(\"O\"))\n\t\t\t\t|| (bt[2].getText().equals(\"O\") && bt[5].getText().equals(\"O\") && bt[8].getText().equals(\"O\"))) {\n\t\t\tjtf.setText(\" PLAYER O WON!\");\n\t\t\tjtf.setForeground(Color.blue);\n\t\t\tjtf.setFont(new Font(\"Arial Black\", Font.BOLD, 50));\n\t\t\tfor (i = 0; i < xo.length; i++) {\n\t\t\t\tbt[i].setEnabled(false);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"private boolean isOver() {\r\n return players.size() == 1;\r\n }",
"boolean isNeedColumnInfo();",
"private boolean checkRowForWinner(String mark , int buttonId)\n {\n \t\n \tint rows = 3;\n \tint columns = 3;\n \tint rowNumber = buttonId/rows;\n \tboolean winStatus=false;\n \tint columnCount= 1;\n \tint index;\n \tint rowIndex = rowNumber;\n \tint columnIndex = 0;\n \t\n \twhile (columnIndex < columns)\n \t{\n \t\tindex = getIndex(rowIndex,columnIndex,columns);\n \t\tif(movesPlayed[index]!=mark || movesPlayed[index]==\"\")\n \t\t{\n \t\t\treturn winStatus;\n \t\t}\n \t\telse\n \t\t{\n \t\t\tcolumnIndex++;\t\n \t\t}\n \t}\n\t\twinStatus=true;\n\t\treturn winStatus; \t\n }",
"private Boolean canWinInColumn(PentagoBoard b, int column, Color who) {\n\t\tint amount=0;\n \tfor(int i=0; i<b.getSize(); i++) {\n\t\t\tif(b.getState(column,i) == Color.EMPTY || b.getState(column,i) == who) {\n\t\t\t\tamount++;\n\t\t\t}\n\t\t\telse\n\t\t\t\tamount=0;\n \t}\n \tif(amount>4)\n \t\treturn true;\n \telse\n \t\treturn false;\n }",
"private boolean checkColumns(char playerSymbol) {\n int count = 0;\n for (int i = 0; i < N; i++) {\n for (int j = 0; j < N; j++) {\n if (grid[i][j].getSymbol() == (playerSymbol))\n count++;\n }\n if (count == N)\n return true;\n count = 0;\n }\n return false;\n }",
"public boolean isOpen(int row, int col) {\n validate(row, col);\n int k = mapping(row, col);\n return idOpen[k] == 1;\n }",
"protected boolean hasColumn(String header){\n return hasColumn(header, false);\n }",
"private boolean isInCol(int col, int value) {\n for(int i = 0; i < size; i++){\n if (board[i][col] == value) return true;\n }\n return false;\n }",
"public boolean isOpen(int row, int col) {\n HandleError(row, col);\n percolation.find(0); //不想加的但为了autograde\n return state[row][col] == 0 || state[row][col] == 2;\n }",
"public boolean hasPlayedBefore ( ) {\n\t\treturn extract ( handle -> handle.hasPlayedBefore ( ) );\n\t}",
"@Override\n\tpublic boolean boardIsfull() {\n\t\treturn _columnFull.size() == _columnCount;\n\t}",
"private boolean playerWonGameWithVerticalLine(Player player) {\n char playerSymbol = player.getType(); \n for (int i = 0; i < 3; i++) {\n if (boardState[0][i] == playerSymbol && boardState[1][i] == playerSymbol \n && boardState[2][i] == playerSymbol) {\n return true; \n }\n \n }\n return false; \n }",
"private boolean isGameOver() {\n int numberOfRowsFilled = 0;\n for (GameRow row : rows) {\n if (row.isFilled()) {\n numberOfRowsFilled++;\n if (row.hasWinner()) {\n return true;\n }\n }\n }\n return numberOfRowsFilled == rows.size();\n }",
"public boolean tieGame() {\n\t\tint counter = 0;\n\t\tfor(int col = 0; col <= size - 1; col ++) \n\t\t\tfor(int dep = 0; dep <= size - 1; dep ++)\n\t\t\t\tif(board[0][col][dep] != -1) {\n\t\t\t\t\tcounter += 1;\n\t\t\t\t\tif(counter == size * size) \n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\treturn false;\n\t}",
"public boolean isOpen(int row, int col) {\n return false;\n }",
"private boolean playerAlive(int curPlayerRow, int curPlayerCol){\n return (gameBoard[curPlayerRow][curPlayerCol].isAlive());\n }",
"private boolean noConflictInColumn(int columnIndex, int number) {\n for (int i = 0; i < 9; i++) {\n if (grid[i][columnIndex] == number) {\n return false;\n }\n }\n return true;\n }",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"boolean hasStatus();",
"private boolean hasColWin() {\n for (int i = 0; i < rows; i++) {\n for (int j = 0; j < cols; j++) {\n if (getBoard()[i][j] != null) {\n\n boolean colWin = colHasFour(i, j);\n if (colWin) {\n return true;\n }\n\n }\n }\n }\n return false;\n }",
"@Override\n public boolean isColumnFull(int col) throws IllegalColumnException {\n //handle exceptions\n if (col < 0 || col >= NUM_COLS) {\n throw new IllegalColumnException(col);\n }\n\n //assume the column is full\n boolean isFull = true;\n try {\n //if the top is empty => the column is empty\n isFull = getCounterAt(col, NUM_ROWS - 1) != EMPTY;\n } catch (IllegalRowException e) {\n System.out.println(e + \" in MyGameState.java Method isColumnFull\");\n } catch (IllegalColumnException e) {\n System.out.println(e + \" in MyGameState.java Method isColumnFull\");\n }\n\n return isFull;\n }",
"public boolean verifyAccountAgingColums(){\n\t\tboolean isAgingColums=false;\n\t\tDynamicFramePage.dynamicFrameForPanchart();\n\t\tDynamicFramePage.switchtoFraFrame();\n\t\tdriver.switchTo().frame(\"panProfile_Frame\");\n\t\tString col2 =SeleniumUtil.getElementWithFluentWait(accountAgingColum2).getText();\n\t\tString col3 =SeleniumUtil.getElementWithFluentWait(accountAgingColum3).getText();\n\t\tString col4 =SeleniumUtil.getElementWithFluentWait(accountAgingColum4).getText();\n\t\tif(col2.equalsIgnoreCase(\"31-60\") && col3.equalsIgnoreCase(\"61-90\") && col4.equalsIgnoreCase(\"Over 90\")){\n\t\t\tSystem.out.println(\"All the aging colums are present\");\n\t\t\tisAgingColums=true;\n\t\t}\n\t\treturn isAgingColums;\n\t}",
"private boolean playerWonGameWithHorizontalLine(Player player) {\n char playerSymbol = player.getType();\n for (int i = 0; i < 3; i++) {\n if (boardState[i][0] == playerSymbol && boardState[i][1] == playerSymbol \n && boardState[i][2] == playerSymbol) {\n return true; \n }\n \n }\n return false; \n }",
"public boolean check2DColWinner(Cell play) {\n\t\tfor(int dim = 0; dim < board.length; dim++) { // for dim\n\t\t\tfor(int col = 0; col < board.length; col++) { // for col\n\t\t\t\tif(board[dim][0][col] == board[dim][1][col] && board[dim][1][col]==board[dim][2][col] && board[dim][2][col]==board[dim][3][col] && board[dim][3][col].equals(play)) { \n\t\t\t\t\t//\t\t\t\t\tSystem.out.println(\"Column win by \"+play.toString()+ \" at dim=\" + dim +\" & col= \" + col);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\n\t}",
"public boolean isOpen(int row, int col) {\n validate(row, col);\n return gridState[row-1][col-1];\n }",
"private boolean checkOrTurn(int row,int column, ItemState itemStateCurrentPlayer, int x, int y) {\n\t\t if(column==Settings.nbrRowsColumns||column<0){\n\t\t\t return false; //Get the hell out\n\t\t }\n\t\t if(row==Settings.nbrRowsColumns||row<0){ \n\t\t\t return false; //Get the hell out\n\t\t }\n\t\t if (gameStateInt[row][column]==Helpers.getOpponentPlayerCorrespondingInt(itemStateCurrentPlayer)){ //Still another color\n\t\t\t if(checkOrTurn(row+y,column+x, itemStateCurrentPlayer, x, y)){ //continue check next\n\t\t\t\t\t changed.add(new Action(row,column));\n\t\t\t\t return true;\n\t\t\t }else{\n\t\t\t\t return false;\n\t\t\t }\n\t\t }else if (gameStateInt[row][column]==Helpers.getPlayerCorrespondingInt(itemStateCurrentPlayer)){\n\t\t\t return true; //found same color\n\t\t }else{\n\t\t\t return false; //found grass\n\t\t }\n\t }",
"public boolean isOpen(int row, int col) {\n\t valid_rc(row, col);\r\n\t return open[index(row, col)];\r\n\t}",
"@Override\n public boolean isOpen() {\n return rows != null;\n }",
"private boolean checkBoardVictory() {\n boolean topRowStatus = checkRowVictory(getTopRow()) != 0;\n boolean midRowStatus = checkRowVictory(getMidRow()) != 0;\n boolean vertMidStatus = checkRowVictory(getVerticalMidRow()) != 0;\n boolean lowRowStatus = checkRowVictory(getLowRow()) != 0;\n boolean leftMidStatus = checkRowVictory(getVerticalLeftRow()) != 0;\n boolean rightMidStatus = checkRowVictory(getVerticalRightRow()) != 0;\n\n return topRowStatus || midRowStatus || vertMidStatus || lowRowStatus || leftMidStatus\n || rightMidStatus;\n }",
"private int checkColumn() {\n for (int i = 0; i < 3; i++) {\n if ((this.board[i][0] == this.board[i][1]) && (this.board[i][0] == this.board[i][2])) {\n return this.board[i][0];\n }\n }\n return 0;\n }",
"public boolean isOpen(int row, int col)\n {\n int oneDimensional = xyTo1D(row, col);\n return grid[oneDimensional];\n }",
"public abstract boolean hasWon(int row, int col);",
"@Override\n public boolean check() {\n String[][] data = raw();\n // And just check if the first row (the header data)\n // corresponds with the ABSExcel model enum. Iff that\n // is true we will return true.\n for(int i = 0; i < ABSColumn.values().length; i++) {\n String columnName = data[0][i].replaceAll(\"[- ]+\", \"\").toUpperCase();\n // If we have a mismatch somewhere, return false.\n if(!columnName.equals(ABSColumn.values()[i].toString())) {\n return false;\n }\n }\n return true;\n }",
"public boolean isOver() {\n \treturn status == GameStatus.victory || status == GameStatus.draw || status == GameStatus.quit;\n }",
"private boolean winsByCol(char symbol) {\n int max_col_count = 0;\n\n // Iterates through columns of gameboard\n for (int j = 0; j < this.boardColumns; j++) {\n\n // Reset the col counter everytime we go to a new col\n int col_count = 0;\n\n // Iterates through rows of gameboard (values in the cols)\n for (int i = 0; i < this.boardRows; i++) {\n\n // We compare all the values in a coloumn to the char symbol. If the element in the col is the same\n // as char symbol we increment the counter by 1 and update the max_col_count if possible.\n if (symbol == this.gameBoard[i][j]){\n\n col_count+=1;\n\n if (col_count > max_col_count){\n max_col_count = col_count;\n }\n }\n // If the value is not the same as char symbol, then we reset the row_count to 0\n else {\n col_count = 0;\n }\n }\n }\n\n // If the max_col_count is greater than or equal to tilesNeeded, then we have sufficient tiles in a col\n // for char symbol to win so we return true. Otherwise, we return false.\n\n if (max_col_count >= this.tilesNeeded){\n return true;\n }\n else {\n return false;\n }\n }",
"public boolean isOpen(int row, int col) {\n validate(row, col);\n return grid[row - 1][col - 1];\n }",
"private boolean colWin(){ \r\n\t\tfor (int i=0; i<3; i++){ \r\n\t\t\tif (checkValue (board[0][i], board[1][i], board[2][i]))\r\n\t\t\t\treturn true; \r\n\t\t}\r\n\t\treturn false; \r\n\t}",
"public boolean isOpen(int row, int col) {\n validate(row, col);\n return openState[getThisSite(row, col)];\n }",
"public boolean percolates(){\n \tif(this.gridLength == 1){\n \t\treturn isOpen(1,1);\n \t}\n \treturn (this.bottom[unionTest.find(0)]);\n }",
"public boolean isCurrentPlayerHungry() {\r\n\tboolean isHungry = true;\r\n\tint length = this.territory[this.currentSide].length;\r\n\tfor (short i = 0; i < length && isHungry; i++) {\r\n\t isHungry = (this.territory[this.currentSide][i] == 0);\r\n\t}\r\n\r\n\treturn isHungry;\r\n }",
"boolean repeatedPosition() {\r\n if (_repeated && _winner == BLACK) {\r\n System.out.println(\"* Black wins\");\r\n } else if (_repeated && _winner == WHITE) {\r\n System.out.println(\"* White wins\");\r\n }\r\n return _repeated;\r\n }",
"public boolean columnFull(int column);",
"public int gameStatus() {\n \t\tfor(int x = 0;x<3;x++) {\n \t\t\tif((Grid[x][0] == Grid[x][1]) && (Grid[x][1] == Grid[x][2]))\n \t\t\t\tif(Grid[x][0] != 0 && Grid[x][1] != 0 && Grid[x][2] != 0)\n \t\t\t\t\treturn Grid[x][0];\n \t\t}\n \t\tfor(int y=0;y<3;y++) {\n \t\t\tif((Grid[0][y] == Grid[1][y]) && (Grid[1][y] == Grid[2][y])) \n \t\t\t\tif(Grid[0][y] != 0 && Grid[1][y] != 0 && Grid[2][y] != 0)\n \t\t\t\t\treturn Grid[0][y];\n \t\t}\n \t\tif(Grid[0][0] == Grid[1][1] && Grid[1][1] == Grid[2][2]) \n \t\t\tif(Grid[0][0] != 0 && Grid[1][1] != 0 && Grid[2][2] != 0)\n \t\t\t\treturn Grid[0][0];\n \t\tif(Grid[2][0] == Grid[1][1] && Grid[1][1] == Grid[0][2])\n \t\t\tif(Grid[2][0] != 0 && Grid[1][1] != 0 && Grid[0][2] != 0)\n \t\t\t\treturn Grid[0][0];\n \t\tfor(int x = 0;x<3;x++) {\n \t\t\tfor(int y = 0;y<3;y++) {\n \t\t\t\tif(Grid[x][y] == 0)\n \t\t\t\t\treturn 0;\n \t\t\t}\n \t\t}\n \t\treturn 3;\t\t\n \t}",
"private boolean columnCheck() {\n\t\tfor(int col = 0; col < puzzle[0].length; col++) {\n\t\t\tfor(int i = 0; i < puzzle[0].length; i++) {\n\t\t\t\tif(puzzle[i][col] != 0) {\n\t\t\t\t\tfor(int j = i + 1; j < puzzle[0].length; j++) {\n\t\t\t\t\t\tif(puzzle[i][col] == puzzle[j][col])\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"public boolean isOpen(int row, int col) {\n if (!isLegalCoordinate(row, col)) throw new IllegalArgumentException(\"Invalid input argument.\");\n return siteStatus[row - 1][col - 1];\n }",
"public void printTableStatus() {\n\t\tInteger playersLeft = 0;\n\t\tfor (int i = 0; i < tablePlayers.length; i++) {\n\t\t\tif (!tablePlayers[i].hasFolded()) playersLeft++;\n\t\t}\n//\t\tSystem.out.println(\"current bet: \" + currBet);\n//\t\tSystem.out.println(\"players left: \" + playersLeft);\n\t}",
"private boolean isSimilar(ColumnState[] state) {\n\t\tif (state.length != getColumnCount() + hiddenCols.size())\n\t\t\treturn false;\n\t\ttry {\n\t\t\tfor (ColumnState colState : state) {\n\t\t\t\tif (!hiddenCols.containsKey(colState.getColId()))\n\t\t\t\t\tgetColumnIndex(colState.getColId());\n\t\t\t}\n\t\t\treturn true;\n\t\t} catch (IllegalArgumentException e) {\n\t\t\treturn false;\n\t\t}\n\t}",
"public boolean isOpen(int row, int col) {\n int index = rowColToIndex(row, col);\n return sitesIsOpen[index];\n }",
"private boolean colCheck(int col, int n)\r\n {\r\n for(int r = 0; r < game.length; r++)\r\n if(game[r][col] == n)\r\n return false;\r\n return true;\r\n }",
"boolean hasRanking();",
"public boolean isInPlayfield(int columnCount, int rowCount) {\n\t\tfor (Coordinate shipPosition : shipPositions) {\n\t\t\tif (shipPosition.getxPosition() >= columnCount)\n\t\t\t\treturn false;\n\t\t\telse if (shipPosition.getxPosition() < 0)\n\t\t\t\treturn false;\n\t\t\telse if (shipPosition.getyPosition() >= rowCount)\n\t\t\t\treturn false;\n\t\t\telse if (shipPosition.getyPosition() < 0)\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public boolean isOpen(final int row, final int col) {\n return grid[row - 1][col - 1];\n }",
"private boolean checkHorizontalWin(BoardPosition lastPos) {\r\n int i, col, count;\r\n int check = 9;\r\n int row = lastPos.getRow();\r\n\r\n for(i = (xMax-xMax)+2; i < (xMax / 2); i += 2){\r\n count = 0;\r\n for(col = i; col < (i + check); col++){\r\n if(grid[row][col] == lastPos.getPlayer())\r\n count++;\r\n }\r\n if (count == win)\r\n return true;\r\n }\r\n return false;\r\n }",
"private boolean checkRows(char playerSymbol) {\n int count = 0;\n for (int i = 0; i < N; i++) {\n for (int j = 0; j < N; j++) {\n if (grid[j][i].getSymbol() == playerSymbol)\n count++;\n }\n if (count == N)\n return true;\n count = 0;\n }\n return false;\n }",
"boolean hasChangeStatus();",
"boolean hasRowsLocked();",
"boolean hasActive();",
"boolean gameOver() {\n return piecesContiguous(BLACK) || piecesContiguous(WHITE);\n }",
"public boolean playerLoses(){\n return (curPlayerRow == curTrollRow && curPlayerCol == curTrollCol);\n }",
"public boolean isDuringSportsActivity() {\n return (mStatus == 1);\n }",
"public boolean checkRow() {\n\t\t// conditions fo player X\n\t\tif ((bt[0].getText().equals(\"X\") && bt[1].getText().equals(\"X\") && bt[2].getText().equals(\"X\"))\n\t\t\t\t|| (bt[3].getText().equals(\"X\") && bt[4].getText().equals(\"X\") && bt[5].getText().equals(\"X\"))\n\t\t\t\t|| (bt[6].getText().equals(\"X\") && bt[7].getText().equals(\"X\") && bt[8].getText().equals(\"X\"))) {\n\t\t\tjtf.setText(\" PLAYER X WON!\");\n\t\t\tjtf.setForeground(Color.red);\n\t\t\tjtf.setFont(new Font(\"Arial Black\", Font.BOLD, 50));\n\t\t\tfor (i = 0; i < xo.length; i++) {\n\t\t\t\tbt[i].setEnabled(false);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\t// conditions fo player O\n\t\tif ((bt[0].getText().equals(\"O\") && bt[1].getText().equals(\"O\") && bt[2].getText().equals(\"O\"))\n\t\t\t\t|| (bt[3].getText().equals(\"O\") && bt[4].getText().equals(\"O\") && bt[5].getText().equals(\"O\"))\n\t\t\t\t|| (bt[6].getText().equals(\"O\") && bt[7].getText().equals(\"O\") && bt[8].getText().equals(\"O\"))) {\n\t\t\tjtf.setText(\" PLAYER O WON!\");\n\t\t\tjtf.setForeground(Color.blue);\n\t\t\tjtf.setFont(new Font(\"Arial Black\", Font.BOLD, 50));\n\t\t\tfor (i = 0; i < xo.length; i++) {\n\t\t\t\tbt[i].setEnabled(false);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"public abstract boolean isMissing(int columnIndex);",
"boolean isStatusSuspensao();",
"private boolean canMoveUp()\n {\n // runs through column first, row second\n for ( int column = 0; column < grid[0].length ; column++ ) {\n for ( int row = 1; row < grid.length; row++ ) {\n // looks at tile directly above the current tile\n int compare = row-1;\n if ( grid[row][column] != 0 ) {\n if ( grid[compare][column] == 0 || grid[row][column] ==\n grid[compare][column] ) {\n return true;\n }\n }\n }\n } \n return false;\n }",
"private boolean checkFlagged(int row, int col, int surrounding) {\n int flags = 0;\n for (int r = -1; r < 2; r++) {\n for (int c = -1; c < 2; c++) {\n int currentRow = row + r;\n int currentCol = col + c;\n if (currentRow >= 0 && currentRow < boardHeight && currentCol >= 0 \n && currentCol < boardWidth && !(currentRow == row && currentCol == col)) {\n if (minefield[currentRow][currentCol].getFlagged()) {\n flags++;\n }\n }\n }\n }\n if (flags == surrounding) {\n return true;\n }\n return false;\n }",
"public boolean hasColumn (String column)\n {\n return data.get(canonicalize(column)) != null;\n }",
"public boolean isOpen(int row, int col) {\n return this.grid[row][col];\n }",
"public boolean meWin(){\n return whitePieces.size() > blackPieces.size() && isWhitePlayer;\n }",
"public boolean column(){\n\t\t\r\n\t\tfor (int j = 0; j < Board.length-1; j++){\r\n\t\t\tfor (int k = 1; k < Board.length-1; k++){\r\n\t\t\t\tif (Board[k][j].charAt(2) != Board[k+1][j].charAt(2))\r\n\t\t\t\t\tbreak;\r\n\t\t\t\telse if (Board[k][j].charAt(2) == '_')\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tif (k == Board.length-2){\r\n\t\t\t\t\tthis.winner = Board[k][j].charAt(2);\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}",
"private boolean noRepeatedNumbersInColumns() {\n return !this.hasAnyRepeatedInColumn();\n }",
"boolean canMove(Color player) {\n int[][] myStatusBoard;\n if (_playerOnMove == ORANGE) {\n myStatusBoard = _orangeStatusBoard;\n } else {\n myStatusBoard = _violetStatusBoard;\n }\n if (Game._totalMoves < 2) {\n return true;\n }\n int i, j;\n for (i = 0; i < 16; i++) {\n for (j = 0; j < 16; j++) {\n if (myStatusBoard[i][j] == 1) {\n if (findMove(i, j, myStatusBoard)) {\n return true;\n }\n }\n }\n }\n return false;\n }",
"public boolean isFull(int row, int col) {\n validate(row, col);\n return isOpen(row, col) &&\n (gridGraphVirtualTop.find(virtualTopGridIndex) == gridGraphVirtualTop.find(convertRowColToIndex(row, col)));\n }",
"private boolean isInColumn(int i, int col) {\n for (int r = 0; r < numbers.length; r++) {\n if(i == numbers[r][col]) {\n return true;\n }\n }\n return false;\n }",
"@Override\n public boolean isLocalPlayersTurn() {\n return getTeam().equals(currentBoard.turn());\n }",
"public static boolean isWrongUserColumn()\n {\n boolean isWrong=false;\n int aux; // Guarda la suma de la columna.\n \n for (int i = 0; i < BOARD_WIDTH; i++)\n {\n aux = 0; // Lo inicializamos para cada columna.\n for (int j = 0; j < BOARD_HEIGHT; j++)\n {\n aux = aux + playerBoardPos[j][i]; // Sumamos el valor de la casilla al aux.\n }\n if (!(aux == 10)) // Si el aux no tiene un 10 significa que hay un numero repetido.\n {\n isWrong = true; // Activamos el boolean de numero repetido.\n }\n }\n return isWrong;\n }",
"private boolean columnIsFree(int column){\n return this.tiles[0][column - 1] == 'O';\n }"
]
| [
"0.6704976",
"0.6356373",
"0.60521454",
"0.6005272",
"0.59644884",
"0.59204274",
"0.59074545",
"0.58801967",
"0.58392125",
"0.58309287",
"0.58084846",
"0.580226",
"0.5782162",
"0.577592",
"0.57740164",
"0.5773421",
"0.57659256",
"0.57596767",
"0.5757258",
"0.57496697",
"0.5745773",
"0.5740178",
"0.5740178",
"0.5740178",
"0.5740178",
"0.5740178",
"0.5740178",
"0.5740178",
"0.5740178",
"0.5740178",
"0.5740178",
"0.5740178",
"0.5740178",
"0.5740178",
"0.5740178",
"0.5740178",
"0.5740178",
"0.5740178",
"0.5740178",
"0.5740178",
"0.5740178",
"0.5740178",
"0.5740178",
"0.57076204",
"0.5705624",
"0.568599",
"0.5672353",
"0.566551",
"0.5662659",
"0.5654909",
"0.5626968",
"0.5605271",
"0.5598832",
"0.558992",
"0.5585683",
"0.556524",
"0.5565123",
"0.5563132",
"0.5552229",
"0.5551484",
"0.5546274",
"0.5543463",
"0.5535986",
"0.5530832",
"0.55248785",
"0.5523537",
"0.55161816",
"0.5513882",
"0.5505987",
"0.55050695",
"0.54990077",
"0.54970634",
"0.5496304",
"0.5494801",
"0.54938126",
"0.54934996",
"0.5476353",
"0.5475047",
"0.54710245",
"0.54704773",
"0.5470266",
"0.5464399",
"0.54574776",
"0.54565144",
"0.54502475",
"0.54464734",
"0.5446174",
"0.54365164",
"0.5435947",
"0.5427029",
"0.54203355",
"0.54176044",
"0.54091454",
"0.5401315",
"0.5400878",
"0.5394688",
"0.53942806",
"0.5388025",
"0.5387927",
"0.53827786"
]
| 0.6778251 | 0 |
Method that helps comparing two BoardCandidate objects based on its grades. If the grades are the same, it adds a random value between 0 and 9 to help skew the options. | @Override
public int compareTo(Object o) {
if(this.getGrade()==((BoardCandidate)o).getGrade()){
return (int)(Math.random()*10-Math.random()*10);
}
return this.getGrade()-((BoardCandidate)o).getGrade();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n\tpublic void testAssignGrade2() {\n\t\tthis.admin.createClass(\"Class1\", 2017, \"Instructor1\", 20);\n\t\tthis.instructor.addHomework(\"Instructor1\", \"Class1\", 2017, \"HW1\");\n\t\tthis.student.submitHomework(\"Student1\", \"HW1\", \"Solution\", \"Class1\", 2017);\n\t\tthis.instructor.assignGrade(\"Instructor2\", \"Class1\", 2017, \"HW1\", \"Student1\", 90);\n\t\tInteger grade = this.instructor.getGrade(\"Class1\", 2017, \"HW1\", \"Student1\");\n\t\tassertFalse(grade.equals(new Integer(90)));\n\t}",
"public void playGame () {\n int rank1 = team1.getSeed();\n int rank2 = team2.getSeed();\n double s1 = Math.random();\n System.out.println(s1);\n double s2 = Math.random();\n System.out.println(s2);\n \n if(rank1 < rank2){\n\t double one = (s1*10)+1;\n\t score1 = (int)one;//gives a slight advantage to the person with a higher seed\n\t double two = (s2*10); \n\t score2 = (int)two;\n\t if(score1 == score2){\n\t score1 = score1+1; //gives the game to the higher seed if there is a tie\n }\n else if(rank2 < rank1){\n\t double r = (s2*10)+1;\n\t score2 = (int)r;\n\t double t = (s1*10); \n\t score1 = (int)t;\n\t if(score1 == score2){\n\t score2 = score2+1;\n\t }}}}",
"@Test\n public void isSameGrade() {\n assertTrue(MATHS_GRADE.isSameGrade(MATHS_GRADE));\n\n // null -> returns false\n assertFalse(MATHS_GRADE.isSameGrade(null));\n\n // same subject name and graded item, different grade -> returns true\n Grade editedMaths = new GradeBuilder(MATHS_GRADE)\n .withGrade(VALID_GRADE_SCIENCE).build();\n assertTrue(MATHS_GRADE.isSameGrade(editedMaths));\n\n // different subject name, all other attributes same -> returns false\n editedMaths = new GradeBuilder(MATHS_GRADE)\n .withSubject(VALID_SUBJECT_NAME_SCIENCE).build();\n assertFalse(MATHS_GRADE.isSameGrade(editedMaths));\n\n // different graded item, all other attributes same -> returns false\n editedMaths = new GradeBuilder(MATHS_GRADE)\n .withGradedItem(VALID_GRADED_ITEM_SCIENCE).build();\n assertFalse(MATHS_GRADE.isSameGrade(editedMaths));\n\n // subject differs in case, all other attributes same -> returns true\n Grade editedScience = new GradeBuilder(SCIENCE_GRADE)\n .withSubject(VALID_SUBJECT_NAME_SCIENCE.toLowerCase()).build();\n assertTrue(SCIENCE_GRADE.isSameGrade(editedScience));\n\n // graded item differs in case, all other attributes same -> returns true\n editedScience = new GradeBuilder(SCIENCE_GRADE)\n .withGradedItem(VALID_GRADED_ITEM_SCIENCE.toLowerCase()).build();\n assertTrue(SCIENCE_GRADE.isSameGrade(editedScience));\n\n // subject has trailing spaces, all other attributes same -> returns false\n String subjectWithTrailingSpaces = VALID_SUBJECT_NAME_SCIENCE + \" \";\n editedScience = new GradeBuilder(SCIENCE_GRADE)\n .withSubject(subjectWithTrailingSpaces).build();\n assertFalse(SCIENCE_GRADE.isSameGrade(editedScience));\n\n // graded item has trailing spaces, all other attributes same -> returns false\n String itemWithTrailingSpaces = VALID_GRADED_ITEM_SCIENCE + \" \";\n editedScience = new GradeBuilder(SCIENCE_GRADE)\n .withGradedItem(itemWithTrailingSpaces).build();\n assertFalse(SCIENCE_GRADE.isSameGrade(editedScience));\n }",
"@Test\r\n\tpublic void getAllGradesWithPerfectGradeTest()\r\n\t\t\tthrows ClassNotFoundException, SonarqubeDataBaseException, SQLException, IOException {\r\n\t\t// Filling with 'perfectScore'\r\n\t\tlistScoreMetricStudent.put(\"comment_lines_density\", 70f);\r\n\t\tlistScoreMetricStudent.put(\"complexity\", 11f);\r\n\t\tlistScoreMetricStudent.put(\"test_success_density\", 100f);\r\n\t\tlistScoreMetricStudent.put(\"tests\", 4f);\r\n\t\tlistScoreMetricStudent.put(\"test_success_density_teacher\", 1f);\r\n\t\tHashMap<String, Integer> mapIssuesEmpty = new HashMap<String, Integer>();\r\n\t\tlistAllGrades.put(\"FinalGrade\", 20f); // changer project name par un projet Student nikel\r\n\t\tAssert.assertEquals(\r\n\t\t\t\tUtilCalculGrade.getAllGrades(mapQuality, listScoreMetricStudent, listScoreMetricTeacher, mapConf,\r\n\t\t\t\t\t\tmapIssuesEmpty, projectName, idModule).get(\"FinalGrade\"),\r\n\t\t\t\tlistAllGrades.get(\"FinalGrade\"));\r\n\t}",
"@Test\n public void equals() {\n Grade mathsCopy = new GradeBuilder(MATHS_GRADE).build();\n assertTrue(MATHS_GRADE.equals(mathsCopy));\n\n // same object -> returns true\n assertTrue(MATHS_GRADE.equals(MATHS_GRADE));\n\n // null -> returns false\n assertFalse(MATHS_GRADE.equals(null));\n\n // different type -> returns false\n assertFalse(MATHS_GRADE.equals(5));\n\n // different person -> returns false\n assertFalse(MATHS_GRADE.equals(SCIENCE_GRADE));\n\n // different subject name -> returns false\n Grade editedMaths = new GradeBuilder(MATHS_GRADE)\n .withSubject(VALID_SUBJECT_NAME_SCIENCE).build();\n assertFalse(MATHS_GRADE.equals(editedMaths));\n\n // different graded item -> returns false\n editedMaths = new GradeBuilder(MATHS_GRADE)\n .withGradedItem(VALID_GRADED_ITEM_SCIENCE).build();\n assertFalse(MATHS_GRADE.equals(editedMaths));\n\n // different grade -> returns false\n editedMaths = new GradeBuilder(MATHS_GRADE)\n .withGrade(VALID_GRADE_SCIENCE).build();\n assertFalse(MATHS_GRADE.equals(editedMaths));\n }",
"@Test\r\n\tpublic void fromNumGradeTest(){\r\n\t\tint[] testNumGrade = { -1, 0, 34,36,41,42,45,47,51,53,55,58,60,63,65,68,71,74,77, 100 };\r\n\t\tint expectedValue = 20;\r\n\t\tfor(int i=0;i<testNumGrade.length;i++){\r\n\t\t\tassertEquals(expectedValue,PointGrade.fromNumGrade(testNumGrade[i]).getPoints());\r\n\t\t\texpectedValue--;\r\n\t\t}\r\n\t}",
"@Test\n\tpublic void testAssignGrade4() {\n\t\tthis.admin.createClass(\"Class1\", 2017, \"Instructor1\", 20);\n\t\tthis.instructor.addHomework(\"Instructor1\", \"Class1\", 2017, \"HW1\");\n\t\tthis.instructor.assignGrade(\"Instructor1\", \"Class1\", 2017, \"HW1\", \"Student1\", 90);\n\t\tInteger grade = this.instructor.getGrade(\"Class1\", 2017, \"HW1\", \"Student1\");\n\t\tassertFalse(grade.equals(new Integer(90)));\n\t}",
"@Test\n\tpublic void testAssignGrade() {\n\t\tthis.admin.createClass(\"Class1\", 2017, \"Instructor1\", 20);\n\t\tthis.instructor.addHomework(\"Instructor1\", \"Class1\", 2017, \"HW1\");\n\t\tthis.student.submitHomework(\"Student1\", \"HW1\", \"Solution\", \"Class1\", 2017);\n\t\tthis.instructor.assignGrade(\"Instructor1\", \"Class1\", 2017, \"HW1\", \"Student1\", 90);\n\t\tInteger grade = this.instructor.getGrade(\"Class1\", 2017, \"HW1\", \"Student1\");\n\t\tassertTrue(grade.equals(new Integer(90)));\n\t}",
"public static void main(String[] args) {\r\n int grade = 0;\r\n \r\n initializeBoard();\r\n \r\n System.out.println(game);\r\n//getValueIn is a simple getter method the returns value at given array index \r\n if (game.getValueIn(1, 1) == 5)\r\n grade += 5;\r\n else\r\n System.out.println(\"getValueIn(r,c) test failed\");\r\n//confirms that to string was done correctly \r\n if (testToString()) \r\n grade += 5;\r\n else\r\n System.out.println(\"toString() test failed\");\r\n//testAddGuess1() test tries to add a guess (value to array index) that depends on boolean flag states \r\n game.addGuess(2, 3, 5);\r\n if (testAddGuess1()) \r\n grade += 5;\r\n else\r\n System.out.println(\"addGuess(r,c,v) test 1 failed\"); \r\n//testAddGuess2() test tries to add a guess (value to array index) that depends on boolean flag states \r\n game.addGuess(2, 2, 5);\r\n if (testAddGuess2()) \r\n grade += 5;\r\n else\r\n System.out.println(\"addGuess(r,c,v) test 2 failed\"); \r\n//testAddGuess3() test tries to add a guess (value to array index) that depends on boolean flag states \r\n game.addGuess(2, 4, 1);\r\n if (testAddGuess3()) \r\n grade += 10;\r\n else\r\n System.out.println(\"addGuess(r,c,v) test 3 failed\"); \r\n //tests reset(), by re-running the first toString test above, after running game.reset() \r\n game.reset();\r\n if (testToString())\r\n grade += 10;\r\n else\r\n System.out.println(\"reset() test failed\");\r\n//tests the game.getAllowedValues method by passing the game object method call and hence it's results\r\n//to the testGetAllowedValues(), which appears to only apply to one cell/array index at a time\r\n//so if I am correct this is saying what values can be used at coordinates 8, 8.\r\n//the answer that it uses to compare is a visual/manual analysis of expected results for cell 8, 8. \r\n if (testGetAllowedValues(game.getAllowedValues(8, 8)))\r\n grade += 10;\r\n else\r\n System.out.println(\"getAllowedValues() test failed\");\r\n \r\n System.out.printf(\"Your grade is %d/50.\\n\", grade);\r\n }",
"@Test \n\tpublic void TestStudentGPA() throws PersonException{\n\t\tArrayList<Enrollment> EnrolledStudents = new ArrayList<Enrollment>();\n\t\tfor (int i = 0; i < Students.size(); i++){\n\t\t\tStudent student = Students.get(i);\n\t\t\tfor (int j = 0; j < Sections.size(); j++){\n\t\t\t\tSection section = Sections.get(j);\n\t\t\t\tEnrollment enrolled = new Enrollment(student.getStudentID(),section.getSectionID());\n\t\t\t\tenrolled.setGrade((i*10)); // Assumes each student gets a consistent grade in every section! (Otherwise average GPAs would be a bit tougher)\n\t\t\t\tEnrolledStudents.add(enrolled);\n\t\t\t}\n\t\t}\n\t\t\n\t\tArrayList<Double> StudentsGPA = new ArrayList<Double>();\n\t\tfor (int i = 0; i < EnrolledStudents.size(); i+=6) {\n\t\t\t\tif (EnrolledStudents.get(i).getGrade() >= 90)\n\t\t\t\t\tStudentsGPA.add(4.0);\n\t\t\t\telse if (EnrolledStudents.get(i).getGrade() >= 80)\n\t\t\t\t\tStudentsGPA.add(3.66);\n\t\t\t\telse if (EnrolledStudents.get(i).getGrade() >= 70)\n\t\t\t\t\tStudentsGPA.add(3.33);\n\t\t\t\telse if (EnrolledStudents.get(i).getGrade() >= 60)\n\t\t\t\t\tStudentsGPA.add(3.0);\n\t\t\t\telse if (EnrolledStudents.get(i).getGrade() >= 50)\n\t\t\t\t\tStudentsGPA.add(2.66);\n\t\t\t\telse if (EnrolledStudents.get(i).getGrade() >= 40)\n\t\t\t\t\tStudentsGPA.add(2.33);\n\t\t\t\telse if (EnrolledStudents.get(i).getGrade() >= 30)\n\t\t\t\t\tStudentsGPA.add(2.0);\n\t\t\t\telse if (EnrolledStudents.get(i).getGrade() >= 20)\n\t\t\t\t\tStudentsGPA.add(1.66);\n\t\t\t\telse if (EnrolledStudents.get(i).getGrade() >= 10)\n\t\t\t\t\tStudentsGPA.add(1.33);\n\t\t\t\telse \n\t\t\t\t\tStudentsGPA.add(1.0);\n\t\t}\n\t\tassertTrue(StudentsGPA.get(0) == 1.0);\n\t\tassertTrue(StudentsGPA.get(1) == 1.33);\n\t\tassertTrue(StudentsGPA.get(2) == 1.66);\n\t\tassertTrue(StudentsGPA.get(3) == 2.0);\n\t\tassertTrue(StudentsGPA.get(4) == 2.33);\n\t\tassertTrue(StudentsGPA.get(5) == 2.66);\n\t\tassertTrue(StudentsGPA.get(6) == 3.0);\n\t\tassertTrue(StudentsGPA.get(7) == 3.33);\n\t\tassertTrue(StudentsGPA.get(8) == 3.66);\n\t\tassertTrue(StudentsGPA.get(9) == 4.0);\n\t\t\n\t\tArrayList<Double> CoursesGPA = new ArrayList<Double>();\n\t\tdouble count = 0;\n\t\tfor (int i = 0; i < EnrolledStudents.size(); i+=6){\n\t\t\tcount += EnrolledStudents.get(i).getGrade();\n\t\t}\n\t\tif (count == 450){ // Again, assumes a simple case (average grade = 45 -> average GPA = 2.497)\n\t\t\tCoursesGPA.add(2.497);\n\t\t}\n\t\tassertTrue(CoursesGPA.get(0) == 2.497);\n\t\t\n\t}",
"public static void main(String[] args) {\n Map<String,Integer> firstGrading = TestResults.getOriginalGrades();\n Map<String, Integer> secondGrading = TestResults.getMakeUpGrades();\n\n for (var student : secondGrading.entrySet()) {\n Integer firstGrade = firstGrading.get(student.getKey()); //getValue?\n Integer secondGrade = secondGrading.get(student.getKey());\n\n if (secondGrade > firstGrade) {\n firstGrading.put(student.getKey(),secondGrade);\n }\n }\n System.out.println(\"The final student grades are:\");\n firstGrading.forEach(\n (k,v) -> System.out.println(\"Student: \" + k + \" with \" + \" Grade: \" + v + \".\")\n );\n\n\n }",
"private void wisselPunten(Speler a, Speler b, int score){\n a.veranderScore(score);\n b.veranderScore(-score);\n }",
"@Test\r\n\tpublic void getAllGradesWithChangeOfTestOfTeacherValueAndAdjustementTest()\r\n\t\t\tthrows ClassNotFoundException, SonarqubeDataBaseException, SQLException, IOException {\r\n\t\tmapQuality.put(\"TestOfTeacher\", new ModelValue(90f));\r\n\t\tmapQuality.put(\"Comments\", new ModelValue(25f, 10f));\r\n\t\tlistAllGrades.put(\"FinalGrade\", new Float(5.5));\r\n\t\tAssert.assertEquals(UtilCalculGrade.getAllGrades(mapQuality, listScoreMetricStudent, listScoreMetricTeacher,\r\n\t\t\t\tmapConf, mapIssues, projectName, idModule).get(\"FinalGrade\"), listAllGrades.get(\"FinalGrade\"));\r\n\t}",
"public static void betterApplicant(double gpaScore1, double gpaScore2, double examScore1, double examScore2)\n {\n System.out.print(\"\\n\");\n double firstApplicant = gpaScore1 + examScore1;\n System.out.printf(\"First applicant overall score: %.1f \\n\", firstApplicant);\n double secondApplicant = gpaScore2 + examScore2;\n System.out.printf(\"Second applicant overall score: %.1f \\n\", secondApplicant);\n \n if(firstApplicant > secondApplicant)\n {\n System.out.println(\"The first applicant seems to be better\");\n }\n else if (secondApplicant > firstApplicant)\n {\n System.out.println(\"The second applicant seems to be better\");\n }\n else if(firstApplicant == secondApplicant)\n {\n System.out.println(\"The two applicants seem to be equal\");\n }\n }",
"@Test\r\n\tpublic void getAllGradesWithChangeOfTestOfTeacherValueAndNoAdjustementTest()\r\n\t\t\tthrows ClassNotFoundException, SonarqubeDataBaseException, SQLException, IOException {\r\n\t\tmapQuality.put(\"TestOfTeacher\", new ModelValue(90f));\r\n\t\tmapQuality.put(\"Comments\", new ModelValue(25f, 5f));\r\n\t\tlistAllGrades.put(\"FinalGrade\", 10.5f);\r\n\t\tAssert.assertEquals(UtilCalculGrade.getAllGrades(mapQuality, listScoreMetricStudent, listScoreMetricTeacher,\r\n\t\t\t\tmapConf, mapIssues, projectName, idModule).get(\"FinalGrade\"), listAllGrades.get(\"FinalGrade\"));\r\n\t}",
"@Test\r\n\tpublic void getAllGradesWithChangeOfTestOfTeacherValueAndNoAdjustementWithLimitTest()\r\n\t\t\tthrows ClassNotFoundException, SonarqubeDataBaseException, SQLException, IOException {\r\n\t\tmapQuality.put(\"TestOfTeacher\", new ModelValue(90f));\r\n\t\tmapQuality.put(\"Comments\", new ModelValue(25f, 9f));\r\n\t\tlistAllGrades.put(\"FinalGrade\", 6.5f);\r\n\t\tAssert.assertEquals(UtilCalculGrade.getAllGrades(mapQuality, listScoreMetricStudent, listScoreMetricTeacher,\r\n\t\t\t\tmapConf, mapIssues, projectName, idModule).get(\"FinalGrade\"), listAllGrades.get(\"FinalGrade\"));\r\n\t}",
"public static Object[] question4(Student student1, Student student2)\r\n {\r\n \r\n int student1HighestGrade = 0;\r\n double student1total = 0;\r\n double student2total = 0;\r\n int student2HighestGrade = 0; \r\n double student1AverageGrade = 0;\r\n double student2AverageGrade = 0; \r\n Student bestAverageGradeStudent = student1;\r\n Student bestHighGradeStudent = student2; \r\n \r\n // Your code goes Here:\r\n for(int i = 0; i < 8; i++)\r\n {\r\n if(student1HighestGrade < student1.getExamScore(i))\r\n {\r\n \r\n student1HighestGrade = student1.getExamScore(i);\r\n }\r\n \r\n if(student2HighestGrade < student2.getExamScore(i))\r\n {\r\n student2HighestGrade = student2.getExamScore(i);\r\n }\r\n \r\n }\r\n if (bestHighGradeStudent == student2)\r\n {\r\n bestHighGradeStudent = student2;\r\n }\r\n else \r\n {\r\n bestAverageGradeStudent = student1;\r\n }\r\n \r\n \r\n \r\n \r\n for(int c = 0;c < 8; c++)\r\n {\r\n student1total += student1.getExamScore(c);\r\n }\r\n student1AverageGrade = student1total/8;\r\n \r\n for(int d = 0; d < 8; d++)\r\n {\r\n student2total += student2.getExamScore(d);\r\n }\r\n student2AverageGrade = student2total/8;\r\n \r\n \r\n \r\n \r\n // Necessary for Unit Test \r\n return new Object[] {student1HighestGrade, student2HighestGrade, student1AverageGrade, student2AverageGrade, bestHighGradeStudent, bestAverageGradeStudent}; \r\n }",
"@Test\n\tpublic void finalScoreTest() {\n\t\tassertEquals(80, g1.finalScore(), .001);\n\t\tassertEquals(162, g2.finalScore(), .001);\n\t\tassertEquals(246, g3.finalScore(), .001);\n\t}",
"private static void print_Final(Gradebook gradebook, String[] flags){\n if (flags[3] != null && flags[3].equals(\"G\")){\n List<Student> studentsList = gradebook.getAllStudents();\n //Map<Student, Double>\n Map<Double, List<Student>> grades = new HashMap<Double, List<Student>>();\n Set<Double> gradeSet = new HashSet<Double>();\n\n for(Student s : studentsList){\n double grade = gradebook.getGradeStudent(s);\n List<Student> studs = grades.get(grade);\n\n if(studs == null){\n studs = new ArrayList<Student>();\n }\n\n studs.add(s);\n grades.put(grade, studs);\n gradeSet.add(grade);\n }\n\n List<Double> gradeList = new ArrayList<Double>(gradeSet);\n Collections.sort(gradeList, Collections.reverseOrder());\n\n DecimalFormat df = new DecimalFormat(\"#.####\"); //Round to 4 decimal places\n df.setRoundingMode(RoundingMode.HALF_UP);\n for(Double d : gradeList){\n\n List<Student> studs = grades.get(d);\n for(Student s : studs){\n\n System.out.println(\"(\" + s.getLast() + \", \" + s.getFirst() + \", \" + df.format(d) + \")\");\n }\n }\n } else if (flags[4] != null && flags[4].equals(\"A\")){\n //compare override class at bottom of file\n List<Student> studentsAlpha = gradebook.getAllStudents();\n Collections.sort(studentsAlpha, new Comparator<Student>() {\n @Override\n public int compare(Student o1, Student o2) {\n if ( o2.getLast().compareToIgnoreCase(o1.getLast()) == 0) {\n return o1.getFirst().compareToIgnoreCase(o2.getFirst());\n } else {\n return o1.getLast().compareToIgnoreCase(o2.getLast());\n }\n }\n });\n\n DecimalFormat df = new DecimalFormat(\"#.####\"); //Round to 4 decimal places\n df.setRoundingMode(RoundingMode.HALF_UP);\n for (Student stud: studentsAlpha) {\n System.out.println(\"(\" + stud.getLast() + \", \" + stud.getFirst() + \", \" + df.format(gradebook.getGradeStudent(stud)) + \")\");\n }\n\n }\n else{\n throw new IllegalArgumentException(\"Grade or Alphabetical flag missing.\");\n }\n return;\n }",
"void generateGradeCard(String studentId);",
"public static void compareCombos() {\n\t\tint currentTotal = 0;\n\t\tint pastTotal = 0;\n\n\t\tcost++;\n\t\tfor (int i = 0; i < numPeople; i++) {\n\t\t\tcurrentTotal += board[i][currentCombo[i]];\n\t\t\tpastTotal += board[i][bestCombo[i]];\n\t\t}\n\t\t\n\t\tif (currentTotal >= pastTotal) {\n\t\t\tbestTotal = 0;\n\t\t\tfor (int i = 0; i < numPeople; i++) {\n\t\t\t\tbestCombo[i] = currentCombo[i];\n\t\t\t\tbestTotal += board[i][currentCombo[i]];\n\t\t\t}\n\t\t}\n\n\t}",
"public void testScoreboardCaseOneA() throws Exception{\n \n String [] runsData = {\n \"2,8,C,1,No\",\n \"15,8,D,1,Yes\",\n \"23,8,D,1,No\",\n \"29,8,D,1,No\",\n \"43,8,C,1,No\",\n \"44,8,A,1,Yes\",\n \"52,8,C,1,Yes\",\n \"65,8,B,2,Yes\",\n };\n \n // Rank TeamId Solved Penalty\n \n String [] rankData = {\n \"1,team8,4,45\",\n \"2,team1,0,0\",\n \"2,team2,0,0\",\n \"2,team3,0,0\",\n \"2,team4,0,0\",\n \"2,team5,0,0\",\n \"2,team6,0,0\",\n \"2,team7,0,0\",\n };\n \n scoreboardTest (8, runsData, rankData);\n }",
"@Test\n public void pickUpSomeGoldTest() {\n\tassertNotEquals(0,score);\n }",
"public void testAltScoring() throws Exception {\n \n String [] runsData = {\n \"1,1,A,1,No\", // 20\n \"2,1,A,3,Yes\", // 3 (Minute points for 1st Yes count)\n \"3,1,A,5,No\", // 20 (a No on a solved problem)\n \"4,1,A,7,Yes\", // zero (only \"No's\" count)\n \"5,1,A,9,No\", // 20 (another No on the solved problem)\n \n \"6,1,B,11,No\", // zero (problem has not been solved)\n \"7,1,B,13,No\", // zero (problem has not been solved)\n \n \"8,2,A,30,Yes\", // 30 (Minute points for 1st Yes)\n \n \"9,2,B,35,No\", // zero -- not solved\n \"10,2,B,40,No\", // zero -- not solved\n \"11,2,B,45,No\", // zero -- not solved\n \"12,2,B,50,No\", // zero -- not solved\n \"13,2,B,55,No\", // zero -- not solved\n };\n \n\n // Rank TeamId Solved Penalty\n \n // alt1: 0 0 200\n \n String[] alt1rankData = {\n \"1,team1,1,200\",\n \"2,team2,1,200\", // tie-breaker causes rank 2\n };\n \n scoreboardTest (2, runsData, alt1rankData, alt1);\n // alt2: 30 5 0\n String[] alt2rankData = {\n \"1,team1,1,45\", // 1 no@30 each + 3 min * 5\n \"2,team2,1,150\", // 5*30\n };\n \n scoreboardTest (2, runsData, alt2rankData, alt2);\n \n // alt3: 0 10 0\n String[] alt3rankData = {\n \"1,team1,1,30\", // 3 min * 10\n \"2,team2,1,300\", // 30 min * 10\n };\n \n scoreboardTest (2, runsData, alt3rankData, alt3);\n \n // alt4: 5 0 20\n String[] alt4rankData = {\n \"1,team2,1,20\", // base yes\n \"2,team1,1,25\", // base yes + 1 no\n };\n \n scoreboardTest (2, runsData, alt4rankData, alt4);\n\n }",
"public void testScoreboardCaseTwo () throws Exception{\n \n // RunID TeamID Prob Time Result\n \n String [] runsData = {\n \"1,1,A,1,No\", // 20\n \"2,1,A,3,Yes\", // 3 (Minute points for 1st Yes count)\n \"3,1,A,5,No\", // 20 (a No on a solved problem)\n \"4,1,A,7,Yes\", // zero (only \"No's\" count)\n \"5,1,A,9,No\", // 20 (another No on the solved problem)\n \n \"6,1,B,11,No\", // zero (problem has not been solved)\n \"7,1,B,13,No\", // zero (problem has not been solved)\n \n \"8,2,A,30,Yes\", // 30 (Minute points for 1st Yes)\n \n \"9,2,B,35,No\", // zero -- not solved\n \"10,2,B,40,No\", // zero -- not solved\n \"11,2,B,45,No\", // zero -- not solved\n \"12,2,B,50,No\", // zero -- not solved\n \"13,2,B,55,No\", // zero -- not solved\n };\n \n\n // Rank TeamId Solved Penalty\n \n String [] rankData = {\n \"1,team1,1,23\",\n \"2,team2,1,30\",\n };\n \n // TODO when SA supports count all runs, replace rankData\n \n /**\n * Case 2 tests when all no runs are counted, the current SA\n * does not support this scoring method. The commented\n * rankData is the proper results\n */\n\n// Team 2 -- 30 <-- Team 2 is now winning with a lower score \n// Team 1 -- 63 (same database; different scoring method)\n \n// String [] rankData = {\n// \"1,team2,1,30\",\n// \"2,team1,1,63\",\n// };\n \n \n scoreboardTest (2, runsData, rankData);\n \n }",
"public static void main(String[] args) {\r\n\t\tCourse la = new Course(\"CS 2110\", 3.0, 4.0);\r\n\t\tCourse laa = new Course(3.0);\r\n\t\tlaa.setName(\"CS 2110\");\r\n\t\tla.gpaConverter();\r\n\t\tSystem.out.println(la);\r\n\t\tSystem.out.println(la.equals(laa));\r\n\t}",
"@Test\n public void randomTest() {\n Deck deck1 = new DeckImplementation();\n Deck deck2 = new DeckImplementation();\n\n assertEquals(\"Wrong size!\", 180, deck1.numberOfCardsRemaining());\n assertEquals(\"Wrong size!\", 180, deck2.numberOfCardsRemaining());\n\n assertEquals(\"Decks are equal!\", false, deck1.equals(deck2));\n }",
"private ChesspairingGame parePlayers(ChesspairingPlayer playerA, ChesspairingPlayer playerB) {\n\t\tString keyA = playerA.getPlayerKey();\n\t\tString keyB = playerB.getPlayerKey();\n\t\tif (keyA.equals(keyB)) {\n\t\t\tthrow new IllegalStateException(\"You shuld never try to pare a players agains himself\");\n\t\t}\n\t\t/**\n\t\t * two players shall not meet more than once\n\t\t */\n\t\tList<String> partnersA = partnerHistory.get(keyA);\n\t\tif (partnersA.contains(keyB)) {\n\t\t\tthrow new IllegalStateException(\"two players shall not meet more than once\");\n\t\t}\n\t\tList<String> partnersB = partnerHistory.get(keyB);\n\t\tif (partnersB.contains(keyA)) {\n\t\t\tthrow new IllegalStateException(\"two players shall not meet more than once\");\n\t\t}\n\n\t\t/**\n\t\t * the color difference is the number of games played with white minus\n\t\t * the number of games played with black\n\t\t * \n\t\t * -2 < diff < 2\n\t\t */\n\t\tint aHistoryColor = getColorDifference(keyA);\n\t\tint bHistoryColor = getColorDifference(keyB);\n\n\t\t// if a is white\n\t\tint aWhite = aHistoryColor + 1;\n\t\tint bBlach = bHistoryColor - 1;\n\n\t\tif ((-2 < aWhite) && (aWhite < 2) && (-2 < bBlach) && (bBlach < 2)) {\n\t\t\t// this works\n\t\t\tChesspairingGame game = new ChesspairingGame();\n\t\t\tgame.setWhitePlayer(playerA);\n\t\t\tgame.setBlackPlayer(playerB);\n\t\t\tgame.setTableNumber(0);\n\t\t\tgame.setResult(ChesspairingResult.NOT_DECIDED);\n\t\t\treturn game;\n\t\t}\n\n\t\t// if a is black\n\t\tint aBlack = aHistoryColor - 1;\n\t\tint bWhite = bHistoryColor + 1;\n\t\tif ((-2 < aBlack) && (aBlack < 2) && (-2 < bWhite) && (bWhite < 2)) {\n\t\t\tChesspairingGame game = new ChesspairingGame();\n\t\t\tgame.setWhitePlayer(playerB);\n\t\t\tgame.setBlackPlayer(playerA);\n\t\t\tgame.setTableNumber(0);\n\t\t\tgame.setResult(ChesspairingResult.NOT_DECIDED);\n\t\t\treturn game;\n\t\t}\n\t\tthrow new IllegalStateException(\"You have tried to generate a game that was not legal\");\n\t}",
"public CourseGrade(LetterGrade lettergrade) {\r\n\t\t\r\n\t\t// Set the private instance variable\r\n\t\tprivateLetterGrade = lettergrade;\r\n\t\t\r\n\t\tswitch(lettergrade)\r\n\t\t{\r\n\t\t\tcase A:\r\n\t\t\tcase A_PLUS:\r\n\t\t\tcase A_MINUS:\r\n\t\t\tcase B:\r\n\t\t\tcase B_PLUS:\r\n\t\t\tcase B_MINUS:\r\n\t\t\tcase C:\r\n\t\t\tcase C_PLUS:\r\n\t\t\tcase C_MINUS:\r\n\t\t\t\tpassing = true;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}",
"private ArrayList<ViewGradeListItem> get_grades(int selected_course_id){\n ArrayList<ViewGradeListItem> grades = new ArrayList<ViewGradeListItem>();\n\n List<GradeCategory> categories = AppDatabase.getAppDatabase(ViewGradeListActivity.this).\n gradeCategoryDAO().getCategoriesByCourseID(selected_course_id);\n\n List<Grade> grade_list = AppDatabase.getAppDatabase(ViewGradeListActivity.this).\n gradeDAO().getGradesByCourseIDAndUserID(selected_course_id, user_id);\n\n\n Map<Integer, Integer> grades_map = new HashMap<Integer, Integer>();\n\n for (Grade g: grade_list){\n grades_map.put(g.getAssignmentID(), g.getScore());\n }\n\n ArrayList<Pair<Float, Float>> grade_scores = new ArrayList<>();\n float max_weight = 0;\n\n for (GradeCategory c: categories){\n ViewGradeListItem cat = new ViewGradeListItem(true, c.getTitle(), c.getCategoryID(), -1, null);\n grades.add(cat);\n\n int max_category_score = 0;\n int earned_category_score = 0;\n\n List<Assignment> assignments = AppDatabase.getAppDatabase(ViewGradeListActivity.this).\n assignmentDAO().getAssignmentsByCategory(c.getCategoryID());\n\n for (Assignment a: assignments){\n int a_max = a.getMaxScore();\n max_category_score += a_max;\n\n Integer a_earned = grades_map.get(a.getAssignmentID());\n\n Float earned_percentage = null;\n if (a_earned == null){\n a_earned = 0;\n } else {\n earned_percentage = utils.calculate_percentage(a_earned, a_max);\n }\n grades.add(new ViewGradeListItem(false, a.getAssTitle(), a.getCategoryID(), a.getAssignmentID(), earned_percentage));\n\n earned_category_score += a_earned;\n }\n float category_percentage = utils.calculate_percentage(earned_category_score, max_category_score);\n cat.set_grade(category_percentage);\n\n max_weight += c.getWeight();\n grade_scores.add(Pair.create(c.getWeight(), category_percentage));\n\n }\n\n Float total_percentage = null;\n if (max_weight != 0){\n total_percentage = 0f;\n for (Pair<Float, Float> s: grade_scores){\n total_percentage += (s.first/max_weight) * s.second;\n }\n }\n\n grades.add(new ViewGradeListItem(true, \"Total\", -1, -1, total_percentage));\n return grades;\n }",
"@Test\n public void testCompare() {\n AantalGastenComparator instance = new AantalGastenComparator();\n int expResult;\n int result;\n \n //test 1\n Accommodatie a1 = new Accommodatie(\"je moeder\", 30.00, 2, 1);\n Accommodatie a2 = new Accommodatie(\"je vader\", 40.00, 3, 1);\n expResult = -1;\n result = instance.compare(a1, a2);\n assertEquals(expResult, result);\n \n \n //test 2\n Accommodatie a3 = new Accommodatie(\"je moeder2\", 30.00, 2, 1);\n Accommodatie a4 = new Accommodatie(\"je vader2\", 40.00, 2, 1);\n expResult = 0;\n result = instance.compare(a3, a4);\n assertEquals(expResult, result);\n \n \n //test 3\n Accommodatie a5 = new Accommodatie(\"je moeder3\", 30.00, 3, 1);\n Accommodatie a6 = new Accommodatie(\"je vader3\", 40.00, 2, 1);\n expResult = 1;\n result = instance.compare(a5, a6);\n assertEquals(expResult, result);\n }",
"@Test\n public void testConstructor() {\n final double DELTA = 0; //Used for stating precision of assertEquals for 2 doubles\n //Currently it's set to 0 which means the 2 doubles have to be the exact same\n\n System.out.println(\"\\nStarting GradeType Test: constructor\");\n\n GradeType gt = new GradeType(1, \"A+\", 4.5);\n assertNotNull(gt);\n assertEquals(\"ID was assigned incorrectly\", 1, gt.getId());\n assertEquals(\"Name was assigned incorrectly\", \"A+\", gt.getName());\n assertEquals(\"Points was assigned incorrectly\", 4.5, gt.getPoints(), DELTA);\n\n System.out.println(\"Finished GradeType Test: constructor\");\n }",
"public void compare(){\n\t\tboolean gameOver = false;\n\t\tfor (int j = 0; j < player.size(); j++){\n\t\t\t/**\n\t\t\t * gameover screen\n\t\t\t */\n\t\t\tif (player.get(j) != input.get(j)){\n\t\t\t\tif (score <= 3){JOptionPane.showMessageDialog(pane, \"Game Over!\\n\" + \"You got the rank \"\n\t\t\t\t\t\t+ \"of a Joker with a score of \" + score + '.');}\n\t\t\t\telse if (score > 3 && score <= 10){JOptionPane.showMessageDialog(pane, \"Game Over!\\n\" +\n\t\t\t\t\"You got the ranking of a Knight with a score of \" + score + '.');}\n\t\t\t\telse if (score > 10 && score <=20){JOptionPane.showMessageDialog(pane, \"Game Over!\\n\" +\n\t\t\t\t\"You got the ranking of a King with a score of \" + score + '.');}\n\t\t\t\telse if (score >20){JOptionPane.showMessageDialog(pane, \"Game Over!\\n\" +\n\t\t\t\t\"You got the ranking of a Master with a score of \" + score + '.');}\n\t\t\t\tgameOver = true;\n\t\t\t\tif (score > highScore){\n\t\t\t\t\thighScore = score;\n\t\t\t\t\tscoreBoard.setHighScore(highScore);\n\t\t\t\t}\n\t\t\t\tplayer.clear();\n\t\t\t\tinput.clear();\n\t\t\t\tlist();\n\t\t\t\t++totalGames;\n\t\t\t\tfindGames();\n\t\t\t\tfindAvg();\n\t\t\t\tscore = 0;\n\t\t\t\tscoreBoard.setScore(score);\n\t\t\t}\n\t\t}\n\t\t/**\n\t\t * starts new round after a successful round\n\t\t */\n\t\tif (player.size() == input.size() && !gameOver){\n\t\t\tplayer.clear();\n\t\t\tscore++;\n\t\t\tscoreBoard.setScore(score);\n\t\t\tstartGame();\n\t\t\t}\n\t}",
"@Test\r\n\tpublic void getAllGradesWithAdjustementTest()\r\n\t\t\tthrows ClassNotFoundException, SonarqubeDataBaseException, SQLException, IOException {\r\n\t\tmapQuality.put(\"Comments\", new ModelValue(25f, 5f));\r\n\t\tlistAllGrades.put(\"FinalGrade\", 10.5f);\r\n\t\tAssert.assertEquals(UtilCalculGrade.getAllGrades(mapQuality, listScoreMetricStudent, listScoreMetricTeacher,\r\n\t\t\t\tmapConf, mapIssues, projectName, idModule).get(\"FinalGrade\"), listAllGrades.get(\"FinalGrade\"));\r\n\t}",
"public char Grading(RegCourse a){\n\t\t//CODE HERE\n\t\t\t\t\tif(a.getAccumScore()>=0.8&&a.getAccumScore()<=1){\n\t\t\t\t\t\t\n\t\t\t\t\t\ta.setGrade(4.00);\n\t\t\t\t\t\treturn 'A';\n\t\t\t\t\t}else if(a.getAccumScore()>=0.7&&a.getAccumScore()<0.8){\n\t\t\t\t\t\t\n\t\t\t\t\t\ta.setGrade(3.00);\n\t\t\t\t\t\treturn 'B';\n\t\t\t\t\t}else if(a.getAccumScore()>=0.6&&a.getAccumScore()<0.7){\n\t\t\t\t\t\t\n\t\t\t\t\t\ta.setGrade(2.00);\n\t\t\t\t\t\treturn 'C';\n\t\t\t\t\t}else if(a.getAccumScore()>=0.5&&a.getAccumScore()<0.6){\n\t\t\t\t\t\t\n\t\t\t\t\t\ta.setGrade(1.00);\n\t\t\t\t\t\treturn 'D';\n\t\t\t\t\t}else {\n\t\t\t\t\t\t\n\t\t\t\t\t\ta.setGrade(0.00);\n\t\t\t\t\t\treturn 'F';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\n\t\t\n\t}",
"public double computeHeuristicGrade();",
"protected abstract boolean canGenerateScore();",
"private void rouletteSelection() {\n parentChromosomes = new Chromosome[2];\n parentIndices = new int[2];\n Arrays.fill(parentChromosomes, null);\n parentIndices[0] = getFittestChromosomeIndex();\n parentChromosomes[0] = chromosomes[parentIndices[0]];\n parentIndices[1] = getFittestChromosomeIndex();\n parentChromosomes[1] = chromosomes[parentIndices[1]];\n System.out.println(\"Individuals selected from Roulette Wheel for crossover: \\n\" +\n Arrays.toString(parentChromosomes[0].getGenes()) + \"\\n\" +\n Arrays.toString(parentChromosomes[1].getGenes()));\n }",
"public int compare(Candidate a, Candidate b) \n { \n return b.getNoOfVotes() - a.getNoOfVotes(); \n }",
"static List<Integer> compareTriplets(List<Integer> a, List<Integer> b) {\r\n\t\tList<Integer> val = new ArrayList<>();\r\n\t\tint aScore = 0;\r\n\t\tint bScore = 0;\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\tif (i==j) {\r\n\t\t\t\t\tint tempA = a.get(i);\r\n\t\t\t\t\tint tempB = b.get(j);\r\n\t\t\t\t\tif (!(1<=tempA && tempA<=100 && 1<=tempB && 1<=tempB)) {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (tempA<tempB) {\r\n\t\t\t\t\t\tbScore += 1;\r\n\t\t\t\t\t} else if (tempA>tempB) {\r\n\t\t\t\t\t\taScore += 1;\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\t\r\n\t\tval.add(aScore);\r\n\t\tval.add(bScore);\r\n\t\treturn val;\r\n\t}",
"@Override\n\tpublic int compare(Person o1, Person o2) {\n\t\t\n\t\treturn o1.payGrade - o2.payGrade;\n\n\t}",
"@Test\n public void checkIfPassportAndDefaultCombinationReturnsHighConfidencePassport() {\n triplets.add(new Triplets<String, Integer, Double>(\"dummy\", 1, 90.00));\n triplets.add(new Triplets<String, Integer, Double>(\"passport\", 2, 90.00));\n triplets.add(new Triplets<String, Integer, Double>(\"passport\", 3, 190.00));\n Triplets<String, Integer, Double> resultTriplet = Triplets.rankRecords(triplets);\n Assert.assertEquals(\"passport\", resultTriplet.getLabel());\n Assert.assertEquals(new Integer(3), resultTriplet.getImageNumber());\n Assert.assertEquals(new Double(190.00), resultTriplet.getMatchConfidence());\n }",
"public void winner() {\n\t\tList<String> authors = new ArrayList<String>(scores_authors.keySet());\n\t\tCollections.sort(authors, new Comparator<String>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(String o1, String o2) {\n\t\t\t\treturn scores_authors.get(o1).compareTo(scores_authors.get(o2));\n\t\t\t}\n\t\t});\n\t\tSystem.out.println(\"Score des auteurs :\");\n\t\tfor(String a :authors) {\n\t\t\tSystem.out.println(a.substring(0,5)+\" : \"+scores_authors.get(a));\n\t\t}\n\t\t\n\t\tList<String> politicians = new ArrayList<String>(scores_politicians.keySet());\n\t\tCollections.sort(politicians, new Comparator<String>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(String o1, String o2) {\n\t\t\t\treturn scores_politicians.get(o1).compareTo(scores_politicians.get(o2));\n\t\t\t}\n\t\t});\n\t\tSystem.out.println(\"Score des politiciens :\");\n\t\tfor(String p :politicians) {\n\t\t\tSystem.out.println(p.substring(0,5)+\" : \"+scores_politicians.get(p));\n\t\t}\n\t}",
"@Test\n void testForLargestCardInTrickComparingRank() {\n Dealer testDealer = new Dealer();\n\n Suit suit1 = Suit.DIAMONDS;\n Suit suit2 = Suit.SPADES;\n Suit suit3 = Suit.DIAMONDS;\n Suit suit4 = Suit.DIAMONDS;\n \n Rank rank1 = Rank.TWO;\n Rank rank2 = Rank.KING;\n Rank rank3 = Rank.ACE;\n Rank rank4 = Rank.FIVE;\n\n Card card1 = new Card(suit1,rank1,false);\n Card card2 = new Card(suit2,rank2,false);\n Card card3 = new Card(suit3,rank3,false);\n Card card4 = new Card(suit4,rank4,false);\n\n \n testDealer.addToPlayedCards(card1);\n testDealer.addToPlayedCards(card2);\n testDealer.addToPlayedCards(card3);\n testDealer.addToPlayedCards(card4);\n\n assertEquals(card3 , testDealer.getLargestCardFromTrick());\n }",
"@Override\n public int compare(Student s1, Student s2) {\n return (int)(1000*(s2.getGPA()-s1.getGPA()));\n }",
"private boolean testIfGameIsValid(ChesspairingGame game) {\n\t\tChesspairingPlayer playerA = game.getWhitePlayer();\n\t\tString keyA = playerA.getPlayerKey();\n\t\tChesspairingPlayer playerB = game.getBlackPlayer();\n\t\tString keyB = playerB.getPlayerKey();\n\t\tif (keyA.equals(keyB)) {\n\t\t\tthrow new IllegalStateException(\"You shuld never try to pare a players agains himself\");\n\t\t}\n\t\t/**\n\t\t * two players shall not meet more than once\n\t\t */\n\t\tList<String> partnersA = partnerHistory.get(keyA);\n\t\tif (partnersA.contains(keyB)) {\n\t\t\treturn false;\n\t\t}\n\t\tList<String> partnersB = partnerHistory.get(keyB);\n\t\tif (partnersB.contains(keyA)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * the color difference is the number of games played with white minus\n\t\t * the number of games played with black\n\t\t * \n\t\t * -2 < diff < 2\n\t\t */\n\t\tint aHistoryColor = getColorDifference(keyA);\n\t\tint bHistoryColor = getColorDifference(keyB);\n\n\t\t// if a is white\n\t\tint aWhite = aHistoryColor + 1;\n\t\tint bBlach = bHistoryColor - 1;\n\t\tboolean aPlaysWite = false;\n\t\tif ((-2 < aWhite) && (aWhite < 2) && (-2 < bBlach) && (bBlach < 2)) {\n\t\t\taPlaysWite = true;\n\t\t}\n\n\t\t// if a is black\n\t\tboolean aPlaysBlack = false;\n\t\tif (!aPlaysWite) {\n\t\t\tint aBlack = aHistoryColor - 1;\n\t\t\tint bWhite = bHistoryColor + 1;\n\t\t\tif ((-2 < aBlack) && (aBlack < 2) && (-2 < bWhite) && (bWhite < 2)) {\n\t\t\t\taPlaysBlack = true;\n\t\t\t}\n\t\t}\n\n\t\tif (!aPlaysWite && !aPlaysBlack) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// basic tests have passed. time to return true\n\t\treturn true;\n\t}",
"public void testCreateExamGrades() {\n double grades[] = new double[10];\n \n for (int i = 0; i < 10; i++) {\n grades[i] = 100 - i;\n }\n \n ExamGrades g = new ExamGrades(grades);\n\n assertEquals(100.0, g.grades[0]);\n assertEquals(91.0, g.grades[9]); \n }",
"private void assignIntoGrade() {\n }",
"@Test\n\tpublic void testAddingPassengerAfterAnotherPassengerBoarding() throws TrainException\n\t{\n\t\tInteger grossWeight = 1;\n\t\tInteger numberOfSeats = 10;\n\t\tInteger newPassengers = 7;\n\t\tInteger addingNewPassenger = 8;\n\t\t\n\t\tasgn2RollingStock.RollingStock passengerCarUnderTest = \n\t\t\tnew asgn2RollingStock.PassengerCar((Integer)grossWeight, (Integer)numberOfSeats);\n\t\t\n\t\tInteger peopleNotGetSeat = ((asgn2RollingStock.PassengerCar)passengerCarUnderTest).board((Integer) newPassengers);\n\t\t\n\t\tpeopleNotGetSeat = ((asgn2RollingStock.PassengerCar)passengerCarUnderTest).board((Integer) addingNewPassenger);\n\t\t\n\t\tInteger expectedPeopleNotGetSeat = newPassengers + addingNewPassenger - numberOfSeats;\n\t\t\n\t\tassertEquals(expectedPeopleNotGetSeat, peopleNotGetSeat);\n\t\t\n\t}",
"@Test\n public void OriginalScoreTest() {\n score = new OriginalScore();\n\n try {\n //Basados en las fronteras\n score.calculateScore(0, 0);\n score.calculateScore(1, 1);\n score.calculateScore(235, 9);\n score.calculateScore(100, 10);\n } catch (HangmanException e) {\n Assert.fail();\n }\n\n try {\n score.calculateScore(-1, -1);\n Assert.fail();\n } catch (HangmanException e) {\n Assert.assertEquals(e.getMessage(), HangmanException.PARAMETROS_NEGATIVOS);\n }\n\n try {\n score.calculateScore(-2, -2);\n Assert.fail();\n } catch (HangmanException e) {\n Assert.assertEquals(e.getMessage(), HangmanException.PARAMETROS_NEGATIVOS);\n }\n\n\n try {\n score.calculateScore(0, 11);\n Assert.fail();\n } catch (HangmanException e) {\n Assert.assertEquals(e.getMessage(), HangmanException.PARAMETRO_LIMITE_PUNTUACION);\n }\n\n try {\n score.calculateScore(0, 12);\n Assert.fail();\n } catch (HangmanException e) {\n Assert.assertEquals(e.getMessage(), HangmanException.PARAMETRO_LIMITE_PUNTUACION);\n }\n try {\n score.calculateScore(20, 11);\n Assert.fail();\n } catch (HangmanException e) {\n Assert.assertEquals(e.getMessage(), HangmanException.PARAMETRO_LIMITE_PUNTUACION);\n }\n }",
"@Override\n\t\tpublic int compare(ScoreSum lhs, ScoreSum rhs) {\n\t\t\tScoreSum temp1 = lhs;\n\t\t\tScoreSum temp2 = rhs;\n\t\t\tint num = temp1.getScore().compareTo(temp2.getScore());\n\t\t\tif (num == 0)\n\t\t\t\treturn temp1.getAthleteName().compareTo(temp2.getAthleteName());\n\t\t\treturn num;\n\t\t}",
"private static void print_Assignment(Gradebook gradebook, String[] flags) {\n //sort grades highest to lowest\n if (flags[3] != null && flags[3].equals(\"G\")) {\n List<Student> studentList = gradebook.getAllStudents();\n Map<Integer, Set<Student>> gradeToName = new HashMap<Integer, Set<Student>>();\n Set<Integer> grades = new HashSet<Integer>();\n\n for(Student s : studentList){\n Assignment assign = gradebook.getAssignment(flags[0]);\n Map<Assignment, Integer> gradeMap = gradebook.getStudentGrades(s);\n Integer grade = gradeMap.get(assign);\n\n Set<Student> studs = gradeToName.get(grade);\n if(studs == null){\n\n studs = new HashSet<Student>();\n }\n\n studs.add(s);\n gradeToName.put(grade, studs);\n grades.add(grade);\n }\n\n List<Integer> sortedList = new ArrayList<Integer>(grades);\n Collections.sort(sortedList, Collections.reverseOrder());\n\n for(Integer i : sortedList){\n Set<Student> studs = gradeToName.get(i);\n for(Student s : studs)\n System.out.println(\"(\" + s.getLast() + \", \" + s.getFirst() + \", \" + i + \")\");\n }\n\n // sort display aplhabetically\n } else if (flags[4] != null && flags[4].equals(\"A\")){\n //compare override class at bottom of file\n List<Student> studentsAlpha = gradebook.getAllStudents();\n Collections.sort(studentsAlpha, new Comparator<Student>() {\n @Override\n public int compare(Student o1, Student o2) {\n if ( o2.getLast().compareToIgnoreCase(o1.getLast()) == 0) {\n return o1.getFirst().compareToIgnoreCase(o2.getFirst());\n } else {\n return o1.getLast().compareToIgnoreCase(o2.getLast());\n }\n }\n });\n\n for (Student stud: studentsAlpha) {\n // flags[0] should be assign name\n System.out.println(\"(\" + stud.getLast() + \", \" + stud.getFirst() + \", \" + gradebook.getPointsAssignment(stud, gradebook.getAssignment(flags[0])) + \")\");\n }\n\n } else {\n throw new IllegalArgumentException(\"Please specify if you want the display to be alphabetical or by grades highest to lowest.\");\n }\n return;\n }",
"@Test\n\tpublic void testAddScoreAndGetWinner2() throws BattleshipException {\n\t\t\n\t\t//Play Julia\n\t\tinitScores(playerJulia);\n\t\t\t\n\t\t//Julia realiza 46 disparos a distintos Crafts y destruye 46 Destroyer, 10 Cruiser y 5 Bomber\n\t\tfor (int i=0; i<46; i++) {\n\t\t\thitScore.score(CellStatus.HIT);\n\t\t\tcraftScore.score(CraftFactory.createCraft(\"ship.Destroyer\", Orientation.NORTH));\n\t\t\tif (i<10) craftScore.score(CraftFactory.createCraft(\"ship.Cruiser\", Orientation.WEST));\n\t\t\tif (i<5) craftScore.score(CraftFactory.createCraft(\"aircraft.Bomber\", Orientation.EAST));\n\t\t}\n\t\tcraftRanking.addScore(craftScore);\n\t\thitRanking.addScore(hitScore);\n\t\tcompareScores(\"Julia(PlayerFile):263\",craftRanking.getWinner().toString());\t\n\t\tcompareScores(\"Julia(PlayerFile):46\",hitRanking.getWinner().toString());\n\t\t\n\t\t//Play Raul\n\t\tinitScores(playerRaul);\n\t\t//Raul realiza 45 disparos a distintos Crafts y destruye 10 Carrier, 30 Battleship y 5 Fighter\n\t\tfor (int i=0; i<45; i++) {\n\t\t\thitScore.score(CellStatus.HIT);\n\t\t\tif (i<30) craftScore.score(CraftFactory.createCraft(\"ship.Battleship\", Orientation.NORTH));\n\t\t\tif (i<10) craftScore.score(CraftFactory.createCraft(\"ship.Carrier\", Orientation.WEST));\n\t\t\tif (i<5) craftScore.score(CraftFactory.createCraft(\"aircraft.Fighter\", Orientation.EAST));\n\t\t}\n\t\t\n\t\tcraftRanking.addScore(craftScore);\n\t\thitRanking.addScore(hitScore);\n\t\tcompareScores(\"Raul(PlayerRandom):310\",craftRanking.getWinner().toString());\t\n\t\tcompareScores(\"Julia(PlayerFile):46\",hitRanking.getWinner().toString());\n\t\t\n\t\t//Play Laura\n\t\tinitScores(playerLaura);\n\t\t//Laura realiza 120 disparos a distintos Crafts y destruye 30 Battleship, 10 Cruiser y 5 Fighter\n\t\tfor (int i=0; i<120; i++) {\n\t\t\thitScore.score(CellStatus.HIT);\n\t\t\tif (i<30) craftScore.score(CraftFactory.createCraft(\"ship.Battleship\", Orientation.EAST));\n\t\t\tif (i<10) craftScore.score(CraftFactory.createCraft(\"ship.Cruiser\", Orientation.WEST));\n\t\t\tif (i<5) craftScore.score(CraftFactory.createCraft(\"aircraft.Fighter\", Orientation.SOUTH));\n\t\t}\n\t\tcraftRanking.addScore(craftScore);\n\t\thitRanking.addScore(hitScore);\n\t\tcompareScores(\"Raul(PlayerRandom):310\",craftRanking.getWinner().toString());\t\n\t\tcompareScores(\"Laura(PlayerRandom):120\",hitRanking.getWinner().toString());\n\t\t\n\t\t//Play Simon\n\t\tinitScores(playerSimon);\n\t\t//Simon realiza 100 disparos a distintos Crafts y destruye 40 Bomber, 15 Destroyer y 75 Transport\n\t\tfor (int i=0; i<100; i++) {\n\t\t\thitScore.score(CellStatus.DESTROYED);\n\t\t\tif (i<40) craftScore.score(CraftFactory.createCraft(\"aircraft.Bomber\", Orientation.NORTH));\n\t\t\tif (i<15) craftScore.score(CraftFactory.createCraft(\"ship.Destroyer\", Orientation.WEST));\n\t\t\tif (i<75) craftScore.score(CraftFactory.createCraft(\"aircraft.Transport\", Orientation.EAST));\n\t\t}\n\t\tcraftRanking.addScore(craftScore);\n\t\thitRanking.addScore(hitScore);\n\t\tcompareScores(\"Simon(PlayerFile):1995\",craftRanking.getWinner().toString());\t\n\t\tcompareScores(\"Laura(PlayerRandom):120\",hitRanking.getWinner().toString());\n\t\tcompareRankings(SRANKING4, rankingsToString());\n\t}",
"private boolean makeMoveByMin(Mancala mancalaGame, int choice) {\n \r\n int length = mancalaGame.boardForA.length * 2 + 1;\r\n int[] tempArray = new int[length];\r\n \r\n int j = 0;\r\n for(int i = 0; i < mancalaGame.boardForA.length; i++) {\r\n tempArray[j++] = mancalaGame.boardForA[i];\r\n }\r\n tempArray[j++] = mancalaGame.countForA;\r\n for(int i = mancalaGame.boardForB.length - 1; i >= 0; i--) {\r\n tempArray[j++] = mancalaGame.boardForB[i];\r\n }\r\n \r\n // start from the index choice-1, and distribute\r\n \r\n j = choice;\r\n int lastIndex = -1;\r\n int count = tempArray[choice - 1];\r\n tempArray[choice - 1] = 0;\r\n \r\n while(count-- != 0) {\r\n lastIndex = j;\r\n tempArray[j]++;\r\n j++;\r\n if(j == length) {\r\n j = 0;\r\n }\r\n }\r\n \r\n // copy back everything into the game\r\n \r\n j = 0;\r\n for(int i = 0; i < mancalaGame.boardForA.length; i++) {\r\n mancalaGame.boardForA[i] = tempArray[j++];\r\n }\r\n mancalaGame.countForA = tempArray[j++];\r\n for(int i = mancalaGame.boardForB.length - 1; i >= 0; i--) {\r\n mancalaGame.boardForB[i] = tempArray[j++];\r\n }\r\n \r\n // determine capture\r\n \r\n if(lastIndex < mancalaGame.boardForA.length && lastIndex >= 0 && tempArray[lastIndex] == 1 && mancalaGame.boardForA[lastIndex] != 0) {\r\n mancalaGame.countForA += mancalaGame.boardForB[lastIndex];\r\n mancalaGame.countForA++;\r\n mancalaGame.boardForB[lastIndex] = 0;\r\n mancalaGame.boardForA[lastIndex] = 0;\r\n }\r\n \r\n // determine free turn\r\n \r\n if(lastIndex == Mancala.boardLength) {\r\n mancalaGame.turn = (mancalaGame.turn + 1) % 2;\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n \r\n }",
"@Test\r\n public void testPlayer_setRandomStrategy_2() {\r\n player2 = new Player(\"\", true);\r\n player2.setRandomStrategy();\r\n String firstStrategy = player2.getStrategy();\r\n boolean strategyReplaced = false;\r\n // generate 20 random strategies and assert at least one of them comes back different.\r\n for(int i = 0; i < 20; i++) {\r\n player2.setRandomStrategy();\r\n if (!player2.getStrategy().equalsIgnoreCase(firstStrategy)) {\r\n strategyReplaced = true;\r\n }\r\n }\r\n assertTrue(strategyReplaced);\r\n }",
"public static Constraints twoDegreesOfFreedom(final Holder holderOrig,\n \t\t\t\t\t\t\t\t\t\t \t final boolean printOutput) throws IOException{\n\n //initialize the running solution and constraints\n Holder holder = new Holder(holderOrig);\n Constraints constraints = holder.getConstraints();\n CurrentSolution currentSolution = holder.getCurrentSolution();\n List<Cell> candidateCells = new ArrayList<Cell>();\n for (Cell candidateCell : currentSolution.getCells()) {\n if (!constraints.getCells().contains(candidateCell)) {\n candidateCells.add(candidateCell);\n }\n }\n\n //select two different cells at random\n Cell changedCell1;\n Cell changedCell2;\n int cellPos1 = (int) Math.round(Math.random()\n * (candidateCells.size() - 1));\n int cellPos2;\n int dim = constraints.getDim();\n do {\n cellPos2 = (int) Math.round(Math.random()\n * (candidateCells.size() - 1));\n changedCell1 = candidateCells.get(cellPos1);\n changedCell2 = candidateCells.get(cellPos2);\n } while ((cellPos1 == cellPos2) ||\n (changedCell1.getxCoord() == changedCell2.getxCoord()) ||\n (changedCell1.getyCoord() == changedCell2.getyCoord()) ||\n (changedCell1.getBox(dim) == changedCell2.getBox(dim))\n );\n\n //set up lists of possible values for the test cells\n List<Integer> candidateValues1 = new ArrayList<Integer>();\n for (Integer candidateVal : changedCell1.getValues()) {\n candidateValues1.add(candidateVal);\n }\n List<Integer> candidateValues2 = new ArrayList<Integer>();\n for (Integer candidateVal : changedCell2.getValues()) {\n candidateValues2.add(candidateVal);\n }\n\n //iterate through possible values of the two test cells, and test what\n //result each combination of values leads to\n for (Integer candidateVal1 : candidateValues1) {\n changedCell1.getValues().clear();\n changedCell1.getValues().add(candidateVal1);\n for (Integer candidateVal2 : candidateValues2) {\n changedCell2.getValues().clear();\n changedCell2.getValues().add(candidateVal2);\n if (printOutput) {\n \tSystem.out.println(\"Setting cell at x = \"\n \t\t\t+ (changedCell1.getxCoord() + 1)\n \t\t\t+ \" y = \" + (changedCell1.getyCoord() + 1)\n \t\t\t+ \" to value \" + candidateVal1.toString());\n \tSystem.out.println(\"Setting cell at x = \"\n \t\t\t+ (changedCell2.getxCoord() + 1)\n \t\t\t+ \" y = \" + (changedCell2.getyCoord() + 1)\n \t\t\t+ \" to value \" + candidateVal2.toString());\n }\n constraints = updateConstraints(constraints, changedCell1,\n changedCell1.getValues());\n constraints = updateConstraints(constraints, changedCell2,\n changedCell2.getValues());\n holder.setConstraints(constraints);\n\n //test whether current values of test cells lead to a final solution\n holder = iterativeUpdateConstraints(holder, false, printOutput);\n constraints = holder.getConstraints();\n if (constraints.getCells().size()\n == (constraints.getDimSq() * constraints.getDimSq())) {\n \treturn constraints;\n } else {\n constraints.getCells().remove(changedCell1);\n constraints.getCells().remove(changedCell2);\n }\n }\n }\n return null;\n }",
"@Test\n \tpublic void testCheckingAccusation() {\n \t\t//Set answer\n \t\tSolution answer = new Solution(\"Colonel Mustard\", \"Knife\", \"Library\");\n \t\tSolution guess = new Solution(\"Colonel Mustard\", \"Knife\", \"Library\");\n \t\tgame.setAnswer(answer);\n \t\t//Check correct accusation\n \t\t//correct if it contains the correct person, weapon and room\n \t\tAssert.assertTrue(game.checkAccusation(guess));\n \t\t//Check false accusation\n \t\t//not correct if the room is wrong, or if the person is wrong, if the weapon is wrong, or if all three are wrong\n \t\t//wrong room\n \t\tguess = new Solution(\"Colonel Mustard\", \"Knife\", \"Billiards Room\");\n \t\tAssert.assertFalse(game.checkAccusation(guess));\n \t\t//wrong weapon\n \t\tguess = new Solution(\"Colonel Mustard\", \"Lead Pipe\", \"Library\");\n \t\tAssert.assertFalse(game.checkAccusation(guess));\n \t\t//wrong person\n \t\tguess = new Solution(\"Ms. Peacock\", \"Knife\", \"Library\");\n \t\tAssert.assertFalse(game.checkAccusation(guess));\n \t}",
"private void coins_a2G(){\n\t\tthis.cube[31] = this.cube[11]; \n\t\tthis.cube[11] = this.cube[2];\n\t\tthis.cube[2] = this.cube[38];\n\t\tthis.cube[38] = this.cube[47];\n\t\tthis.cube[47] = this.cube[31];\n\t}",
"@Test\n public void testRunScoringScenario() throws Exception\n {\n YahtzeeModel y1 = new YahtzeeModel();\n\n //Turn 1\n y1.getDiceCollection().setValues(1, 1, 3, 3, 3);\n assertEquals(2, y1.scoreOnes());\n //Turn 2\n y1.getDiceCollection().setValues(2, 1, 2, 2, 3);\n assertEquals(6, y1.scoreTwos());\n //Turn 3\n y1.getDiceCollection().setValues(2, 1, 2, 2, 3);\n assertEquals(3, y1.scoreThrees());\n //Turn 4\n y1.getDiceCollection().setValues(2, 1, 2, 2, 3);\n assertEquals(0, y1.scoreFours());\n //Turn 5\n y1.getDiceCollection().setValues(2, 1, 2, 2, 5);\n assertEquals(5, y1.scoreFives());\n //Turn 6\n y1.getDiceCollection().setValues(6, 6, 6, 6, 6);\n assertEquals(30, y1.scoreSixes());\n //3 of a kind\n y1.getDiceCollection().setValues(2, 1, 2, 2, 3);\n assertEquals(10, y1.scoreThreeOfAKind());\n //4 of a kind\n y1.getDiceCollection().setValues(2, 2, 2, 2, 2);\n assertEquals(10, y1.scoreFourOfAKind());\n //full house\n y1.getDiceCollection().setValues(6, 4, 6, 4, 6);\n assertEquals(25, y1.scoreFullHouse());\n //small straight\n y1.getDiceCollection().setValues(6, 6, 6, 6, 6);\n assertEquals(0, y1.scoreSmallStraight());\n //large straight\n y1.getDiceCollection().setValues(2, 1, 2, 2, 3);\n assertEquals(0, y1.scoreLargeStraight());\n //yahtzee\n y1.getDiceCollection().setValues(2, 2, 2, 2, 2);\n assertEquals(50, y1.scoreYahtzee());\n //chance\n y1.getDiceCollection().setValues(6, 1, 1, 1, 1);\n assertEquals(10, y1.scoreChance());\n\n //calculate bonus and verify bonus\n assertEquals(0, y1.scoreBonus());\n\n //verify that the available scoring types has one entry for YAHTZEE since it was scored\n assertEquals(1, y1.getScoreCard().getAvailableScoreTypes().size());\n assertTrue(y1.getScoreCard().getAvailableScoreTypes().contains(YahtzeeScoreTypes.YAHTZEE));\n\n //verify final score\n assertEquals(151, y1.getScoreCard().getScore());\n\n\n //*** Game 2: 0 Bonus, 2 Yahtzee ***\n YahtzeeModel y2 = new YahtzeeModel();\n\n //Turn 1\n y2.getDiceCollection().setValues(1, 1, 1, 1, 1);\n assertEquals(50, y2.scoreYahtzee());\n //Turn 2\n y2.getDiceCollection().setValues(2, 1, 2, 2, 3);\n assertEquals(6, y2.scoreTwos());\n //Turn 3\n y2.getDiceCollection().setValues(2, 1, 2, 2, 3);\n assertEquals(3, y2.scoreThrees());\n //Turn 4\n y2.getDiceCollection().setValues(2, 1, 2, 2, 3);\n assertEquals(0, y2.scoreFours());\n //Turn 5\n y2.getDiceCollection().setValues(2, 1, 2, 2, 5);\n assertEquals(5, y2.scoreFives());\n //Turn 6\n y2.getDiceCollection().setValues(6, 6, 6, 6, 6);\n assertEquals(30, y2.scoreSixes());\n //3 of a kind\n y2.getDiceCollection().setValues(2, 1, 2, 2, 3);\n assertEquals(10, y2.scoreThreeOfAKind());\n //4 of a kind\n y2.getDiceCollection().setValues(2, 2, 2, 2, 2);\n assertEquals(10, y2.scoreFourOfAKind());\n //full house\n y2.getDiceCollection().setValues(6, 4, 6, 4, 6);\n assertEquals(25, y2.scoreFullHouse());\n //small straight\n y2.getDiceCollection().setValues(6, 6, 6, 6, 6);\n assertEquals(0, y2.scoreSmallStraight());\n //large straight\n y2.getDiceCollection().setValues(2, 1, 2, 2, 3);\n assertEquals(0, y2.scoreLargeStraight());\n //yahtzee\n y2.getDiceCollection().setValues(2, 2, 2, 2, 2);\n assertEquals(100, y2.scoreYahtzee());\n //chance\n y2.getDiceCollection().setValues(6, 1, 1, 1, 1);\n assertEquals(10, y2.scoreChance());\n\n //calculate bonus and verify bonus\n assertEquals(0, y2.scoreBonus());\n\n //verify that the available scoring types has two entres...\n // one for YAHTZEE and one for ONES\n assertEquals(2, y2.getScoreCard().getAvailableScoreTypes().size());\n assertTrue(y2.getScoreCard().getAvailableScoreTypes().contains(YahtzeeScoreTypes.ONES));\n assertTrue(y2.getScoreCard().getAvailableScoreTypes().contains(YahtzeeScoreTypes.YAHTZEE));\n\n //verify final score\n assertEquals(249, y2.getScoreCard().getScore());\n\n //*** Game 3: 1 Bonus, 0 Yahtzee ***\n YahtzeeModel y3 = new YahtzeeModel();\n\n //Turn 1\n y3.getDiceCollection().setValues(1, 1, 1, 1, 1);\n assertEquals(5, y3.scoreOnes());\n //Turn 2\n y3.getDiceCollection().setValues(2, 1, 2, 2, 3);\n assertEquals(6, y3.scoreTwos());\n //Turn 3\n y3.getDiceCollection().setValues(3, 3, 2, 2, 3);\n assertEquals(9, y3.scoreThrees());\n //Turn 4\n y3.getDiceCollection().setValues(2, 4, 4, 4, 3);\n assertEquals(12, y3.scoreFours());\n //Turn 5\n y3.getDiceCollection().setValues(2, 5, 2, 2, 5);\n assertEquals(10, y3.scoreFives());\n //Turn 6\n y3.getDiceCollection().setValues(6, 6, 6, 6, 6);\n assertEquals(30, y3.scoreSixes());\n //3 of a kind\n y3.getDiceCollection().setValues(2, 1, 2, 2, 3);\n assertEquals(10, y3.scoreThreeOfAKind());\n //4 of a kind\n y3.getDiceCollection().setValues(2, 2, 2, 2, 2);\n assertEquals(10, y3.scoreFourOfAKind());\n //full house\n y3.getDiceCollection().setValues(6, 4, 6, 4, 6);\n assertEquals(25, y3.scoreFullHouse());\n //small straight\n y3.getDiceCollection().setValues(6, 6, 6, 6, 6);\n assertEquals(0, y3.scoreSmallStraight());\n //large straight\n y3.getDiceCollection().setValues(2, 1, 2, 2, 3);\n assertEquals(0, y3.scoreLargeStraight());\n //yahtzee\n y3.getDiceCollection().setValues(2, 1, 2, 2, 2);\n assertEquals(0, y3.scoreYahtzee());\n //chance\n y3.getDiceCollection().setValues(6, 1, 1, 1, 1);\n assertEquals(10, y3.scoreChance());\n\n //calculate bonus and verify bonus\n assertEquals(35, y3.scoreBonus());\n\n //verify that no scoring types remain\n assertEquals(0, y3.getScoreCard().getAvailableScoreTypes().size());\n\n //verify final score\n assertEquals(162, y3.getScoreCard().getScore());\n }",
"public int score() {\n int sum = 0;\n for (Candidate c : chosen) {\n sum += c.score(compatibilityScoreSet);\n }\n return sum;\n }",
"@Test(expected = IllegalArgumentException.class)\r\n\tpublic void outfromNumGradeTest2(){\r\n\t\tPointGrade.fromNumGrade(101);\r\n\t}",
"public float calculateGrade() {\r\n\t\t// Creating variables for correct answers, total questions and the grade itself.\r\n\t\tint correct = 0;\r\n\t\tint total = correctAnswers.size();\r\n\t\tfloat grade = 0;\r\n\t\t// Loop that goes around the list with user's answers and correct answers.\r\n\t\tfor (int i = 0; i < correctAnswers.size(); i++) {\r\n\t\t\t// Creating variable result which compare the elements from the two list index\r\n\t\t\t// by index.\r\n\t\t\tint result = (userAnswers.get(i).compareTo(correctAnswers.get(i)));\r\n\t\t\t// Condition that increments the variable correct with one every time when there\r\n\t\t\t// is match between the lists' elements by index.\r\n\t\t\tif (result == 0) {\r\n\t\t\t\tcorrect++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Calculating the grade of the student.\r\n\t\tgrade = (float) ((double) correct / total * 100);\r\n\t\treturn grade;\r\n\t}",
"public void testScoreboardCaseOne () throws Exception {\n // RunID TeamID Prob Time Result\n \n String [] runsData = {\n \"1,1,A,1,No\", // 20 (a No before first yes)\n \"2,1,A,3,Yes\", // 3 (first yes counts Minute points but never Run Penalty points)\n \"3,1,A,5,No\", // zero -- after Yes\n \"4,1,A,7,Yes\", // zero -- after Yes\n \"5,1,A,9,No\", // zero -- after Yes\n \"6,1,B,11,No\", // zero -- not solved\n \"7,1,B,13,No\", // zero -- not solved\n \"8,2,A,30,Yes\", // 30 (minute points; no Run points on first Yes)\n \"9,2,B,35,No\", // zero -- not solved\n \"10,2,B,40,No\", // zero -- not solved\n \"11,2,B,45,No\", // zero -- not solved\n \"12,2,B,50,No\", // zero -- not solved\n \"13,2,B,55,No\", // zero -- not solved\n };\n \n // Rank TeamId Solved Penalty\n \n String [] rankData = {\n \"1,team1,1,23\",\n \"2,team2,1,30\"\n };\n \n scoreboardTest (2, runsData, rankData);\n }",
"public void gpaConverter() {\r\n\t\tdouble numGPA = this.getNumGrade();\r\n\t\ttry {\r\n\t\t\tif (numGPA >= 4.0) {\r\n\t\t\t\tthis.letterGrade = \"A\"; }\r\n\t\t\tif (3.7 <= numGPA && numGPA < 4.0) {\r\n\t\t\t\tthis.letterGrade = \"A-\"; \r\n\t\t\t}\r\n\t\t\tif (3.3 <= numGPA && numGPA < 3.7) {\r\n\t\t\t\tthis.letterGrade = \"B+\";\r\n\t\t\t}\r\n\t\t\tif (3.0 <= numGPA && numGPA < 3.3) {\r\n\t\t\t\tthis.letterGrade = \"B\";\r\n\t\t\t}\r\n\t\t\tif (2.7 <= numGPA && numGPA < 3.0) {\r\n\t\t\t\tthis.letterGrade = \"B-\";\r\n\t\t\t}\r\n\t\t\tif (2.3 <= numGPA && numGPA < 2.7) {\r\n\t\t\t\tthis.letterGrade = \"C+\";\r\n\t\t\t}\r\n\t\t\tif (2.0 <= numGPA && numGPA < 2.3) {\r\n\t\t\t\tthis.letterGrade = \"C\";\r\n\t\t\t}\r\n\t\t\tif (1.7 <= numGPA && numGPA < 2.0) {\r\n\t\t\t\tthis.letterGrade = \"C-\";\r\n\t\t\t}\r\n\t\t\tif (1.3 <= numGPA && numGPA < 1.7) {\r\n\t\t\t\tthis.letterGrade = \"D+\";\r\n\t\t\t}\r\n\t\t\tif (1.0 <= numGPA && numGPA < 1.3) {\r\n\t\t\t\tthis.letterGrade = \"D\";\r\n\t\t\t}\r\n\t\t\tif (0.7 <= numGPA && numGPA < 1.0) {\r\n\t\t\t\tthis.letterGrade = \"D-\";\r\n\t\t\t}\r\n\t\t\tif (0.0 <= numGPA && numGPA < 0.7) {\r\n\t\t\t\tthis.letterGrade = \"F\";\r\n\t\t\t} \r\n\t\t}\r\n\t\tcatch (InputMismatchException e) {\r\n\t\t\tSystem.out.print(\"Input Mismatch Exception \");\r\n\t\t}\r\n\t\tcatch (NumberFormatException e) {\r\n\t\t\tSystem.out.print(\"Number Format Exception \");\r\n\t\t}\r\n\t\tcatch (Exception e) {}\r\n\t}",
"@Test\n\tpublic void addScoreTest() {\n\t\tassertEquals(\"80.0 75.0 \", g1.toString());\n\t\tassertEquals(\"64.0 90.0 72.0 \", g2.toString());\n\t\tassertEquals(\"82.0 52.0 92.0 72.0 \", g3.toString());\n\t}",
"protected double newCompundScore(double score, double score2) {\n return score + score2;\n }",
"public void checkScore() {\n\n whatIsTurnScore();\n\n if (turn == 1) {\n\n if ((p1.getScore() - turnScore < 0) || (p1.getScore() - turnScore == 1)) {\n newScore.setText(null);\n\n displayScore();\n\n\n Toast.makeText(this, \"Bust\", Toast.LENGTH_SHORT).show();\n } else if (p1.getScore() - turnScore > 1) {\n if ((turnScore > 99) && (turnScore < 140)) {\n p1.setHundres(p1.getHundres() + 1);\n } else if ((turnScore > 139) && (turnScore < 180)) {\n p1.setOneforties(p1.getOneforties() + 1);\n } else if (turnScore == 180) {\n p1.setOneeighties(p1.getOneeighties() + 1);\n }\n calculateScore();\n\n\n displayScore();\n } else if (p1.getScore() - turnScore == 0) {\n p1.setScore(0);\n }\n }\n\n if (turn == 2) {\n if ((p2.getScore() - turnScore < 0) || (p2.getScore() - turnScore == 1)) {\n newScore.setText(null);\n teamBCheckout.setText(checkOut(p2.getScore()));\n displayScore();\n\n\n Toast.makeText(this, \"Bust\", Toast.LENGTH_SHORT).show();\n } else if (p2.getScore() - turnScore > 1) {\n\n if ((turnScore > 99) && (turnScore < 140)) {\n p2.setHundres(p2.getHundres() + 1);\n } else if ((turnScore > 139) && (turnScore < 180)) {\n p2.setOneforties(p2.getOneforties() + 1);\n } else if (turnScore == 180) {\n p2.setOneeighties(p2.getOneeighties() + 1);\n }\n calculateScore();\n\n displayScore();\n\n } else if (p2.getScore() - turnScore == 0) {\n p2.setScore(0);\n }\n\n }\n\n\n }",
"@Test\n\tpublic void testAssignGrade3() {\n\t\tthis.admin.createClass(\"Class1\", 2017, \"Instructor1\", 20);\n\t\tthis.instructor.addHomework(\"Instructor1\", \"Class1\", 2017, \"HW2\");\n\t\tthis.student.submitHomework(\"Student1\", \"HW1\", \"Solution\", \"Class1\", 2017);\n\t\tthis.instructor.assignGrade(\"Instructor1\", \"Class1\", 2017, \"HW1\", \"Student1\", 90);\n\t\tInteger grade = this.instructor.getGrade(\"Class1\", 2017, \"HW1\", \"Student1\");\n\t\tassertNull(grade);\n\t}",
"@Test\n\tpublic void testPassengersBoardsToPassengerCar() throws TrainException\n\t{\n\t\tInteger grossWeight = 1;\n\t\tInteger numberOfSeats = 10;\n\t\tInteger newPassengers = 5;\n\t\t\n\t\tasgn2RollingStock.RollingStock passengerCarUnderTest = \n\t\t\tnew asgn2RollingStock.PassengerCar((Integer)grossWeight, (Integer)numberOfSeats);\n\t\t\n\t\tInteger expectedPeopleNotGetSeat = 0;\n\t\tInteger peopleNotGetSeat = ((asgn2RollingStock.PassengerCar)passengerCarUnderTest).board\n\t\t\t\t((Integer) newPassengers);\n\t\t\n\t\tassertEquals(\"expected = \" + expectedPeopleNotGetSeat.toString() + \" but \" + peopleNotGetSeat.toString(),\n\t\t\t\texpectedPeopleNotGetSeat, peopleNotGetSeat);\n\t}",
"public static List<Integer> gradingStudents(List<Integer> grades) {\n\t\t int test=0;\n\t\t int p=0;\n\t\t \n\t\t for(int grade: grades) {\n\t\t\t\n\t\t\t if(((grade/5)+1)*5-grade<3 && grade>=38 ) {\n\t\t\t test = (grade/5+1)*5;\n\t\t\t\t \n\t\t\t }else {\n\t\t\t\t test=grade;\n\t\t\t }\n\t\t\t \n\t\t }\n\t\t \n\t\t System.out.println(\"test \"+test );\n\t\t \treturn new ArrayList();\n\t\t }",
"@Test\r\n\tpublic void getAllGradesWithNoRuleLostPointsTest()\r\n\t\t\tthrows ClassNotFoundException, SonarqubeDataBaseException, SQLException, IOException {\r\n\t\tlistAllGrades.put(\"FinalGrade\", 17.5f);\r\n\t\tAssert.assertEquals(UtilCalculGrade.getAllGrades(mapQuality, listScoreMetricStudent, listScoreMetricTeacher,\r\n\t\t\t\tmapConf, mapIssuesEmpty, projectName, idModule).get(\"FinalGrade\"), listAllGrades.get(\"FinalGrade\"));\r\n\t}",
"static String score(String agent1,String agent2)\n {\n int a1=random(s.length);\n int a2=random(s.length);\n if(a1==a2)\n a2++;\n if (a1 < a2)\n {\n allScores[in]=agent1+\" lose from \"+ agent2 + \" \" + a2 +\"-\"+ a1;\n JOptionPane.showMessageDialog(new JFrame(),allScores[in]);\n in++;\n return agent2;\n }\n else\n {\n allScores[in]=agent2+\" lose from \"+ agent1 +\" \" + a1 +\"-\"+ a2;\n JOptionPane.showMessageDialog(new JFrame(),allScores[in]);\n in++;\n return agent1;\n }\n\n }",
"private static void assertEqual(ReviewFeedback first, ReviewFeedback other) {\n\t\tassertEquals(\"The result should be correct.\", first.getCreateUser(),\n\t\t\t\tother.getCreateUser());\n\t\tassertEquals(\"The result should be correct.\", first.getProjectId(),\n\t\t\t\tother.getProjectId());\n\t\tassertEquals(\"The result should be correct.\", first.getComment(),\n\t\t\t\tother.getComment());\n\t\tassertEquals(\"The result should be correct.\", first.getId(),\n\t\t\t\tother.getId());\n\t\tassertEquals(\"The result should be correct.\",\n\t\t\t\tfirst.getDetails().size(), other.getDetails().size());\n\t\tComparator<ReviewFeedbackDetail> comparator = new Comparator<ReviewFeedbackDetail>() {\n\t\t\tpublic int compare(ReviewFeedbackDetail o1, ReviewFeedbackDetail o2) {\n\t\t\t\treturn o1.getFeedbackText().hashCode()\n\t\t\t\t\t\t- o2.getFeedbackText().hashCode();\n\t\t\t}\n\t\t};\n\t\tCollections.sort(first.getDetails(), comparator);\n\t\tCollections.sort(other.getDetails(), comparator);\n\t\tfor (int i = 0; i < first.getDetails().size(); i++) {\n\t\t\tassertEquals(\"The result should be correct.\", first.getDetails()\n\t\t\t\t\t.get(i).getReviewerUserId(), other.getDetails().get(i)\n\t\t\t\t\t.getReviewerUserId());\n\t\t\tassertEquals(\"The result should be correct.\", first.getDetails()\n\t\t\t\t\t.get(i).getScore(), other.getDetails().get(i).getScore());\n\t\t\tassertEquals(\"The result should be correct.\", first.getDetails()\n\t\t\t\t\t.get(i).getFeedbackText(), other.getDetails().get(i)\n\t\t\t\t\t.getFeedbackText());\n\t\t}\n\t}",
"@Test(expected = IllegalArgumentException.class)\r\n\tpublic void outfromNumGradeTest1(){\r\n\t\tPointGrade.fromNumGrade(-2);\r\n\t}",
"@Test\r\n void testGradualSecond() {\r\n Gradual testStrat = new Gradual();\r\n PeriodicCD testStrat2 = new PeriodicCD();\r\n ArrayList<Integer> payoffs = new ArrayList<>(Arrays.asList(3, 5, 0, 1));\r\n ArrayList<Character> expected = new ArrayList<>(Arrays.asList('c', \r\n 'c', 'd', 'c', 'c', 'c', 'd', 'd'));\r\n Game game = new Game(testStrat, testStrat2, 8, payoffs);\r\n game.playGame();\r\n assertEquals(game.historyStrategy1, expected, \"Gradual strategy not functioning correctly\");\r\n }",
"public static void grade(int size)\n {\n int score = 0;\n for(int i = 0; i<size;i++)\n {\n if(answer[i] == nb1[i] + nb2[i])\n {\n score+=10;\n }\n }\n System.out.println(\"Votre score est \" + score+\"/100\");\n }",
"@Test \n public void compareFunctionalEquals() {\n HighScoreComparator comparator2 = new HighScoreComparator();\n int a;\n a = comparator2.compare(p1, p1);\n \n assertEquals(0, a);\n }",
"public int compare(PuzzleBoard lhs, PuzzleBoard rhs) {\r\n if(lhs.dist() == rhs.dist())\r\n {\r\n return lhs.compareStates(rhs);\r\n }\r\n else if(lhs.priority()<rhs.priority())\r\n return -1;\r\n else\r\n return 1;\r\n\r\n }",
"@Test\n public void getScoreTwo() {\n this.reset();\n this.bps.startGame(this.fullDeck, false, 7, 1);\n assertEquals(185, this.bps.getScore());\n this.bps.remove(6, 2, 6, 6);\n assertEquals(172, this.bps.getScore());\n }",
"public static void main(String[] args) {\n Scanner input = new Scanner(System.in);//declare scanner and have it accenpt user input\n System.out.println(\"Enter in 15 student grades.\");//prompt user to enter 15 grades\n int[] Grades = new int[15];//create single dimensional array\n int grade1 = 0;//start at zero\n int grade2 = 0;//start at zero\n for(int i = 0; i<15; i++){//begin outer for loop\n Boolean isGood = false;//declare boolean\n do{\n Grades[i] = input.nextInt();//the grade is equal to the integer entered by the user\n while(Grades[i]>100){//condition mmust be satisfied or will print error\n System.out.println(\"The Integer you input was over 100!\");\n Grades[i] = input.nextInt();//Prompt again for user input\n }\n while(Grades[i]<0){//condition mmust be satisfied or will print error\n System.out.println(\"The Integer you input was under 0!\");\n Grades[i] = input.nextInt();//Prompt again for user input\n }if(i != 0){\n while(Grades[i]<= Grades[i-1]){//condition mmust be satisfied or will print error\n System.out.println(\"The Integer you input was not greater than the last!\");\n Grades[i] = input.nextInt();//Prompt again for user input\n }\n }else{\n isGood = true;\n }\n \n }while(Grades[i]>100 || Grades[i]<0 && isGood);//begin while loop for set conditions\n }\n for(int x = 0; x<15; x++){\n System.out.print(Grades[x] + \" \");\n }\n System.out.println(\"Enter a grade to search for\");\n grade1 = input.nextInt();//Enter the grade you are searching for\n BinarySearch(Grades, grade1);\n \n System.out.println(\"Scrambled\");//notify when the array has been scrambled\n if(ScrambleArray(Grades)){\n System.out.println(\"Scrambled\");\n }\n System.out.println(\"Enter a grade to search for\");\n grade2 = input.nextInt();//Enter the grade you are searching for\n int indexForLinear = LinearSearch(Grades, grade2);\n if(indexForLinear == -1){\n System.out.println(grade2 + \" was not found in \" + indexForLinear + \" iterations\");//print number of iterations it took\n }\n if(indexForLinear != -1){\n System.out.println(grade2 + \" was found in \" + indexForLinear + \" iterations\");//print number of iterations it took\n }\n }",
"public boolean guessAgain(ArrayList<Range> ranges, ArrayList<Range> compRanges)\r\n\t{\r\n\t\tint minR = 12;\r\n\t\tint minRComp = 12;\r\n\r\n\t\tfor(int i = 0; i<ranges.size(); i++)\r\n\t\t{\r\n\t\t\tif(ranges.get(i).getStart() != -1 && ranges.get(i).getRange() <minR)\r\n\t\t\t{\r\n\t\t\t\tminR = ranges.get(i).getRange();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tfor(int i = 0; i <compRanges.size(); i++)\r\n\t\t{\r\n\t\t\tif(ranges.get(i).getStart() != -1 && ranges.get(i).getRange() <minR)\r\n\t\t\t{\r\n\t\t\t\tminR = ranges.get(i).getRange();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tif(minR == 0 || minR == 1)\r\n\t\t\treturn true;\r\n\t\t\r\n\t\tif(minRComp<2)\r\n\t\t\treturn false;\r\n\t\t\r\n\t\tif(minR == 2)\r\n\t\t{\t\r\n\t\t\tint ranNum = (int)(Math.random()*10);\r\n\t\t\tif(ranNum<6)\r\n\t\t\t\treturn true;\r\n\t\t\telse \r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\tif(minR == 3)\r\n\t\t{\r\n\t\t\tint ranNum = (int)(Math.random()*10);\r\n\t\t\tif(ranNum<4)\r\n\t\t\t\treturn true;\r\n\t\t\telse \r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\tif(minR == 4)\r\n\t\t{\r\n\t\t\tint ranNum = (int)(Math.random()*10);\r\n\t\t\tif(ranNum<3)\r\n\t\t\t\treturn true;\r\n\t\t\telse \r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public void evaluate(Combination comparison){\r\n boolean answerUsed[] = new boolean[COMBI_LENGTH];\r\n boolean guessUsed[] = new boolean[COMBI_LENGTH];\r\n for (int i = 0; i < COMBI_LENGTH; i++){\r\n answerUsed[i] = false;\r\n guessUsed[i] = false;\r\n }\r\n\r\n //Reset results\r\n for (int i = 0; i < 2; i++)\r\n results[i] = 0;\r\n\r\n //Count correct and right placed\r\n for (int i = 0; i < COMBI_LENGTH; i++){\r\n if (this.combi[i] == comparison.getColors()[i]){\r\n this.results[0]++;\r\n answerUsed[i] = true;\r\n guessUsed[i] = true;\r\n }\r\n }\r\n\r\n //Count correct but wrong placed\r\n for (int i = 0; i < COMBI_LENGTH; i++){\r\n if (guessUsed[i])\r\n continue;\r\n\r\n for (int j = 0; j < COMBI_LENGTH; j++){\r\n if (answerUsed[j])\r\n continue;\r\n if (this.combi[i] == comparison.getColors()[j]){\r\n this.results[1]++;\r\n answerUsed[j] = true;\r\n break; // no need to set guessUsed[i] to true as we break and thus never come back to this guess again\r\n }\r\n }\r\n }\r\n }",
"public static ArrayList < Student > teamMemberGPAConstraintApplicator(ArrayList < Student > teamCreator) {\n int GPAGreaterThanThreeCounter = 0;\n for (int i = 0; i < teamCreator.size(); i++) {\n if (teamCreator.get(i).getGpa() >= 3.00) {\n GPAGreaterThanThreeCounter++;\n }\n }\n\n //considering sumOfGPA here as well so that changes made here should not impact teamAverageGPAConstraint\n double sumOfGPA = 0;\n for (Student student: teamCreator) {\n sumOfGPA = sumOfGPA + student.getGpa();\n }\n double averageGpaOfTeam = sumOfGPA / 4;\n\n if (GPAGreaterThanThreeCounter < 2) { //if hard constraint is violeted then we will first try to meet it by swapping students between teamCreator and studentsNotInATeam\n for (int i = 0; i < studentsNotInATeam.size(); i++) {\n if ((studentsNotInATeam.get(i).getGender() == 'm' || studentsNotInATeam.get(i).getGender() == 'M')&& studentsNotInATeam.get(i).getGpa() >= 3.00) {\n for (Student student: teamCreator) {\n if (((studentsNotInATeam.get(i).getGender() == 'm' || studentsNotInATeam.get(i).getGender() == 'M') && student.getGpa() < 3.00) && (((sumOfGPA + studentsNotInATeam.get(i).getGpa() - student.getGpa()) / 4) < 3.50)) {\n //swapping students\n studentsNotInATeam.add(student);\n teamCreator.remove(student);\n teamCreator.add(studentsNotInATeam.get(i));\n studentsNotInATeam.remove(studentsNotInATeam.get(i));\n GPAGreaterThanThreeCounter++; //we got one more student with GPA >= 3\n break;\n }\n }\n if (GPAGreaterThanThreeCounter == 2) {\n break; // if hard constraint is met\n }\n }\n }\n }\n return teamCreator;\n }",
"@Override\n\t\tpublic int compareTo(student that) {\n\t\t\treturn that.gpa - this.gpa;\n\t\t}",
"@Test\r\n void testGradualFirst() {\r\n Gradual testStrat = new Gradual();\r\n PeriodicCCD testStrat2 = new PeriodicCCD();\r\n ArrayList<Integer> payoffs = new ArrayList<>(Arrays.asList(3, 5, 0, 1));\r\n ArrayList<Character> expected = new ArrayList<>(Arrays.asList('c', \r\n 'c', 'c', 'd', 'c', 'c', 'd', 'd', 'c', 'c'));\r\n Game game = new Game(testStrat, testStrat2, 10, payoffs);\r\n game.playGame();\r\n assertEquals(game.historyStrategy1, expected, \"Gradual strategy not functioning correctly\");\r\n }",
"public double weightedGPA() {\r\n\t\t\tdouble average = 0; \r\n\t\t\tdouble gradePoint = 0;\r\n\t\t\tdouble credit = 0;\r\n\t\t\t// Grade points\r\n\t\t\tfor (int i = 0; i < finalGrade.size(); i++) {\r\n\t\t\t\tif (finalGrade.get(i) >= 90 && finalGrade.get(i) <= 100) {\r\n\t\t\t\t\tgradePoint = gradePoint + (9*courseTaken.get(i).getCredit());\r\n\t\t\t\t\tcredit = credit + courseTaken.get(i).getCredit();\r\n\t\t\t\t}\r\n\t\t\t\telse if (finalGrade.get(i) >= 80 && finalGrade.get(i) <= 89.99) {\r\n\t\t\t\t\tgradePoint = gradePoint + (8*courseTaken.get(i).getCredit());\r\n\t\t\t\t\tcredit = credit + courseTaken.get(i).getCredit();\r\n\t\t\t\t}\r\n\t\t\t\telse if (finalGrade.get(i) >= 75 && finalGrade.get(i) <= 79.99) {\r\n\t\t\t\t\tgradePoint = gradePoint + (7*courseTaken.get(i).getCredit());\r\n\t\t\t\t\tcredit = credit + courseTaken.get(i).getCredit();\r\n\t\t\t\t}\r\n\t\t\t\telse if (finalGrade.get(i) >= 70 && finalGrade.get(i) <= 74.99) {\r\n\t\t\t\t\tgradePoint = gradePoint + (6*courseTaken.get(i).getCredit());\r\n\t\t\t\t\tcredit = credit + courseTaken.get(i).getCredit();\r\n\t\t\t\t}\r\n\t\t\t\telse if (finalGrade.get(i) >= 65 && finalGrade.get(i) <= 69.99) {\r\n\t\t\t\t\tgradePoint = gradePoint + (5*courseTaken.get(i).getCredit());\r\n\t\t\t\t\tcredit = credit + courseTaken.get(i).getCredit();\r\n\t\t\t\t}\r\n\t\t\t\telse if (finalGrade.get(i) >= 60 && finalGrade.get(i) <= 64.99) {\r\n\t\t\t\t\tgradePoint = gradePoint + (4*courseTaken.get(i).getCredit());\r\n\t\t\t\t\tcredit = credit + courseTaken.get(i).getCredit();\r\n\t\t\t\t}\r\n\t\t\t\telse if (finalGrade.get(i) >= 55 && finalGrade.get(i) <= 59.99) {\r\n\t\t\t\t\tgradePoint = gradePoint + (3*courseTaken.get(i).getCredit());\r\n\t\t\t\t\tcredit = credit + courseTaken.get(i).getCredit();\r\n\t\t\t\t}\r\n\t\t\t\telse if (finalGrade.get(i) >= 50 && finalGrade.get(i) <= 54.99) {\r\n\t\t\t\t\tgradePoint = gradePoint + (2*courseTaken.get(i).getCredit());\r\n\t\t\t\t\tcredit = credit + courseTaken.get(i).getCredit();\r\n\t\t\t\t}\r\n\t\t\t\telse if (finalGrade.get(i) >= 47 && finalGrade.get(i) <= 49.99) {\r\n\t\t\t\t\tgradePoint = gradePoint + (1*courseTaken.get(i).getCredit());\r\n\t\t\t\t\tcredit = credit + courseTaken.get(i).getCredit();\r\n\t\t\t\t}\r\n\t\t\t\telse if (finalGrade.get(i) > 47) {\r\n\t\t\t\t\tgradePoint = gradePoint + 0;\r\n\t\t\t\t\tcredit = credit + courseTaken.get(i).getCredit();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\taverage = gradePoint/credit; // GPA\r\n\t\t\treturn Math.round(average*10)/10.0; // GPA is returned\r\n\t\t}",
"public static void main(String[] args) {\n ExamGrade eg1=new ExamGrade(60, 90);\n ExamGrade eg2=new ExamGrade(20, 60);\n ExamGrade eg3=new ExamGrade(55, 85);\n //instances of student \n Student s1=new Student(\"Barış\", \"Arslan\", \"male\", 3.4, \"CMPE\",eg1);\n Student s2=new Student(\"Fırat\", \"Arslan\", \"male\", 2.5, \"CMPE\", eg1);\n Student s3=new Student(\"ali\", \"mehmet\", \"male\", 1.0, \"EEN\", eg3);\n Student s4=new Student(\"ayşe\", \"pek\", \"female\", 3.0, \"EEN\", eg2);\n Student s5=new Student(\"kai\", \"pek\", \"male\", 3.1, \"TK\", eg2);\n\n Student[] a={s5,s3,s2,s1,s4}; //array for test \n Student[] b=generatedStudent(4); //describing genereted values to b because of testing\n show(b); //instance of show method\n findMinMax(b); //instance of findMinMax method\n \n System.out.println(search(a,118101));//instance of search method\n System.out.println(s2);//these control changeGrade before working method\n changeGrade(a, 118102, eg3);//instance of changeGrade method\n System.out.println(s2);//these control changeGrade after working method\n meanGPA(a);//instance of meanGPA \n }",
"@Test\n void testBotBIsNextPlayerWhenBotAHas2Clubs() {\n Dealer testDealer = new Dealer();\n testDealer.initDealer();\n \n ArrayList<Card> clubCards;\n clubCards = new ArrayList <Card>();\n\n for (Rank rank : Rank.values()) {\n clubCards.add(new Card(Suit.CLUBS, rank, true));\n }\n \n testDealer.getBotA().fillHandCards(clubCards);\n testDealer.setPlayerStarter(); //botA is nextPlayer\n testDealer.getTrickPlayer();\n assertEquals(testDealer.getBotB().getId(), testDealer.getNextPlayer());\n }",
"@Test\n public void testCalculateScore() {\n System.out.println(\"calculateScore\");\n String input1 = \"8 0 3 1 6 5 -2 4 7 1 3 -2 6\";\n String input2 = \"8 0 3 1 6 5 -2 4 7 3 2 -2 6\";\n CCGeneticDrift instance = new CCGeneticDrift();\n int expResult1 = 2;\n int expResult2 = 4;\n int result1 = instance.calculateScore(input1);\n assertEquals(result1, expResult1);\n int result2 = instance.calculateScore(input2);\n assertEquals(result2, expResult2);\n }",
"@Test\r\n\tpublic void testPlayableCards2()\r\n\t{\n\t\t\r\n\t\tCardList clubList = new CardList();\r\n\t\tclubList.add(AllCards.a6C);\r\n\t\tclubList.add(AllCards.aTC);\t\t\r\n//\t\tassertTrue( h.playableCards(Suit.CLUBS, null).toString().equals(clubList.toString()));\r\n\t\t\r\n\t\tCardList diamondsList = new CardList();\r\n\t\tdiamondsList.add(AllCards.a7D);\r\n\t\tdiamondsList.add(AllCards.aQD);\r\n\t\tdiamondsList.add(AllCards.aKD);\r\n//\t\tassertTrue( h.playableCards(Suit.DIAMONDS, null).toString().equals(diamondsList.toString()));\r\n\t\t\r\n\t\tCardList heartsList = new CardList();\r\n\t\theartsList.add(AllCards.a9H);\t\t\r\n//\t\tassertTrue( h.playableCards(Suit.HEARTS, null).toString().equals(heartsList.toString()));\r\n\t\t\r\n\t\tCardList spadesList = new CardList();\r\n\t\tspadesList.add(AllCards.aTS);\r\n\t\tspadesList.add(AllCards.a7S);\r\n\t\tspadesList.add(AllCards.aJS);\r\n\t\tspadesList.add(AllCards.aKS);\r\n//\t\tassertTrue( h.playableCards(Suit.SPADES, null).toString().equals(spadesList.toString()));\r\n\t\t\r\n\t\tCardList joker = new CardList();\t\t\t\r\n\t\tjoker.add(AllCards.aLJo);\t\t\r\n\t\tjoker.add(AllCards.aHJo);\r\n//\t\tassertTrue(jokerhand.playableCards(Suit.DIAMONDS, null).sort(new Card.ByRankComparator()).toString().equals(joker.toString()));\r\n\t\t\r\n\t\t\r\n\t\t// Trump\r\n\t\tclubList.add(AllCards.aJS);\r\n\t\tclubList.add(AllCards.aLJo);\r\n\t\tclubList = clubList.sort(new Card.ByRankComparator());\r\n\t\tassertTrue( h.playableCards(Suit.CLUBS, Suit.CLUBS).sort(new Card.ByRankComparator()).toString().equals(clubList.toString()));\r\n\t\t\r\n\t\tdiamondsList.add(AllCards.aLJo);\r\n\t\tdiamondsList = diamondsList.sort(new Card.ByRankComparator());\r\n\t\tassertTrue( h.playableCards(Suit.DIAMONDS, Suit.DIAMONDS).sort(new Card.ByRankComparator()).toString().equals(diamondsList.toString()));\r\n\r\n\t\theartsList = heartsList.sort(new Card.ByRankComparator());\t\t\r\n\t\tassertTrue( h.playableCards(Suit.HEARTS, Suit.DIAMONDS).sort(new Card.ByRankComparator()).toString().equals(heartsList.toString()));\r\n\t\t\r\n\t\tspadesList.remove(AllCards.aJS);\r\n\t\tspadesList = spadesList.sort(new Card.ByRankComparator());\r\n\t\tassertTrue( h.playableCards(Suit.SPADES, Suit.CLUBS).sort(new Card.ByRankComparator()).toString().equals(spadesList.toString()));\r\n\t\t\r\n\t\t// no Trump in hand\r\n\t\tassertTrue(jokerhand.playableCards(Suit.DIAMONDS, Suit.DIAMONDS).sort(new Card.ByRankComparator()).toString().equals(joker.toString()));\r\n\t\tassertTrue(jokerhand.playableCards(Suit.DIAMONDS, Suit.CLUBS).sort(new Card.ByRankComparator()).toString().equals(joker.toString()));\r\n\t\t\r\n\t\tCardList jackList = new CardList();\r\n\t\tjackList.add(AllCards.aJS);\r\n\t\tjackList.add(AllCards.aJC);\r\n\t\tassertTrue(jackHand.playableCards(Suit.CLUBS, Suit.SPADES).sort(new Card.ByRankComparator()).toString().equals(jackList.toString()));\r\n\t\t\r\n\t}",
"public void testScoreboardCaseFour () throws Exception {\n \n // RunID TeamID Prob Time Result\n \n String [] runsData = {\n\n \"1,1,A,1,No\", //20\n \"2,1,A,3,Yes\", //3 (first yes counts Minutes only)\n \"3,1,A,5,No\", //20\n \"4,1,A,7,Yes\", //20 \n \"5,1,A,9,No\", //20\n \n \"6,1,B,11,No\", //20 (all runs count)\n \"7,1,B,13,No\", //20 (all runs count)\n \n \"8,2,A,30,Yes\", //30\n \n \"9,2,B,35,No\", //20 (all runs count)\n \"10,2,B,40,No\", //20 (all runs count)\n \"11,2,B,45,No\", //20 (all runs count)\n \"12,2,B,50,No\", //20 (all runs count)\n \"13,2,B,55,No\", //20 (all runs count)\n\n };\n \n // Rank TeamId Solved Penalty\n \n String [] rankData = {\n \"1,team1,1,23\",\n \"2,team2,1,30\"\n };\n \n // TODO when SA supports count all runs, replace rankData\n \n /**\n * Case 4 tests when all runs are counted, the current SA\n * does not support this scoring method. The commented\n * rankData is the proper results\n */\n \n// Team 1 -- 123 <-- Team 1 is winning again\n// Team 2 -- 130\n \n// String [] rankData = {\n// \"1,team1,1,123\",\n// \"2,team2,1,130\"\n// };\n \n scoreboardTest (2, runsData, rankData);\n }",
"private void jComboBox3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox3ActionPerformed\r\n //Step1: Get the selected student and selected homework from the dropdown jComboBox2 and jComboBox3 resp\r\n String selectedStudentID = Students.get(jComboBox2.getSelectedIndex());\r\n String selectedHWForStudent = StudentHomework.get(jComboBox3.getSelectedIndex());\r\n \r\n //step2: Get the values of score selection method of homework, HW score, total number of attempts\r\n try\r\n { \r\n \r\n // To find score selection method and hw score according to score selection method.\r\n query = \"select a.assignment_id, a.assignment_name, \" +\r\n \" CASE \" +\r\n \"\tWHEN a.score_selection_method = 1 THEN 'Latest Attempt' \" +\r\n \"\tWHEN a.score_selection_method = 2 THEN 'Maximum Score' \" +\r\n \"\tWHEN a.score_selection_method = 3 THEN 'Average Score' \" +\r\n \"END as score_selection_method, \" +\r\n \"CASE \" +\r\n \"\tWHEN a.score_selection_method = 1 THEN \" +\r\n \"\t\t(select a1.atmpt_score \" +\r\n \"\t\tfrom attempt a1 where \" +\r\n \"\t\ta.assignment_id = a1.assignment_id \" +\r\n \"\t\tand a1.atmpt_dt = \" +\r\n \"\t\t(select max(atmpt_dt) from attempt a2 \" +\r\n \"\t\twhere a1.student_id = a2.student_id \" +\r\n \" \t\tand a1.assignment_id = a2.assignment_id \" +\r\n \"\t\tand a.assignment_id = a2.assignment_id \" +\r\n \"\t\tand a2.student_id = '\" + selectedStudentID + \"'\" +\r\n \"\t\tgroup by a2.student_id, a2.assignment_id)) \" +\r\n \r\n \"\tWHEN a.score_selection_method = 2 THEN \" +\r\n \"\t\t(select max(a3.atmpt_score) from attempt a3 \" +\r\n \"\t\twhere a.assignment_id = a3.assignment_id \" +\r\n \"\t\tand a3.student_id = '\" + selectedStudentID + \"'\" +\r\n \"\t\tgroup by a3.student_id, a3.assignment_id) \" +\r\n \r\n \"\tWHEN a.score_selection_method = 3 THEN \" +\r\n \"\t\t(select avg(a4.atmpt_score) from attempt a4 \" +\r\n \"\t\twhere a.assignment_id = a4.assignment_id \" +\r\n \"\t\tand a4.student_id = '\" + selectedStudentID + \"'\" +\r\n \"\t\tgroup by a4.student_id, a4.assignment_id) \" +\r\n \" End as homework_score \" +\r\n \" from assignment a where a.assignment_id = '\" + selectedHWForStudent + \"'\";\r\n rs = db.conn.createStatement().executeQuery(query);\r\n while (rs.next()) {\r\n jLabel21.setText(rs.getString(\"score_selection_method\"));\r\n jLabel14.setText(rs.getString(\"homework_score\"));\r\n }\r\n \r\n // To find total number of attempts by particular student for particular homework.\r\n query = \" select at.student_id, at.assignment_id , count(at.atmpt_dt) as totalAttempts from attempt at \" +\r\n \" where at.student_id = '\" + selectedStudentID + \"'\" +\r\n \" and at.assignment_id = '\" + selectedHWForStudent + \"'\" +\r\n \" group by at.student_id, at.assignment_id \"; \r\n rs = db.conn.createStatement().executeQuery(query);\r\n while (rs.next()) {\r\n jLabel19.setText(rs.getString(\"totalAttempts\"));\r\n }\r\n \r\n }\r\n catch (Exception oops) {\r\n System.out.println(\"Prof_Report.java:PopulateComboBoxData() \" + oops);\r\n }\r\n }",
"@Test\r\n\tpublic void getAllGradesTestWithDisableQualityAxisTest() {\r\n\t\tmapQuality.remove(\"Comments\");\r\n\t\tlistAllGrades.put(\"FinalGrade\", 15.5f);\r\n\t\ttry {\r\n\t\t\tAssert.assertEquals(UtilCalculGrade.getAllGrades(mapQuality, listScoreMetricStudent, listScoreMetricTeacher,\r\n\t\t\t\t\tmapConf, mapIssues, projectName, idModule).get(\"FinalGrade\"), listAllGrades.get(\"FinalGrade\"));\r\n\t\t} catch (ClassNotFoundException | SonarqubeDataBaseException | SQLException | IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t}",
"@Test\n \tpublic void testDisprovingSuggestion() {\n \t\t//Set suggestion\n \t\tSolution suggestion = new Solution(\"Colonel Mustard\", \"Knife\", \"Library\");\n \t\tComputerPlayer computer1 = new ComputerPlayer();\n \t\tComputerPlayer computer2 = new ComputerPlayer();\n \t\tComputerPlayer computer3 = new ComputerPlayer();\n \t\tHumanPlayer human = new HumanPlayer();\n \t\tArrayList<Card> hand = new ArrayList<Card>();\n \t\tArrayList<ComputerPlayer> comps = new ArrayList<ComputerPlayer>();\n \t\t\n \t\t\n \t\t//ensure If a player (human or computer) has a card that's suggested, that card is \"shown\"\n \t\tCard mustardCard = new Card(\"Colonel Mustard\", Card.cardType.PERSON);\n \t\thand.add(mustardCard);\n \t\tcomputer1.setCards(hand);\n \t\tAssert.assertEquals(computer1.disproveSuggestion(suggestion), mustardCard);\n \t\t\n \t\t\n \t\t//ensure If the player has multiple cards that match, the card to be returned is selected randomly.\n \t\tCard knifeCard = new Card (\"Knife\", Card.cardType.WEAPON);\n \t\tCard libraryCard = new Card(\"Library\", Card.cardType.ROOM);\n \t\thand.add(knifeCard);\n \t\thand.add(libraryCard);\n \t\thuman.setCards(hand);\n \t\tint mustard = 0, knife = 0, library = 0;\n \t\t//make sure card is valid and counts how many times each card is returned\n \t\tfor(int i = 0; i < 100; i++) {\n \t\t\tCard disproved = human.disproveSuggestion(suggestion);\n \t\t\t\n \t\t\tif(disproved == mustardCard)\n \t\t\t\tmustard++;\n \t\t\telse if(disproved == knifeCard)\n \t\t\t\tknife++;\n \t\t\telse if(disproved == libraryCard)\n \t\t\t\tlibrary++;\n \t\t\telse\n \t\t\t\tfail(\"Invalid card returned\");\n \t\t}\n \t\t//makes sure every card is returned more than once\n \t\tAssert.assertTrue(mustard > 10);\n \t\tAssert.assertTrue(knife > 10);\n \t\tAssert.assertTrue(library > 10);\n \t\t\n \t\thuman.setCards(null);\n \t\tgame.setCurrentPlayer(game.getHuman());\n \t\t\t\n \t\t//ensure In the board game, disproving a suggestion starts with a player to the left of the person making the suggestion\n \t\thand.remove(mustardCard);\n \t\thand.remove(knifeCard);\n \t\tcomputer2.setCards(hand);\n \t\thand.remove(libraryCard);\n \t\thand.add(knifeCard);\n \t\tcomputer3.setCards(hand);\n \t\tcomps.add(computer1);\n \t\tcomps.add(computer2);\n \t\tcomps.add(computer3);\n \t\t\n \t\tint comp1 = 0, comp2 = 0, comp3 = 0;\n \t\tgame.setComputer(comps);\n \t\tfor(int i = 0; i < 100; i++) {\n \t\t\tCard returned = game.handleSuggestion(suggestion);\n \t\t\tif(returned == mustardCard)\n \t\t\t\tcomp1++;\n \t\t\telse if(returned == libraryCard)\n \t\t\t\tcomp2++;\n \t\t\telse if(returned == knifeCard)\n \t\t\t\tcomp3++;\n \t\t\telse\n \t\t\t\tfail(\"Invalid card returned\");\t\n \t\t}\n\t\t//Assert.assertTrue(comp1 > 10);\n\t\t//Assert.assertTrue(comp2 > 10);\n \t\tAssert.assertTrue(comp3 > 10);\n \t\t//ensure The player making the suggestion should not be queried\n \t\tgame.setCurrentPlayer(computer1);\n \t\tfor(int i = 0; i < 100; i++) {\n \t\t\tCard returned = game.handleSuggestion(suggestion);\n \t\t\tif(returned == mustardCard)\n \t\t\t\tfail(\"Suggesting player cannot return a card\");\t\n \t\t}\n \t}",
"@Test\r\n\tpublic void getAllGradesWithNoAdjustementLimitTest()\r\n\t\t\tthrows ClassNotFoundException, SonarqubeDataBaseException, SQLException, IOException {\r\n\t\tmapQuality.put(\"Comments\", new ModelValue(25f, 3f));\r\n\t\tlistAllGrades.put(\"Comments\", 3f);\r\n\t\tlistAllGrades.put(\"TestOfTeacher\", 0.0f);\r\n\t\tlistAllGrades.put(\"FinalGrade\", 12.5f);\r\n\t\tAssert.assertEquals(UtilCalculGrade.getAllGrades(mapQuality, listScoreMetricStudent, listScoreMetricTeacher,\r\n\t\t\t\tmapConf, mapIssues, projectName, idModule), listAllGrades);\r\n\t}",
"@Test\n @Order(1)\n void algorithms() {\n \n Combination initialComb = new Combination();\n for (int i = 0; i < assignementProblem.getAssignmentData().getLength(); i++) {\n initialComb.add((long) i + 1);\n }\n assignementProblem.setInCombination(initialComb);\n executeAlgo(SearchTestUtil.ALGO.TABU);\n executeAlgo(SearchTestUtil.ALGO.RECUIT);\n }",
"public void testCaseTwo() {\n\t\tgrcbal3 = new GRCbal3();\n\n\t\t// first tick\n\t\tgrcbal3.doTick();\n\t\tassertEquals(grcbal3.a.isPresent(), ABSENT);\n\t\tassertEquals(grcbal3.b.isPresent(), ABSENT);\n\t\tassertEquals(grcbal3.c.isPresent(), ABSENT);\n\t\tassertEquals(grcbal3.d.isPresent(), ABSENT);\n\t\tassertEquals(grcbal3.e.isPresent(), ABSENT);\n\t\tassertEquals(grcbal3.t.isPresent(), ABSENT);\n\n\t\t// second tick\n\t\tgrcbal3.doTick();\n\t\tassertEquals(grcbal3.a.isPresent(), ABSENT);\n\t\tassertEquals(grcbal3.b.isPresent(), PRESENT);\n\t\tassertEquals(grcbal3.c.isPresent(), ABSENT);\n\t\tassertEquals(grcbal3.d.isPresent(), ABSENT);\n\t\tassertEquals(grcbal3.e.isPresent(), ABSENT);\n\t\tassertEquals(grcbal3.t.isPresent(), ABSENT);\n\t}",
"private boolean validationPhase(Secret secretA, Secret secretB, int smallestSize, double[] optimalBox) {\n\n\t\t// number of all possible subsets with a size of smallestSize\n\t\tint numberSubsets; \n\t\tif((secretA.getTimes().size() / smallestSize) <= (secretB.getTimes().size() / smallestSize)) {\n\t\t\tnumberSubsets = (secretA.getTimes().size() / smallestSize);\n\t\t} else {\n\t\t\tnumberSubsets = (secretB.getTimes().size() / smallestSize);\n\t\t}\n\n\t\t// rest of the size modulo all subsets\n\t\tint restA = secretA.getTimes().size() % (numberSubsets * smallestSize);\n\t\tint restB = secretB.getTimes().size() % (numberSubsets * smallestSize);\n\n\t\tArrayList<Time> subsetA; \n\t\tArrayList<Time> subsetB;\n\n\t\tint countWrongResults = 0;\n\n\t\tArrayList<String> validateSubsetSignificantDifferent = new ArrayList<String>();\n\t\tArrayList<String> validateSubsetOverlapA = new ArrayList<String>();\n\t\tArrayList<String> validateSubsetOverlapB = new ArrayList<String>();\n\t\tArrayList<Time> prevSubsetA = new ArrayList<Time>();\n\t\tArrayList<Time> prevSubsetB = new ArrayList<Time>();\n\n\n\t\tfor (int i = 0; i < numberSubsets; ++i) {\n\n\t\t\tint countInvalid = 0;\n\t\t\t// the rest will be deducted at the beginning\n\t\t\tsubsetA = secretA.getBisectedTimes(restA + (smallestSize * i), smallestSize);\n\t\t\tsubsetB = secretB.getBisectedTimes(restB + (smallestSize * i), smallestSize);\n\n\t\t\tCollections.sort(subsetA);\n\t\t\tCollections.sort(subsetB);\n\n\t\t\tif (BoxTest.boxTestSmaller(subsetA, subsetB, optimalBox)) {\n\t\t\t\tvalidateSubsetSignificantDifferent.add(\"o\");\n\n\t\t\t} else {\n\t\t\t\tvalidateSubsetSignificantDifferent.add(\"x\");\n\t\t\t\t//logger.info(\"subset \" + i + \": wrong result\");\n\t\t\t\t++countInvalid;\n\t\t\t}\n\t\t\t\n\t\t\tif(i != 0) {\n\t\t\t\tif (BoxTest.boxTestOverlap(prevSubsetA, subsetA, optimalBox)) {\n\t\t\t\t\tvalidateSubsetOverlapA.add(\"o\");\n\n\t\t\t\t} else {\n\t\t\t\t\tvalidateSubsetOverlapA.add(\"x\");\n\t\t\t\t\t//logger.info(\"subset \" + i + \": only significant different\");\n\t\t\t\t\t++countInvalid;\n\t\t\t\t} \n\n\t\t\t\tif (BoxTest.boxTestOverlap(prevSubsetB, subsetB, optimalBox)) {\n\t\t\t\t\tvalidateSubsetOverlapB.add(\"o\");\n\t\t\t\t\t//logger.info(\"subset \" + i + \": right result\");\n\n\t\t\t\t} else {\n\t\t\t\t\tvalidateSubsetOverlapB.add(\"x\");\n\t\t\t\t\t//logger.info(\"subset \" + i + \": only significant different, subset A overlaps\");\n\t\t\t\t\t++countInvalid;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(countInvalid > 0) {\n\t\t\t\t++countWrongResults;\n\t\t\t}\n\n\t\t\tprevSubsetA = new ArrayList<Time>();\n\t\t\tprevSubsetB = new ArrayList<Time>();\n\n\t\t\tprevSubsetA = subsetA;\n\t\t\tprevSubsetB = subsetB;\n\t\t}\n\n\t\tdouble confidenceInterval = 100 - (countWrongResults * 100 / numberSubsets);\n\n\t\tthis.boxTestResults.get(this.boxTestResults.size() - 1).saveValidation(smallestSize, confidenceInterval, validateSubsetOverlapA, validateSubsetOverlapB, validateSubsetSignificantDifferent);\n\t\tlogger.finest(\"\\n\\\"o\\\" = successful box test \\n\\\"x\\\" = unsuccesful box test\\n\");\n\t\tlogger.finest(secretA.getName() + \" overlaps: \" + Folder.convertArrayListToString(validateSubsetOverlapA));\n\t\tlogger.finest(secretB.getName() + \" overlaps: \" + Folder.convertArrayListToString(validateSubsetOverlapB));\n\t\tlogger.finest(secretA.getName() + \" < \" + secretB.getName() + \": \" + Folder.convertArrayListToString(validateSubsetSignificantDifferent));\n\n\t\tlogger.info(secretA.getName() + \" < \" + secretB.getName() + \": validate smallest size \" + smallestSize + \": \" + countWrongResults + \" out of \" + numberSubsets + \" comparisons returned wrong results.\");\n\n\t\tif(countWrongResults != 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"public void newRound()\n\t{\n\t\tif(player1.getDeck().isEmpty())\n\t\t{\n\t\t\treshufflePlayer1();\n\t\t}\n\t\tif(player2.getDeck().isEmpty())\n\t\t{\n\t\t\treshufflePlayer2();\n\t\t}\n\t\t\n\t\tactivePlayerOneCard = player1.draw();\n\t\tactivePlayerTwoCard = player2.draw();\n\t}",
"public static void main(String[] args) {\n Hand hand1 = new Hand();\n\n hand1.add(new Card(2, Card.SPADES));\n hand1.add(new Card(14, Card.CLUBS));\n hand1.add(new Card(12, Card.HEARTS));\n hand1.add(new Card(2, Card.CLUBS));\n\n hand1.sort();\n\n Hand hand2 = new Hand();\n\n hand2.add(new Card(11, Card.DIAMONDS));\n hand2.add(new Card(11, Card.CLUBS));\n hand2.add(new Card(11, Card.HEARTS));\n\n int comparison = hand1.compareTo(hand2);\n\n if (comparison < 0) {\n System.out.println(\"the most valuable hand contains the cards\");\n hand2.print();\n } else if (comparison > 0) {\n System.out.println(\"the most valuable hand contains the cards\");\n hand1.print();\n } else {\n System.out.println(\"the hands are equally valuable\");\n }\n\n System.out.println(\"\");\n System.out.println(\"_________________________\");\n System.out.println(\"\");\n\n Card cardTest1 = new Card(3, Card.SPADES);\n Card cardTest2 = new Card(3, Card.SPADES);\n\n SortAgainstSuitAndValue sorter = new SortAgainstSuitAndValue();\n int sortingVar = sorter.compare(cardTest1, cardTest2);\n\n if (sortingVar < 0) {\n System.out.println(\"The highest card is:\" + cardTest1);\n } else if (sortingVar > 0) {\n System.out.println(\"The highest card is:\" + cardTest2);\n } else if (sortingVar == 0) {\n System.out.println(\"The cards are the same.\");\n }\n\n Hand hand = new Hand();\n\n hand.add(new Card(12, Card.HEARTS));\n hand.add(new Card(4, Card.CLUBS));\n hand.add(new Card(2, Card.DIAMONDS));\n hand.add(new Card(14, Card.CLUBS));\n hand.add(new Card(7, Card.HEARTS));\n hand.add(new Card(2, Card.CLUBS));\n\n hand.sortAgainstSuit();\n\n //hand.print();\n }"
]
| [
"0.5930315",
"0.56037205",
"0.5497339",
"0.5478895",
"0.54416424",
"0.5405533",
"0.53514993",
"0.53341925",
"0.530755",
"0.53011674",
"0.5294442",
"0.5239073",
"0.52101094",
"0.51660657",
"0.5149231",
"0.51350063",
"0.507334",
"0.50662977",
"0.50607675",
"0.5038086",
"0.5027692",
"0.5021971",
"0.4961534",
"0.493501",
"0.49030703",
"0.4868638",
"0.48640865",
"0.48622385",
"0.48598853",
"0.48527083",
"0.48444533",
"0.48314527",
"0.4828819",
"0.48011398",
"0.4776119",
"0.4771412",
"0.47636986",
"0.47604543",
"0.47593582",
"0.47548756",
"0.47547397",
"0.47529736",
"0.47468057",
"0.4745249",
"0.47398698",
"0.47350937",
"0.4731247",
"0.4726712",
"0.47121528",
"0.4711987",
"0.47093752",
"0.4708031",
"0.46898124",
"0.46838322",
"0.46831858",
"0.4679042",
"0.46744874",
"0.4674474",
"0.4668388",
"0.46678594",
"0.4666446",
"0.46633494",
"0.46568164",
"0.46542567",
"0.4650513",
"0.46501336",
"0.4637225",
"0.4633379",
"0.46309203",
"0.46289048",
"0.46286824",
"0.46245685",
"0.46170726",
"0.46109068",
"0.46095446",
"0.4607754",
"0.4598344",
"0.45898458",
"0.45807192",
"0.45697054",
"0.45565453",
"0.45472148",
"0.4544064",
"0.454361",
"0.45410562",
"0.453991",
"0.45332292",
"0.45248306",
"0.45224538",
"0.4518793",
"0.45159957",
"0.45124575",
"0.4505959",
"0.45037925",
"0.4503605",
"0.45021456",
"0.45002508",
"0.4497627",
"0.4493459",
"0.44928458"
]
| 0.6579915 | 0 |
Close the connection when an exception is raised. | @Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
cause.printStackTrace();
ctx.close();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n public void close() throws Exception {\r\n if (connection != null){\r\n connection.close();\r\n }\r\n }",
"@Override\r\n\tpublic void close()\r\n {\r\n\t\ttry\r\n {\r\n\t connection.close();\r\n }\r\n\t\tcatch (final SQLException e)\r\n {\r\n\t\t\t// Ignore, shutting down anyway\r\n }\r\n }",
"public void connectionClose() {\n try {\n conn.close();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }",
"public void closeConnection(){\n try {\n connection.close();\n } catch (SQLException ex) {\n System.out.println(\"SQLException in closeConnection()\");\n }\n }",
"private synchronized void closeConnection() {\n/* 212 */ if (this.conn != null) {\n/* 213 */ this.log.debug(\"Closing connection\");\n/* */ try {\n/* 215 */ this.conn.close();\n/* 216 */ } catch (IOException iox) {\n/* 217 */ if (this.log.isDebugEnabled()) {\n/* 218 */ this.log.debug(\"I/O exception closing connection\", iox);\n/* */ }\n/* */ } \n/* 221 */ this.conn = null;\n/* */ } \n/* */ }",
"private void closeConnection() {\r\n try {\r\n socket.close();\r\n } catch (IOException ex) {\r\n // Ex on close\r\n }\r\n }",
"private void close() {\n\t\ttry {\n\t\t\tif (conn != null) {\n\t\t\t\tconn.close();\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tlog(e);\n\t\t} finally {\n\t\t\tisConnected = false;\n\t\t}\n\t}",
"public void disconnect()\r\n\t{\r\n\t\ttry {\r\n\t\t\tconnection_.close();\r\n\t\t} catch (IOException e) {} // How can closing a connection fail?\r\n\t\t\r\n\t}",
"public void close()\r\n {\r\n try\r\n {\r\n connection.close();\r\n } catch(SQLException exception)\r\n {\r\n LOG.log(Level.SEVERE, \"\", exception);\r\n }\r\n }",
"private void closeConnection() {\n\t\t_client.getConnectionManager().shutdown();\n\t}",
"void close()\n {\n DisconnectInfo disconnectInfo = connection.getDisconnectInfo();\n if (disconnectInfo == null)\n {\n disconnectInfo = connection.setDisconnectInfo(\n new DisconnectInfo(connection, DisconnectType.UNKNOWN, null, null));\n }\n\n // Determine if this connection was closed by a finalizer.\n final boolean closedByFinalizer =\n ((disconnectInfo.getType() == DisconnectType.CLOSED_BY_FINALIZER) &&\n socket.isConnected());\n\n\n // Make sure that the connection reader is no longer running.\n try\n {\n connectionReader.close(false);\n }\n catch (final Exception e)\n {\n debugException(e);\n }\n\n try\n {\n outputStream.close();\n }\n catch (final Exception e)\n {\n debugException(e);\n }\n\n try\n {\n socket.close();\n }\n catch (final Exception e)\n {\n debugException(e);\n }\n\n if (saslClient != null)\n {\n try\n {\n saslClient.dispose();\n }\n catch (final Exception e)\n {\n debugException(e);\n }\n finally\n {\n saslClient = null;\n }\n }\n\n debugDisconnect(host, port, connection, disconnectInfo.getType(),\n disconnectInfo.getMessage(), disconnectInfo.getCause());\n if (closedByFinalizer && debugEnabled(DebugType.LDAP))\n {\n debug(Level.WARNING, DebugType.LDAP,\n \"Connection closed by LDAP SDK finalizer: \" + toString());\n }\n disconnectInfo.notifyDisconnectHandler();\n }",
"public void close () throws IOException , GateException {\n try{\n conn.close();\n }\n catch (SQLException e){\n log.error(\"Problem closing database connection\", e);\n System.exit(5);\n }\n\n }",
"public static void closeConnection() {\n\t\ttry {\n\t\t\tcon.close();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error al cerrar la conexion.\");\n\t\t}\n\t}",
"public void closeConnection() {\n //It's important to close the connection when you are done with it\n try {\n connection.close();\n DriverManager.getConnection(JDBC_URL + \";shutdown=true\"); // shut Derby down, See: https://db.apache.org/derby/papers/DerbyTut/embedded_intro.html#shutdown\n } catch (SQLException ignore) {\n LOGGER.log(Level.SEVERE, \"Unable to close DB connection due to error {0}\", ignore.getMessage());\n\n // Alternative: Cascade the original exception (or rewrap it as a more specific exception)\n // Here, we just log it \n }\n }",
"private void closeConnection(){\n report(\"Close connection\");\n try{\n if(socket != null && !socket.isClosed()) {\n report(\"Client: Close socket\");\n socket.close();\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n report(\"End\");\n }",
"public void closeConnection() {\n if (conn != null) {\n try {\n conn.close();\n } catch (SQLException sqlEx) {\n dbg(\"closeConnection-->SQLException raised while closing conn =\" + sqlEx.getMessage());\n }\n }\n }",
"public void closeConnection(){\r\n if (connection != null)\r\n try{\r\n log.info(\"close connection\");\r\n connection.close();\r\n }\r\n catch (SQLException e){\r\n log.error(e.getMessage());\r\n e.printStackTrace();\r\n }\r\n }",
"private void closeConnection(Throwable cause) {\n log.debug(\"Closing connection\", cause);\n\n setState(SessionState.DISCONNECTING, cause);\n this.client.disconnect().onComplete(this::disconnectCompleted);\n }",
"public static void closeConnection() {\n if(connection != null) {\n try {\n connection.close();\n connection = null;\n }\n catch (Exception e) \n { \n e.printStackTrace(); \n }\n }\n }",
"public void closeConnection() throws Exception {\n\t\ttry {\n\t\t\tclient.close();\n\t\t\tis.close();\n\t\t\tisr.close();\n\t\t\tbr.close();\n\t\t\tSystem.out.println(\"Connection is closed\");\n\t\t\tgetConnection();\n\t\t} catch (IOException ex) {\n\t\t\tLogger.getLogger(ServerTCP.class.getName()).log(Level.SEVERE, null, ex);\n\t\t}\n\n\t}",
"private void closeConnection () {\n\t\ttry {\n\t\t\tconnection.close();\n\t\t\tconnection = null;\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public void closeConnection() {\n\t\ttry {\n\t\t\tsocket.close();\n\t\t} catch (IOException e) {\n\t\t\tlogger.warning(\"problem closing socket connection with JSON-RPC server at \" + serverIP + \":\" + serverPort);\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public void close() {\n if (conn != null) {\n try {\n conn.close();\n } catch (SQLException e) {\n logger.error(\"Failed to close the connection.\");\n }\n }\n }",
"public void close() {\n try {\n connect.close();\n } catch (SQLException ex) {\n System.err.println(\"Error while closing db connection\" + ex.toString());\n }\n }",
"public void closeConnection() {\n try {\n if (connection != null) {\n connection.close();\n connection = null;\n }\n } catch (Exception e) {\n System.out.print(e.getMessage());\n }\n }",
"protected void close() {\n\t\tthis.connection.close();\n\t\tthis.connection = null;\n\t}",
"public void close() {\n if (connection == null) {\n LOGGER.error(\"DB : Uninitialized DB Connection.\");\n return;\n }\n\n try {\n if (connection.isClosed()) {\n LOGGER.warn(\"Connection is already closed.\");\n return;\n }\n connection.close();\n } catch (SQLException e) {\n LOGGER.error(\"Error closing the connection.\", e);\n }\n\n }",
"public void closeConnection() {\n System.out.println(\"Closing connection\");\n\n try {\n reader.close();\n \n if (connectionSocket != null) {\n connectionSocket.close();\n connectionSocket = null;\n }\n System.out.println(\"Connection closed\");\n } catch (IOException e) {\n System.out.println(\"IOException at closeConnection()\");\n } catch (NullPointerException e) {\n System.out.println(\"NullPointerException at closeConnection()\");\n } catch (Exception e) {\n System.out.println(\"Exception at closeConnection()\");\n System.out.println(e.toString());\n }\n }",
"public void closeConnection() {\n try {\n socket.close();\n oStream.close();\n } catch (Exception e) { }\n }",
"private void closeConnection(final String reason) {\n closeConnection(new VertxException(reason).fillInStackTrace());\n }",
"abstract public void closeConnection();",
"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 }",
"private void closeConnection () {\n setConnection (null);\n }",
"private void releaseConnection() {\n try {\n con.close();\n } catch (SQLException ex) {\n throw new EJBException(\"releaseConnection: \" + ex.getMessage());\n }\n }",
"public void closeConnection() {\n try {\n con.close();\n } catch (SQLException e) {\n System.err.println(e.getMessage());\n e.printStackTrace();\n }\n }",
"@Override\r\n\tpublic void close() {\n\t \t if (conn != null) {\r\n\t \t\t try {\r\n\t \t\t\t conn.close();\r\n\t \t\t } catch (Exception e) {\r\n\t \t\t\t e.printStackTrace();\r\n\t \t\t }\r\n\t \t }\r\n\t}",
"public void closeConnection();",
"private void closeConnection() {\n\t\t\tSystem.out.println(\"\\nTerminating connection \" + myConID + \"\\n\");\n\t\t\ttry {\n\t\t\t\toutput.close(); // close output stream\n\t\t\t\tinput.close(); // close input stream\n\t\t\t\tconnection.close(); // close socket\n\t\t\t} catch (IOException ioException) {\n\t\t\t\tSystem.out.println(\"Exception occured in closing connection\"\n\t\t\t\t\t\t+ ioException);\n\t\t\t}\n\t\t}",
"protected void connectionClosed() {}",
"private void endConnection(){\n\t\tif(this.connection != null){\n\t\t\ttry {\n\t\t\t\tthis.connection.close();\n\t\t\t} catch (SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"public static void close() {\n\t\ttry {\n\t\t\tconn.close();\n\t\t} catch(Exception e) {\n\t\t\tPvPTeleport.instance.getLogger().info(e.getMessage());\n\t\t}\n\n\t}",
"private void closeConnection()\n\t{\n\t\tif(result != null)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tresult.close();\n\t\t\t\tresult = null;\n\t\t\t}\n\t\t\tcatch(Exception ignore){}\n\t\t}\n\t\tif(con != null)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tcon.close();\n\t\t\t\tcon = null;\n\t\t\t}\n\t\t\tcatch(Exception ignore){}\n\t\t}\n\t}",
"public void closeConnection() {\n client.close();\n System.out.println(\"Connection to db closed.\");\n }",
"public void close() {\n\n\t\tdebug();\n\n\t\tif (isDebug == true) {\n\t\t\tlog.debug(\"=== CLOSE === \");\n\t\t}\n\n\t\ttry {\n\n\t\t\tif (connection != null) {\n\n\t\t\t\tlog.debug(\"Antes Connection Close\");\n\t\t\t\tconnection.close();\n\t\t\t\tlog.debug(\"Pos Connection Close\");\n\t\t\t}\n\n\t\t\tif (m_dbConn != null) {\n\t\t\t\tm_dbConn.close();\n\t\t\t}\n\n\t\t\tif (isDebug == true) {\n\t\t\t\tlog.debug(\"Connection Close\");\n\n\t\t\t}\n\n\t\t} catch (SQLException e) {\n\t\t\tlog.debug(\"ERRO Connection Close\");\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tconnection = null;\n\t\tm_dbConn = null;\n\n\t}",
"public void closeConnection() {\n try {\n dis.close();\n dos.close();\n socket.close();\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public static void closeConnection()\n\t{\n\t\ttry\n\t\t{\n\t\t\tconnect.close();\n\t\t} catch (SQLException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public void closeConnection() {\n if (this.connection != null && this.connected) {\n try {\n this.connection.close();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }\n }",
"public void closeConnection() {\r\n\t\ttry {\r\n\t\t\tthis.store.close();\r\n\t\t} catch (MessagingException e) {\r\n\t\t\tLog.error(e.getStackTrace().toString());\r\n\t\t}\r\n\t}",
"public void closeConnection() {\r\n if (getConnection() != null && StringUtil.isNotBlank(config.getDataSource())\r\n /*&& this.conn.getConnection() instanceof PooledConnection */) {\r\n LOG.ok(\"Close the pooled connection\");\r\n dispose();\r\n }\r\n }",
"public void closeConnection() {\n\t\tif (conn != null) {\n\t\t\ttry {\n\t\t\t\tconn.close();\n\t\t\t} catch(SQLException se){\n\t\t\t\tse.printStackTrace();\n\t\t\t}\n\t\t} \n\t}",
"private void connectionClosed() {\n if (this.state != SessionState.DISCONNECTING) {\n // this came unexpected\n connectionClosed(new VertxException(\"Connection closed\"));\n }\n }",
"public void close() throws IOException {\n try {\n _connection.close();\n } catch (SQLException e) {\n String msg = \"Failed to close database connection.\";\n _logger.warn(msg, e);\n }\n super.close(); //close the /dev/null that ncml gave us\n }",
"public void closeConnection()\n {\n try{\n if(statement!=null)\n connection.close();\n }catch(SQLException se){\n System.out.println(\"Close statement ex:\"+ se.getMessage());\n }// do nothing\n try{\n if(connection!=null)\n connection.close();\n }catch(SQLException se){\n System.out.println(\"Close connection ex:\"+ se.getMessage());\n }//end finally try\n }",
"protected static void closeConnection(Connection connection) throws ConnectionFailedException {\r\n try {\r\n if (!connection.isClosed()) { // If connection is not closed\r\n connection.close();\r\n }\r\n } catch (SQLException e) {\r\n // Something went wrong with the connection\r\n throw new ConnectionFailedException();\r\n }\r\n }",
"public void closeConnection() throws SQLException;",
"void close() throws Exception;",
"void close() throws Exception;",
"public void closeConnection() {\n\t\ttry{\n\t\t\tif(this.connection!=null)\n\t\t\t\tthis.connection.close();\n\t\t}catch(SQLException se){\n\t\t\tse.printStackTrace();\n\t\t}\n\t}",
"private void closeConnection(Connection connection, String signature) throws LateDeliverablesProcessingException {\r\n try {\r\n connection.close();\r\n } catch (SQLException e) {\r\n throw Helper.logException(log, signature, new LateDeliverablesProcessingException(\r\n \"Fails to close connection.\", e));\r\n }\r\n }",
"private void closeConnection() {\n try {\n fromClient.close();\n toClient.close();\n client.close();\n } catch (IOException e) {\n System.err.println(\"Unable to close connection:\" + e.getMessage());\n }\n }",
"public void closeConnection() {\n try {\n stdIn.close();\n socketIn.close();\n socketOut.close();\n }\n catch(IOException e) {\n e.printStackTrace();\n }\n }",
"public synchronized void close() throws SQLException {\n/* 204 */ if (this.physicalConn != null) {\n/* 205 */ this.physicalConn.close();\n/* */ \n/* 207 */ this.physicalConn = null;\n/* */ } \n/* */ \n/* 210 */ if (this.connectionEventListeners != null) {\n/* 211 */ this.connectionEventListeners.clear();\n/* */ \n/* 213 */ this.connectionEventListeners = null;\n/* */ } \n/* */ }",
"private void closeConnection() throws IOException {\n\t\tclientSocket.close();\n\t}",
"public void closeConnection() {\n try {\n String token = conn.toString();\n conn.close();\n log.info(\"Database Connection Closed. ID: {} \", token);\n } catch (Exception e) {\n log.error(\"Error closing the database connection. \\n Trace: {}\", ExceptionUtilities.stacktraceToString(e));\n }\n }",
"public void closeConnection() {\n\t\ttry {\n\t\t\tconn.close();\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"ERROR: cannot close connection to local database\");\n\t\t}\n\t}",
"public void closeConnection(Connection conn) throws SQLException;",
"public void close() {\n\t\ttry {\n\t\t\tconn.close();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public void close() {\n if (mLeakedException != null) {\n getConnectionManager().shutdown();\n mLeakedException = null;\n }\n }",
"public void closeConnection() {\n this.session.close();\n }",
"public void closeCon(){\r\n\t\ttry\r\n\t\t{\r\n\t\t\tmyConnection.close();\r\n\r\n\t\t}\r\n\r\n\t\tcatch (SQLException e )\r\n\t\t{\r\n\t\t\tSystem.out.println(\"something went wrong with closing DB connection\");\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"public void close() {\n connection.close();\n running = false;\n }",
"@Override\n\tpublic final void close() throws SailException {\n\t\tconnectionLock.writeLock().lock();\n\n\t\ttry {\n\t\t\tif (isOpen) {\n\t\t\t\ttry {\n\t\t\t\t\tforceCloseActiveOperations();\n\n\t\t\t\t\tif (txnActive) {\n\t\t\t\t\t\tlogger.warn(\"Rolling back transaction due to connection close\",\n\t\t\t\t\t\t\t\tdebugEnabled ? new Throwable() : null);\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t// Use internal method to avoid deadlock: the public\n\t\t\t\t\t\t\t// rollback method will try to obtain a connection lock\n\t\t\t\t\t\t\trollbackInternal();\n\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\ttxnActive = false;\n\t\t\t\t\t\t\ttxnPrepared = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tcloseInternal();\n\t\t\t\t} finally {\n\t\t\t\t\tisOpen = false;\n\t\t\t\t\tsailBase.connectionClosed(this);\n\t\t\t\t}\n\t\t\t}\n\t\t} finally {\n\t\t\t// Release the exclusive lock. Any threads waiting to obtain a\n\t\t\t// non-exclusive read lock will get one and then fail with an\n\t\t\t// IllegalStateException, because the connection is no longer open.\n\t\t\tconnectionLock.writeLock().unlock();\n\t\t}\n\t}",
"public void closeConnection() {\n\t\ttry {\n\t\t\tif (conn != null) {\n\t\t\t\tconn.close();\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t}\n\t\tconn = null;\n\t}",
"void close_Connection(){\n\t\ttry{\n\t\t\toutfile.close();\n\t\t\tcon.close();\n\t\t\tSystem.out.println(\"MYSQL is disconnected\");\n\t\t//Catch SQL exception\t\t\n\t\t}catch(SQLException sqle){ \n\t\t\tsqle.printStackTrace();\n\t\t\tSystem.exit(1);\n\t\t}\n\t\t//Catch I/O exception\t\n\t\tcatch(IOException ioe){ \n\t\t\tioe.printStackTrace();\n\t\t\tSystem.exit(1);\n\t\t}\t\t\n\t}",
"protected void closeConnection(RepositoryConnection connection)\n throws RepositoryException {\n }",
"public static void closeConnection(){\r\n\t\tif(connection != null)\r\n\t\t\ttry {\r\n\t\t\t\tconnection.close();\r\n\t\t\t} catch (SQLException 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}",
"final public void closeConnection() throws IOException {\n\n readyToStop = true;\n closeAll();\n }",
"public void close() {\n if (closed) {\n return;\n }\n try {\n disconnect();\n } catch (Exception e) {\n throw new IOError(e);\n }\n closed = true;\n }",
"@Override\r\n\tpublic void closeConnection() {\n\t\t\r\n\t}",
"public void close() {\n try {\n closeConnection(socket);\n } catch (IOException ioe) {\n ioe.printStackTrace();\n }\n }",
"@Override\n public void close() throws Exception {\n }",
"public void disconnect() {\n\t\tif (_connection != null) {\n\t\t\ttry {\n\t\t\t\twhile (!_connection.isClosed()) {\n\t\t\t\t\t_connection.close();\n\t\t\t\t}\n\t\t\t} catch (Exception e) { /* ignore close errors */\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"public void closeConnection()\n\t{\n\t\ttry\n\t\t{\n\t\t\tdatabaseConnection.close();\n\t\t}\n\t\tcatch (SQLException currentSQLError)\n\t\t{\n\t\t\tdisplaySQLErrors(currentSQLError);\n\t\t}\n\t}",
"public void ExitConection(){\n try {\n resultSet.close();\n preparedStatement.close();\n conection.close();\n } catch (Exception e) {\n// MessageEmergent(\"Fail ExitConection(): \"+e.getMessage());\n }\n }",
"public void cleanup(){\n try{\n if (this._connection != null){\n this._connection.close ();\n }//end if\n }catch (SQLException e){\n // ignored.\n }//end try\n }",
"public void disconnect() throws Exception\n {\n if(!connected)\n return;\n connectionSocket.close();\n reader.close();\n writer.close();\n listenerTimer.cancel();\n connected = false;\n\n }",
"void close() throws Exception;",
"public void closeConnection() throws SQLException {\n conn.close();\r\n }",
"public void shutdown() throws DatabaseAccessException {\n\t\ttry {\n\t\t\tthis.connection.close();\n\t\t} catch (SQLException e) {\n\t\t\tthrow new DatabaseAccessException(Failure.CONNECTION);\n\t\t}\n\t}",
"@Override\n public void closeConnection() {\n\n System.out.println(\"[CLIENT] Closing socket connection...\");\n try {\n socket.close();\n in.close();\n out.close();\n System.out.println(\"[CLIENT] Closed socket connection.\");\n } catch (IOException e) {\n System.out.println(\"[CLIENT] Error occurred when closing socket\");\n }\n System.exit(0);\n\n }",
"private void closeConnection() {\n try {\n bufferedWriter.close();\n } catch (IOException e) {\n System.err.println(\"Cannot close connection to MS SQL DB\");\n e.printStackTrace();\n }\n System.out.println(\"Close connection to MS SQL DB\");\n }",
"@Override\n public final void close() throws IOException {\n close(new MongoDbException(\"Connection closed.\"));\n }",
"public void close(Connection connection) throws SQLException {\n\n try { connection.close(); }\n catch (SQLException e) { throw e; }\n }",
"@Override\n public synchronized void close() throws IOException {\n disconnect(false);\n }",
"public void releaseConnection() {\r\n\t\tif (conn != null) {\r\n\t\t\ttry {\r\n\t\t\t\tconn.close();\r\n\t\t\t} catch (SQLException ex) {\r\n\t\t\t\tSystem.out.println(\"Exception closing connection: \" + ex);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private void connectionClosed(final Throwable cause) {\n if (log.isDebugEnabled()) {\n log.debug(\"Connection closed\", cause);\n } else {\n log.info(\"Connection closed: \" + (cause != null ? cause.getMessage() : \"<unknown>\"));\n }\n\n if (this.client != null) {\n this.client.exceptionHandler(null);\n this.client.publishHandler(null);\n this.client.closeHandler(null);\n this.client.subscribeCompletionHandler(null);\n this.client.publishCompletionHandler(null);\n this.client.publishCompletionExpirationHandler(null);\n this.client.publishCompletionUnknownPacketIdHandler(null);\n this.client = null;\n }\n setState(SessionState.DISCONNECTED, cause);\n }",
"public void closeSession() throws ConnectionException {\n\t\tif (!(stateMachine.getCurrent().getClass() == SessionValid.class)) {\n\t\t\tthrow new ConnectionException(\"Illegal connection state: \"\n\t\t\t\t\t+ stateMachine.getCurrent().getClass().getSimpleName());\n\t\t}\n\n\t\tstateMachine.doTransition(new CloseSession(managedSystemSessionId,\n\t\t\t\tmessageQueue.getSequenceNumber()));\n\t}",
"@Override\n public void closeConnection() throws SQLException{\n getConnection().close();\n }",
"@Override\n\tpublic void closeConnection() {\n\t\t\n\t}",
"public void pgClose() {\n\t\ttry {\n\t\t\tconn.close();\n\t\t\tSystem.out.println(\"Connection closed\");\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.err.println(\"Connection could not be closed ĘC SQLexception\");\n\t\t}\n\t\t\n\t}",
"public static void closeConnection() throws SQLException, IOException, JSchException {\n PropertiesLoader loader = new PropertiesLoader();\n int localPort = Integer.parseInt(loader.loadProperty().getProperty(\"localPort\"));\n if (connection != null) {\n connection.close();\n }\n if (session != null) {\n session.delPortForwardingL(localPort);\n session.disconnect();\n }\n }"
]
| [
"0.7704999",
"0.76463586",
"0.73903507",
"0.73521256",
"0.7350661",
"0.7295211",
"0.7225442",
"0.7179988",
"0.71199733",
"0.7105953",
"0.708345",
"0.7079227",
"0.70501345",
"0.70449096",
"0.7011599",
"0.70075023",
"0.7004892",
"0.6974568",
"0.6963415",
"0.69564366",
"0.6952796",
"0.69337857",
"0.6933656",
"0.69323766",
"0.6924903",
"0.6915388",
"0.68879485",
"0.68808776",
"0.68659776",
"0.6848343",
"0.6832983",
"0.6820896",
"0.6818761",
"0.68134516",
"0.67919874",
"0.6791807",
"0.6787328",
"0.6771483",
"0.6770194",
"0.6755082",
"0.67524767",
"0.6750426",
"0.6745384",
"0.6743759",
"0.6732872",
"0.6728082",
"0.6715504",
"0.6708956",
"0.6704755",
"0.6697451",
"0.6684012",
"0.6674213",
"0.66715837",
"0.66694164",
"0.6669001",
"0.6668211",
"0.6668211",
"0.66631955",
"0.6657815",
"0.6648441",
"0.6639282",
"0.66371655",
"0.66196084",
"0.66079843",
"0.6607654",
"0.6566321",
"0.65584666",
"0.6552014",
"0.65495235",
"0.6547116",
"0.65428567",
"0.6542436",
"0.65362877",
"0.65291065",
"0.65252155",
"0.6524055",
"0.6515227",
"0.6513205",
"0.65050036",
"0.64879924",
"0.64862925",
"0.64824253",
"0.64808714",
"0.647113",
"0.64706975",
"0.64667535",
"0.6462458",
"0.6455907",
"0.64507675",
"0.644379",
"0.6442512",
"0.6442068",
"0.64375013",
"0.6436077",
"0.6434716",
"0.6427553",
"0.6422623",
"0.64200526",
"0.6419986",
"0.64170223",
"0.6412645"
]
| 0.0 | -1 |
Think about Zuma Game. You have a row of balls on the table, colored red(R), yellow(Y), blue(B), green(G), and white(W). You also have several balls in your hand. Each time, you may choose a ball in your hand, and insert it into the row (including the leftmost place and rightmost place). Then, if there is a group of 3 or more balls in the same color touching, remove these balls. Keep doing this until no more balls can be removed. Find the minimal balls you have to insert to remove all the balls on the table. If you cannot remove all the balls, output 1. | public static void main(String[] args) {
System.out.println(findMinStep("WRRBBW", "RB"));
System.out.println(findMinStep("WWRRBBWW", "WRBRW"));
System.out.println(findMinStep("G", "GGGGG"));
System.out.println(findMinStep("RBYYBBRRB", "YRBGB"));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int dropBalls(){\r\n if(balls>0){\r\n balls--;\r\n }\r\n return getBalls();\r\n }",
"public void verifyDestroyedBoatsOnColumns(){ \n for (int i = 0; i < canvasNumberOfColumns; i++){\n int start = 0;\n int startCopy = 0;\n \n for (int j = 0; j < canvasNumberOfLines; j++){\n if (gameMatrix[j][i] != 0 && booleanMatrixUserChoices[j][i] == 1 && booleanFoundBoats[j][i] == 0){\n if (startCopy != gameMatrix[j][i] || start == 0){\n start = gameMatrix[j][i]+1;\n startCopy = gameMatrix[j][i];\n }\n }\n \n if (gameMatrix[j][i] == 0){\n start = 0;\n startCopy = 0;\n }\n \n if (start > 0 && booleanMatrixUserChoices[j][i] == 1){\n start--;\n }\n \n if (start == 1){\n if (startCopy == 1){\n boatsNumber[0] -= 1;\n booleanFoundBoats[j][i] = 1;\n }\n else if (startCopy == 2){\n boatsNumber[1] -= 1;\n booleanFoundBoats[j][i] = 1;\n booleanFoundBoats[j-1][i] = 1;\n }\n else if (startCopy == 3){\n boatsNumber[2] -= 1;\n booleanFoundBoats[j][i] = 1;\n booleanFoundBoats[j-1][i] = 1;\n booleanFoundBoats[j-2][i] = 1;\n }\n else if (startCopy == 4){\n boatsNumber[3] -= 1;\n booleanFoundBoats[j][i] = 1;\n booleanFoundBoats[j-1][i] = 1;\n booleanFoundBoats[j-2][i] = 1;\n booleanFoundBoats[j-3][i] = 1;\n }\n else if (startCopy == 5){\n boatsNumber[4] -= 1;\n booleanFoundBoats[j][i] = 1;\n booleanFoundBoats[j-1][i] = 1;\n booleanFoundBoats[j-2][i] = 1;\n booleanFoundBoats[j-3][i] = 1;\n booleanFoundBoats[j-4][i] = 1;\n }\n \n start = 0;\n startCopy = 0;\n }\n \n } \n } \n }",
"public void verifyDestroyedBoatsOnLines(){\n for (int i = 0; i < canvasNumberOfLines; i++){\n int start = 0;\n int startCopy = 0;\n \n for (int j = 0; j < canvasNumberOfColumns; j++){\n if (gameMatrix[i][j] != 0 && booleanMatrixUserChoices[i][j] == 1 && booleanFoundBoats[i][j] == 0){\n if (startCopy != gameMatrix[i][j] || start == 0){\n start = gameMatrix[i][j]+1;\n startCopy = gameMatrix[i][j];\n }\n }\n \n if (gameMatrix[i][j] == 0){\n start = 0;\n startCopy = 0;\n }\n \n if (start > 0 && booleanMatrixUserChoices[i][j] == 1){\n start--;\n }\n \n if (start == 1){\n if (startCopy == 1){\n boatsNumber[0] -= 1;\n booleanFoundBoats[i][j] = 1;\n }\n else if (startCopy == 2){\n boatsNumber[1] -= 1;\n booleanFoundBoats[i][j] = 1;\n booleanFoundBoats[i][j-1] = 1;\n }\n else if (startCopy == 3){\n boatsNumber[2] -= 1;\n booleanFoundBoats[i][j] = 1;\n booleanFoundBoats[i][j-1] = 1;\n booleanFoundBoats[i][j-2] = 1;\n }\n else if (startCopy == 4){\n boatsNumber[3] -= 1;\n booleanFoundBoats[i][j] = 1;\n booleanFoundBoats[i][j-1] = 1;\n booleanFoundBoats[i][j-2] = 1;\n booleanFoundBoats[i][j-3] = 1;\n }\n else if (startCopy == 5){\n boatsNumber[4] -= 1;\n booleanFoundBoats[i][j] = 1;\n booleanFoundBoats[i][j-1] = 1;\n booleanFoundBoats[i][j-2] = 1;\n booleanFoundBoats[i][j-3] = 1;\n booleanFoundBoats[i][j-4] = 1;\n }\n \n start = 0;\n startCopy = 0;\n }\n \n } \n } \n }",
"private void detectBombs(int row, int col){\r\n int bombCount = 0; //Amount of bombs nearby\r\n //Check up\r\n if((row-1 >= 0) && row<map.length && col<map[0].length && col>=0 && map[row-1][col].getSafe() == false){\r\n bombCount++;\r\n }\r\n //Check down\r\n if((row+1 < map.length) && row>=0&& col<map[0].length && col>=0 && map[row+1][col].getSafe() == false){\r\n bombCount++;\r\n }\r\n //Check right\r\n if((col+1 < map[0].length) && col>=0 && row<map.length && row>=0 && map[row][col+1].getSafe() == false){\r\n bombCount++;\r\n }\r\n //Check left\r\n if((col-1 >= 0) && col<map[0].length && row<map.length && row>=0 && map[row][col-1].getSafe() == false){\r\n bombCount++;\r\n }\r\n //Check up right\r\n if((row-1 >= 0) && row<map.length && (col+1 < map[0].length) && col>=0 && map[row-1][col+1].getSafe() == false){\r\n bombCount++;\r\n }\r\n //Check up left\r\n if((row-1 >= 0) && row<map.length && (col-1 >= 0) && col<map[0].length&& map[row-1][col-1].getSafe() == false){\r\n bombCount++;\r\n }\r\n //Check down left\r\n if((row+1 < map.length) && row>=0 && (col-1 >= 0)&& col<map[0].length && map[row+1][col-1].getSafe() == false){\r\n bombCount++;\r\n }\r\n //check down right\r\n if((row+1 < map.length) && row>=0 && (col+1 < map[0].length)&& col>=0 && map[row+1][col+1].getSafe() == false){\r\n bombCount++;\r\n }\r\n if(row>=0 && col>=0 && row<map.length && col<map[0].length && !map[row][col].getVisual().equals(\"F\") && map[row][col].getSafe() == true){\r\n if(bombCount==0){\r\n map[row][col].setVisual(zero);\r\n }\r\n if(bombCount==1){\r\n map[row][col].setVisual(one);\r\n }\r\n if(bombCount==2){\r\n map[row][col].setVisual(two);\r\n }\r\n if(bombCount==3){\r\n map[row][col].setVisual(three);\r\n }\r\n if(bombCount==4){\r\n map[row][col].setVisual(four);\r\n }\r\n if(bombCount==5){\r\n map[row][col].setVisual(five);\r\n }\r\n if(bombCount==6){\r\n map[row][col].setVisual(six);\r\n }\r\n if(bombCount==7){\r\n map[row][col].setVisual(seven);\r\n }\r\n if(bombCount==8){\r\n map[row][col].setVisual(eight);\r\n }\r\n map[row][col].setRevealed(true);\r\n }\r\n\r\n\r\n //return bombCount;\r\n\r\n\r\n }",
"int removeObstacle(int numRows, int numColumns, List<List<Integer>> lot)\r\n {\r\n \tint m = 0;\r\n \tint n = 0;\r\n \tfor(List<Integer> rowList: lot) {\r\n \t\tfor(Integer num: rowList) {\r\n \t\t\tif(num == 9 ) {\r\n \t\t\t\tbreak;\r\n \t\t\t}\r\n \t\t\tn++;\r\n \t\t}\r\n \t\tm++;\r\n \t}\r\n \t// to store min cells required to be \r\n // covered to reach a particular cell \r\n int dp[][] = new int[numRows][numColumns]; \r\n \r\n // initially no cells can be reached \r\n for (int i = 0; i < numRows; i++) \r\n for (int j = 0; j < numColumns; j++) \r\n dp[i][j] = Integer.MAX_VALUE; \r\n \r\n // base case \r\n dp[0][0] = 1; \r\n \r\n for (int i = 0; i < lot.size(); i++) {\r\n \tList<Integer> columnList = lot.get(i);\r\n for (int j = 0; j < columnList.size(); j++) { \r\n \r\n // dp[i][j] != INT_MAX denotes that cell \r\n // (i, j) can be reached from cell (0, 0) \r\n // and the other half of the condition \r\n // finds the cell on the right that can \r\n // be reached from (i, j) \r\n if (dp[i][j] != Integer.MAX_VALUE && \r\n (j + columnList.get(j)) < numColumns && (dp[i][j] + 1) \r\n < dp[i][j + columnList.get(j)]\r\n \t\t && columnList.get(j) != 0) \r\n dp[i][j + columnList.get(j)] = dp[i][j] + 1; \r\n \r\n if (dp[i][j] != Integer.MAX_VALUE && \r\n (i + columnList.get(j)) < numRows && (dp[i][j] + 1) \r\n < dp[i + columnList.get(j)][j] && columnList.get(j) != 0) \r\n dp[i + columnList.get(j)][j] = dp[i][j] + 1; \r\n } \r\n } \r\n \r\n if (dp[m - 1][n - 1] != Integer.MAX_VALUE) \r\n return dp[m - 1][n - 1]; \r\n \r\n return -1; \r\n }",
"public static void main(String args[]){\n int count = 1; \n long time1, time2;\n long redSum= 0;\n long blackSum =0;\n char[][] board = {\n {'W','B','W','B','W','B','W','B'},\n {'B','W','B','W','B','W','B','W'},\n {'W','B','X','B','X','B','X','B'},\n {'B','W','B','E','B','W','B','W'},\n {'W','B','X','B','X','B','X','B'},\n {'B','W','B','W','B','W','B','X'},\n {'X','B','X','B','X','B','X','B'},\n {'B','X','B','W','B','W','B','W'}\n \n } ;\n \n char[][] oldBoard = board;\n System.out.println(\"WIBB\");\n printBoard(board);\n while(count>0){\n \n time1 = new Date().getTime();\n for(int i =0; i<6; i++){\n \n // AlphaBetaTree isRedAI = new AlphaBetaTree(null, true, 0, -1000, 1000, 0, board, i);\n \n //isRedAI.getBestMove();\n \n }\n ArrayList<MoveCoordinates> aThing = new ArrayList<>();\n \n AlphaBetaTree isRedAI = new AlphaBetaTree(null, true, 0, -1000, 1000, 0, board, 3, aThing);\n // time1 = new Date().getTime();\n BoardMovesPair best= isRedAI.getBestMove();\n board = best.getBoard();\n if(board.equals(oldBoard)){\n \n break;\n }\n oldBoard = board;\n time2 = new Date().getTime();\n System.out.println(\"\\nRed's turn: \" + (count +1) );\n redSum+= (time2-time1);\n System.out.println(\"It took \" + (time2-time1 ) + \"ms\");\n printBoard(board);\n ArrayList<MoveCoordinates> allMoves = best.getAllMoves();\n if(allMoves == null){\n \n System.out.println(\"IS A NULL!!!\");\n \n }\n for(int i =0; i<allMoves.size(); i++){\n \n \n System.out.println(allMoves.get(i).getRow() + \" - \" + allMoves.get(i).getCol());\n \n }\n \n \n AlphaBetaTree isBlackAI = new AlphaBetaTree(null, false, 0, -1000, 1000, 0, board, 3, aThing);\n \n \n time1 = new Date().getTime();\n best = isBlackAI.getBestMove();\n board = best.getBoard();\n if(board.equals(oldBoard)){\n \n break;\n }\n oldBoard = board;\n time2 = new Date().getTime();\n System.out.println(\"\\nBlacks's turn: \" + (count +1) );\n blackSum+= (time2-time1);\n System.out.println(\"It took \" + (time2-time1 ) + \"ms\");\n \n printBoard(board);\n \n allMoves = best.getAllMoves();\n for(int i =0; i<allMoves.size(); i++){\n \n System.out.println(\"UM!? \" + allMoves.get(i).getRow() + \" - \" + allMoves.get(i).getCol());\n \n }\n \n count--;\n System.out.println(\"Count is: \" +count);\n }\n System.out.println(\"Red pieces: \" + BoardUtilities.countPieces('O', board));\n System.out.println(\"Red Kings: \" + BoardUtilities.countPieces('E', board));\n System.out.println(\"Average move: \" + (redSum/(count+1)) + \"ms\" );\n \n System.out.println(\"Black pieces: \" + BoardUtilities.countPieces('X', board));\n System.out.println(\"Black Kings: \" + BoardUtilities.countPieces('K', board));\n System.out.println(\"Average move: \" + (blackSum/(count+1)) + \"ms\" );\n printBoard(board);\n \n }",
"public static void dutch_flag_sort(char[] balls)\n {\n int n = balls.length;\n\n int swapRedHere = 0;\n int swapBluHere = n-1;\n\n int cur = 0;\n while (cur <= swapBluHere)\n {\n // If current ball is red, swap with swapRedHere. We will get a green so move current.\n if (balls[cur] == 'R')\n {\n swap(balls, cur, swapRedHere++);\n cur++;\n }\n // If current ball is blue, move it to swapBluHere. But don't move current because it now has unknown ball..\n else if (balls[cur] == 'B')\n {\n swap(balls, cur, swapBluHere--);\n }\n // Otherwise we have a green. Leave it there because it will get pulled out when swapRedHere reaches it.\n else // 'G'\n {\n cur++;\n }\n }\n }",
"public void RemoveRowsIfStackedTooHigh() {\n \t\t\n while (rowHasBlocks(Parameters.RemoveBiggestPartialRowIfBlockInRow)) {\n int NoOfPiecesRemoved = \n eraseBiggestRowGreaterThan(Parameters.RemoveBiggestPartialRowIfBlockInRow);\n //remove points for each empty square\n ComputeScoreAndDelay(-(COLUMNS - NoOfPiecesRemoved) * Parameters.PointsSubtractedPerEmptySpaceFromPartialRow);\n \n }\n game_grid.repaint();\n LogEvent(\"row_removed\");\n }",
"public void checkBallCollisions(Ball ball, Board board, ArrayList<Brick> bricks) {\n float currDir = ball.getDirection();\n // check if the ball has hit any of the bricks\n for(Brick brick : bricks){\n boolean hitBrick = false;\n boolean hitCorner = false;\n\n if (ball.intersects(brick.getTopLeftCorner())) {\n float angle = getDirectionAfterCollisionWithCircle(ball,brick.getTopLeftCorner());\n if ((!ball.hasPositiveXDirection()) && angle<reverseVerticalDirection(angle)) ball.reverseVerticalDirection();\n else if (ball.hasPositiveYDirection() && angle>reverseHorizontalDirection(angle)) ball.reverseHorizontalDirection();\n else ball.setDirection(angle);\n hitCorner = true;\n } else if (ball.intersects(brick.getTopRightCorner())) {\n float angle = getDirectionAfterCollisionWithCircle(ball,brick.getTopRightCorner());\n if (ball.hasPositiveXDirection() && angle>reverseVerticalDirection(angle) && angle<Math.PI) ball.reverseVerticalDirection();\n else if (ball.hasPositiveYDirection() && (angle<reverseHorizontalDirection(angle)\n || angle>Math.PI)) ball.reverseHorizontalDirection();\n else ball.setDirection(angle);\n hitCorner = true;\n } else if (ball.intersects(brick.getBottomLeftCorner())) {\n float angle = getDirectionAfterCollisionWithCircle(ball,brick.getBottomLeftCorner());\n if ((!ball.hasPositiveXDirection()) && angle>reverseVerticalDirection(angle)) ball.reverseVerticalDirection();\n else if ((!ball.hasPositiveYDirection()) && angle<reverseHorizontalDirection(angle)) ball.reverseHorizontalDirection();\n else ball.setDirection(angle);\n hitCorner = true;\n } else if (ball.intersects(brick.getBottomRightCorner())) {\n float angle = getDirectionAfterCollisionWithCircle(ball,brick.getBottomRightCorner());\n if (ball.hasPositiveXDirection() && angle<reverseVerticalDirection(angle) && angle>Math.PI) ball.reverseVerticalDirection();\n else if ((!ball.hasPositiveYDirection()) && angle>reverseHorizontalDirection(angle)) ball.reverseHorizontalDirection();\n else ball.setDirection(angle);\n hitCorner = true;\n }\n if (hitCorner) {\n brick.decrementLife(); Points.getInstance().addPoints(10);\n break;\n }\n if (ball.intersects(brick.getNorthLine()) && Math.PI<=currDir\n && currDir<=2*Math.PI) {\n ball.reverseVerticalDirection();\n hitBrick = true;\n } else if (ball.intersects(brick.getSouthLine()) && 0<=currDir\n && currDir<=Math.PI) {\n ball.reverseVerticalDirection();\n hitBrick = true;\n } else if (ball.intersects(brick.getWestLine()) && ((0<=currDir\n && currDir<=(Math.PI)/2) || ((3*Math.PI)/2<=currDir\n && currDir<=2*Math.PI))) {\n ball.reverseHorizontalDirection();\n hitBrick = true;\n } else if (ball.intersects(brick.getEastLine()) && (Math.PI)/2<=currDir\n && currDir<=(3*Math.PI)/2) {\n ball.reverseHorizontalDirection();\n hitBrick = true;\n }\n if (hitBrick) {\n brick.decrementLife(); Points.getInstance().addPoints(10);\n break;\n }\n }\n\n // check if the ball has hit the ceiling or one of the walls\n if (ball.getY() <= ceilingPos) {\n ball.setY(ceilingPos);\n ball.reverseVerticalDirection();\n } else if (ball.getMaxX() >= rightWallPos) {\n ball.setX(rightWallPos - 2 * ball.getRadius());\n ball.reverseHorizontalDirection();\n } else if (ball.getX() <= leftwallPos) {\n ball.setX(leftwallPos);\n ball.reverseHorizontalDirection();\n }\n\n // check if the ball has hit the board\n if (currDir>((Math.PI)/6) && currDir<((3*Math.PI)/6)) return;\n if (ball.intersects(board.getBody()) && currDir>Math.PI) {\n ball.reverseVerticalDirection();\n } else if (ball.intersects(board.getLeftEdge())) {\n float angle = getDirectionAfterCollisionWithCircle(ball, board.getLeftEdge());\n if (angle<((Math.PI)/2) || angle>(3*Math.PI)/2) ball.reverseVerticalDirection();\n else ball.setDirection(angle);\n } else if (ball.intersects(board.getRightEdge())) {\n float angle = getDirectionAfterCollisionWithCircle(ball, board.getRightEdge());\n if (angle>((Math.PI)/2) && angle<(3*Math.PI)/2) ball.reverseVerticalDirection();\n else ball.setDirection(angle);\n }\n }",
"public void clearBalls();",
"public void hunt() {\n\t\tfor(int i = 0; i < N; i++) {\n\t\t\tif(cells[i].visited == false) {\n\t\t\t\t\n\t\t\t\tint currentIndex = i;\n\t\t\t\t\n\t\t\t\tArrayList<Integer> neighbors = setVisitedNeighbors(i);\n\t\t\t\tint nextIndex = getRandomVisitedNeighborIndex(neighbors);\n\t\t\t\t\t\t\t\t\n\t\t\t\tif(neighbors.size() != 0 ) {\n\t\t\t\t\tcells[currentIndex].visited = true;\n\t\t\t\t\t\n\t\t\t\t\tif(nextIndex == NOT_EXIST) {\n\t\t\t\t\t\tbreak; \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//if there is NO not visited neighbors \n\t\t\t\t\t}\n\t\t\t\t\telse if(currentIndex - nextIndex == -1) {\n\t\t\t\t\t\tcells[currentIndex].border[EAST] = NO_WALL; \t\t\t\t\t\t\t//neighbor is right \n\t\t\t\t\t\tcells[nextIndex].border[WEST] = NO_WALL;\n\t\t\t\t\t}\n\t\t\t\t\telse if(currentIndex - nextIndex == width) {\n\t\t\t\t\t\tcells[currentIndex].border[NORTH] = NO_WALL;\t\t\t\t\t\t\t//neighbor is up\n\t\t\t\t\t\tcells[nextIndex].border[SOUTH] = NO_WALL;\n\t\t\t\t\t}\n\t\t\t\t\telse if(currentIndex - nextIndex == -width) {\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tcells[currentIndex].border[SOUTH] = NO_WALL;\t\t\t\t\t\t\t//neighbor is down\n\t\t\t\t\t\tcells[nextIndex].border[NORTH] = NO_WALL;\n\t\t\t\t\t}\n\t\t\t\t\telse if(currentIndex - nextIndex == 1) {\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tcells[currentIndex].border[WEST] = NO_WALL;\t\t\t\t\t\t\t\t//neighbor is left\n\t\t\t\t\t\tcells[nextIndex].border[EAST] = NO_WALL;\n\t\t\t\t\t}\n\t\t\t\t\tkill(nextIndex);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public static void randomMove(Board b){\r\n if (!b.getGameOver()){ //make sure game is not already over\r\n Random rand = new Random();\r\n int xIndex = rand.nextInt(7);\r\n int yIndex = 0;\r\n \r\n // make sure random column is not already full\r\n while (b.getGameGridCircle(xIndex,yIndex).getState() != 0) {\r\n xIndex = (xIndex + 1)%7;\r\n }\r\n //find the lowest empty slot in the chosen column\r\n //Place a circle there\r\n while(b.getGameGridCircle(xIndex, yIndex+1).getState() == 0){\r\n yIndex++;\r\n if (yIndex == b.numRows - 1) {\r\n break;\r\n }\r\n }\r\n\t //change state,turn,draw counter and refresh the board\r\n b.getGameGridCircle(xIndex,yIndex).setState(b.getTurn());\r\n b.setTurn(1);\r\n b.repaint();\r\n b.setDrawCounter(b.getDrawCounter() + 1);\r\n }\r\n }",
"public int leastBricks(List<List<Integer>> wall) {\r\n\t\tif (wall == null || wall.isEmpty()) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\tint height = wall.size();\r\n int wallWidth = 0;\r\n for (int brickWidth : wall.get(0)) {\r\n \twallWidth += brickWidth;\r\n }\r\n List<List<Integer>> positions = getPositions(wall);\r\n Set<Integer> stopPoints = new TreeSet<>();\r\n for (List<Integer> row : positions) {\r\n \tfor (int position : row) {\r\n \t\tstopPoints.add(position);\r\n \t}\r\n }\r\n stopPoints.remove(wallWidth);\r\n \r\n Map<Integer, Set<Integer>> rowsPerPosition = getRowsPerPosition(positions);\r\n int min = height;\r\n for (int stop : stopPoints) {\r\n \tmin = Math.min(min, height - rowsPerPosition.get(stop).size());\r\n }\r\n \r\n return min;\r\n }",
"private void playRound(GOval ball) {\n int bricksOnStage = NBRICK_ROWS * NBRICKS_PER_ROW;\n\n while(true) {\n bricksOnStage = collideObject(ball, bricksOnStage);\n collideStageLimits(ball);\n if (hasMissPaddle(ball)) {\n showLabel(\"BUSTED\", Color.BLACK);\n clearStage(ball);\n break;\n }\n ball.move(vx, vy);\n //println(vx + \" \" + vy);\n if (isBricksLeft(bricksOnStage)){\n showLabel(\"YOU WON!\", Color.red);\n clearStage(ball);\n break;\n }\n pause(PAUSE_TIME);\n }\n }",
"private Cell getBananaTarget() {\n Cell[][] blocks = gameState.map;\n int mostWormInRange = 0;\n Cell chosenCell = null;\n boolean wormAtCenter;\n\n for (int i = currentWorm.position.x - currentWorm.bananaBomb.range; i <= currentWorm.position.x + currentWorm.bananaBomb.range; i++){\n for (int j = currentWorm.position.y - currentWorm.bananaBomb.range; j <= currentWorm.position.y + currentWorm.bananaBomb.range; j++){\n wormAtCenter = false;\n if (isValidCoordinate(i, j)\n && euclideanDistance(i, j, currentWorm.position.x, currentWorm.position.y) <= 5) {\n List<Cell> affectedCells = getBananaAffectedCell(i, j);\n\n int wormInRange = 0;\n for (Cell cell : affectedCells) {\n for (Worm enemyWorm : opponent.worms) {\n if (enemyWorm.position.x == cell.x && enemyWorm.position.y == cell.y\n && enemyWorm.health > 0)\n wormInRange++;\n if (enemyWorm.position.x == i && enemyWorm.position.y == j)\n wormAtCenter = true;\n }\n for (Worm myWorm : player.worms) {\n if (myWorm.position.x == cell.x && myWorm.position.y == cell.y && myWorm.health > 0)\n wormInRange = -5;\n }\n }\n if (wormInRange > mostWormInRange) {\n mostWormInRange = wormInRange;\n chosenCell = blocks[j][i];\n } else if (wormInRange == mostWormInRange && wormAtCenter) {\n chosenCell = blocks[j][i];\n }\n }\n }\n }\n\n return chosenCell;\n }",
"public void ballVSbrick(Ball bb, Brick br) {\n Rectangle bb_box = new Rectangle(bb.getX(), bb.getY(), bb.getWidth(), bb.getHeight());\r\n Rectangle br_box = new Rectangle(br.getX(), br.getY(), br.getWidth(), br.getHeight());\r\n\r\n if (bb_box.intersects(br_box)) {\r\n //collision\r\n if (bb.getVX() < 0 && bb.getVY() < 0) {//-x,-y\r\n bb.setVY(bb.getVY() * -1);\r\n //remove brick\r\n //totalBricks.get(i)\r\n }//Inconsistent with collision\r\n else if (bb.getVX() > 0 && (bb.getVY() > 0)) {//+x,+y\r\n bb.setVY(bb.getVY() * -1);\r\n }//works\r\n else if (bb.getVX() < 0 && (bb.getVY() > 0)) {//-x,+y\r\n bb.setVY(bb.getVY() * -1);\r\n }//also inconsistent with collision\r\n else if(bb.getVX()>0 && bb.getVY()<0){//+x,-y\r\n bb.setVY(bb.getVY()*-1);\r\n }\r\n }\r\n if (totalBricks.isEmpty()) {\r\n this.setCleared(true);\r\n }\r\n //when the ball hits a brick\r\n //remove the brick\r\n //update velocity of ball\r\n\r\n }",
"public static int minimumNumberOfBlackWallsOnBoard()\n {\n return 0;\n }",
"public void removeBalls() {\r\n for (Ball ball : this.ballsList) {\r\n ball.removeFromGame(this);\r\n }\r\n this.ballsList.clear();\r\n }",
"private void randomPosBoats(GameData gameData) {\n int x0 = 0;\n int y0 = 0;\n for ( int n = gameData.getBoatArray().size()-1; n>=0; n--){\n Boat b = gameData.getBoatArray().get(n);\n Random rand = new Random();\n int l = b.getLength();\n\n boolean retry = true;\n while(retry) {\n int direction = rand.nextInt(2);\n\n //HORIZONTAL\n if (direction == 1) {\n x0 = rand.nextInt(gameData.getBoard().getWidth() - l);\n y0 = rand.nextInt(gameData.getBoard().getHeight());\n\n // we suppose it's a good starting point\n retry = false;\n for (int i = 0; i < l; i++) {\n //if one of the tiles already has a boat\n if (gameData.existsBoatAround(x0 + i, y0)) {\n retry = true;\n }\n }\n //POSITION BOAT\n if (!retry) {\n ArrayList pos = new ArrayList();\n for (int i = 0; i < l; i++) {\n int x = x0 + i;\n gameData.getMatrix()[y0][x] = b.getBoatid();\n pos.add(new int[]{x, y0});\n }\n b.setPositions(pos);\n }\n\n //VERTICAL\n } else {\n // determine the tile on which to start\n x0 = rand.nextInt(gameData.getBoard().getWidth());\n y0 = rand.nextInt(gameData.getBoard().getHeight() - l);\n\n // we suppose it's a good starting point\n retry = false;\n for (int i = 0; i < l; i++) {\n if (gameData.existsBoatAround(x0, y0 + i)) {\n retry = true;\n }\n }\n if(!retry){\n ArrayList pos = new ArrayList();\n for (int i = 0; i < l; i++) {\n int y = y0 + i;\n gameData.getMatrix()[y][x0] = b.getBoatid();\n pos.add(new int[]{x0, y});\n }\n b.setPositions(pos);\n }\n }\n }\n }\n }",
"public void moveBlueCrab() {\n\t\tloseLife();\n\t\tif (wallOverlapX()) {\n\t\t\tif (hitRight) {\n\t\t\t\tif (xVel > 0) {\n\t\t\t\t\tyPos += yVel;\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\txPos += xVel;\n\t\t\t\t\tyPos += yVel;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else if (hitLeft) {\n\t\t\t\tif (xVel < 0) {\n\t\t\t\t\tyPos += yVel;\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\txPos += xVel;\n\t\t\t\t\tyPos += yVel;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (wallOverlapY()) {\n\t\t\tif (hitUp) {\n\t\t\t\tif (yVel < 0) {\n\t\t\t\t\txPos += xVel;\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\txPos += xVel;\n\t\t\t\t\tyPos += yVel;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else if (hitDown) {\n\t\t\t\tif (yVel > 0) {\n\t\t\t\t\txPos += xVel;\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\txPos += xVel;\n\t\t\t\t\tyPos += yVel;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tint xLow = xPos;\n\t\tint xHigh =xPos + width;\n\t\tint yTop = yPos;\n\t\tint yBot = yPos + height;\n\t\tfor (int i = 0; i < game.m.walls.size(); i++) {\n\t\t\tif (game.m.walls.get(i).wallHit(this) > 0) {\n//\t\t\t\twhile (game.m.walls.get(i).wallHit(this)) {\n\t\t\t\tif (game.m.walls.get(i).wallHit(this) == 4) {\n\t\t\t\t\tif (yVel < 0) {\n\t\t\t\t\t\tyPos += yVel;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} \n\t\t\t\t\telse {\n\t\t\t\t\t\tfor (int j = 0; j < game.m.walls.size(); j++) {\n\t\t\t\t\t\t\tif (game.m.walls.get(j).wallHit(this) == 1) {\n\t\t\t\t\t\t\t\tif (xVel > 0) {\n\t\t\t\t\t\t\t\t\txPos += xVel;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (int j = 0; j < game.m.walls.size(); j++) {\n\t\t\t\t\t\t\tif (game.m.walls.get(j).wallHit(this) == 2) {\n\t\t\t\t\t\t\t\tif (xVel < 0) {\n\t\t\t\t\t\t\t\t\txPos += xVel;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\txPos += xVel;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (game.m.walls.get(i).wallHit(this) == 3) {\n\t\t\t\t\tif (yVel > 0) {\n\t\t\t\t\t\tyPos += yVel;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} \n\t\t\t\t\telse {\n\t\t\t\t\t\tfor (int j = 0; j < game.m.walls.size(); j++) {\n\t\t\t\t\t\t\tif (game.m.walls.get(j).wallHit(this) == 1) {\n\t\t\t\t\t\t\t\tif (xVel > 0) {\n\t\t\t\t\t\t\t\t\txPos += xVel;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (int j = 0; j < game.m.walls.size(); j++) {\n\t\t\t\t\t\t\tif (game.m.walls.get(j).wallHit(this) == 2) {\n\t\t\t\t\t\t\t\tif (xVel < 0) {\n\t\t\t\t\t\t\t\t\txPos += xVel;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\txPos += xVel;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (game.m.walls.get(i).wallHit(this) == 2) {\n\t\t\t\t\tif (xVel < 0) {\n\t\t\t\t\t\txPos += xVel;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} \n\t\t\t\t\telse {\n\t\t\t\t\t\tfor (int j = 0; j < game.m.walls.size(); j++) {\n\t\t\t\t\t\t\tif (game.m.walls.get(j).wallHit(this) == 3) {\n\t\t\t\t\t\t\t\tif (yVel > 0) {\n\t\t\t\t\t\t\t\t\tyPos += yVel;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (int j = 0; j < game.m.walls.size(); j++) {\n\t\t\t\t\t\t\tif (game.m.walls.get(j).wallHit(this) == 4) {\n\t\t\t\t\t\t\t\tif (yVel < 0) {\n\t\t\t\t\t\t\t\t\tyPos += yVel;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tyPos += yVel;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (game.m.walls.get(i).wallHit(this) == 1) {\n\t\t\t\t\tif (xVel > 0) {\n\t\t\t\t\t\txPos += xVel;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} \n\t\t\t\t\telse {\n\t\t\t\t\t\tfor (int j = 0; j < game.m.walls.size(); j++) {\n\t\t\t\t\t\t\tif (game.m.walls.get(j).wallHit(this) == 3) {\n\t\t\t\t\t\t\t\tif (yVel > 0) {\n\t\t\t\t\t\t\t\t\tyPos += yVel;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (int j = 0; j < game.m.walls.size(); j++) {\n\t\t\t\t\t\t\tif (game.m.walls.get(j).wallHit(this) == 4) {\n\t\t\t\t\t\t\t\tif (yVel < 0) {\n\t\t\t\t\t\t\t\t\tyPos += yVel;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tyPos += yVel;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n//\t\t\t\tif (xVel > 0) {\n//\t\t\t\t\txPos -= 20;\n//\t\t\t\t\treturn;\n//\t\t\t\t} \n//\t\t\t\telse if (xVel < 0) {\n//\t\t\t\t\txPos += 20;\n//\t\t\t\t\treturn;\n//\t\t\t\t}\n//\t\t\t\tif (yVel > 0) {\n//\t\t\t\t\tyPos -= 20;\n//\t\t\t\t\treturn;\n//\t\t\t\t}\n//\t\t\t\telse if (yVel < 0) {\n//\t\t\t\t\tyPos += 20;\n//\t\t\t\t\treturn;\n//\t\t\t\t}\n//\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (xPos <= 0) {\n\t\t\tif (xVel > 0) {\n\t\t\t\txPos += xVel;\n\t\t\t} else if (yPos + height <= game.mapHeight && yPos >= 0){\n\t\t\t\tyPos += yVel;\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else if (xPos + width >= game.mapWidth) {\n\t\t\tif (xVel < 0) {\n\t\t\t\txPos += xVel;\n\t\t\t} else if (yPos + height <= game.mapHeight && yPos >= 0){\n\t\t\t\tyPos += yVel;\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else if (yPos <= 0) {\n\t\t\tif (yVel > 0) {\n\t\t\t\tyPos += yVel;\n\t\t\t} else if (xPos + width <= game.mapWidth && xPos >= 0){ \n\t\t\t\txPos += xVel;\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else if (yPos + height >= game.mapHeight) { \n\t\t\tif (yVel < 0) {\n\t\t\t\tyPos += yVel;\n\t\t\t} else if (xPos + width <= game.mapWidth && xPos >= 0){\n\t\t\t\txPos += xVel;\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\txPos += xVel;\n\t\t\tyPos += yVel;\n\t\t}\n\n\t}",
"public void updateTopBorder(){\n\n\n //Go up until reach maximum border height and then go down, so zig zag, maximum will increase when score increases.\n //Every 100 points insert random blocks\n\n for (int i = 0; i < topborder.size(); i++){\n topborder.get(i).update();\n\n //Remove top border if off map and replace by adding a new one\n if (topborder.get(i).getX()<-25){\n topborder.remove(i);\n\n //Retrieves the last element in the array list\n if (topborder.get(topborder.size()-1).getHeight()>=maxBorderHeight){\n top = false;\n }\n if (topborder.get(topborder.size()-1).getHeight()<=minBorderHeight){\n top = true;\n }\n\n //New border will have a larger height, else smaller height\n if (top){\n topborder.add(new TopBorder(BitmapFactory.decodeResource(getResources(),R.drawable.newborder), topborder.get(topborder.size()-1).getX()+25, 0, topborder.get(topborder.size()-1).getHeight()+1));\n }\n else {\n topborder.add(new TopBorder(BitmapFactory.decodeResource(getResources(),R.drawable.newborder), topborder.get(topborder.size()-1).getX()+25, 0, topborder.get(topborder.size()-1).getHeight()-1));\n }\n }\n }\n\n }",
"public void seekWalls() {\n\t\t for (int j=0; j<visited[0].length; j++){\n\t\t\tfor (int i=visited.length-1; i>=0; i--) {\t\t\t\n\t\t\t\tif (i!=0 && j!= visited[0].length-1) {//general position\n\t\t\t\t\tif (map.get(visited[i][j]) + map.get(visited[i-1][j]) == maxComb && !isFree(i,j,2)) {\n\t\t\t\t\t\twallRow = i+1;\n\t\t\t\t\t\twallCol = j+1;\n\t\t\t\t\t\twallSide = 'N';\n\t\t\t\t\t\treturn;//not break!!!!! return to exit !\n\t\t\t\t\t}\n\n\t\t\t\t\tif (map.get(visited[i][j]) + map.get(visited[i][j+1]) == maxComb && !isFree(i,j,4)) {\n\t\t\t\t\t\twallRow = i+1;\n\t\t\t\t\t\twallCol = j+1;\n\t\t\t\t\t\twallSide = 'E';\t\n\t\t\t\t\t\treturn;\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse if (i==0 && j!= visited[0].length-1) {\n\t\t\t\t\tif (map.get(visited[i][j]) + map.get(visited[i][j+1]) == maxComb && !isFree(i,j,4)) {\n\t\t\t\t\t\twallRow = i+1;\n\t\t\t\t\t\twallCol = j+1;\n\t\t\t\t\t\twallSide = 'E';\t\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\telse if (i!=0 && j== visited[0].length-1) {\n\t\t\t\t\tif (map.get(visited[i][j]) + map.get(visited[i-1][j]) == maxComb && !isFree(i,j,2)) {\n\t\t\t\t\t\twallRow = i+1;\n\t\t\t\t\t\twallCol = j+1;\n\t\t\t\t\t\twallSide = 'N';\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\telse {//if (i==0 && j== visited[0].length-1) {\n\t\t\t\t\t//no solution\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"private int nbrBombAround(int i, int j) {\n int nbr = 0;\n if (i - 1 != -1) \n nbr = state[i - 1][j] == 'X' ? nbr + 1 : nbr + 0;\n if (i + 1 != state.length) \n nbr = state[i + 1][j] == 'X' ? nbr + 1 : nbr + 0;\n\n if (j - 1 != -1) \n nbr = state[i][j - 1] == 'X' ? nbr + 1 : nbr + 0;\n if (j + 1 != state.length) \n nbr = state[i][j + 1] == 'X' ? nbr + 1 : nbr + 0;\n\n if (i - 1 != -1 && j - 1 != -1) \n nbr = state[i - 1][j - 1] == 'X' ? nbr + 1 : nbr + 0;\n if (i + 1 != state.length && j + 1 != state.length) \n nbr = state[i + 1][j + 1] == 'X' ? nbr + 1 : nbr + 0;\n\n if (i - 1 != -1 && j + 1 != state.length) \n nbr = state[i - 1][j + 1] == 'X' ? nbr + 1 : nbr + 0;\n if (i + 1 != state.length && j - 1 != -1) \n nbr = state[i + 1][j - 1] == 'X' ? nbr + 1 : nbr + 0;\n\n return nbr;\n}",
"private synchronized void removeWall(int desiredRow, int desiredColumn) {\n \tint topBlock = m.maze[desiredRow - 1][desiredColumn];\t\t\t\t\t// block directly above the current block\r\n \tint leftBlock = m.maze[desiredRow][desiredColumn - 1];\t\t\t\t\t// block directly left of the current block\r\n \tint bottomBlock = m.maze[desiredRow + 1][desiredColumn];\t\t\t\t// block directly below the current block\r\n \tint rightBlock = m.maze[desiredRow][desiredColumn + 1];\t\t\t\t\t// block directly right of the current block\r\n \t\r\n if (desiredRow % 2 == 1 && leftBlock != rightBlock) {\t\t\t\t\t// wall is vertical\r\n \tm.fixBlocks(desiredRow, desiredColumn - 1, leftBlock, rightBlock);\t// fix all blocks so a loop is not created when the wall is removed\r\n m.maze[desiredRow][desiredColumn] = rightBlock;\t\t\t\t\t\t// set current block with wall to be empty (no wall) thus removing the wall\r\n } else if (desiredRow % 2 == 0 && topBlock != bottomBlock) {\t\t\t// wall is horizontal\r\n \tm.fixBlocks(desiredRow - 1, desiredColumn, topBlock, bottomBlock);\t// fix all blocks so a loop is not created when the wall is removed\r\n m.maze[desiredRow][desiredColumn] = bottomBlock;\t\t\t\t\t// set current block with wall to be empty (no wall) thus removing the wall\r\n }\r\n repaint();\r\n try { wait(1); }\r\n catch (InterruptedException e) { }\r\n }",
"private Move produceHeuristicMove(Board board){\n\n\t\tint numRows = board.getNumberOfRows();\n\t\tint[][] bins = new int[numRows][BINARY_LENGTH];\n\t\tint[] binarySum = new int[BINARY_LENGTH];\n\t\tint bitIndex,higherThenOne=0,totalOnes=0,lastRow=0,lastLeft=0,lastSize=0,lastOneRow=0,lastOneLeft=0;\n\t\t\n\t\tfor(bitIndex = 0;bitIndex<BINARY_LENGTH;bitIndex++){\n\t\t\tbinarySum[bitIndex] = 0;\n\t\t}\n\t\t\n\t\tfor(int k=0;k<numRows;k++){\n\t\t\t\n\t\t\tint curRowLength = board.getRowLength(k+1);\n\t\t\tint i = 0;\n\t\t\tint numOnes = 0;\n\t\t\t\n\t\t\tfor(bitIndex = 0;bitIndex<BINARY_LENGTH;bitIndex++){\n\t\t\t\tbins[k][bitIndex] = 0;\n\t\t\t}\n\t\t\t\n\t\t\tdo {\n\t\t\t\tif(i<curRowLength && board.isStickUnmarked(k+1,i+1) ){\n\t\t\t\t\tnumOnes++;\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\tif(numOnes>0){\n\t\t\t\t\t\t\n\t\t\t\t\t\tString curNum = Integer.toBinaryString(numOnes);\n\t\t\t\t\t\twhile(curNum.length()<BINARY_LENGTH){\n\t\t\t\t\t\t\tcurNum = \"0\" + curNum;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor(bitIndex = 0;bitIndex<BINARY_LENGTH;bitIndex++){\n\t\t\t\t\t\t\tbins[k][bitIndex] += curNum.charAt(bitIndex)-'0'; //Convert from char to int\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(numOnes>1){\n\t\t\t\t\t\t\thigherThenOne++;\n\t\t\t\t\t\t\tlastRow = k +1;\n\t\t\t\t\t\t\tlastLeft = i - numOnes + 1;\n\t\t\t\t\t\t\tlastSize = numOnes;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttotalOnes++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlastOneRow = k+1;\n\t\t\t\t\t\tlastOneLeft = i;\n\t\t\t\t\t\t\n\t\t\t\t\t\tnumOnes = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t}while(i<=curRowLength);\n\t\t\t\n\t\t\tfor(bitIndex = 0;bitIndex<BINARY_LENGTH;bitIndex++){\n\t\t\t\tbinarySum[bitIndex] = (binarySum[bitIndex]+bins[k][bitIndex])%2;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t//We only have single sticks\n\t\tif(higherThenOne==0){\n\t\t\treturn new Move(lastOneRow,lastOneLeft,lastOneLeft);\n\t\t}\n\t\t\n\t\t//We are at a finishing state\t\t\t\t\n\t\tif(higherThenOne<=1){\n\t\t\t\n\t\t\tif(totalOnes == 0){\n\t\t\t\treturn new Move(lastRow,lastLeft,lastLeft+(lastSize-1) - 1);\n\t\t\t} else {\n\t\t\t\treturn new Move(lastRow,lastLeft,lastLeft+(lastSize-1)-(1-totalOnes%2));\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tfor(bitIndex = 0;bitIndex<BINARY_LENGTH-1;bitIndex++){\n\t\t\t\n\t\t\tif(binarySum[bitIndex]>0){\n\t\t\t\t\n\t\t\t\tint finalSum = 0,eraseRow = 0,eraseSize = 0,numRemove = 0;\n\t\t\t\tfor(int k=0;k<numRows;k++){\n\t\t\t\t\t\n\t\t\t\t\tif(bins[k][bitIndex]>0){\n\t\t\t\t\t\teraseRow = k+1;\n\t\t\t\t\t\teraseSize = (int)Math.pow(2,BINARY_LENGTH-bitIndex-1);\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor(int b2 = bitIndex+1;b2<BINARY_LENGTH;b2++){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(binarySum[b2]>0){\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(bins[k][b2]==0){\n\t\t\t\t\t\t\t\t\tfinalSum = finalSum + (int)Math.pow(2,BINARY_LENGTH-b2-1);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tfinalSum = finalSum - (int)Math.pow(2,BINARY_LENGTH-b2-1);\n\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\t\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\t\n\t\t\t\tnumRemove = eraseSize - finalSum;\n\t\t\t\t\n\t\t\t\t//Now we find that part and remove from it the required piece\n\t\t\t\tint numOnes=0,i=0;\n\t\t\t\twhile(numOnes<eraseSize){\n\n\t\t\t\t\tif(board.isStickUnmarked(eraseRow,i+1)){\n\t\t\t\t\t\tnumOnes++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnumOnes=0;\n\t\t\t\t\t}\n\t\t\t\t\ti++;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\treturn new Move(eraseRow,i-numOnes+1,i-numOnes+numRemove);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//If we reached here, and the board is not symmetric, then we only need to erase a single stick\n\t\tif(binarySum[BINARY_LENGTH-1]>0){\n\t\t\treturn new Move(lastOneRow,lastOneLeft,lastOneLeft);\n\t\t}\n\t\t\n\t\t//If we reached here, it means that the board is already symmetric, and then we simply mark one stick from the last sequence we saw:\n\t\treturn new Move(lastRow,lastLeft,lastLeft);\t\t\n\t}",
"public void rowChecked(){\n\t\tint numRows = 0;\n\t\tboolean full;\n\t\tint row = well[0].length - 2;\n\t\twhile(!emptyRow(row)){\n\t\t\tfull = true;\n\t\t\tfor(int i = 0; i < well.length; i++){\n\t\t\t\tif(well[i][row] == Color.WHITE)\n\t\t\t\t\tfull = false;\n\t\t\t}\n\t\t\tif(full){\n\t\t\t\tdeleteRow(row);\n\t\t\t\tnumRows++;\n\t\t\t}\n\t\t\telse row--;\n\t\t}\n\t\tswitch(numRows){\n\t\t\tcase 0: break;\n\t\t\tcase 1: score += 100; break;\n\t\t\tcase 2: score += 200; break;\n\t\t\tcase 3: score += 400; break;\n\t\t\tcase 4: score += 800; break;\n\t\t\tcase 5: score += 1600; break;\n\t\t}\n\t}",
"public Pair<Queue<BaseSingle>, boolean[][]> getBorderTroops() {\n Queue<BaseSingle> borderTroops = new LinkedList<>();\n boolean[][] inDanger = new boolean[depth][width];\n int i = 0;\n int j = 0;\n\n // First, scan the first line.\n BaseSingle troop;\n boolean oneLineLeft = false;\n for (j = 0; j < width; j++) {\n troop = aliveTroopsFormation[i][j];\n if (troop != null) {\n borderTroops.add(troop);\n inDanger[i][j] = true;\n } else {\n oneLineLeft = true;\n }\n }\n if (oneLineLeft) return new Pair<>(borderTroops, inDanger);\n\n // Then scan downward from both sides\n int heightLeft = 0;\n int heightRight = 0;\n BaseSingle troopLeft;\n BaseSingle troopRight;\n for (i = 1; i < depth; i++) {\n troopLeft = aliveTroopsFormation[i][0];\n troopRight = aliveTroopsFormation[i][width - 1];\n if (troopLeft != null) {\n borderTroops.add(troopLeft);\n heightLeft += 1;\n inDanger[i][0] = true;\n }\n if (troopRight != null) {\n borderTroops.add(troopRight);\n heightRight += 1;\n inDanger[i][width - 1] = true;\n }\n if (troopLeft == null || troopRight == null) break;\n }\n\n // Last line\n int lastLine = Math.min(heightLeft, heightRight);\n if (lastLine == depth - 1) {\n for (j = 1; j < width - 1; j++) {\n inDanger[lastLine][j] = true;\n borderTroops.add(aliveTroopsFormation[lastLine][j]);\n }\n } else {\n for (j = 1; j < width - 1; j++) {\n if (aliveTroopsFormation[lastLine + 1][j] == null) {\n inDanger[lastLine][j] = true;\n borderTroops.add(aliveTroopsFormation[lastLine][j]);\n } else {\n inDanger[lastLine + 1][j] = true;\n borderTroops.add(aliveTroopsFormation[lastLine + 1][j]);\n }\n }\n }\n return new Pair<>(borderTroops, inDanger);\n }",
"private void UpdateSurround(int row, int col) {\n\t\t\n\t\t// updates the 3 positions below the bomb\n\t\tif(row - 1 >= 0) {\n\t\t\tif(grid[row-1][col] < 9)\n\t\t\t\tgrid[row-1][col] = grid[row-1][col] + 1;\n\t\t\tif(col - 1 >= 0) {\n\t\t\t\tif(grid[row-1][col-1] < 9)\n\t\t\t\t\tgrid[row-1][col-1] = grid[row-1][col-1] + 1;\n\t\t\t}\n\t\t\tif(col + 1 < width) {\n\t\t\t\tif(grid[row-1][col+1] < 9)\n\t\t\t\t\tgrid[row-1][col+1] = grid[row-1][col+1] + 1;\n\t\t\t}\n\t\t}\n\t\t// updates the 3 positions above the bomb\n\t\tif(row + 1 < height) {\n\t\t\tif(grid[row+1][col] < 9)\n\t\t\t\tgrid[row+1][col] = grid[row+1][col] + 1;\n\t\t\tif(col - 1 >= 0) {\n\t\t\t\tif(grid[row+1][col-1] <9)\n\t\t\t\t\tgrid[row+1][col-1] = grid[row+1][col-1] + 1;\n\t\t\t}\n\t\t\tif(col + 1 < width) {\n\t\t\t\tif(grid[row+1][col+1] < 9)\n\t\t\t\t\tgrid[row+1][col+1] = grid[row+1][col+1] + 1;\n\t\t\t}\n\t\t}\n\t\t// updates position to the left\n\t\tif(col - 1 >= 0) {\n\t\t\tif(grid[row][col-1] < 9)\n\t\t\t\tgrid[row][col-1] = grid[row][col-1] + 1;\n\t\t}\n\t\t// updates position to the right\n\t\tif(col + 1 < width) {\n\t\t\tif(grid[row][col+1] < 9)\n\t\t\t\tgrid[row][col+1] = grid[row][col+1] + 1;\n\t\t}\n\t}",
"public int hamming() {\n int numIncorrect = -1;\n int index = 1;\n\n for (int[] row : tiles) {\n for (int tile : row) {\n if (tile != index)\n numIncorrect++;\n index++;\n }\n }\n return numIncorrect;\n }",
"void lowerNumberOfStonesOnBoard();",
"private Cell getSnowballTarget() {\n Cell[][] blocks = gameState.map;\n int mostWormInRange = 0;\n Cell chosenCell = null;\n\n for (int i = currentWorm.position.x - 5; i <= currentWorm.position.x + 5; i++) {\n for (int j = currentWorm.position.y - 5; j <= currentWorm.position.y + 5; j++) {\n if (isValidCoordinate(i, j)\n && euclideanDistance(i, j, currentWorm.position.x, currentWorm.position.y) <= 5) {\n List<Cell> affectedCells = getSurroundingCells(i, j);\n affectedCells.add(blocks[j][i]);\n int wormInRange = 0;\n for (Cell cell : affectedCells) {\n for (Worm enemyWorm : opponent.worms) {\n if (enemyWorm.position.x == cell.x && enemyWorm.position.y == cell.y\n && enemyWorm.roundsUntilUnfrozen == 0 && enemyWorm.health > 0)\n wormInRange++;\n }\n for (Worm myWorm : player.worms) {\n if (myWorm.position.x == cell.x && myWorm.position.y == cell.y && myWorm.health > 0)\n wormInRange = -5;\n }\n }\n if (wormInRange > mostWormInRange) {\n mostWormInRange = wormInRange;\n chosenCell = blocks[j][i];\n }\n }\n }\n }\n\n return chosenCell;\n }",
"public int hamming() {\n int count = 1;\n int hamming = 0;\n for (int row = 0; row < dimension(); row++) {\n for (int column = 0; column < dimension(); column++) {\n if (row == dimension() - 1 && column == dimension()-1) break; // Skip last value of the board\n if (blocks[row][column] != count) hamming++;\n count++;\n }\n } \n return hamming;\n }",
"public void initLogicBoard() {\n int numOfBombs = 0;\n while (numOfBombs<bombs) {\n int randX = (int) (Math.random() * (rows - 1));\n int randY = (int) (Math.random() * (cols - 1));\n if (allTiles[randX][randY].getType() != 10) {\n allTiles[randX][randY].setType(10);\n\n for (int m = randX - 1; m <= randX + 1; m++) {\n for (int n = randY - 1; n <= randY + 1; n++) {\n if ((m < rows && n < cols) && (m >= 0 && n >= 0)) {\n if (allTiles[m][n].getType() != 10)\n allTiles[m][n].setType(allTiles[m][n].getType() + 1);\n }\n }\n }\n numOfBombs++;\n\n }\n }\n }",
"public void update() {\n\t\t// Complete this method\n\n\t\tint [][]tempTable = new int [numberOfRows()][numberOfColumns()];\n\n\t\tfor ( int r = 0; r < numberOfRows(); r++ ){\n\t\t\tfor (int c = 0; c < numberOfColumns(); c++){\n\t\t\t\tif(neighborCount(r,c) == 3){//if there is exactly three\n\t\t\t\t\tif(gameGrid[r][c] == 0)//cell is born\n\t\t\t\t\t\ttempTable[r][c] = 1;//then you add one to your tempTable\t\n\t\t\t\t}\n\n\t\t\t\tif((neighborCount(r,c) == 2) || (neighborCount(r,c) == 3)){//if there is two or three\n\t\t\t\t\tif(gameGrid[r][c] == 1)//this is your existing cell\n\t\t\t\t\t\ttempTable[r][c] = 1;//then the cell remains\n\t\t\t\t}\n\n\t\t\t\tif((neighborCount(r,c) == 0) || (neighborCount(r,c) == 1)){//if there were two neighbors\n\t\t\t\t\tif(gameGrid[r][c] == 0)//if there is no cell\n\t\t\t\t\t\ttempTable[r][c] = 0;//a cell dies\n\t\t\t\t}\n\n\t\t\t\tif((neighborCount(r,c) > 3)){//if there is more than three\n\t\t\t\t\tif(gameGrid[r][c] == 1)//if there is no cell\n\t\t\t\t\t\ttempTable[r][c] = 0;//a cell dies\n\t\t\t\t}\n\n\t\t\t}//end of column for loop\n\t\t}//end of row for loop\n\t\tgameGrid = tempTable;\n\t}",
"public static void moveBalls() {\n\t\tfor (Ball b : Panel.balls) {\n\t\t\tif (b.getxPOS() + b.getxVelocity() < 410 || b.getxPOS() + b.getxVelocity() > (1200 - (b.getMass() * 7))) { //checking next frame for boundry collision\n\t\t\t\tb.setxVelocity(-b.getxVelocity());\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//reverseing velocity if true\n\t\t\t}\n\t\t\tif (b.getyPOS() + b.getyVelocity() < 0) {\n\t\t\t\tb.setyVelocity(-(b.getyVelocity()));\n\t\t\t}\n\t\t\tif (b.getyPOS() + b.getyVelocity() > (800 - (b.getMass() * 7)) - 22) { //on each collision with the floor, decrease the balls X and Y velocity\n\t\t\t\tb.setyVelocity(-(b.getyVelocity() - energyLost));\n\t\t\t\tif (Panel.tick % 7 == 0 && Panel.Gravity) {\n\t\t\t\t\tif (b.getxVelocity() < 0) {\n\t\t\t\t\t\tb.setxVelocity(b.getxVelocity() + 1);\n\t\t\t\t\t}\n\t\t\t\t\tif (b.getxVelocity() > 0) {\n\t\t\t\t\t\tb.setxVelocity(b.getxVelocity() - 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!(b.getyPOS() + b.getyVelocity() > (800 - (b.getMass() * 7)) - 22)) { //applying motion in the Y direction only if the ball is not resting on the floor\n\t\t\t\tb.setyPOS(b.getyPOS() + b.getyVelocity());\n\t\t\t}\n\t\t\telse {\n\t\t\t\tb.setyPOS((800 - (b.getMass() * 7)) - 22);\n\t\t\t}\n\t\t\t\n\t\t\tb.setxPOS(b.getxPOS() + b.getxVelocity()); //motion is always applied in the X direction\n\t\t}\n\t}",
"public static void main(String args[]) throws IOException {\n Scanner s = new Scanner (System.in);\n int t = s.nextInt();\n while(t-- > 0)\n {\n int k = s.nextInt();\n int bucket_width [] = new int[k];\n for(int i = 0; i < k; i++)\n bucket_width[i] = s.nextInt();\n \n int n = s.nextInt();\n int balls_width[] = new int[n];\n for(int i = 0; i < n; i++)\n balls_width[i] = s.nextInt();\n \n int ball_bucket[] = new int[k];\n \n \n for(int i = 0; i < k; i++)\n ball_bucket[i] = 0;\n \n \n int j = 0;\n for(int i = 0; i < n; i++)\n {\n \n for( j = k - 1; j >= 0; j--)\n {\n if(bucket_width[j] >= balls_width[i] && ball_bucket[j] <= j )\n {\n ball_bucket[j] += 1;\n System.out.print(j + 1 + \" \");\n break;\n }\n }\n if(j < 0)\n System.out.print(\"0\" + \" \");\n }\n System.out.println();\n }\n }",
"private boolean moveUP() {\r\n\t\tint i,j,k;\r\n\t\tboolean flag = false;\r\n\t\tfor(i = 0 ; i < rows_size; i++) {\r\n\t\t\tfor( j = 0; j < columns_size; j++) {\r\n\t\t\t\tif( !isEmpty(i,j) ) {\r\n\t\t\t\t\tfor(k = i; k >= 0 && isEmpty(k-1,j); k--);\r\n\t\t\t\t\t\tif(k == 0) {\r\n\t\t\t\t\t\t\tif(k != i) {\r\n\t\t\t\t\t\t\tgame[k][j] = new Cell2048(game[i][j]);\r\n\t\t\t\t\t\t\tgame[i][j].setValue(0);\r\n\t\t\t\t\t\t\tflag = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tif(game[i][j].isEqual(game[k-1][j]) && game[k-1][j].getFlag() == false) {\r\n\t\t\t\t\t\t\t\tgame[k-1][j].setValue(game[k-1][j].getValue()*2);\r\n\t\t\t\t\t\t\t\tgame[k-1][j].setFlag(true);\r\n\t\t\t\t\t\t\t\tgame[i][j].setValue(0);\r\n\t\t\t\t\t\t\t\tscore += game[k-1][j].getValue();\r\n\t\t\t\t\t\t\t\t--takenCells;\r\n\t\t\t\t\t\t\t\t++freeCells;\r\n\t\t\t\t\t\t\t\tflag = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tif(k != i) {\r\n\t\t\t\t\t\t\t\tgame[k][j] = new Cell2048 (game[i][j]);\r\n\t\t\t\t\t\t\t\tgame[i][j].setValue(0);\r\n\t\t\t\t\t\t\t\tflag = true;\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\t\t\t\t}\r\n\t\t\t}\r\n\t\tFalseFlag();\r\n\t\treturn flag;\r\n\t}",
"private void fillBoard() {\n\t\tint randomRow, randomColumn;\n\t\t\n\t\tfor (int i = 0; i < bombs; ++i) {\n\t\t\trandomRow = (int)(Math.random() * rows);\n\t\t\trandomColumn = (int)(Math.random() * columns);\n\t\t\tboard[randomRow][randomColumn] = -1;\n\t\t}\n\t\t\n\t\tfor (int r = 0; r < rows; ++r) {\n\t\t\tfor (int c = 0; c < columns; ++c) {\n\t\t\t\tif (board[r][c] == -1) {\n\t\t\t\t\tincreaseFreeCells(r, c);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"private void tileSetSurroundingBombs() {\r\n for (int r = 0; r < gridSize; r++) {\r\n for (int c = 0; c < gridSize; c++) {\r\n int neighborBombs = neighborBombCount(grid[r][c]);\r\n grid[r][c].setSurroundingBombs(neighborBombs);\r\n }\r\n } \r\n }",
"public void SpiritBomb()\r\n {\r\n\r\n\t \r\n\t\tLocation loc = new Location(userRow+1, userCol);\r\n\t\tLocation loc1 = new Location(userRow+1, userCol1);\r\n\t\tLocation loc2 = new Location(userRow+1, userCol2);\r\n\t\tLocation loc3 = new Location(userRow+1, userCol3);\r\n\t\t\r\n\t\tLocation loc4 = new Location(userRow, userCol);\r\n\t\tLocation loc5 = new Location(userRow, userCol1);\r\n\t\tLocation loc6 = new Location(userRow, userCol2);\r\n\t\tLocation loc7 = new Location(userRow, userCol3);\r\n\t\t\r\n\t\tLocation loc8 = new Location(userRow-1, userCol);\r\n\t\tLocation loc9 = new Location(userRow-1, userCol1);\r\n\t\tLocation loc10 = new Location(userRow-1, userCol2);\r\n\t\tLocation loc11 = new Location(userRow-1, userCol3);\r\n\t\t\r\n\t\tLocation loc12 = new Location(userRow-2, userCol);\r\n\t\tLocation loc13= new Location(userRow-2, userCol1);\r\n\t\tLocation loc14 = new Location(userRow-2, userCol2);\r\n\t\tLocation loc15 = new Location(userRow-2, userCol3);\r\n\r\n\t \r\n\r\n\r\n\r\n\t\t\r\n\t\tLocation base1 = new Location(userRow,0);\r\n\t\t\r\n\t\t\tgrid.setImage(base1, \"FSpiritHold.png\");\r\n\t\t\t\r\n\t\tfor(int a = 0; a<9; a++) {\r\n\t\tif(userCol>0 && userCol3 !=15 && userCol2!=15 && userCol1!=15 && userCol!=15 && userRow>0)\r\n\t\t{\r\n\t\r\n\t\t\t Location next101 = new Location(userRow+1,userCol);\r\n\t\t\t Location next102 = new Location(userRow+1,userCol1);\r\n\t\t\t Location next103 = new Location(userRow+1,userCol2);\r\n\t\t\t Location next104 = new Location(userRow+1,userCol3);\r\n\r\n\t\t\t\tLocation next201 = new Location(userRow,userCol);\r\n\t\t\t\tLocation next202 = new Location(userRow,userCol1);\r\n\t\t\t\tLocation next203 = new Location(userRow,userCol2);\r\n\t\t\t\tLocation next204 = new Location(userRow,userCol3);\r\n\t\t\t\t\r\n\t\t\t\tLocation next301 = new Location(userRow-1,userCol);\r\n\t\t\t\tLocation next302 = new Location(userRow-1,userCol1);\r\n\t\t\t\tLocation next303 = new Location(userRow-1,userCol2);\r\n\t\t\t\tLocation next304 = new Location(userRow-1,userCol3);\r\n\t\t\t\t\r\n\t\t\t Location next401 = new Location(userRow-2,userCol);\r\n\t\t\t Location next402 = new Location(userRow-2,userCol1);\r\n\t\t\t Location next403 = new Location(userRow-2,userCol2);\r\n\t\t\t Location next404 = new Location(userRow-2,userCol3);\r\n\t\t\t userCol+=1;\r\n\t\t\t userCol1+=1;\r\n\t\t\t\tuserCol2+=1;\r\n\t\t\t\tuserCol3+=1;\r\n\t\t\t grid.setImage(next101, \"SB401.png\");\r\n\t\t\t grid.setImage(loc1, null);\r\n\r\n\t\t\t \r\n\t\t\t\tgrid.setImage(next102, \"SB402.png\");\r\n\t\t\t grid.setImage(loc2, null);\r\n\r\n\t\t\t \r\n\t\t\t\tgrid.setImage(next103, \"SB403.png\");\r\n\t\t\t grid.setImage(loc2, null);\r\n\r\n\t\t\t \r\n\t\t\t\tgrid.setImage(next104, \"SB404.png\");\r\n\t\t\t grid.setImage(loc3, null);\r\n\r\n\t\t\t\t\r\n\t\t\t\tgrid.setImage(next201, \"SB301.png\");\r\n\t\t\t grid.setImage(loc4, null);\r\n\r\n\t\t\t \r\n\t\t\t\tgrid.setImage(next202, \"SB302.png\");\r\n\t\t\t grid.setImage(loc5, null);\r\n\r\n\t\t\t \r\n\t\t\t\tgrid.setImage(next203, \"SB303.png\");\r\n\t\t\t grid.setImage(loc6, null);\r\n\r\n\t\t\t \r\n\t\t\t\tgrid.setImage(next204, \"SB304.png\");\r\n\t\t\t grid.setImage(loc7, null);\r\n\r\n\t\t\t\t\r\n\t\t\t\tgrid.setImage(next301, \"SB201.png\");\r\n\t\t\t grid.setImage(loc8, null);\r\n\r\n\t\t\t \r\n\t\t\t\tgrid.setImage(next302, \"SB202.png\");\r\n\t\t\t grid.setImage(loc9, null);\r\n\r\n\t\t\t \r\n\t\t\t\tgrid.setImage(next303, \"SB203.png\");\r\n\t\t\t grid.setImage(loc10, null);\r\n\r\n\t\t\t \r\n\t\t\t\tgrid.setImage(next304, \"SB204.png\");\r\n\t\t\t grid.setImage(loc11, null);\r\n\r\n\t\t\t\t\r\n\t\t\t\tgrid.setImage(next401, \"SB101.png\");\r\n\t\t\t grid.setImage(loc12, null);\r\n\r\n\t\t\t \r\n\t\t\t\tgrid.setImage(next402, \"SB102.png\");\r\n\t\t\t grid.setImage(loc13, null);\r\n\r\n\t\t\t \r\n\t\t\t\tgrid.setImage(next403, \"SB103.png\");\r\n\t\t\t grid.setImage(loc14, null);\r\n\r\n\t\t\t \r\n\t\t\t\tgrid.setImage(next404, \"SB104.png\");\r\n\t\t\t grid.setImage(loc15, null);\r\n\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t \r\n\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n }\r\n }",
"public static int try_pos(int pos, int x, int n){\n\t\tint left = pos, right = pos+1;\n\n\t\t// If the left and right balls are of color x\n\t\tif (c[left] != x || c[right] != x) return 0;\n\n\t\tint right_block_size, left_block_size;\n\t\tdo{\n\t\t\tleft = max_left[left];\n\t\t\tright = max_right[right];\n\n\t\t\tright_block_size = max_right[right] - right;\n\t\t\tleft_block_size = left - max_left[left];\n\n\t\t\t// Reached an edge so no more balls are deleted\n\t\t\tif (left < 0 || right >= n) break;\n\t\t}while( c[left] == c[right] && right_block_size + left_block_size >= 3 );\n\n\t\treturn right - left - 1;\n\t}",
"public int orangesRotting(int[][] grid) {\n /**\n 经典的bfs 队列模拟\n 要注意的是 记录层数即为times的消耗 用queue.size 来遍历 每次先记录queue的大小 若size减为0 则说明当前层遍历完\n\n 这题要注意几个corner case\n 1.有永远新鲜的水果 1的周围都是0\n 2.原本就没有水果 全是空格0\n\n **/\n int time=0;\n if(grid==null||grid.length==0)return 0;\n\n Queue<int[]> queue=new LinkedList<>();\n\n\n int flag=0;\n for(int i=0;i<grid.length;i++){\n for(int j=0;j<grid[0].length;j++){\n if(grid[i][j]==2)\n queue.add(new int[]{i,j});\n if(grid[i][j]==1)\n flag=1;\n }\n }\n if(queue.isEmpty()&&flag==0)return 0;\n\n int dir[][]={{0,1},{0,-1},{1,0},{-1,0}};\n\n\n\n while(!queue.isEmpty()){\n int size=queue.size();\n while(size>0){\n int[] cur=queue.poll();\n\n for(int i=0;i<4;i++){\n int x=cur[0]+dir[i][0];\n int y=cur[1]+dir[i][1];\n if(x<0||x>=grid.length||y<0||y>=grid[0].length)continue;\n if(grid[x][y]==1){\n grid[x][y]=2;\n queue.add(new int[]{x,y});\n }\n\n }\n size--;\n }\n\n time++;\n\n }\n\n for(int i=0;i<grid.length;i++){\n for(int j=0;j<grid[0].length;j++){\n if(grid[i][j]==1)\n return -1;\n }\n }\n\n\n return time-1;\n }",
"public void winBigSquare (){\n /*for (int i =0; i<9; i++){\n for (int j=0; j<9; j++)\n System.out.print(bSquares.get(i).getSmallSquare(j).getOwnership()+\" \");\n System.out.println();\n }*/\n for (int i =0; i<9; i++){\n if (bSquares.get(i).getOwnership()==0){\n bSquares.get(i).setOwnership(bSquares.get(i).checkThreeInaRow());\n //System.out.println(\"SWAGSTA!\");\n }\n }\n \n }",
"private static Point findFarthestState(Cells[][] wallBoard, int column, int row)\n\t{\n\t\tint tries = 100;\n\t\tint farthest = 0;\n\t\tint farthestX = 0;\n\t\tint farthestY = 0;\n\t\tPoint farthestPos = new Point();\n\n\t\t_DF = new DeadlocksFinder(wallBoard);\n\n\t\tint[][] staticDLMap = _DF.getStaticDLMap();\n\n\t\tdo\n\t\t{\n\t\t\tint i = rn.nextInt(rows);\n\t\t\tint j = rn.nextInt(columns);\n\n\t\t\tif(board[i][j]==Cells.FLOOR && staticDLMap[i][j]!=1 && canStillReachEveryCrates(wallBoard, j, i))\n\t\t\t{\n\t\t\t\tArrayList<Point> path = _PF.findAReversedWay(column, row, j, i);\n\t\t\t\tint distance = path.size();\n\n\t\t\t\tif(distance==0)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tPoint ppos = new Point((int)path.get(path.size()-1).getX(), (int)path.get(path.size()-1).getY());\n\n\t\t\t\tif(distance > farthest)\n\t\t\t\t{\n\t\t\t\t\tfarthestX=j;\n\t\t\t\t\tfarthestY=i;\n\t\t\t\t\tfarthest=distance;\n\t\t\t\t\tfarthestPos=ppos;\n\t\t\t\t}\n\t\t\t}\n\t\t} while(tries-->0);\n\t\t\t\t\n\n\n\t\t/*for(int i=0; i<rows; i++)\n\t\t{\n\t\t\tfor(int j=0; j<columns; j++)\n\t\t\t{\n\t\t\t\tif(board[i][j]==Cells.FLOOR && staticDLMap[i][j]!=1)// && canStillReachEveryCrates(wallBoard, j, i))\n\t\t\t\t{\n\t\t\t\t\tArrayList<Point> path = _PF.findAReversedWay(column, row, j, i);\n\t\t\t\t\tint distance = path.size();\n\n\t\t\t\t\tif(distance==0)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tPoint ppos = new Point((int)path.get(path.size()-1).getX(), (int)path.get(path.size()-1).getY());\n\n\t\t\t\t\tif(distance > farthest)\n\t\t\t\t\t{\n\t\t\t\t\t\tfarthestX=j;\n\t\t\t\t\t\tfarthestY=i;\n\t\t\t\t\t\tfarthest=distance;\n\t\t\t\t\t\tfarthestPos=ppos;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}*/\n\n\t\tplayerPos.add(farthestPos);\n\t\treturn new Point(farthestX, farthestY);\n\t}",
"public void showBowlingOrder()\n\t{\n\t\twhile(bowlers.size()!=0)\n\t\t{\n\t\t\tbowlers.get(0).setBall(bowlers.get(0).getBall()-1);\n\t\t\tSystem.out.println(bowlers.get(0).getName()+\" throw this ball and left with \"+bowlers.get(0).getBall());\n\t\t\tif(bowlers.get(0).getBall()==0)\n\t\t\t{\n\t\t\t\tbowlers.remove(0);\n\t\t\t}\n\t\t\tthis.shortSort();\n\t\t}\n\t}",
"public void wallsAndGates(int[][] rooms) {\n if (rooms == null || rooms.length == 0 || rooms[0] == null || rooms[0].length == 0)\n return;\n\n Queue<int[]> queue = new LinkedList<>();\n\n for (int i = 0; i < rooms.length; i++) {\n for (int j = 0; j < rooms[0].length; j++) {\n if (rooms[i][j] == 0)\n queue.add(new int[]{i,j});\n }\n }\n\n while (!queue.isEmpty()) {\n int[] top = queue.remove();\n int row = top[0];\n int col = top[1];\n if (row > 0 && rooms[row - 1][col] == Integer.MAX_VALUE) {\n rooms[row - 1][col] = rooms[row][col] + 1;\n queue.add(new int[]{row - 1, col});\n }\n if (row < rooms.length - 1 && rooms[row + 1][col] == Integer.MAX_VALUE) {\n rooms[row+1][col] = rooms[row][col] + 1;\n queue.add(new int[]{row + 1, col});\n }\n if (col > 0 && rooms[row][col - 1] == Integer.MAX_VALUE){\n rooms[row][col -1] = rooms[row][col] + 1;\n queue.add(new int[]{row, col - 1});\n }\n if (col < rooms[0].length - 1 && rooms[row][col + 1] == Integer.MAX_VALUE) {\n rooms[row][col +1] = rooms[row][col] + 1;\n queue.add(new int[]{row, col + 1});\n }\n }\n\n }",
"public void specialMove() {\n\t\tChessSquare initial = getSquare();\n\t\tChessSquare next;\n\t\t\n\t\tif(initial.getNorth() != null){\n\t\t\tnext = initial.getNorth();\n\t\t\t\n\t\t\tif((next.getOccupant() == null) || (!next.getOccupant().getColor().equals(this.getColor())))\n\t\t\t\tnext.removeOccupant();\n\t\t\tif(next.getEast() != null)\n\t\t\t\tif((next.getEast().getOccupant() == null) || (!next.getEast().getOccupant().getColor().equals(this.getColor())))\n\t\t\t\t\tnext.removeOccupant();\n\t\t\tif(next.getWest() != null && next.getWest().getOccupant() == null)\n\t\t\t\tif((next.getWest().getOccupant() == null) || (!next.getWest().getOccupant().getColor().equals(this.getColor())))\n\t\t\t\t\tnext.removeOccupant();\n\t\t}\n\t\t\n\t\tif(initial.getSouth() != null){\n\t\t\tnext = initial.getSouth();\n\t\t\t\n\t\t\tif((next.getOccupant() == null) || (!next.getOccupant().getColor().equals(this.getColor())))\n\t\t\t\tnext.removeOccupant();\n\t\t\tif(next.getEast() != null)\n\t\t\t\tif((next.getEast().getOccupant() == null) || (!next.getEast().getOccupant().getColor().equals(this.getColor())))\n\t\t\t\t\tnext.removeOccupant();\n\t\t\tif(next.getWest() != null)\n\t\t\t\tif((next.getWest().getOccupant() == null) || (!next.getWest().getOccupant().getColor().equals(this.getColor())))\n\t\t\t\t\tnext.removeOccupant();\n\t\t\t\n\t\t}\n\t\t\n\t\tnext = initial.getEast();\n\t\tif(next != null)\n\t\t\tif((next.getOccupant() == null) || (!next.getOccupant().getColor().equals(this.getColor())))\n\t\t\t\tnext.removeOccupant();\n\t\tnext = initial.getWest();\n\t\tif(next != null)\n\t\t\tif((next.getOccupant() == null) || (!next.getOccupant().getColor().equals(this.getColor())))\n\t\t\t\tnext.removeOccupant();\n\t\tsetCountdown(9);\n\t}",
"public void removeBoat (int index) {\n Boat b = getBoatAt(index);\n int startX = Math.min(b.getStartX(), b.getEndX());\n System.out.println(\"removeBoat(): startX = \" + startX);\n int startY = Math.min(b.getStartY(), b.getEndY());\n System.out.println(\"removeBoat(): startY = \" + startY);\n int endX = Math.max(b.getStartX(), b.getEndX());\n System.out.println(\"removeBoat(): endX = \" + endX);\n int endY = Math.max(b.getStartY(), b.getEndY());\n System.out.println(\"removeBoat(): endY = \" + endY);\n \n //reset cells in grid.\n if (startX == endX) { \n for (int j = startY; j <= endY; j++) {\n System.out.println(\"removeBoat(): X constant. Changing coordinate: \" + j);\n grid[startX-1][j-1].setHasBoat(false);\n System.out.println(\"removeBoat(): Cell: \" + grid[startX-1][j-1]);\n } \n } else if (startY == endY) {\n for (int i = startX; i <= endX; i++) {\n System.out.println(\"removeBoat(): Y constant. Changing coordinate: \" + i);\n grid[i-1][startY-1].setHasBoat(false);\n System.out.println(\"removeBoat(): Cell: \" + grid[i-1][startY-1]);\n }\n }\n \n //reset boat\n b.setStartX(INVALID); \n b.setStartY(INVALID); \n b.setEndX(INVALID); \n b.setEndY(INVALID);\n \n }",
"void getBlowUp(int x, int y) {\n //YOUR CODE HERE\n\t whichBoard.remove(x, y);\n }",
"private void bombDifficulty(int maxBombs) {\r\n int randomRow;\r\n int randomCol;\r\n for(int bombAmount = 0; bombAmount < maxBombs;){\r\n randomRow = rand.nextInt(map.length-1);\r\n randomCol = rand.nextInt(map[0].length-1);\r\n if(map[randomRow][randomCol].getSafe() == false){\r\n //Do nothing. Checks if same row col is not chosen again\r\n }\r\n else {\r\n map[randomRow][randomCol].setSafe(false);\r\n if (TESTING_MODE) {\r\n map[randomRow][randomCol].setVisual(bomb);\r\n\r\n }\r\n bombAmount++;\r\n }\r\n }\r\n }",
"private void createBallsOnTopOfPaddle() {\r\n for (int i = 0; i < levelInformation.numberOfBalls(); i++) {\r\n Ball ball = new Ball((guiWidth / 2) - ((levelInformation.numberOfBalls() - 1) * ballRadius)\r\n + (i * (ballRadius * 2)), 550, ballRadius, Color.WHITE, environment);\r\n ball.setVelocity(levelInformation.initialBallVelocities().get(i));\r\n ball.addToGame(this);\r\n }\r\n ballCounter.increase(levelInformation.numberOfBalls());\r\n }",
"public int check (int a){\n\t\tfor(int i= 0; i<boxes.size();i++){\t//check whether each box touches the wall\n\t\t\tbox k= boxes.get(i);\n\t\t\tif(a==1){\n\t\t\t\tint l= 0;\n\t\t\t\tif(h.getX()-20==k.getX()&&h.getY()==k.getY()){//if the player moving left then meets the box\n\t\t\t\t\titem=boxes.get(i);\n\t\t\t\t\tbox j = new box(item.getX()-20,item.getY());\n\t\t\t\t\tfor(int p=0; p<walls.size();p++){\n\t\t\t\t\t\twall o = walls.get(p);\n\t\t\t\t\t\tif(j.getX()==o.getX()&&j.getY()==o.getY()){// if the box pushed by the player collisions the wall\n\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfor(int q=0;q<boxes.size();q++){\n\t\t\t\t\t\tbox w = boxes.get(q);\n\t\t\t\t\t\tif(w.getX()==j.getX()&&w.getY()==j.getY()){//check if the box meets another box\n\t\t\t\t\t\t\tl++;\t\t\t\t\t//the box will meet itself too\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(l>=1){\n\t\t\t\t\t\treturn 2;//if it meets another box\n\t\t\t\t\t}\n\t\t\t\t\tboxes.set(i, j);//change the position of the box being pushed\n\t\t\t\t\treturn 3;//the player meets only one box\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(a==2){\n\t\t\t\tint l= 0;\n\t\t\t\tif(h.getX()+20==k.getX()&&h.getY()==k.getY()){//if the player moving right then meets the box\n\t\t\t\t\titem=boxes.get(i);\n\t\t\t\t\tbox j = new box(item.getX()+20,item.getY());\n\t\t\t\t\tfor(int p=0; p<walls.size();p++){\n\t\t\t\t\t\twall o = walls.get(p);\n\t\t\t\t\t\tif(j.getX()==o.getX()&&j.getY()==o.getY()){// if the box pushed by the player collisions the wall\n\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfor(int q=0;q<boxes.size();q++){\n\t\t\t\t\t\tbox w = boxes.get(q);\n\t\t\t\t\t\tif(w.getX()==j.getX()&&w.getY()==j.getY()){//check if the box meets another box\n\t\t\t\t\t\t\tl++;//the box will meet itself too\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(l>=1){\n\t\t\t\t\t\treturn 2;//if it meets another box\n\t\t\t\t\t}\n\n\t\t\t\t\tboxes.set(i, j);\n\t\t\t\t\treturn 3;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(a==3){\n\t\t\t\tint l= 0;\n\t\t\t\tif(h.getX()==k.getX()&&h.getY()-20==k.getY()){//if the player moving up then the boxes meet the wall\n\t\t\t\t\titem=boxes.get(i);\n\t\t\t\t\tbox j = new box(item.getX(),item.getY()-20);\n\t\t\t\t\tfor(int p=0; p<walls.size();p++){\n\t\t\t\t\t\twall o = walls.get(p);\n\t\t\t\t\t\tif(j.getX()==o.getX()&&j.getY()==o.getY()){\n\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfor(int q=0;q<boxes.size();q++){\n\t\t\t\t\t\tbox w = boxes.get(q);\n\t\t\t\t\t\tif(w.getX()==j.getX()&&w.getY()==j.getY()){\n\t\t\t\t\t\t\tl++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(l>=1){\n\t\t\t\t\t\treturn 2;\n\t\t\t\t\t}\n\n\t\t\t\t\tboxes.set(i, j);\n\t\t\t\t\treturn 3;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(a==4){\n\t\t\t\tint l= 0;\n\t\t\t\tif(h.getX()==k.getX()&&h.getY()+20==k.getY()){//if the player moving down then the boxes meet the wall\n\t\t\t\t\titem=boxes.get(i);\n\t\t\t\t\tbox j = new box(item.getX(),item.getY()+20);\n\t\t\t\t\tfor(int p=0; p<walls.size();p++){\n\t\t\t\t\t\twall o = walls.get(p);\n\t\t\t\t\t\tif(j.getX()==o.getX()&&j.getY()==o.getY()){\n\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfor(int q=0;q<boxes.size();q++){\n\t\t\t\t\t\tbox w = boxes.get(q);\n\t\t\t\t\t\tif(w.getX()==j.getX()&&w.getY()==j.getY()){\n\t\t\t\t\t\t\tl++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(l>=1){\n\t\t\t\t\t\treturn 2;\n\t\t\t\t\t}\n\n\t\t\t\t\tboxes.set(i, j);\n\t\t\t\t\treturn 3;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn 0;//the player neither meets the box or the wall\n\t}",
"private void initialize() {\n\n this.levelName = \"Green 3\";\n this.numberOfBalls = 2;\n int ballsRadius = 5;\n Color ballsColor = Color.white;\n this.paddleHeight = (screenHeight / 27);\n this.paddleWidth = (screenWidth / 8);\n this.paddleSpeed = 11;\n int surroundingBlocksWidth = 30;\n this.paddleColor = new Color(1.0f, 0.699f, 0.000f);\n this.paddleUpperLeft = new Point(screenWidth / 2.2, screenHeight - surroundingBlocksWidth\n - this.paddleHeight);\n Color backgroundColor = new Color(0.000f, 0.420f, 0.000f);\n this.background = new Block(new Rectangle(new Point(0, 0), screenWidth + 1\n , screenHeight + 2), backgroundColor);\n this.background.setNumber(-1);\n\n Color[] colors = {Color.darkGray, Color.red, Color.yellow, Color.blue, Color.white};\n int blocksRowsNum = 5;\n int blocksInFirstRow = 10;\n int blocksWidth = screenWidth / 16;\n int blockHeight = screenHeight / 20;\n int firstBlockYlocation = screenHeight / 4;\n int removableBlocks = 0;\n Block[][] stairs = new Block[blocksRowsNum][];\n //blocks initialize.\n for (int i = 0; i < blocksRowsNum; i++, blocksInFirstRow--) {\n int number;\n for (int j = 0; j < blocksInFirstRow; j++) {\n if (i == 0) {\n number = 2; //top row.\n } else {\n number = 1;\n }\n stairs[i] = new Block[blocksInFirstRow];\n Point upperLeft = new Point(screenWidth - (blocksWidth * (j + 1)) - surroundingBlocksWidth\n , firstBlockYlocation + (blockHeight * i));\n stairs[i][j] = new Block(new Rectangle(upperLeft, blocksWidth, blockHeight), colors[i % 5]);\n if (stairs[i][j].getHitPoints() != -2 && stairs[i][j].getHitPoints() != -3) { // not death or live block\n stairs[i][j].setNumber(number);\n removableBlocks++;\n }\n this.blocks.add(stairs[i][j]);\n }\n\n }\n this.numberOfBlocksToRemove = (int) (removableBlocks * 0.5); //must destroy half of them.\n this.ballsCenter.add(new Point(screenWidth / 1.93, screenHeight * 0.9));\n this.ballsCenter.add(new Point(screenWidth / 1.93, screenHeight * 0.9));\n List<Velocity> v = new ArrayList<>();\n v.add(Velocity.fromAngleAndSpeed(45, 9));\n v.add(Velocity.fromAngleAndSpeed(-45, 9));\n this.ballsFactory = new BallsFactory(this.ballsCenter, ballsRadius, ballsColor,\n screenWidth, screenHeight, v);\n\n //bodies.\n //tower.\n Block base = new Block(new Rectangle(new Point(surroundingBlocksWidth + screenWidth / 16, screenHeight * 0.7)\n , screenWidth / 6, screenHeight * 0.3), Color.darkGray);\n base.setNumber(-1);\n this.bodies.add(base);\n Block base2 = new Block(new Rectangle(new Point(base.getCollisionRectangle().getUpperLine()\n .middle().getX() - base.getWidth() / 6\n , base.getCollisionRectangle().getUpperLeft().getY() - base.getHeight() / 2.5), base.getWidth() / 3\n , base.getHeight() / 2.5), Color.gray);\n base2.setNumber(-1);\n this.bodies.add(base2);\n Block pole = new Block(new Rectangle(new Point(base2.getCollisionRectangle().getUpperLine().middle().getX()\n - base2.getWidth() / 6, base2.getCollisionRectangle().getUpperLeft().getY() - screenHeight / 3)\n , base2.getWidth() / 3, screenHeight / 3), Color.lightGray);\n pole.setNumber(-1);\n this.bodies.add(pole);\n\n double windowWidth = base.getWidth() / 10;\n double windowHeight = base.getHeight() / 7;\n double b = base.getWidth() / 12;\n double h = base.getHeight() / 20;\n for (int i = 0; i < 6; i++) { //windows of tower.\n for (int j = 0; j < 5; j++) {\n Block window = new Block(new Rectangle(new Point(base.getCollisionRectangle().getUpperLeft().getX() + b\n + (windowWidth + b) * j,\n base.getCollisionRectangle().getUpperLeft().getY() + h + (windowHeight + h) * i), windowWidth\n , windowHeight), Color.white);\n window.setNumber(-1);\n this.bodies.add(window);\n }\n }\n\n //circles on the top of the tower.\n Circle c1 = new Circle(pole.getCollisionRectangle().getUpperLine().middle().getX()\n , pole.getCollisionRectangle().getUpperLine().middle().getY() - 17, 17, Color.black, \"fill\");\n Circle c2 = new Circle(pole.getCollisionRectangle().getUpperLine().middle().getX()\n , pole.getCollisionRectangle().getUpperLine().middle().getY() - 17, 12, Color.darkGray, \"fill\");\n Circle c3 = new Circle(pole.getCollisionRectangle().getUpperLine().middle().getX()\n , pole.getCollisionRectangle().getUpperLine().middle().getY() - 17, 7, Color.red, \"fill\");\n this.bodies.add(c1);\n this.bodies.add(c2);\n this.bodies.add(c3);\n\n\n }",
"@Override\n public ColorRow breakerGuess(int pegs, int colors) {\n if (turnBlacks.size() == 0 && turnWhites.size() == 0) {\n ColorRow initialGuess = breakerInitialGuess(pegs, colors);\n gameGuesses.add(initialGuess);\n return initialGuess;\n }\n int generation = 0;\n boolean feasibleNotFull = true;\n initPopulation(pegs, colors);\n calculateFitness();\n sortFeasibleByFitness(fitness, population);\n while (feasibleCodes.isEmpty()) {\n generation = 0;\n while (feasibleNotFull && generation <= GENERATION_SIZE) {\n evolvePopulation(pegs, colors);\n calculateFitness();\n sortFeasibleByFitness(fitness, population);\n feasibleNotFull = addToFeasibleCodes();\n generation += 1;\n }\n\n }\n ColorRow guess = feasibleCodes.get((int) (Math.random() * feasibleCodes.size()));\n gameGuesses.add(guess);\n return guess;\n }",
"public int hamming() {\n int wrong = 0;\n for (int row = 0; row < N; ++row) {\n for (int col = 0; col < N; ++col) {\n int goalValue = N * row + col + 1;\n if (tiles[row][col] != 0 && tiles[row][col] != goalValue) {\n wrong++;\n }\n }\n }\n\n return wrong;\n }",
"public void computeNumberOfBombs() {\n\t\tfor (int row = 0; row < numRows; row++) {\n\t\t\tfor (int col = 0; col < numCols; col++) {\n\t\t\t\tint n = 0;\n\t\t\t\tn += isBombAt(row - 1, col - 1);\n\t\t\t\tn += isBombAt(row - 1, col);\n\t\t\t\tn += isBombAt(row - 1, col + 1);\n\t\t\t\tn += isBombAt(row, col - 1);\n\t\t\t\tn += isBombAt(row, col + 1);\n\t\t\t\tn += isBombAt(row + 1, col - 1);\n\t\t\t\tn += isBombAt(row + 1, col);\n\t\t\t\tn += isBombAt(row + 1, col + 1);\n\t\t\t\ttable[row][col].setNumberOfBombsAround(n);\n\t\t\t}\n\t\t}\n\t}",
"public void wallsAndGates(int[][] rooms) {\n if (rooms.length == 0 || rooms[0].length == 0) return;\n Queue<int[]> queue = new LinkedList<>();\n for (int i = 0; i < rooms.length; i++) {\n for (int j = 0; j < rooms[0].length; j++) {\n if (rooms[i][j] == 0) queue.add(new int[]{i, j});\n }\n }\n while (!queue.isEmpty()) {\n int[] top = queue.remove();\n int row = top[0], col = top[1];\n if (row > 0 && rooms[row - 1][col] == Integer.MAX_VALUE) {\n rooms[row - 1][col] = rooms[row][col] + 1;\n queue.add(new int[]{row - 1, col});\n }\n if (row < rooms.length - 1 && rooms[row + 1][col] == Integer.MAX_VALUE) {\n rooms[row + 1][col] = rooms[row][col] + 1;\n queue.add(new int[]{row + 1, col});\n }\n if (col > 0 && rooms[row][col - 1] == Integer.MAX_VALUE) {\n rooms[row][col - 1] = rooms[row][col] + 1;\n queue.add(new int[]{row, col - 1});\n }\n if (col < rooms[0].length - 1 && rooms[row][col + 1] == Integer.MAX_VALUE) {\n rooms[row][col + 1] = rooms[row][col] + 1;\n queue.add(new int[]{row, col + 1});\n }\n }\n }",
"public static boolean hasCheckingCondition(int condition, Color colorCheck){ //maybe instead of checking for all each time, just check based on the disc placed\r\n int rownum;\r\n int columnnum;\r\n boolean found = false;\r\n int inARow = 0;\r\n \r\n if(numTurns>=(condition+(condition-1))-2){ //can only have connect 4 if there are a total of 7 total moves at the least\r\n //checking vertically-------------\r\n \r\n for(int i = 0; i<7; i++){ //for each column\r\n \r\n if(arrayCircles[5-(7-condition)][i].getColor()==Color.white){ //say if in the column, there are not even 4 checkers. This way, the checking algorithm is much more efficient\r\n continue; //checks the next column now\r\n }\r\n \r\n inARow=0; //resseting inARow to 0 when the column is done seraching\r\n for(int j = 5; j>=0; j--){ //for each row; 0 check going bottom to top\r\n \r\n if(arrayCircles[j][i].getColor()==colorCheck){\r\n inARow++;\r\n \r\n if(inARow == condition){ \r\n found = true; //returning here because the condition has been found\r\n return found;\r\n }\r\n if(j>0&&arrayCircles[j-1][i].getColor()!=colorCheck){ //if the subsequent chip is not of the same color\r\n inARow = 0; //reset the inARow counter\r\n }\r\n }\r\n }\r\n } \r\n \r\n //checking horizontally------\r\n for(int i = 5; i>=0; i--){ //for each row; going from bottom-top \r\n inARow = 0; //resetting inARow to 0 when the row is finished\r\n \r\n for(int j = 0; j<7; j++){ //for each column - check going across\r\n \r\n if(arrayCircles[i][j].getColor()==colorCheck){\r\n inARow++;\r\n if(inARow == condition){\r\n found = true; //setting found to true because the condition has been met\r\n return found;\r\n }\r\n if(j<6&&arrayCircles[i][j+1].getColor()!=colorCheck){ //if the next one is not the colour, reset the counter\r\n inARow=0; \r\n }\r\n }\r\n }\r\n }\r\n \r\n //checking diagonally now --starting from the bottom left and searching to top right\r\n for(int i = 0; i<7; i++){ //for each column\r\n for(int j = 5; j>=0; j--){ //for each row going bottom to top\r\n \r\n rownum = j; //keeping these variables as j and i but manipulating them when checking\r\n columnnum = i; //[rownum][columnnum] = the starting chip\r\n \r\n if(arrayCircles[j][i].getColor()==colorCheck){ //making sure there is indeed a checker there\r\n \r\n inARow = 0; //resestting in a row counter each time we switch the starting chip\r\n \r\n for(int z = 0; z<6; z++){ //max diagonal is 6 long\r\n \r\n if(rownum>=0&&rownum<=5&&columnnum>=0&&columnnum<=6){\r\n \r\n if(arrayCircles[rownum][columnnum].getColor() == colorCheck){\r\n inARow++;\r\n \r\n rownum--; //moving one up and one right whenever inARow is incremented \r\n columnnum++;\r\n \r\n if(inARow == condition){ //if the condition is met, then return that the player won\r\n found = true;\r\n return found;\r\n }\r\n }\r\n \r\n else{ //if that chip is not equal to the color of the player\r\n inARow = 0;\r\n break; //break out of loop\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n //checking diagonal still but from bottom right to top left; same code as above but different rownum and columnnum\r\n \r\n for(int i = 6; i>=0; i--){ //for each column\r\n for(int j = 5; j>=0; j--){ //for each row going bottom to top\r\n \r\n rownum = j; //keeping these variables as j and i but manipulating them when checking\r\n columnnum = i; //[rownum][columnnum] = the starting chip\r\n \r\n if(arrayCircles[j][i].getColor()==colorCheck){ //making sure there is indeed a checker there of the right color\r\n \r\n inARow = 0; //resetting in a row counter each time we switch the starting chip\r\n \r\n for(int z = 0; z<6; z++){ //max diagonal is 6 long\r\n \r\n if(rownum>=0&&rownum<=5&&columnnum>=0&&columnnum<=6){\r\n \r\n if(arrayCircles[rownum][columnnum].getColor() == colorCheck){ //if the colour matches that of the row and column\r\n inARow++; //incrementing the inARow counter\r\n \r\n rownum--; //moving one up and one right whenever inARow is incremented \r\n columnnum--;\r\n \r\n if(inARow == condition){ //if condition is met, then return true because person has won\r\n found = true;\r\n return found;\r\n }\r\n }\r\n \r\n else{ //if that chip is not the same colour\r\n // rownum--; //moving one up and one right //maybe keep this not sure\r\n // columnnum--;\r\n // if(rownum>=0&&rownum<=5&&columnnum>=0&&columnnum<=6&&arrayCircles[rownum][columnnum].getColor()!=colorCheck){ //checking the next one, if so then break out of loop\r\n inARow = 0;\r\n break; //break out of loop\r\n // }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return found; //if none of the above returns, it will return found, which is false \r\n }",
"private void analyzeForObstacles() {\n \t\n \t\n \tStack<Rect> bestFound = new Stack<Rect>();//This is a stack as the algorithm moves along x linearly\n \tboolean[][] blackWhiteGrid = getBlackWhiteGrid();\n \tint[] cache = new int[grid.length];\n \t\n \twhile (true) {\n\t\t\tboolean noneFound = true;\n\t\t\t\n\t\t\tfor (int i = 0; i<cache.length; i++)\n\t\t\t\tcache[i] = 0;\n\t\t\tfor (int llx = grid.length -1; llx >= 0; llx--) {\n\t\t\t\tupdate_cache(blackWhiteGrid,cache, llx);\n\t\t\t\tfor (int lly = 0; lly < grid.length; lly++) {\n\t\t\t\t\tRect bestOfRound = new Rect(llx,lly,llx,lly);\n\t\t\t\t\tint y = lly;\n\t\t\t\t\tint x_max = 9999;\n\t\t\t\t\tint x = llx;\n\t\t\t\t\twhile (y+1<grid.length && blackWhiteGrid[llx][y]) {\n\t\t\t\t\t\ty++;\n\t\t\t\t\t\tx = Math.min(llx+cache[y]-1, x_max);\n\t\t\t\t\t\tx_max = x;\n\t\t\t\t\t\tRect tryRect = new Rect(llx,lly-1,x,y);\n\t\t\t\t\t\tif (tryRect.area() > bestOfRound.area()) {\n\t\t\t\t\t\t\tbestOfRound = tryRect;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (bestOfRound.area() > 40) {\n\t\t\t\t\t\tif (noneFound) {\n\t\t\t\t\t\t\tbestFound.push(bestOfRound);\n\t\t\t\t\t\t\tnoneFound = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tRect lastRect = bestFound.peek();\n\t\t\t\t\t\t\tif (lastRect.area() < bestOfRound.area()) {\n\t\t\t\t\t\t\t\tbestFound.pop();\n\t\t\t\t\t\t\t\tbestFound.push(bestOfRound);\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\tif (noneFound)\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tclearFoundRectangle(blackWhiteGrid, bestFound.peek());\n \t}\n \t\n \t//add found rectanlges\n \tobstacles.clear();\n \tobstacles.addAll(bestFound);\n \tSystem.out.println(\"Sweep done:\");\n \tfor (Rect r : bestFound){\n \t\tSystem.out.println(\"Rect: llx=\" + (r.llx-400) + \"\\tlly=\" + (r.lly-400) + \"\\turx=\" + (r.urx-400) + \"\\tury=\" + (r.ury-400));\n \t\tList<Point2D.Double> corners = new ArrayList<Point2D.Double>();\n \t\tcorners.add(new Point2D.Double((r.llx-400),(r.lly-400)));\n \t\tcorners.add(new Point2D.Double((r.llx-400),(r.ury-400)));\n \t\tcorners.add(new Point2D.Double((r.urx-400),(r.lly-400)));\n \t\tcorners.add(new Point2D.Double((r.urx-400),(r.ury-400)));\n \t\tobstaclesF.add(new Obstacle(corners));\n \t}\n \t\n \ttoExplore.clear();\n \tint i = 0;\n \tRandom rand = new Random();\n \twhile (toExplore.size() < 10 && i < 1000) {\n \t\tint x = rand.nextInt(grid.length);\n \t\tint y = rand.nextInt(grid.length);\n \t\tif (grid[x][y] == .5) {\n \t\t\ttoExplore.add(new Flag(\"blue\",x,y));\n \t\t}\n \t}\n }",
"private List<Box> initBoxes(List<Integer> deadBoxes){\n List<Box> boxes = new ArrayList<>();\n\n for(int x=0;x<16;x++){\n boxes.add(new Box(x + 1, grid[x]));\n }\n\n\n /**\n * 1 2 3 4\n * 5 6 7 8\n * 9 10 11 12\n * 13 14 15 16\n */\n\n //first row\n addNeighbours(1, new int[]{2,5,6}, boxes);\n addNeighbours(2,new int[]{1,3,5,6,7}, boxes);\n addNeighbours(3,new int[]{2,4,6,7,8}, boxes);\n addNeighbours(4,new int[]{3,7,8}, boxes);\n addNeighbours(5,new int[]{1,2,6,9,10}, boxes);\n addNeighbours(6,new int[]{1,2,3,5,7,9,10,11}, boxes);\n addNeighbours(7,new int[]{2,3,4,6,8,10,11,12}, boxes);\n addNeighbours(8,new int[]{3,4,7,11,12}, boxes);\n addNeighbours(9,new int[]{5,6,10,13,14}, boxes);\n addNeighbours(10,new int[]{5,6,7,9,11,13,14,15}, boxes);\n addNeighbours(11,new int[]{6,7,8,10,12,14,15,16}, boxes);\n addNeighbours(12,new int[]{7,8,11,15,16}, boxes);\n addNeighbours(13,new int[]{9,10,14}, boxes);\n addNeighbours(14,new int[]{9,10,11,13,15}, boxes);\n addNeighbours(15,new int[]{10,11,12,14,16}, boxes);\n addNeighbours(16,new int[]{11,12,15}, boxes);\n\n return removeBoxes(boxes,deadBoxes);\n }",
"public void moveTime(double time){\n\t\ttable.moveTime(time);\n\n\t\t// assign players their ball groups if they sink a ball and don't have groups yet\n\t\tif (groups[turn] == -1){\n\t\t\tif (this.table.sunkByType[Ball.TYPE_RED] > 0){\n\t\t\t\tgroups[turn] = Ball.TYPE_RED; \n\t\t\t\tgroups[(turn+1)%2] = Ball.TYPE_BLUE;\n\t\t\t}\n\t\t\tif (this.table.sunkByType[Ball.TYPE_BLUE] > 0){\n\t\t\t\tgroups[turn] = Ball.TYPE_BLUE; \n\t\t\t\tgroups[(turn+1)%2] = Ball.TYPE_RED;\n\t\t\t}\n\t\t}\n\n\t\t// if the cueball was/is moving, we need to keep track of what type of ball it hit first\n\t\tif (lastMovingByType[Ball.TYPE_CUEBALL] != 0 || this.table.movingByType[Ball.TYPE_CUEBALL] != 0){\n\t\t\tif (firstContact == -1){\n\t\t\t\t// if a type of ball wasn't moving before and it is now, the cueball most likely came into contact with it first\n\t\t\t\tif (lastMovingByType[Ball.TYPE_RED] == 0 && this.table.movingByType[Ball.TYPE_RED] != 0){firstContact = Ball.TYPE_RED;}\n\t\t\t\telse if (lastMovingByType[Ball.TYPE_BLUE] == 0 && this.table.movingByType[Ball.TYPE_BLUE] != 0){firstContact = Ball.TYPE_BLUE;}\n\t\t\t\telse if (lastMovingByType[Ball.TYPE_8BALL] == 0 && this.table.movingByType[Ball.TYPE_8BALL] != 0){firstContact = Ball.TYPE_8BALL;}\n\n\t\t\t\tif (groups[turn] == -1 && firstContact != -1){firstContact = 0;} // (if we dont have a group assigned to us, the type should be irrelevant. just as long as we hit something)\n\t\t\t}\n\t\t}\n\n\t\t// our move is over whenever all the balls stop moving\n\t\tif (!table.moving && lastMoving){\n\t\t\t// now that the move's over, we can determine whether a foul occurred or not\n\t\t\t// 3 types of fouls are covered\n\t\t\tif (this.table.sunkByType[Ball.TYPE_CUEBALL] != 0){foul = true;} // 1. we sunk the cueball\n\t\t\telse if (firstContact == -1){foul = true;} // 2. we didn't hit anything\n\t\t\telse if (firstContact != 0){ // 3. we had an assigned group...\n\t\t\t\tif (firstContact != groups[turn] && lastSunkByType[groups[turn]] != 7){ // ...and didnt hit a ball from our group first (provided all our balls arent sunken yet)\n\t\t\t\t\tfoul = true;\n\t\t\t\t}\n\t\t\t\telse if (firstContact != Ball.TYPE_8BALL && lastSunkByType[groups[turn]] == 7){ // or we didn't hit the cueball first (provided all our balls are already sunken)\n\t\t\t\t\tfoul = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// if the 8 ball's sunken, we need to declare a winner. (i.e. set their group to 3) but there's a couple caveats...\n\t\t\t// TODO: enum for player group?\n\t\t\tif (this.table.sunkByType[Ball.TYPE_8BALL] != 0 && lastSunkByType[Ball.TYPE_8BALL] == 0){\n\t\t\t\tif (foul){ // if we committed a foul while sinking the 8 ball, the opponent wins\n\t\t\t\t\tgroups[(turn+1)%2] = 3;\n\t\t\t\t}\n\t\t\t\telse if (groups[turn] == -1){ // if we didn't even have a group yet and we sunk the 8 ball, the opponent wins\n\t\t\t\t\tgroups[(turn+1)%2] = 3;\n\t\t\t\t}\n\t\t\t\telse if (lastSunkByType[groups[turn]] != 7){ // if we sunk the 8 ball before sinking all of our balls first, the opponent wins\n\t\t\t\t\tgroups[(turn+1)%2] = 3;\n\t\t\t\t}\n\t\t\t\telse { // otherwise, we win\n\t\t\t\t\tgroups[turn] = 3;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// now to figure out whether we change turns or not\n\t\t\tif (groups[turn] != -1){ // if the player has an assigned group...\n\t\t\t\t// ...only change turn if the player hasn't sunken a ball in their group or has committed a foul\n\t\t\t\tif (this.table.sunkByType[groups[turn]] == lastSunkByType[groups[turn]] || foul){\n\t\t\t\t\tturn = (turn+1)%2;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse { // otherwise just change turns normally\n\t\t\t\tturn = (turn+1)%2;\n\t\t\t}\n\t\t \tlastSunkByType = table.sunkByType.clone(); firstContact = -1;\n\t\t}\n\n\t\tlastMoving = this.table.moving; lastMovingByType = this.table.movingByType.clone();\n\t}",
"private int findBestFit(Color c, int[][] tileArray, int x, int y) {\n int radiusTiles = 10; // The number of radius tiles... this WILL be user-configurable.\n int closestSoFar = 0; // Index of the tile that best matches the color so far.\n int redDiff, greenDiff, blueDiff, totalDiff = 0;\n totalDiff = (256*3); // Initialize the total difference to the largest reasonable number.\n if (c==null) { // assume that the color is black...\n c = new Color(0,0,0);\n }\n for (int count = 0; count < tileLibrary.getSize(); count++) { // Cycle through all of the library tiles.\n if (tileLibrary.get(count).getColor() != null) {\n\n/********* UNCOMMENT THE FOLLOWING TO USE THE NO-REP ALGORITHM ***********/\n /* // This is the no-rep algorithm.\n redDiff = Math.abs(c.getRed() - images.get(count).getColor().getRed());\n blueDiff = Math.abs(c.getBlue() - images.get(count).getColor().getBlue());\n greenDiff = Math.abs(c.getGreen() - images.get(count).getColor().getGreen());\n if (((redDiff + blueDiff + greenDiff) < totalDiff) && (used[count] == false)) {\n totalDiff = redDiff + blueDiff + greenDiff;\n closestSoFar = count;\n }\n */\n/**************************************************************************/\n\n/********** COMMENT OUT TO USE NO-REP ALGORITHM INSTEAD *******************/\n // Is this image in our no-dice radius?\n boolean inRadius = false;\n for (int newX = (x - radiusTiles); newX < (x+radiusTiles); newX++) { // Cycle through the width of the box...\n for (int newY = (y - radiusTiles); newY < (y+radiusTiles); newY++) { // Cycle through the height of the box...\n // If we are still within the bounds of the image....\n if ((newX >= 0) && (newY >= 00) && (newX < hTiles) && (newY < vTiles)) { // && !((newX >= x) && (newY >= y))) {\n try {\n if (tileArray[newX][newY] == count) { // If that tile is already in the box...\n inRadius = true;\n }\n } catch (Exception e) {System.out.println(e);}\n }\n }\n }\n if (inRadius == false) { // If this tile isn't in the box, find the difference in color.\n redDiff = Math.abs(c.getRed() - tileLibrary.get(count).getColor().getRed());\n blueDiff = Math.abs(c.getBlue() - tileLibrary.get(count).getColor().getBlue());\n greenDiff = Math.abs(c.getGreen() - tileLibrary.get(count).getColor().getGreen());\n if (((redDiff + blueDiff + greenDiff) < totalDiff)) { // if this is closer than the previous closest...\n totalDiff = redDiff + blueDiff + greenDiff;\n closestSoFar = count; // Keep track of this tile.\n }\n }\n }\n }\n return closestSoFar; // return the tile we chose.\n }",
"private int clearLines() {\n\t\tint numGarbageLines = 0;\n\t\tArrayList<Integer> linesToShift = new ArrayList<Integer>();\n\t\tfor (int r = 0; r < matrixHeight; r++) {\n\t\t\tif (isLineFull(r)) {\n\t\t\t\tif (isGarbageLine(r)) {\n\t\t\t\t\tnumGarbageLines++;\n\t\t\t\t}\n\t\t\t\tlinesToShift.add(r);\n\t\t\t\tnumLinesCleared++;\n\t\t\t\tfor (int c = 0; c < matrixWidth; c++) {\n\t\t\t\t\tboardTiles[r][c] = backgroundColor;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (Integer removedRow : linesToShift) {\n\t\t\tshiftDownBoard(removedRow);\n\t\t}\n\t\tupdateView();\n\t\treturn linesToShift.size() - numGarbageLines;\n\t}",
"int numberOfBalls();",
"void collisions(){\n float tmp;\n \n if (dist(redX, redY, yelX, yelY) < 30 ){ // Red and Yellow\n tmp = yelDX; yelDX = redDX; redDX = tmp;\n tmp= yelDY; yelDY = redDY; redDY = tmp;\n }\n \n if (dist(redX, redY, bluX, bluY) < 30){ // Red and Blue\n tmp = bluDX; bluDX = redDX; redDX = tmp;\n tmp = bluDY; bluDY = redDY; redDY = tmp;\n }\n \n if (dist(bluX, bluY, yelX, yelY) < 30){ // Blue and Yellow\n tmp = yelDX; yelDX = bluDX; bluDX = tmp;\n tmp = yelDY; yelDY = bluDY; bluDY = tmp;\n }\n if (dist(cueX, cueY, redX, redY) < 30){ // Cue and Red\n tmp = redDX; redDX = cueDX; cueDX = tmp;\n tmp = redDY; redDY = cueDY; cueDY = tmp;\n }\n if (dist(cueX, cueY, bluX, bluY) < 30){ // Cue and Blue\n tmp = bluDX; bluDX = cueDX; cueDX = tmp;\n tmp = bluDY; bluDY = cueDY; cueDY = tmp;\n }\n if (dist(cueX, cueY, yelX, yelY) < 30){ // Cue and Yellow\n tmp = yelDX; yelDX = cueDX; cueDX = tmp;\n tmp = yelDY; yelDY = cueDY; cueDY = tmp;\n }\n}",
"public int checkCollisions() {\r\n\t\tArrayList<Comet> comets = Comet.getCometList();\r\n\r\n\t\tfor (int i = 0; i < comets.size(); i++) {\r\n\t\t\tComet tempComet = comets.get(i);\r\n\r\n\t\t\tif (getBounds().intersects(tempComet.getBounds())) {\r\n\t\t\t\tComet.removeComet(tempComet);\r\n\t\t\t\tcol++;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn col;\r\n\t}",
"private int collideObject(GOval ball, int bricksOnStage) {\n GObject collider = getCollidingObject(ball);\n if (isObjectAPaddle(collider) && vy > 0){\n vy = - vy;\n }\n else if (isObjectABrick(collider)){\n remove(collider);\n vy = - vy;\n bricksOnStage -= 1;\n }\n return bricksOnStage;\n }",
"public void launchBall() {\n\n\t\tint contBlue = 0, contRed = 0, red = 0, blue = 0, maxScore = 0;\n\t\t// You can modify this value to play more matches (Important: Odd/Uneven value)\n\t\tint bestOf = 5;\n\n\t\tfor (int i = 0; i < bestOf; i++) {\n\n\t\t\tSystem.out.println(\"Red team launch\");\n\t\t\tred = (int) (Math.random() * (200 - 0));\n\t\t\tSystem.out.println(red);\n\t\t\tmaxScore = (red > maxScore) ? red : maxScore;\n\n\t\t\tSystem.out.println(\"Blue team launch\");\n\t\t\tblue = (int) (Math.random() * (200 - 0));\n\t\t\tSystem.out.println(blue);\n\t\t\t// Find the highest score between bluePoints and redPoints\n\t\t\tmaxScore = (blue > maxScore) ? blue : maxScore;\n\t\t\t// Count which team has more score than the other one\n\t\t\tif (red > blue)\n\n\t\t\t\tcontRed++;\n\n\t\t\telse\n\n\t\t\t\tcontBlue++;\n\n\t\t}\n\t\tint option;\n\t\t// Try: Throw error if you introduce a String or Char instead Integer\n\t\ttry {\n\t\t\tdo {\n\t\t\t\tSystem.out.println(\"What ratio was the highest score? (1.0-50/2.50-100/3.100-150/4.150-200)\");\n\t\t\t\toption = scanner.nextInt();\n\t\t\t\t// Minigame to hit the ratio of highest score\n\t\t\t\tswitch (option) {\n\n\t\t\t\tcase 1: {\n\n\t\t\t\t\tif (maxScore >= 0 && maxScore < 50)\n\t\t\t\t\t\tSystem.out.println(\"You win, the highest score is: \" + maxScore);\n\t\t\t\t\telse\n\t\t\t\t\t\tSystem.out.println(\"Sorry, that's not the highest score\");\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase 2: {\n\t\t\t\t\tif (maxScore >= 50 && maxScore < 100)\n\t\t\t\t\t\tSystem.out.println(\"You win, the highest score is: \" + maxScore);\n\t\t\t\t\telse\n\t\t\t\t\t\tSystem.out.println(\"Sorry, that's not the highest score\");\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\t\t\t\tcase 3: {\n\t\t\t\t\tif (maxScore >= 100 && maxScore < 150)\n\t\t\t\t\t\tSystem.out.println(\"You win, the highest score is: \" + maxScore);\n\t\t\t\t\telse\n\t\t\t\t\t\tSystem.out.println(\"Sorry, that's not the highest score\");\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t\tcase 4: {\n\t\t\t\t\tif (maxScore >= 150 && maxScore <= 200)\n\t\t\t\t\t\tSystem.out.println(\"You win, the highest score is: \" + maxScore);\n\t\t\t\t\telse\n\t\t\t\t\t\tSystem.out.println(\"Sorry, that's not the highest score\");\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tSystem.err.println(\"Insert valid value\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} while (option > 4 || option < 1);\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(\"Please, insert an Intenger value\");\n\t\t\tscanner.next();\n\t\t}\n\t\tSystem.out.println(\"The highest score was \" + maxScore);\n\n\t\tSystem.out.println(\"The match is over Blue: \" + contBlue + \" wins, y Red: \" + contRed + \" wins\");\n\t\t// Show which team won\n\t\tif (contRed > contBlue) {\n\n\t\t\tSystem.out.println(\"Red wins\");\n\t\t\tthis.redWins = contRed;\n\n\t\t} else {\n\n\t\t\tSystem.out.println(\"Blue wins\");\n\t\t\tthis.blueWins = contBlue;\n\n\t\t}\n\t}",
"private void cull() {\n\t\tArrayList<NQueenBoard> temp = new ArrayList<NQueenBoard>();\n\t\ttemp.add(populationArray.get(0));\n\t\tfor (int i = 1; i < population; ++i) {\n\t\t\tfor (int j = 0; j < temp.size(); ++j) {\n\t\t\t\tif (populationArray.get(i).getFitness() > temp.get(j).getFitness()) {\n\t\t\t\t\ttemp.add(j, populationArray.get(i));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (populationArray.get(i).getFitness() <= temp.get(temp.size()-1).getFitness()) {\n\t\t\t\ttemp.add(populationArray.get(i));\n\t\t\t}\n\t\t}\n\t\t//replace the worst half with newly generated random boards\n\t\tfor (int i = temp.size()/2; i < temp.size(); ++i) {\n\t\t\ttemp.set(i, new NQueenBoard(n));\n\t\t}\n\t\tpopulationArray = temp;\n\t}",
"public static int Main()\n\t{\n\t\t//????i???,j?,hang????????lie????num???????h????????l?????\n\t\tint i;\n\t\tint j;\n\t\tint[] h = new int[5];\n\t\tint[] l = new int[5];\n\t\tint hang = 0;\n\t\tint lie;\n\t\tint num;\n\t\tint[][] a = new int[5][5];\n\t\tfor (i = 0; i < 5; i++)\n\t\t{\n\t\t\tfor (j = 0; j < 5; j++)\n\t\t\t{\n\t\t\t\ta[i][j] = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\t\t}\n\t\t}\n\t\tfor (i = 0; i < 5; i++)\n\t\t{\n\t\t\th[i] = a[i][0]; //???????????????\n\t\t\tfor (j = 0; j < 5; j++)\n\t\t\t{\n\t\t\t\tif (a[i][j] > h[i])\n\t\t\t\t{\n\t\t\t\t\th[i] = a[i][j]; //??????h?????\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (j = 0; j < 5; j++)\n\t\t{\n\t\t\t\tl[j] = a[0][j];\n\t\t\t\tfor (i = 0; i < 5; i++)\n\t\t\t\t{\n\t\t\t\t\tif (a[i][j] < l[j])\n\t\t\t\t\t{\n\t\t\t\t\t\tl[j] = a[i][j]; //???l\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n\t\tfor (i = 0; i < 5; i++)\n\t\t{\n\t\t\tfor (j = 0; j < 5; j++) //??????\n\t\t\t{\n\t\t\t\t//??????????????????\n\t\t\t\tif ((a[i][j] == h[i]) && (a[i][j] == l[j]))\n\t\t\t\t{\n\t\t\t\t\thang = i + 1; //hang?i??,??hang????0\n\t\t\t\t\tlie = j + 1; //lie?j??\n\t\t\t\t\tnum = a[i][j]; //???a[i][j]\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (hang == 0) //??hang??0????????????\n\t\t{\n\t\t\tSystem.out.print(\"not found\");\n\t\t\tSystem.out.print(\"\\n\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//??????\n\t\t\tSystem.out.print(hang);\n\t\t\tSystem.out.print(\" \");\n\t\t\tSystem.out.print(lie);\n\t\t\tSystem.out.print(\" \");\n\t\t\tSystem.out.print(num);\n\t\t\tSystem.out.print(\"\\n\");\n\t\t}\n\n\t\treturn 0;\n\t}",
"private ArrayList<Move> blackKing() {\n // obtain current co-ordinates\n int x = this.getX();\n int y = this.getY();\n\n ArrayList<Move> blackMoves = new ArrayList<Move>();\n\n // set up m to refer to a Move object\n Move theMove = null;\n\n\n // the top and bottom are opposites coordinates for the black and white kings and so are left and right\n // all Unoccupied moves\n\n // first legal move is to go from x,y to x,y-1 if x,y-1 is unoccupied (top)\n if (validNormalMove(x, y - 1)) {\n theMove = new Move(this, x, y, x, y - 1, false);\n if(takeOverCheck(x, y-1)){\n theMove.setOccupied(true);\n }\n\n blackMoves.add(theMove);\n }\n\n\n // legal move is to go from x,y to x,y+1 if x,y+1 is unoccupied (bottom)\n if (validNormalMove(x, y + 1)) {\n theMove = new Move(this, x, y, x, y + 1, false);\n if(takeOverCheck(x, y+1)){\n theMove.setOccupied(true);\n }\n blackMoves.add(theMove);\n }\n\n //left\n // legal move to go left from x,y to x+1, y if x+1,y is unoccupied (left)\n\n if (validNormalMove(x+1, y)) {\n theMove = new Move(this, x, y, x+1, y, false);\n if(takeOverCheck(x+1, y)){\n theMove.setOccupied(true);\n }\n blackMoves.add(theMove);\n\n }\n\n //right\n // legal move to go right from x,y to x-1, y if x-1,y is unoccupied (right)\n\n if (validNormalMove(x-1, y)) {\n theMove = new Move(this, x, y, x-1, y, false);\n\n if(takeOverCheck(x-1, y)){\n theMove.setOccupied(true);\n }\n blackMoves.add(theMove);\n }\n\n\n // legal move to diagonal top right for white king\n if (validNormalMove(x-1, y - 1)) {\n theMove = new Move(this, x, y, x-1, y - 1, false);\n if(takeOverCheck(x-1, y-1)){\n theMove.setOccupied(true);\n }\n blackMoves.add(theMove);\n }\n\n // legal move to diagonal bottom left\n\n if (validNormalMove(x+1, y +1)) {\n theMove = new Move(this, x, y, x+1, y + 1, false);\n\n if(takeOverCheck(x+1, y+1)){\n theMove.setOccupied(true);\n }\n blackMoves.add(theMove);\n }\n\n // legal move to diagonal bottom right\n if (validNormalMove(x-1, y +1)) {\n theMove = new Move(this, x, y, x-1, y + 1, false);\n if(takeOverCheck(x-1, y+1)){\n theMove.setOccupied(true);\n }\n blackMoves.add(theMove);\n }\n\n // legal move to diagonal top left\n if (validNormalMove(x+1, y-1)) {\n theMove = new Move(this, x, y, x+1, y - 1, false);\n if(takeOverCheck(x+1, y-1)){\n theMove.setOccupied(true);\n }\n blackMoves.add(theMove);\n }\n\n\n\n\n\n if (blackMoves.isEmpty())\n return null;\n return blackMoves;\n }",
"public int numberOfBalls() {\r\n return 3;\r\n }",
"public static void mazeUnion(){\n\n\t\tint n = 10;\t\n\n\t\tdsf S = new dsf(n*n);\n\t\tMaze one = new Maze(n);\n\n\t\tRandom random;\n\t\tint sets = n*n;\t//number of sets in the DSF\n\t\tint randomNumber;\n\t\tint randomDirection;\n\t\tint row;\n\t\tint col;\n\n\t\tchar upperRight; \t//bottom or right\n\n\t\tS.print();\n\n\t\twhile(sets > 1){\n\t\t\trandom = new Random();\n\t\t\trandomNumber = random.nextInt((n*n) - 1);\n\t\t\tSystem.out.println(\"RANDOM NUMBER: \"+randomNumber);\n\t\t\trow = randomNumber /n;\t//SWITCHED\n\t\t\tcol = randomNumber %n;\t//SWITCHED\n\t\t\trandomDirection = random.nextInt(2);\n\t\t\tString direct;\n\t\t\tif(randomDirection == 0)\n\t\t\t\tdirect = \"upper\";\n\t\t\telse\n\t\t\t\tdirect = \"right\";\n\t\t\tSystem.out.println(\"RANDOM DIRECTI0N: \"+direct);\n\t\t\tupperRight = one.direction(randomDirection);\n\n\t\t\tif(upperRight == 'u'){\n\t\t\t\tif((randomNumber) < ((n*n)-n)){\n\t\t\t\t\tSystem.out.println(\"Sets: \"+sets);\n\t\t\t\t\tif(S.find(randomNumber+n) != S.find(randomNumber)){\n\t\t\t\t\t\tS.union(randomNumber+n, randomNumber);\n\t\t\t\t\t\tone.remove_wall(col, row, 'u');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(upperRight == 'r'){\n\t\t\t\tif(((randomNumber)%(n*n)) != n-1){\n\t\t\t\t\tif(S.findAndCompress(randomNumber) != S.findAndCompress(randomNumber+1)){\n\t\t\t\t\t\tS.union(randomNumber, randomNumber+1);\n\t\t\t\t\t\tone.remove_wall(col, row, 'r');\n\t\t\t\t\t\t//S.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tStdDraw.show(0);\n\t\tone.draw();\n\t\tone.printCellNumbers();\n\t\t\n\t\tbuildAdjacencyList(one, n);\n\t\tuserSelection_SolveMaze(n);\n\n\t}",
"public int evaluate(PentagoBoardState pbs) {\n PentagoBoardState.Piece[][] pieces = pbs.getBoard();\n\n\n int whitescore =0; //keep track of white's total score\n int blackscore = 0;//keep track of black's total score\n\n //Check rows\n for (int x = 0; x <6 ; x++) {\n int countWHori = 0;\n int countBHori = 0;\n\n int blacks = 0;\n int whites = 0;\n\n\n for (int y = 0; y <5 ; y++) {\n //Count how many black and white pieces\n if (pieces[x][y].ordinal() == 0 ) {\n\n //countBHori = countBHori + countvalue;\n blacks++;\n }\n if (pieces[x][y].ordinal() == 1) {\n\n //countWHori = countWHori +countvalue;\n whites++;\n }\n\n //Check for consecutive\n if (pieces[x][y].ordinal() == 0 && pieces[x][y+1].ordinal() == 0 ) {\n\n countBHori = countBHori +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 0 && pieces[x][y+1].ordinal() == 2 ) {\n\n countBHori = countBHori + blankspaceconsec;\n }\n else if (pieces[x][y].ordinal() == 2 && pieces[x][y+1].ordinal() == 0 ) {\n\n countBHori = countBHori + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x][y+1].ordinal() == 1 ) {\n\n countWHori = countWHori +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x][y+1].ordinal() == 2 ) {\n\n countWHori = countWHori + blankspaceconsec;\n }\n else if (pieces[x][y].ordinal() == 2 && pieces[x][y+1].ordinal() == 1 ) {\n\n countWHori = countWHori + blankspaceconsec;\n }\n\n //Check for disjoint and joint set If * B B W * * then disjoint and * B B * B * Then joint set for B * B\n if (y!=4){\n if (pieces[x][y].ordinal() == 0 && pieces[x][y+1].ordinal() == 0 && pieces[x][y+2].ordinal() == 1){\n countBHori = countBHori +disjointset;\n }\n else if (pieces[x][y].ordinal() == 1 && pieces[x][y+1].ordinal() == 1 && pieces[x][y+2].ordinal() == 0){\n countWHori = countWHori +disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x][y+1].ordinal() == 2 && pieces[x][y+2].ordinal() == 0){\n countBHori = countBHori +jointset;\n }\n else if (pieces[x][y].ordinal() == 1 && pieces[x][y+1].ordinal() == 2 && pieces[x][y+2].ordinal() == 1){\n countWHori = countWHori +jointset;\n }\n }\n }\n //check if unwinnable\n if (blacks == 4 && whites==2){\n countBHori += unwinnable;\n }\n if (blacks == 2 && whites==4){\n countWHori += unwinnable;\n }\n if (blacks == 3 && whites==3){\n countWHori += unwinnable;\n countBHori += unwinnable;\n }\n\n\n //Run value for row in evaluation scheme and add to total score\n int valuew = consecutivevalue(countWHori);\n whitescore = whitescore +valuew;\n int valueb = consecutivevalue(countBHori);\n blackscore = blackscore + valueb;\n //System.out.println(\"Black consec hori \" + valueb + \"White consec hori \" + valuew);\n\n }\n\n //Check Verticals\n for (int y = 0; y <6 ; y++) {\n int countWvert = 0;\n int countBvert = 0;\n int blacks = 0;\n int whites = 0;\n\n\n for (int x = 0; x <5 ; x++) {\n if (pieces[x][y].ordinal() == 0) {\n\n //countBvert = countBvert +1;\n blacks++;\n }\n if (pieces[x][y].ordinal() == 1) {\n\n //countWvert = countWvert +1;\n whites++;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y].ordinal() == 0 ) {\n\n countBvert = countBvert +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y].ordinal() == 2 ) {\n\n countBvert = countBvert + blankspaceconsec;\n }\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y].ordinal() == 0 ) {\n\n countBvert = countBvert + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y].ordinal() == 1 ) {\n\n countWvert = countWvert +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y].ordinal() == 2 ) {\n\n countWvert = countWvert + blankspaceconsec;\n }\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y].ordinal() == 1 ) {\n\n countWvert = countWvert + blankspaceconsec;\n }\n\n if (x!=4){\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y].ordinal() == 0 && pieces[x+1][y].ordinal() == 1){\n countBvert = countBvert +disjointset;\n }\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y].ordinal() == 1 && pieces[x+1][y].ordinal() == 0){\n countWvert = countWvert +disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y].ordinal() == 2 && pieces[x+1][y].ordinal() == 0){\n countBvert = countBvert +jointset;\n }\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y].ordinal() == 2 && pieces[x+1][y].ordinal() == 1){\n countWvert = countWvert +jointset;\n }\n }\n }\n\n if (blacks == 4 && whites==2){\n countBvert += unwinnable;\n }\n if (blacks == 3 && whites==3){\n countBvert += unwinnable;\n countWvert += unwinnable;\n }\n if (blacks == 2 && whites==4){\n countWvert += unwinnable;\n }\n //System.out.println(\"Black consec vert \" + countBvert + \"White consec \" + countWvert);\n int valuew = consecutivevalue(countWvert);\n whitescore = whitescore +valuew;\n int valueb = consecutivevalue(countBvert);\n blackscore = blackscore + valueb;\n //System.out.println(\"Black consec VERT \" + valueb + \"White consec hori \" + valuew);\n }\n\n //S West N EAST Top\n for (int a = 1; a <6 ; a++) { //loop through all diagonal lines\n int countWdiagSoNe = 0;\n int countBdiagSoNe = 0;\n int x=0;\n int blacks = 0;\n int whites = 0;\n\n\n for (int y = a; y !=0 ; y--) { //loop through one diagonal line\n\n int r = pieces[x][y].ordinal();\n int s =pieces[x+1][y-1].ordinal();\n //System.out.println(\"x \" + x+ \" y \" +y);\n //System.out.println(\"first \" + r+ \" second \" +s);\n if (pieces[x][y].ordinal() == 0) {\n\n //countBdiagSoNe = countBdiagSoNe +2;\n blacks++;\n }\n if (pieces[x][y].ordinal() == 1 ) {\n\n //countWdiagSoNe = countWdiagSoNe +2;\n whites++;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 ) {\n\n countBdiagSoNe = countBdiagSoNe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 ) {\n\n countBdiagSoNe = countBdiagSoNe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y-1].ordinal() == 0 ) {\n\n countBdiagSoNe = countBdiagSoNe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 ) {\n\n countWdiagSoNe = countWdiagSoNe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 ) {\n\n countWdiagSoNe = countWdiagSoNe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y-1].ordinal() == 1 ) {\n\n countWdiagSoNe = countWdiagSoNe + blankspaceconsec;\n }\n\n // check for joint and disjoint set at these x y coordinates by looking 2 pieces ahead\n if (x==0 && y==4){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==1 && y==3){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==2 && y==2){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==0 && y==5){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==1 && y==4){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==2 && y==3){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==3 && y==2){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n\n x++;\n\n\n }\n if (blacks == 4 && whites==2){\n countBdiagSoNe += unwinnable;\n }\n if (blacks == 3 && whites==3){\n countBdiagSoNe += unwinnable;\n countWdiagSoNe += unwinnable;\n }\n if (blacks == 2 && whites==4){\n countWdiagSoNe += unwinnable;\n }\n if (a==4 && blacks == 4 && whites==1){\n countBdiagSoNe += unwinnable;\n }\n if (a==4 && blacks == 1 && whites==4){\n countWdiagSoNe += unwinnable;\n }\n\n //System.out.println(\"Black consec vert \" + countBdiagSoNe + \"White consec \" + countWdiagSoNe);\n int valuew = consecutivevalue(countWdiagSoNe);\n whitescore = whitescore +valuew;\n int valueb = consecutivevalue(countBdiagSoNe);\n blackscore = blackscore + valueb;\n //System.out.println(\"Black consec DIAGOMAAL \" + valueb + \" \" + countBdiagSoNe + \"White consec hori \" + valuew + \" \" + countWdiagSoNe);\n }\n //S West N EAST Bot\n for (int a = 1; a <5 ; a++) {\n int countWdiagSoNe = 0;\n int countBdiagSoNe = 0;\n int y=5;\n int blacks = 0;\n int whites = 0;\n\n for (int x = a; x <5 ; x++) {\n\n int r = pieces[x][y].ordinal();\n int s =pieces[x+1][y-1].ordinal();\n //System.out.println(\"x \" + x+ \" y \" +y);\n //System.out.println(\"first \" + r+ \" second \" +s);\n if (pieces[x][y].ordinal() == 0) {\n\n //countBdiagSoNe = countBdiagSoNe +\n blacks++;\n }\n if (pieces[x][y].ordinal() == 1 ) {\n\n //countWdiagSoNe = countWdiagSoNe +2;\n whites++;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 ) {\n\n countBdiagSoNe = countBdiagSoNe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 ) {\n\n countBdiagSoNe = countBdiagSoNe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y-1].ordinal() == 0 ) {\n\n countBdiagSoNe = countBdiagSoNe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 ) {\n\n countWdiagSoNe = countWdiagSoNe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 ) {\n\n countWdiagSoNe = countWdiagSoNe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y-1].ordinal() == 1 ) {\n\n countWdiagSoNe = countWdiagSoNe + blankspaceconsec;\n }\n if (x==1 && y==5){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==2 && y==4){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==3 && y==3){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n //System.out.println(x + \" y:\" + y +\" Black consec DIAGOMAAL \" + countBdiagSoNe + \"White consec hori \" + countWdiagSoNe);\n y--;\n\n\n }\n if (a==1 && blacks == 4 && whites==1){\n countBdiagSoNe += unwinnable;\n }\n /*if (blacks == 3 && whites==3){\n countBdiagSoNe += unwinnable;\n countWdiagSoNe += unwinnable;\n }*/\n if (a==1&& blacks == 1 && whites==4){\n countWdiagSoNe += unwinnable;\n }\n //System.out.println(\"Black consec vert \" + countBdiagSoNe + \"White consec \" + countWdiagSoNe);\n int valuew = consecutivevalue(countWdiagSoNe);\n whitescore = whitescore +valuew;\n int valueb = consecutivevalue(countBdiagSoNe);\n blackscore = blackscore + valueb;\n //System.out.println(\"Black consec DIAGOMAAL \" + valueb + \" \" + countBdiagSoNe + \"White consec hori \" + valuew + \" \" + countWdiagSoNe);\n }\n\n //NorthWest S EAST Left\n for (int a = 0; a <5 ; a++) {\n int countWdiagNoSe = 0;\n int countBdiagNoSe = 0;\n int y=0;\n int blacks = 0;\n int whites = 0;\n\n for (int x = a; x <5 ; x++) {\n //System.out.println(pbs+\"x \" + x+ \" y \" +y);\n int r = pieces[x][y].ordinal();\n int s =pieces[x+1][y+1].ordinal();\n //System.out.println(\"x \" + x+ \" y \" +y);\n //System.out.println(\"first \" + r+ \" second \" +s);\n if (pieces[x][y].ordinal() == 0) {\n blacks++;\n //countBdiagNoSe = countBdiagNoSe +2;\n }\n if (pieces[x][y].ordinal() == 1) {\n whites++;\n //countWdiagNoSe = countWdiagNoSe +2;\n }\n\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 ) {\n\n countBdiagNoSe = countBdiagNoSe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 ) {\n\n countBdiagNoSe = countBdiagNoSe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y+1].ordinal() == 0 ) {\n\n countBdiagNoSe = countBdiagNoSe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 ) {\n\n countWdiagNoSe = countWdiagNoSe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 ) {\n\n countWdiagNoSe= countWdiagNoSe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y+1].ordinal() == 1 ) {\n\n countWdiagNoSe = countWdiagNoSe + blankspaceconsec;\n }\n\n if (x==0 && y==0){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==1 && y==1){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==2 && y==2){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==3 && y==3){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==1 && y==0){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==2 && y==1){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==3 && y==2){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n y++;\n\n\n }\n //System.out.println(\"Black consec vert \" + countBdiagSoNe + \"White consec \" + countWdiagSoNe);\n if (blacks == 4 && whites==2){\n countBdiagNoSe += unwinnable;\n }\n if (a==1 && blacks == 4 && whites==1){\n countBdiagNoSe += unwinnable;\n }\n if (blacks == 3 && whites==3){\n countBdiagNoSe += unwinnable;\n countWdiagNoSe += unwinnable;\n }\n if (blacks == 2 && whites==4){\n countWdiagNoSe += unwinnable;\n }\n if (a==1 && blacks == 1 && whites==4){\n countWdiagNoSe += unwinnable;\n }\n\n int valuew = consecutivevalue(countWdiagNoSe);\n whitescore = whitescore +valuew;\n int valueb = consecutivevalue( countBdiagNoSe);\n blackscore = blackscore + valueb;\n //System.out.println(\"Black consec DIAGOMAAL \" + valueb + \" \" + countBdiagNoSe + \"White consec hori \" + valuew + \" \" + countWdiagNoSe);\n }\n //NorthWest S EAST Right\n for (int a = 1; a <5 ; a++) {\n int countWdiagNoSe = 0;\n int countBdiagNoSe = 0;\n int x=0;\n int blacks = 0;\n int whites = 0;\n\n for (int y = a; y <5 ; y++) {\n //System.out.println(\"x \" + x+ \" y \" +y);\n int r = pieces[x][y].ordinal();\n int s =pieces[x+1][y+1].ordinal();\n //System.out.println(\"x \" + x+ \" y \" +y);\n //System.out.println(\"first \" + r+ \" second \" +s);\n if (pieces[x][y].ordinal() == 0 ) {\n blacks++;\n //countBdiagNoSe = countBdiagNoSe +2;\n }\n if (pieces[x][y].ordinal() == 1) {\n whites++;\n //countWdiagNoSe = countWdiagNoSe +2;\n }\n\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 ) {\n\n countBdiagNoSe = countBdiagNoSe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 ) {\n\n countBdiagNoSe = countBdiagNoSe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y+1].ordinal() == 0 ) {\n\n countBdiagNoSe = countBdiagNoSe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 ) {\n\n countWdiagNoSe = countWdiagNoSe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 ) {\n\n countWdiagNoSe= countWdiagNoSe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y+1].ordinal() == 1 ) {\n\n countWdiagNoSe = countWdiagNoSe + blankspaceconsec;\n }\n\n if (x==0 && y==1){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==1 && y==2){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==2 && y==3){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n x++;\n\n\n }\n if (a==1 && blacks == 1 && whites==4){\n countWdiagNoSe += unwinnable;\n }\n if (a==1 && blacks == 4 && whites==1){\n countBdiagNoSe += unwinnable;\n }\n //System.out.println(\"Black consec vert \" + countBdiagSoNe + \"White consec \" + countWdiagSoNe);\n int valuew = consecutivevalue(countWdiagNoSe);\n whitescore = whitescore +valuew;\n int valueb = consecutivevalue( countBdiagNoSe);\n blackscore = blackscore + valueb;\n //System.out.println(\"Black consec DIAGOMAAL \" + valueb + \" \" + countBdiagNoSe + \"White consec hori \" + valuew + \" \" + countWdiagNoSe);\n }\n\n\n\n\n\n //System.out.println(\"Black consec score \" + blackscore +\" \" + \"White consec scpre \" + whitescore);\n //System.out.println(\"max player is \" + maxplayer + \"My colour is \" + mycolour);\n int i = -123456789;\n if (mycolour == 0){\n //System.out.println(blackscore-whitescore +\" I am black\");\n\n\n i= blackscore-whitescore;\n return i;\n\n }\n else {\n //System.out.println(whitescore-blackscore +\" I am white\");\n i= whitescore-blackscore;\n return i;\n }\n /*\n if(i>0 && i<1000){\n return 100; //i*2;\n }\n else if(i>=1000 && i<10000){\n return 1000; //i*10;\n }\n else if(i>=10000 && i<100000){\n return 10000; //i*50;\n }\n else if(i>=100000){\n return 100000;//i*500;\n }\n else if(i<=0 && i>-100){\n return -100; //i*2;\n }\n else if(i<=-100 && i>-1000){\n return -1000; //i*10;\n }\n else if(i<=-1000 && i>-10000){\n return -10000; //i*50;\n }\n else if(i<=0 && i>-100000){\n return -100000;//i*500;\n }\n\n */\n\n\n }",
"public static int minimumNumberOfWhiteWallsOnBoard()\n {\n return 0;\n }",
"private void findUniqueInBox(int startRow, int endRow, int startColumn, int endColumn) {\n\n //Reduce the board to consist of only the positions in the box and \n //only include those that aren't yet assigned a value.\n List<Number> box = numbers.stream()\n .filter(n -> n.getRow() >= startRow)\n .filter(n -> n.getRow() <= endRow)\n .filter(n -> n.getColumn() >= startColumn)\n .filter(n -> n.getColumn() <= endColumn)\n .filter(n -> n.getValue() == 0)\n .collect(Collectors.toList());\n\n //Create a hash to count the number of occurences of each possible value.\n HashMap<Integer,Integer> possibleValues = new HashMap<Integer, Integer>();\n\n box.forEach(n -> {\n //Find the possible values...\n\n //Create a list of numbers 1-9\n List<Integer> intThrough9 = IntStream.rangeClosed(1, 9)\n .boxed()\n .collect(Collectors.toList());\n\n //Remove those that have been used to set the possible values.\n intThrough9.removeAll(n.getUsedValues());\n n.setPossibleValues(intThrough9);\n \n //Update the map with the count of each possible value\n intThrough9.stream().forEach(i -> {\n if (possibleValues.containsKey(i)) {\n possibleValues.replace(i, possibleValues.get(i) + 1);\n }\n else {\n possibleValues.put(i,1);\n }\n });\n });\n\n //Filter out those that only have 1. If there are any then we know\n //that position can be set to that value.\n possibleValues.entrySet().stream().\n filter(p -> p.getValue() == 1).\n forEach(p -> {\n //Whichever block has this unique possibility is the one to set.\n box.stream()\n .filter(b -> b.getPossibleValues() != null)\n .filter(b -> b.getPossibleValues().contains(p.getKey()))\n .findFirst()\n .ifPresent(n -> n.setValue(p.getKey()));\n });\n }",
"public void createMaze(int rows, int cols) {\n\t\t\n\t\tint total = rows*cols;\n\t\tDisjSets ds = new DisjSets(total); //Create an object of the disjoint set class\n\t\t \n\t\tList<List<Node>> maze = new ArrayList<List<Node>>();\n\t\t \n\t\tmaze = initializeMaze(rows, cols, maze); //Initialize the maze\n\t\t \n\t\tRandom rand = new Random();\n\t\t \n\t\twhile(ds.find(0) != ds.find(total - 1)) {\n\t\t\t \n\t\t\tint currRow = rand.nextInt(rows); //Random row number\n\t\t\tint currCol = rand.nextInt(cols); //Random column number\n\t\t\tNode currNode = maze.get(currRow).get(currCol); //Current node(cell)\n\t\t\tint currValue = currNode.value;\n\t\t\t \n\t\t\tint root1 = ds.find(currValue); //Find on current node(cell)\n\t\t\tint root2;\n\t\t\tboolean removeHorizontal = false;\n\t\t\t \n\t\t\tif(currValue == total - 1) {\n\t\t\t\tcontinue; //Don't do anything if the current cell is the bottom-rightmost cell\n\t\t\t}\n\t\t\t \n\t\t\tif(currRow == rows - 1) {\n\t\t\t\t//Last row -- can only break the right wall, can't break the wall to the bottom \n\t\t\t\troot2 = ds.find(currValue + 1);\n\t\t\t} else if(currCol == cols - 1) {\n\t\t\t\t//Last column -- can only break the wall to the bottom, can't break the right wall \n\t\t\t\troot2 = ds.find(currValue + cols);\n\t\t\t\tremoveHorizontal = true;\n\t\t\t} else {\n\t\t\t\t//Neither last row nor last column\n\t\t\t\t//Randomly select either right wall or wall to the bottom to break\n\t\t\t\tboolean selectRight;\n\t\t\t\tselectRight = rand.nextBoolean();\n\t\t\t\t \n\t\t\t\tif(selectRight) {\n\t\t\t\t\troot2 = ds.find(currValue + 1);\n\t\t\t\t} else {\n\t\t\t\t\troot2 = ds.find(currValue + cols);\n\t\t\t\t\tremoveHorizontal = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Finds resulted in different sets\n\t\t\tif(root1 != root2) {\n\t\t\t\t \n\t\t\t\tds.union(root1, root2); //Take union of the two sets\n\t\t\t\t \n\t\t\t\tif(removeHorizontal) {\n\t\t\t\t\tcurrNode.horizontal = false; //Break the horizontal wall\n\t\t\t\t} else {\n\t\t\t\t\tcurrNode.vertical = false; //Break the vertical wall\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Leave the bottom right corner open\n\t\tNode destination = maze.get(rows - 1).get(cols - 1);\n\t\tdestination.horizontal = false;\n\t\tdestination.vertical = false;\n\t\t \n\t\tprintMaze(rows, cols, maze); //Print the final maze\n\t}",
"private void reduce(int amount){\n while(colours.size() > amount){\n rgb curColour = colours.get(colours.size() - 1);\n double closest = -1;\n int id = -1;\n boolean notChanged = true;\n\n for(int i = 0; i < colours.size() - 1; i++){\n double dist = getDist(colours.get(i), curColour);\n if(dist < 0){\n colours.get(i).anotherFew(curColour.getAmount());\n notChanged = false;\n break;\n }else if(closest == -1 || dist < closest){\n closest = dist;\n id = i;\n }\n }\n if(notChanged){\n colours.get(id).anotherFew(curColour.getAmount());\n }\n colours.remove(colours.size() - 1);\n reinsert(id);\n }\n }",
"protected void clearBallCount(int ballCount){\n canvas.remove(ballBox);\n for (int i = 0; i < ballCount; i++){\n if (canvas.getElementAt(60 + i*(15), 730) instanceof Ellipse){\n canvas.remove(canvas.getElementAt(60 + i*(15), 730));\n }\n }\n }",
"private void checkForDroneCollisions(Set<Drone> droneSet) {\n\t\t//then check if any drone is in a 5m vicinity of another\n\t\t//first cast the set to a list\n\t\tList<Drone> droneList = new ArrayList<>(droneSet);\n\t\t//create a list to store the crashed indices\n\t\tSet<Integer> crashedDroneIndices = new HashSet<>();\n\t\t//get the size of the list\n\t\tint listSize = droneList.size();\n\n\t\t//Outer loop, check every drone once\n\t\tfor(int i = 0; i != listSize; i++){\n\t\t\t//inner loop, only the following drones need to be checked, all the previous have already passed the outer loop\n\t\t\tfor(int j = i + 1; j < listSize; j++){\n\t\t\t\t//first get the positions of the drone\n\t\t\t\tVector pos1 = droneList.get(i).getPosition();\n\t\t\t\tVector pos2 = droneList.get(j).getPosition();\n\n\t\t\t\t//then get the distance between the two drones\n\t\t\t\tfloat distance = pos1.distanceBetween(pos2);\n\t\t\t\tif(distance <= CRASH_DISTANCE){\n\t\t\t\t\tcrashedDroneIndices.add(i);\n\t\t\t\t\tcrashedDroneIndices.add(j);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//all the drones that have collided with eachother need to be removed\n\t\tfor(Integer droneIndex: crashedDroneIndices){\n\t\t\t//first get the drone\n\t\t\tDrone currDrone = droneList.get(droneIndex);\n\t\t\t//then remove it from the world\n\t\t\tthis.removeDrone(currDrone);\n\t\t\t//remove it from the drone set (for consistency and performance improvement)\n\t\t\tdroneSet.remove(currDrone);\n\t\t}\n\t}",
"public static void compute_possible_moves(Board s){\n\t\tint b [][] = s.board;\n\t\tint x = -1;\n\t\tint y = -1;\n\t\tfor (int i = 0;i < b.length;i++) {\n\t\t\tfor (int j = 0;j < b[i].length;j++) {\n\t\t\t\tif(b[i][j] == 0){\n\t\t\t\t\tx = i;\n\t\t\t\t\ty = j;\n\t\t\t\t\tbreak;\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\n\t\tint left [][];\n\t\tint right [][];\n\t\tint up [][];\n\t\tint down [][];\n\t\tpossible_boards.clear();\n\t\tif(x - 1 != -1 && x >= 0 && x < 3){\n\t\t\t//up is a legal move\n\t\t\tint temporary_board [][] = new int[b.length][];\n\t\t\tfor(int q = 0; q < b.length; q++)\n\t\t\t temporary_board [q] = b[q].clone();\n\t\t\t\n\n\t\t\tint temp = temporary_board[x - 1][y];\n\t\t\ttemporary_board[x - 1][y] = temporary_board[x][y];\n\t\t\ttemporary_board[x][y] = temp;\n\t\t\tup = temporary_board;\n\n\t\t\tBoard up_board = new Board(up);\n\t\t\tpossible_boards.add(up_board);\n\n\t\t}\n\t\tif(x + 1 != 3 && x >= 0 && x < 3){\n\t\t\t//down is a legal move\n\t\t\tint temporary_board [][] = new int[b.length][];\n\t\t\tfor(int q = 0; q < b.length; q++)\n\t\t\t temporary_board [q] = b[q].clone();\n\t\t\t\n\t\t\tint temp = temporary_board[x + 1][y];\n\t\t\ttemporary_board[x + 1][y] = temporary_board[x][y];\n\t\t\ttemporary_board[x][y] = temp;\n\t\t\tdown = temporary_board;\n\t\t\tBoard down_board = new Board(down);\n\t\t\tpossible_boards.add(down_board);\n\t\t}\n\t\tif(y - 1 != -1 && y >= 0 && y < 3){\n\t\t\t//left move is legal\n\t\t\tint temporary_board [][] = new int[b.length][];\n\t\t\tfor(int q = 0; q < b.length; q++)\n\t\t\t temporary_board [q] = b[q].clone();\n\t\t\t\n\t\t\tint temp = temporary_board[x][y - 1];\n\t\t\ttemporary_board[x][y - 1] = temporary_board[x][y];\n\t\t\ttemporary_board[x][y] = temp;\n\t\t\tleft = temporary_board;\n\t\t\tBoard left_board = new Board(left);\n\t\t\tpossible_boards.add(left_board);\n\n\t\t}\n\t\tif(y + 1 != 3 && y >= 0 && y < 3){\n\t\t\t//right move is legal\n\t\t\tint temporary_board [][] = new int[b.length][];\n\t\t\tfor(int q = 0; q < b.length; q++)\n\t\t\t temporary_board [q] = b[q].clone();\n\t\t\t\n\t\t\tint temp = temporary_board[x][y + 1];\n\t\t\ttemporary_board[x][y + 1] = temporary_board[x][y];\n\t\t\ttemporary_board[x][y] = temp;\n\t\t\tright = temporary_board;\n\t\t\tBoard right_board = new Board(right);\n\t\t\tpossible_boards.add(right_board);\n\n\t\t}\n\n\t}",
"private void generate () {\n\t\t\n\t\tArrayList<Integer[]> copyToCheck = new ArrayList<Integer[]> ();\n\t\tfor (int i = 0; i < Math.pow(size, 3); i++) { // Filling up the maze with blocks\n\t\t\tint x, y, z;\n\t\t\tx = i / (size * size); // Get the x, y, and z\n\t\t\ty = i % (size * size) / size;\n\t\t\tz = i % (size * size) % size;\n\t\t\t// spaces each block out by 1\n\t\t\tif (x%2 == 1 && y%2 == 1 && z%2 == 1) {\n\t\t\t\tmaze.add(new Block (x, y, z, ' ')); // 'w' means wall\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tmaze.add(new Block (x, y, z, 'w'));\n\t\t\t\tif (x > 0 && y > 0 && z > 0 && x < size-1 && y < size-1 && z < size-1) { // if the blocks are within the outer shell, add the blocks to the list of walls to check\n\t\t\t\t\tif (x%2+y%2+z%2 == 2)copyToCheck.add(new Integer[] {x, y, z});\n\t\t\t\t}\n\t\t\t}\n\t\t\t//if (x > 0 && y > 0 && z > 0 && x < size-1 && y < size-1 && z < size-1) { // checks if the coordinates are within the smaller cube that is below the first layer.\n\t\t\t\t//copyToCheck.add(new Integer[] { x, y, z });\t// the Block coords left to check\n\t\t\t//}\n\t\t}\n\t\t\n\t\tint starty, startx, startz; // x, y and z of current block\n\t\tstartz = 0; // the starting block will be at z = 0 because that is the bottom-most layer\n\n\t\tstartx = ((int)(Math.random() * (size/2)))*2 + 1; \n\t\tstarty = ((int)(Math.random() * (size/2)))*2 + 1;\n\t\tstart = get(startx, starty, startz);\n\t\t\n\t\tint endx, endy, endz; // x, y and z of end block\n\t\tendx = ((int)(Math.random() * (size/2)))*2 + 1; \n\t\tendy = ((int)(Math.random() * (size/2)))*2 + 1;\n\t\tendz = size-1;\n\t\tend = get(endx, endy, endz);\n\t\t\n\t\tArrayList<Integer[]> toCheck;\n\t\tboolean removed = true;\n\t\twhile (removed) {\n\t\t\tremoved = false;\n\t\t\ttoCheck = new ArrayList<Integer[]> ();\n\t\t\tfor (Integer[] thing : copyToCheck) {\n\t\t\t\ttoCheck.add(thing);\n\t\t\t}\n\t\t\tCollections.shuffle(toCheck); // Randomizes the order of the list of coordinates to check.\n\t\t\tfor (Integer[] coords : toCheck) {\n\t\t\t\tBlock curr = get(coords[0], coords[1], coords[2]);\n\t\t\t\tArrayList<Block> neighbors = getAdj(curr);\n\t\t\t\tboolean isJoint = false;\n\t\t\t\t\tfor (int i = 0; i < neighbors.size() - 1 && !isJoint; i++) {\n\t\t\t\t\t\tfor (int j = i+1; j < neighbors.size(); j++) {\n\t\t\t\t\t\t\tif (neighbors.get(j).t == ' ')\n\t\t\t\t\t\t\t\tif (neighbors.get(i).tree == neighbors.get(j).tree) {\n\t\t\t\t\t\t\t\t\tisJoint = true;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (isJoint) { // Even if it doesn't matter too much, don't want to spend a bunch of time iterating through the stuff unless I have too.\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!isJoint) {\n\t\t\t\t\t\tremoved = true;\n\t\t\t\t\t\tcopyToCheck.remove(coords);\n\t\t\t\t\t\tjoin(curr); // Joins all of the sets, changes the type of the block.\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n\t\tArrayList<Block> t = new ArrayList<Block>();\n\t\tfor (int i = 0; i < 5*size; i++) {\n\t\t\tArrayList<Block> b = getWalls();\n\t\t\t\n\t\t\tint rand = (int)(Math.random()*b.size());\n\t\t\tint x = b.get(rand).x;\n\t\t\tint y = b.get(rand).y;\n\t\t\tint z = b.get(rand).z;\n\t\t\tset(x, y, z, new Trap (x, y, z));\n\t\t}\n\t\tstart.t = ' '; // sets the type of the start and end blocks\n\t\tend.t = 'e';\n\t}",
"public void step()\n {\n\t int rows = grid.length-1;\n\t int cols = grid[0].length-1;\n\t int direction = (int) (Math.random()*3);\n\t direction--;\n\t int row = (int) (Math.random()*rows);\n\t //System.out.println(row);\n\t int col = (int) (Math.random()*cols);\n\t //System.out.println(col);\n\t if(grid[row][col] == SAND && (grid[row+1][col] == EMPTY || grid[row+1][col] == WATER)) {\n\t\t grid[row+1][col] = SAND;\n\t\t grid[row][col] = EMPTY;\n\t }\n\t if(grid[row][col] == WATER && grid[row+1][col] == EMPTY) {\n\t\t if(col != 0) {\n\t\t\t grid[row+1][col+direction] = WATER;\n\t\t\t grid[row][col] = EMPTY;\n\t\t }\n\t\t else {\n\t\t\t grid[row+1][col] = WATER;\n\t\t\t grid[row][col] = EMPTY;\n\t\t }\n\t }\n }",
"public void step()\n { \n //Remember, you need to access both row and column to specify a spot in the array\n //The scalar refers to how big the value could be\n //int someRandom = (int) (Math.random() * scalar)\n //remember that you need to watch for the edges of the array\n\t int randomRow = (int)(Math.random() * grid.length - 1);\n\t int randomCol = (int)(Math.random() * grid[0].length - 1);\n\t int randomDirection = (int)(Math.random() * 3);\n\t int randomDirectionFire = (int)(Math.random() * 4);\n\t int randomSpread = (int)(Math.random() * 100);\n\t int randomTelRow = (int)(Math.random() * grid.length);\n\t int randomTelCol = (int)(Math.random() * grid[0].length);\n\t \n\t //Sand\n\t if(grid[randomRow][randomCol] == SAND && (grid[randomRow + 1][randomCol] == EMPTY || grid[randomRow + 1][randomCol] == WATER))\n\t {\n\t\t if(grid[randomRow + 1][randomCol] == WATER)\n\t\t {\n\t\t\t grid[randomRow + 1][randomCol] = grid[randomRow][randomCol];\n\t\t\t grid[randomRow][randomCol] = WATER;\n\t\t }\n\t\t else\n\t\t {\n\t\t\t grid[randomRow + 1][randomCol] = grid[randomRow][randomCol];\n\t\t\t grid[randomRow][randomCol] = 0;\n\t\t }\n\n\t }\n\t //Water\n\t if(grid[randomRow][randomCol] == WATER && randomCol - 1 >= 0)\n\t {\n\t\t if(randomDirection == 1 && grid[randomRow + 1][randomCol] == EMPTY)\n\t\t {\n\t\t\t grid[randomRow + 1][randomCol] = WATER;\n\t\t\t grid[randomRow][randomCol] = 0;\n\t\t }\n\t\t else if(randomDirection == 2 && grid[randomRow][randomCol - 1] == EMPTY)\n\t\t {\n\t\t\t grid[randomRow][randomCol - 1] = WATER;\n\t\t\t grid[randomRow][randomCol] = 0;\n\t\t }\n\t\t else if(grid[randomRow][randomCol + 1] == EMPTY)\n\t\t {\n\t\t\t grid[randomRow][randomCol + 1] = WATER;\n\t\t\t grid[randomRow][randomCol] = 0;\n\t\t }\n\t }\n\t //Helium\n\t if(grid[randomRow][randomCol] == HELIUM && randomCol - 1 >= 0 && randomRow - 1 >= 0)\n\t {\n\t\t if(grid[randomRow - 1][randomCol] == WATER)\n\t\t {\n\t\t\t grid[randomRow - 1][randomCol] = grid[randomRow][randomCol];\n\t\t\t grid[randomRow][randomCol] = WATER;\n\t\t }\n\t\t else if(randomDirection == 1 && grid[randomRow - 1][randomCol] == EMPTY)\n\t\t {\n\t\t\t grid[randomRow - 1][randomCol] = grid[randomRow][randomCol];\n\t\t\t grid[randomRow][randomCol] = 0;\n\t\t }\n\t\t else if(randomDirection == 2 && grid[randomRow][randomCol - 1] == EMPTY)\n\t\t {\n\t\t\t grid[randomRow][randomCol - 1] = grid[randomRow][randomCol];\n\t\t\t grid[randomRow][randomCol] = 0;\n\t\t }\n\t\t else if(grid[randomRow][randomCol + 1] == EMPTY)\n\t\t {\n\t\t\t grid[randomRow][randomCol + 1] = grid[randomRow][randomCol];\n\t\t\t grid[randomRow][randomCol] = 0;\n\t\t }\n\t }\n\t \n\t //Bounce\n\t if(grid[randomRow][randomCol] == BOUNCE)\n\t { \t\n\t\t if(randomRow + 1 >= grid[0].length - 1 || randomRow + 1 == METAL)\n\t\t {\n\t\t\t hitEdge[randomCol] = true;\n\t\t }\n\t\t else if(randomRow - 1 < 0 || randomRow - 1 == METAL)\n\t\t {\n\t\t\t hitEdge[randomCol] = false;\n\t\t }\n\t\t \n\t\t if(hitEdge[randomCol] == true)\n\t\t {\n\t\t\t grid[randomRow - 1][randomCol] = BOUNCE;\n\t\t\t grid[randomRow][randomCol] = 0;\n\t\t }\n\t\t else\n\t\t {\n\t\t\t grid[randomRow + 1][randomCol] = BOUNCE;\n\t\t\t grid[randomRow][randomCol] = 0;\n\t\t }\n\t }\n\t \n\t //Virus\n\t if(grid[randomRow][randomCol] == VIRUS && randomCol - 1 >= 0 && randomRow - 1 >= 0)\n\t {\n\t\t if(grid[randomRow + 1][randomCol] == EMPTY)\n\t\t {\n\t\t\t grid[randomRow + 1][randomCol] = VIRUS;\n\t\t\t grid[randomRow][randomCol] = 0;\n\t\t }\n\t\t \n\t\t\t int temp = grid[randomRow + 1][randomCol];\n\t\t\t //VIRUS takeover\n\t\t\t if(grid[randomRow - 1][randomCol] != EMPTY)\n\t\t\t {\n\t\t\t\t grid[randomRow - 1][randomCol] = VIRUS;\n\t\t\t }\n\t\t\t if(grid[randomRow + 1][randomCol] != EMPTY)\n\t\t\t {\n\t\t\t\t grid[randomRow + 1][randomCol] = VIRUS;\n\t\t\t }\n\t\t\t if(grid[randomRow][randomCol - 1] != EMPTY)\n\t\t\t {\n\t\t\t\t grid[randomRow][randomCol - 1] = VIRUS;\n\t\t\t }\n\t\t\t if(grid[randomRow][randomCol + 1] != EMPTY)\n\t\t\t {\n\t\t\t\t grid[randomRow][randomCol + 1] = VIRUS;\n\t\t\t }\n\t\t\t //TEMP takeover\n\t\t\t grid[randomRow][randomCol] = temp;\n\t\t\t if(grid[randomRow - 1][randomCol] != EMPTY)\n\t\t\t {\n\t\t\t\t grid[randomRow - 1][randomCol] = temp;\n\t\t\t }\n\t\t\t if(grid[randomRow + 1][randomCol] != EMPTY)\n\t\t\t {\n\t\t\t\t grid[randomRow + 1][randomCol] = temp;\n\t\t\t }\n\t\t\t if(grid[randomRow][randomCol - 1] != EMPTY)\n\t\t\t {\n\t\t\t\t grid[randomRow][randomCol - 1] = temp;\n\t\t\t }\n\t\t\t if(grid[randomRow][randomCol + 1] != EMPTY)\n\t\t\t {\n\t\t\t\t grid[randomRow][randomCol + 1] = temp;\n\t\t\t }\n\t }\n\t \n\t //Fire\n\t if(grid[randomRow][randomCol] == FIRE && randomCol - 1 >= 0 && randomRow - 1 >= 0)\n\t { \n\t\t if(randomDirectionFire == 1)\n\t\t {\n\t\t\t grid[randomRow][randomCol] = EMPTY;\n\t\t }\n\t\t else if(randomDirectionFire == 2)\n\t\t {\n\t\t\t grid[randomRow - 1][randomCol - 1] = FIRE;\n\t\t\t grid[randomRow][randomCol] = EMPTY;\n\t\t }\n\t\t else if(randomDirectionFire == 3)\n\t\t {\n\t\t\t grid[randomRow - 1][randomCol + 1] = FIRE;\n\t\t\t grid[randomRow][randomCol] = EMPTY;\n\t\t }\n\t\t \n\t\t //Fire Eats Vine\n\t\t if(grid[randomRow - 1][randomCol] == VINE)\n\t\t {\n\t\t\t grid[randomRow - 1][randomCol] = FIRE;\n\t\t }\n\t\t if(grid[randomRow + 1][randomCol] == VINE)\n\t\t {\n\t\t\t grid[randomRow + 1][randomCol] = FIRE;\n\t\t }\n\t\t if(grid[randomRow][randomCol - 1] == VINE)\n\t\t {\n\t\t\t grid[randomRow][randomCol - 1] = FIRE;\n\t\t }\n\t\t if(grid[randomRow][randomCol + 1] == VINE)\n\t\t {\n\t\t\t grid[randomRow][randomCol + 1] = FIRE;\n\t\t }\n\t\t \n\t\t //Fire Blows Up Helium\n\t\t if(grid[randomRow - 1][randomCol] == HELIUM && randomRow - 2 >= 0 && randomCol - 2 >= 0 && randomRow + 2 < grid[0].length && randomCol + 2 < grid.length)\n\t\t {\n\t\t\t //Explosion\n\t\t\t grid[randomRow - 2][randomCol] = FIRE;\n\t\t\t grid[randomRow + 2][randomCol] = FIRE;\n\t\t\t grid[randomRow + 2][randomCol + 2] = FIRE;\n\t\t\t grid[randomRow + 2][randomCol - 2] = FIRE;\n\t\t\t grid[randomRow - 2][randomCol + 2] = FIRE;\n\t\t\t grid[randomRow - 2][randomCol - 2] = FIRE;\n\t\t\t grid[randomRow][randomCol - 2] = FIRE;\n\t\t\t grid[randomRow][randomCol + 2] = FIRE;\n\t\t\t //Clear Explosion\n\t\t\t grid[randomRow - 1][randomCol] = EMPTY;\n\t\t\t grid[randomRow + 1][randomCol] = EMPTY;\n\t\t\t grid[randomRow + 1][randomCol + 1] = EMPTY;\n\t\t\t grid[randomRow + 1][randomCol - 1] = EMPTY;\n\t\t\t grid[randomRow - 1][randomCol + 1] = EMPTY;\n\t\t\t grid[randomRow - 1][randomCol - 1] = EMPTY;\n\t\t\t grid[randomRow][randomCol - 1] = EMPTY;\n\t\t\t grid[randomRow][randomCol + 1] = EMPTY;\n\t\t }\n\t\t if(grid[randomRow + 1][randomCol] == HELIUM && randomRow - 2 >= 0 && randomCol - 2 >= 0 && randomRow + 2 < grid[0].length && randomCol + 2 < grid.length)\n\t\t {\n\t\t\t//Explosion\n\t\t\t grid[randomRow - 2][randomCol] = FIRE;\n\t\t\t grid[randomRow + 2][randomCol] = FIRE;\n\t\t\t grid[randomRow + 2][randomCol + 2] = FIRE;\n\t\t\t grid[randomRow + 2][randomCol - 2] = FIRE;\n\t\t\t grid[randomRow - 2][randomCol + 2] = FIRE;\n\t\t\t grid[randomRow - 2][randomCol - 2] = FIRE;\n\t\t\t grid[randomRow][randomCol - 2] = FIRE;\n\t\t\t grid[randomRow][randomCol + 2] = FIRE;\n\t\t\t //Clear Explosion\n\t\t\t grid[randomRow - 1][randomCol] = EMPTY;\n\t\t\t grid[randomRow + 1][randomCol] = EMPTY;\n\t\t\t grid[randomRow + 1][randomCol + 1] = EMPTY;\n\t\t\t grid[randomRow + 1][randomCol - 1] = EMPTY;\n\t\t\t grid[randomRow - 1][randomCol + 1] = EMPTY;\n\t\t\t grid[randomRow - 1][randomCol - 1] = EMPTY;\n\t\t\t grid[randomRow][randomCol - 1] = EMPTY;\n\t\t\t grid[randomRow][randomCol + 1] = EMPTY;\n\t\t }\n\t\t if(grid[randomRow][randomCol - 1] == HELIUM && randomRow - 2 >= 0 && randomCol - 2 >= 0 && randomRow + 2 < grid[0].length && randomCol + 2 < grid.length)\n\t\t {\n\t\t\t//Explosion\n\t\t\t grid[randomRow - 2][randomCol] = FIRE;\n\t\t\t grid[randomRow + 2][randomCol] = FIRE;\n\t\t\t grid[randomRow + 2][randomCol + 2] = FIRE;\n\t\t\t grid[randomRow + 2][randomCol - 2] = FIRE;\n\t\t\t grid[randomRow - 2][randomCol + 2] = FIRE;\n\t\t\t grid[randomRow - 2][randomCol - 2] = FIRE;\n\t\t\t grid[randomRow][randomCol - 2] = FIRE;\n\t\t\t grid[randomRow][randomCol + 2] = FIRE;\n\t\t\t //Clear Explosion\n\t\t\t grid[randomRow - 1][randomCol] = EMPTY;\n\t\t\t grid[randomRow + 1][randomCol] = EMPTY;\n\t\t\t grid[randomRow + 1][randomCol + 1] = EMPTY;\n\t\t\t grid[randomRow + 1][randomCol - 1] = EMPTY;\n\t\t\t grid[randomRow - 1][randomCol + 1] = EMPTY;\n\t\t\t grid[randomRow - 1][randomCol - 1] = EMPTY;\n\t\t\t grid[randomRow][randomCol - 1] = EMPTY;\n\t\t\t grid[randomRow][randomCol + 1] = EMPTY;\n\t\t }\n\t\t if(grid[randomRow][randomCol + 1] == HELIUM && randomRow - 2 >= 0 && randomCol - 2 >= 0 && randomRow + 2 < grid[0].length && randomCol + 2 < grid.length)\n\t\t {\n\t\t\t//Explosion\n\t\t\t grid[randomRow - 2][randomCol] = FIRE;\n\t\t\t grid[randomRow + 2][randomCol] = FIRE;\n\t\t\t grid[randomRow + 2][randomCol + 2] = FIRE;\n\t\t\t grid[randomRow + 2][randomCol - 2] = FIRE;\n\t\t\t grid[randomRow - 2][randomCol + 2] = FIRE;\n\t\t\t grid[randomRow - 2][randomCol - 2] = FIRE;\n\t\t\t grid[randomRow][randomCol - 2] = FIRE;\n\t\t\t grid[randomRow][randomCol + 2] = FIRE;\n\t\t\t //Clear Explosion\n\t\t\t grid[randomRow - 1][randomCol] = EMPTY;\n\t\t\t grid[randomRow + 1][randomCol] = EMPTY;\n\t\t\t grid[randomRow + 1][randomCol + 1] = EMPTY;\n\t\t\t grid[randomRow + 1][randomCol - 1] = EMPTY;\n\t\t\t grid[randomRow - 1][randomCol + 1] = EMPTY;\n\t\t\t grid[randomRow - 1][randomCol - 1] = EMPTY;\n\t\t\t grid[randomRow][randomCol - 1] = EMPTY;\n\t\t\t grid[randomRow][randomCol + 1] = EMPTY;\n\t\t }\n\t }\n\t \n\t //Vine\n\t if(grid[randomRow][randomCol] == VINE && randomCol - 1 >= 0 && randomRow - 1 >= 0)\n\t {\n\t\t if(grid[randomRow + 1][randomCol] == EMPTY)\n\t\t { \n\t\t\t if(randomSpread == 1)\n\t\t\t {\n\t\t\t\t grid[randomRow + 1][randomCol] = VINE;\n\t\t\t }\n\t\t }\n\t\t else if(grid[randomRow + 1][randomCol] == WATER)\n\t\t {\n\t\t\t if(randomSpread >= 90)\n\t\t\t {\n\t\t\t\t grid[randomRow + 1][randomCol] = VINE;\n\t\t\t\t grid[randomRow][randomCol + 1] = VINE;\n\t\t\t\t grid[randomRow][randomCol - 1] = VINE;\n\t\t\t }\n\t\t }\n\t }\n\t \n\t //Teleport\n\t if(grid[randomRow][randomCol] == TELEPORT && randomCol - 1 >= 0 && randomRow - 1 >= 0)\n\t {\n\t\t grid[randomTelRow][randomTelCol] = TELEPORT;\n\t\t grid[randomRow][randomCol] = EMPTY;\n\t }\n\t \n\t //Laser\n\t if(grid[randomRow][randomCol] == LASER && randomCol - 1 >= 0 && randomRow - 1 >= 0)\n\t {\n\t\t if(randomDirectionLaser == 1 && randomRow - 4 >= 0)\n\t\t {\n\t\t\t grid[randomRow + 1][randomCol] = LASER;\n\t\t\t grid[randomRow - 4][randomCol] = EMPTY;\n\t\t\t if(randomRow + 1 == grid.length - 1)\n\t\t\t {\n\t\t\t\t grid[randomRow][randomCol] = EMPTY;\n\t\t\t\t grid[randomRow - 1][randomCol] = EMPTY;\n\t\t\t\t grid[randomRow - 2][randomCol] = EMPTY;\n\t\t\t\t grid[randomRow - 3][randomCol] = EMPTY;\n\t\t\t }\n\t\t }\n\t\t else if(randomDirectionLaser == 2)\n\t\t {\n\t\t\t grid[randomRow - 1][randomCol] = LASER;\n\t\t\t grid[randomRow + 4][randomCol] = EMPTY;\n\t\t\t if(randomRow - 1 == 0)\n\t\t\t {\n\t\t\t\t grid[randomRow][randomCol] = EMPTY;\n\t\t\t\t grid[randomRow + 1][randomCol] = EMPTY;\n\t\t\t\t grid[randomRow + 2][randomCol] = EMPTY;\n\t\t\t\t grid[randomRow + 3][randomCol] = EMPTY;\n\t\t\t }\n\t\t }\n\t\t else if(randomDirectionLaser == 3 && randomCol - 4 >= 0)\n\t\t {\n\t\t\t grid[randomRow][randomCol + 1] = LASER;\n\t\t\t grid[randomRow][randomCol - 4] = EMPTY;\n\t\t\t if(randomCol + 1 == grid[0].length - 1)\n\t\t\t {\n\t\t\t\t grid[randomRow][randomCol] = EMPTY;\n\t\t\t\t grid[randomRow][randomCol - 1] = EMPTY;\n\t\t\t\t grid[randomRow][randomCol - 2] = EMPTY;\n\t\t\t\t grid[randomRow][randomCol - 3] = EMPTY;\n\t\t\t }\n\t\t }\n\t\t else\n\t\t {\n\t\t\t grid[randomRow][randomCol - 1] = LASER;\n\t\t\t grid[randomRow][randomCol + 4] = EMPTY;\n\t\t\t if(randomCol - 1 == 0)\n\t\t\t {\n\t\t\t\t grid[randomRow][randomCol] = EMPTY;\n\t\t\t\t grid[randomRow][randomCol + 1] = EMPTY;\n\t\t\t\t grid[randomRow][randomCol + 2] = EMPTY;\n\t\t\t\t grid[randomRow][randomCol + 3] = EMPTY;\n\t\t\t }\n\t\t }\n\t }\n }",
"void updateAvailMovesInBoxForFirstMove(int x, int y, int num) {\n\t\tint counter = 0;\n\t\tint i = x/boxSize;\n\t\tint j = y/boxSize;\n\t\tfor (int k = boxSize * i; k < boxSize * i + boxSize; k++) {\n\t\t\tfor (int l = boxSize * j; l < boxSize * j + boxSize; l++) {\n\t\t\t\tif (availMoves[k][l][num-1] == true) {\n\t\t\t\t\tcounter++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// next we see if there is a horizontal/vertical line that contains all of them, if it does, we can remove them from the line in the other boxes.\n\t\tif (counter > 1) {\n\t\t\tint lineCounter;\n\t\t\t// see if all the the availMoves that contain num are vertical\n\t\t\tfor (int k = boxSize * i; k < boxSize * i + boxSize; k++) {\n\t\t\t\tlineCounter = 0;\n\t\t\t\tfor (int l = boxSize * j; l < boxSize * j + boxSize; l++) {\n\t\t\t\t\tif (availMoves[k][l][num-1] == true) {\n\t\t\t\t\t\tlineCounter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (lineCounter == counter) {\n\t\t\t\t\tupdateAvailMovesInLineInBoxVertical(num, k, j);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse if(lineCounter > 0) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// see if all the the availMoves that contain num are horizontal\n\t\t\tfor (int l = boxSize * j; l < boxSize * j + boxSize; l++) {\n\t\t\t\tlineCounter = 0;\n\t\t\t\tfor (int k = boxSize * i; k < boxSize * i + boxSize; k++) {\n\t\t\t\t\tif (availMoves[k][l][num-1] == true) {\n\t\t\t\t\t\tlineCounter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (lineCounter == counter) {\n\t\t\t\t\tupdateAvailMovesInLineInBoxHorizontal(num, l, i);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse if(lineCounter > 0) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t}",
"public Cell hunt() {\n for (int i = 0; i < height; i++) {\n for (int j = 0; j < width; j++) {\n if (cells[i][j].isVisited() == false && getNeighbors(cells[i][j], true).length >= 1) {\n //mark the found cell as visited\n cells[i][j].visit();\n //find all visited neighbors\n Cell[] visitedNeighbors = getNeighbors(cells[i][j], true);\n //connect this cell and one of the visited neighbors (choose randomly)\n cells[i][j].carveThrough(visitedNeighbors[numberGenerator.nextInt(visitedNeighbors.length)]);\n return cells[i][j];\n }\n }\n }\n return null;\n }",
"public void fillBombs()\r\n {\r\n for (int i = 0; i < gameBoard.BOMB_COUNT; i++)\r\n {\r\n Cell tempCell = new Cell(true);\r\n tempCell.makeBomb();\r\n initBombClick(tempCell);\r\n gameBoard.bombList.add(tempCell);\r\n }\r\n for (int j = gameBoard.BOMB_COUNT; j < (gameBoard.BOARD_WIDTH * gameBoard.BOARD_WIDTH); j++)\r\n {\r\n Cell tempCell = new Cell(false);\r\n initEmptyClick(tempCell);\r\n gameBoard.bombList.add(tempCell);\r\n }\r\n Collections.shuffle(gameBoard.bombList);\r\n }",
"public static void removeSomeWalls(TETile[][] t) {\n for (int x = 1; x < WIDTH - 1; x++) {\n for (int y = 1; y < HEIGHT - 1; y++) {\n if (t[x][y] == Elements.TREE\n && t[x + 1][y] == Elements.FLOOR) {\n if (t[x - 1][y] == Elements.FLOOR\n && t[x][y + 1] == Elements.FLOOR) {\n if (t[x][y - 1] == Elements.FLOOR\n && t[x + 1][y + 1] == Elements.FLOOR) {\n if (t[x + 1][y - 1] == Elements.FLOOR\n && t[x - 1][y + 1] == Elements.FLOOR) {\n if (t[x - 1][y - 1] == Elements.FLOOR) {\n t[x][y] = Elements.FLOOR;\n }\n }\n }\n }\n }\n }\n }\n }",
"public void setPixel(int x, int y, short red, short green, short blue) {\n // Your solution here, but you should probably leave the following line\n // at the end.\n\t //if setPixel at the first location.\n\t if((x==0) && (y==0)) {\n\t\t if(red!=runs.getFirst().item[1]) {\n\t\t\t if(runs.getFirst().item[0]!=1) {\n\t\t\t\t int[] item= new int[] {1,red,green,blue};\n\t\t\t\t runs.getFirst().item[0]=runs.getFirst().item[0]-1;\n\t\t\t\t runs.addFirst(item);\n\t\t\t }\n\t\t\t else {\n\t\t\t\t if(red!=runs.getFirst().next.item[1]) {\n\t\t\t\t runs.remove(runs.nth(1));\n\t\t\t\t int[] item= new int[] {1,red,green,blue};\n\t\t\t\t runs.addFirst(item);\n\t\t\t\t System.out.println(runs.toString());\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t\t\t runs.remove(runs.nth(1));\n\t\t\t\t\t runs.getFirst().item[0]=runs.getFirst().item[0]+1;\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\t }\n\t \n\t //if setPixel at the last location.\n\t else if((x==(width-1)) && (y==(height-1))) {\n\t\t if(runs.getLast().item[0]==1) {\n\t\t\t if(red!=runs.getLast().prev.item[1]) {\n\t\t\t\t int[] item= new int[] {1,red,green,blue}; \n\t\t\t\t runs.remove(runs.getLast());\n\t\t\t\t runs.addLast(item);\n\t\t }\n\t\t \n\t\t\t else {\n\t\t\t\t runs.remove(runs.getLast());\n\t\t\t\t runs.getLast().item[0]=runs.getLast().item[0]+1;\n\t\t\t }\n\t\t\t \n\t\t }\n\t\t else {\n\t\t\t int[] item= new int[] {1,red,green,blue};\n\t\t\t runs.addLast(item);\n\t\t\t runs.getLast().prev.item[0]=runs.getLast().prev.item[0]-1;\n\t\t }\n\t }\n\t \n\t //if Pixel is at a random location.\n//\t if(((x>0) && (y>0)) && ((x!=(width-1)) && (y!=(height-1))) ) {\n//\t if((x>0)&&(x!=(width-1))){\n\t else {\n\t int loc=y*(width)+x+1; \n\t int count=0;\n\t for(int i=0;i<runs.length();i++) {\n\t\t \n\t\tloc=loc-runs.nth(i+1).item[0] ;\n\t\tcount++;\n\t\tif (loc<=0) {\n\t\t\tbreak;\n\t\t}\n\t }\n\t if((loc==0) && (runs.nth(count).item[0]==1)){\n\t\t if((red!=runs.nth(count).next.item[1])&&(red!=runs.nth(count).prev.item[1])) { \n\t\t\t int[] item= new int[] {1,red,green,blue};\n\t\t\t runs.addAfter(runs.nth(count), item);\n\t\t\t runs.remove(runs.nth(count));\n\t\t }\n\t\t if((red==(runs.nth(count).next).item[1])&& (red!=runs.nth(count).prev.item[1])){\n\t\t\t runs.remove(runs.nth(count));\n\t\t\t runs.nth(count).item[0]=runs.nth(count).item[0]+1;\n\t\t }\t\n\t\t if((red==(runs.nth(count).prev).item[1])&&(red!=runs.nth(count).next.item[1])) {\n\t\t\t runs.remove(runs.nth(count));\n\t\t\t runs.nth(count).prev.item[0]=runs.nth(count).prev.item[0]+1;\n\t\t }\t\n\t\t if((red==(runs.nth(count).prev).item[1])&&(red==runs.nth(count).next.item[1])) {\n\t\t\t runs.nth(count).prev.item[0]=runs.nth(count).prev.item[0]+1+runs.nth(count).next.item[0];\n\t\t\t runs.remove(runs.nth(count));\n\t\t\t runs.remove(runs.nth(count));\n\t\t }\n\t }\n\t else if((loc==0) && (runs.nth(count).item[0]!=1)) {\n\t\t if(red!=runs.nth(count).next.item[1]) {\n\t\t\t runs.nth(count).item[0]=runs.nth(count).item[0]-1;\n\t\t\t int[] item= new int[] {1,red,green,blue};\n\t\t\t runs.addAfter(runs.nth(count), item);\t \n\t\t }\n\t\t else {\n\t\t\t runs.nth(count+1).item[0]=runs.nth(count+1).item[0]+1;\n\t\t }\t\t \n\t } \n\t else if(loc!=0) {\n\t\t \n\t\t int[] item= new int[] {1,red,green,blue};\n\n//\t\t DListNode<int[]> dup=runs.nth(count);\n//\t\t System.out.println(\"This is dup\"+dup.item[0]+\" \"+dup.item[1]+\" \"+dup.item[2]+\" \"+dup.item[0]);\t\t \n\t\t runs.addAfter(runs.nth(count), item);\n\t\t int[] dup=new int[] {runs.nth(count).item[0],runs.nth(count).item[1],runs.nth(count).item[2],runs.nth(count).item[3]};\n\t\t runs.addAfter(runs.nth(count).next, dup);\n\t\t System.out.println(runs.nth(count).item[0]+\"This is loc \"+loc+\"THis is count \"+count);\n\t\t runs.nth(count).item[0]=runs.nth(count).item[0]+loc-1;\n\t\t System.out.println(runs.nth(count).next.next.item[0]+\"This is loc \"+loc+\"THis is count \"+count);\n\t\t runs.nth(count).next.next.item[0]=runs.nth(count).next.next.item[0]+loc-1;\t\n\t\t }\n\t\t \n\t \n\t }\n check();\n}",
"public static void mazeHeight(){\n\t\tint n = 10;\t\n\n\t\tdsf S = new dsf(n*n);\n\t\tMaze three = new Maze(n);\n\n\t\tRandom random;\n\t\tint sets = n*n;\t//number of sets in the DSF\n\t\tint randomNumber;\n\t\tint randomDirection;\n\t\tint row;\n\t\tint col;\n\n\t\tchar upperRight; \t//bottom or right\n\n\t\tS.print();\n\n\t\twhile(sets > 1){\n\t\t\trandom = new Random();\n\t\t\trandomNumber = random.nextInt((n*n) - 1);\n\t\t\t//System.out.println(\"RANDOM NUMBER: \"+randomNumber);\n\t\t\trow = randomNumber /n;\t//SWITCHED\n\t\t\tcol = randomNumber %n;\t//SWITCHED\n\t\t\trandomDirection = random.nextInt(2);\n\t\t\tString direct;\n\t\t\tif(randomDirection == 0)\n\t\t\t\tdirect = \"upper\";\n\t\t\telse\n\t\t\t\tdirect = \"right\";\n\t\t\t//System.out.println(\"RANDOM DIRECTI0N: \"+direct);\n\t\t\tupperRight = three.direction(randomDirection);\n\n\t\t\tif(upperRight == 'u'){\n\t\t\t\tif((randomNumber) < ((n*n)-n)){\n\t\t\t\t\tSystem.out.println(\"Sets: \"+sets);\n\t\t\t\t\tif(S.find(randomNumber) != S.find(randomNumber + n)){\n\t\t\t\t\t\tS.unionByHeight(randomNumber, randomNumber+n);\n\t\t\t\t\t\tthree.remove_wall(col, row, 'u');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(upperRight == 'r'){\n\t\t\t\tif(((randomNumber)%(n*n)) != n-1){\n\t\t\t\t\tif(S.find(randomNumber) != S.find(randomNumber+1)){\n\t\t\t\t\t\tS.unionByHeight(randomNumber, randomNumber+1);\n\t\t\t\t\t\tthree.remove_wall(col, row, 'r');\n\t\t\t\t\t\tS.print();\n\t\t\t\t\t\tsets--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tbuildAdjacencyList(three, n);\n\t\tuserSelection_SolveMaze(n);\n\n\n\t\tStdDraw.show(0);\n\t\tthree.draw();\n\t\tthree.printCellNumbers();\t\n\t}",
"public void changeBoard(int columnnumber, int whoseTurn, Color color1, Color color2){ //changes the colour of the circles on the board\r\n \r\n if(whoseTurn==1){ \r\n if(erase>0){ //this if statement runs if a checker needs to be erased; (because AI was checking future game states)\r\n for(int i = 0; i<=5; i++){ //going from top to bottom to change the last entered checker\r\n if(arrayCircles[i][erase-1].getColor()==color1){\r\n arrayCircles[i][erase-1].setColor(Color.white); //removing the checker that was previously placed\r\n repaint();\r\n break;\r\n }\r\n }\r\n }\r\n else{\r\n for(int i = 5; i>=0; i--){\r\n if(arrayCircles[i][columnnumber-1].getColor()==Color.white){ //starting from row 5 (the bottom one) see if any of those within the column is null\r\n arrayCircles[i][columnnumber-1].setColor(color1); //if so, set that value to the colour of the player who inputted that columnnumber\r\n repaint(); //repainting the board so that it updates and is visible to viewers\r\n break; //break once the colour has been changed and a move has been made\r\n }\r\n }\r\n }\r\n }\r\n \r\n else if(whoseTurn==2){\r\n for(int i = 5; i>=0; i--){\r\n if(arrayCircles[i][columnnumber-1].getColor()==Color.white){ //if there is an open space, set its colour to the desired colour \r\n arrayCircles[i][columnnumber-1].setColor(color2);\r\n repaint();\r\n break;\r\n }\r\n }\r\n }\r\n \r\n else if(whoseTurn==3||whoseTurn==4){ //either the easyAI or the hardAI\r\n \r\n \r\n if(erase>0){ //this if statement erases the last placed coloured checker\r\n for(int i = 0; i<=5; i++){ //going from top to bottom to change the last entered checker to white\r\n if(arrayCircles[i][erase-1].getColor()==Color.magenta){\r\n arrayCircles[i][erase-1].setColor(Color.white); //sets it back to white\r\n repaint(); //repaints and breaks\r\n break;\r\n }\r\n }\r\n }\r\n else{\r\n for(int i = 5; i>=0; i--){ //setting the colour of the column to magenta (for the AI)\r\n if(arrayCircles[i][columnnumber-1].getColor()==Color.white){\r\n arrayCircles[i][columnnumber-1].setColor(color2);\r\n repaint();\r\n break;\r\n }\r\n }\r\n } \r\n }\r\n }",
"public boolean makeMove(int orient, int slot) {\n turn++;\n //height if the first column makes contact\n int height = top[slot]-pBottom[nextPiece][orient][0];\n //for each column beyond the first in the piece\n for(int c = 1; c < pWidth[nextPiece][orient];c++) {\n height = Math.max(height,top[slot+c]-pBottom[nextPiece][orient][c]);\n }\n \n //check if game ended\n if(height+pHeight[nextPiece][orient] >= ROWS) {\n lost = true;\n return false;\n }\n\n \n //for each column in the piece - fill in the appropriate blocks\n for(int i = 0; i < pWidth[nextPiece][orient]; i++) {\n \n //from bottom to top of brick\n for(int h = height+pBottom[nextPiece][orient][i]; h < height+pTop[nextPiece][orient][i]; h++) {\n field[h][i+slot] = turn;\n }\n }\n \n //adjust top\n for(int c = 0; c < pWidth[nextPiece][orient]; c++) {\n top[slot+c]=height+pTop[nextPiece][orient][c];\n }\n \n int rowsCleared = 0;\n \n //check for full rows - starting at the top\n for(int r = height+pHeight[nextPiece][orient]-1; r >= height; r--) {\n //check all columns in the row\n boolean full = true;\n for(int c = 0; c < COLS; c++) {\n if(field[r][c] == 0) {\n full = false;\n break;\n }\n }\n //if the row was full - remove it and slide above stuff down\n if(full) {\n rowsCleared++;\n cleared++;\n //for each column\n for(int c = 0; c < COLS; c++) {\n\n //slide down all bricks\n for(int i = r; i < top[c]; i++) {\n field[i][c] = field[i+1][c];\n }\n //lower the top\n top[c]--;\n while(top[c]>=1 && field[top[c]-1][c]==0) top[c]--;\n }\n }\n }\n\n //pick a new piece\n nextPiece = randomPiece();\n\n return true;\n }",
"private void fireball1Collisions() {\r\n\t\tGObject topLeft = getElementAt(fireball1.getX() - 1, fireball1.getY());\r\n\t\tGObject bottomLeft = getElementAt(fireball1.getX() - 1, fireball1.getY() + fireball1.getHeight());\r\n\t\tGObject topRight = getElementAt(fireball1.getX() + fireball1.getWidth() + 1, fireball1.getY());\r\n\t\tGObject bottomRight = getElementAt(fireball1.getX() + fireball1.getWidth() + 1, fireball1.getY() + fireball1.getHeight());\r\n\t\tif(topLeft == player || bottomLeft == player || topRight == player || bottomRight == player) {\r\n\t\t\tremove(fireball1);\r\n\t\t\tfireball1 = null;\r\n\t\t\thits++;\r\n\t\t\tloseLife();\r\n\t\t}\r\n\t}",
"void makeMove(int row, int col, int nextRow, int nextCol) {\r\n int temp = checks[row][col];\r\n checks[nextRow][nextCol] = temp;\r\n checks[row][col] = 0;\r\n if (Math.abs(nextRow - row) == 2){\r\n removePiece(nextRow, nextCol,row, col);\r\n }\r\n checkKing(nextRow,nextCol);\r\n }",
"public void calculateSurroundings(int bombXPos, int bombYPos){\n for(int x = bombXPos - 1; x <= (bombXPos + 1); x++){\n for(int y = bombYPos - 1; y <= (bombYPos + 1); y++){\n if(x >= 0 && x < mineWidthHeight && y >= 0 && y < mineWidthHeight){\n if(model[x][y].getHasBomb() != Mine.BOMB){\n model[x][y].setNumSurroundingBombs((short)(model[x][y].getNumSurroundingBombs() + 1));\n }\n }\n }\n\n }\n }",
"public void disperse() {\t\t\n\t\tfor (int r = 0; r < rows; r++){\n\t\t\tfor (int c = 1; c < cols; c++){\n\t\t\t\tint sum = values[r+1][c-1] + values[r+1][c] + values[r+1][c+1];\n\t\t\t\tif(r < rows - fireLevel + 14){\n\t\t\t\t\tvalues[r][c] = (sum / 3) - 1;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tvalues[r][c] = (int)((sum / 3.0) - 0.0); \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (values[r][c] < 0) values[r][c] = 0;\n\t\t\t\tg2.setColor(colors[values[r][c]]);\n\t\t\t\tif(values[r][c] > 5){\n\t\t\t\t\tg2.fillRect(c*res,r*res,res,res);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"void initializeGrid() {\n int maxBombs = GridHelper.getMaxBombs((int)Math.pow(hiddenGrid.length, 2.0)); // A: How many bombs CAN this have?\n bombsPlaced = 0; // B: How many bombs DOES this have?\n int cycleCap = randomCycleCap(); // C: Sets cycleCap to a randomly generated number between 0 and 15,\n int cycleCellCount = 0; // D: cycleCap starts at zero and goes up\n\n for (int i = 0; i < hiddenGrid.length; i++) {\n for (int j = 0; j < hiddenGrid[i].length; j++) {\n\n if (hiddenGrid[i][j] == null) {\n setCell(i, j, 0); // a: initializes the null value to 0\n }\n if((cycleCellCount == cycleCap) && (bombsPlaced < maxBombs)){\n placeBomb(i, j, -1); // a: turns this cell into a bomb, increments cells around it\n cycleCellCount = 0; // b: Restarts the 'cycle counter'\n cycleCap = randomCycleCap(); // c: Gives us a new number to 'count down' to, to place the next bomb\n } else{\n ++cycleCellCount; // a. Moves to the next cell in the 'cycle' having done nothing\n }\n }\n }\n System.out.println(\"Bombs placed: \" + bombsPlaced);\n }",
"public int getMarbles(int remainingMarbles) {\n\n /*\n Counter Used to keep track of how many marbles the SmartComputer has\n removed within his turn.\n */\n int Counter = 0 ;\n\n /*\n Local Variable \"holder\" Serves as a holder for the Intial Pile Size.\n This is used to check if the SmartComputer has removed half the amount\n of this current size. If so, It is also used to create a random number\n between 1 and this holders value which is the current pile size entered\n into the method.\n */\n int holder = remainingMarbles ;\n /*\n This While Loop Within the getMarbles() Method is the Algorithm for\n how the SmartComputer ensures it leaves a Pilesize of a power of 2 - 1.\n First, it checks to see if the Current Remaining Pile Size is a power of\n 2, if so the While Loop Breaks and Counter is initialized and returned.\n (1 Marble Removed to Leave Power of 2 - 1). However, if the Current \n Pile Size is not a power of 2, it will remove 1 marble and check to see\n if it has removed half the amount of marbles within the current pile. \n If it has, then it Stops and instead of removing that amount it instead \n ends up removing a random number between 1 and half the current pile \n size.This is because, the method has to remove one more marble in the \n end, which would be more than half which is not allowed. However, if it \n has not removed more than half it will keep removing and checking if the\n left over amount is a power of 2. When it obtains a power of 2 within \n the pile, it will remove exactly 1 more to leave a Power of 2 - 1 to \n ensure victory.\n */\n while (!isFound(remainingMarbles)) {\n remainingMarbles-- ;//Removes a marble if not power of 2 yet.\n Counter++ ;//Counter for how many marbles have been removed.\n /*\n You Might be thinking, How come the Smart Computer cannot remove \n half the amount of the pile? Well Because the Smart computer will\n never want to stop at half, it will want to continue as there is\n no power of 2 - 1 that can be reached by subtracting half of another \n power of 2 - 1. Example, 31: The SmartComputer Will want to get to\n 15, However that entails removing 16, Which is more than half, \n Therefore once the Counter reaches 15 it stops for it knows it will\n try to remove one more, therefore it returns a random int between\n 1 and the Initial Entered Pile Size instead. \n */\n if (Counter == ((holder) / 2)) {\n return ((gen.nextInt(holder / 2)) + 1) ;\n }\n }\n return ++Counter ; //Returns one more than the number of moves down to \n //get the pile to a power of 2 in order to leave a power of 2 - 1.\n }",
"private static void findBridges() {\n Map<Integer, Integer> lastSeen = new HashMap<>();\n for (int i = 0; i < columns.length; i++) {\n if (!lastSeen.containsKey(columns[i])) {\n lastSeen.put(columns[i], i);\n }\n }\n bridgesCount = 0;\n\n int lastBridgeIndex = 0;\n for (int i = 1; i < columns.length; i++) {\n\n //returns prev index of columns[i]\n int columnPrevIndex = lastSeen.get(columns[i]);\n //columnPrevIndex must be to the right from lastBridgeIndex to avoid crossing\n if (columnPrevIndex != i &&\n columnPrevIndex >= lastBridgeIndex) {\n lastBridgeIndex = i;\n bridgesCount++;\n connections[i] = true;\n connections[columnPrevIndex] = true;\n }\n //not optimized solution -> for every element we search to it's left side\n //from lastBridgeIndex to i and if we meet same element -> connect new bridge\n// for (int j = lastBridgeIndex; j < i; j++) {\n//\n// if (columns[j] == columns[i]) {\n// lastBridgeIndex = i;\n// connections[j] = true;\n// connections[i] = true;\n// bridgesCount++;\n// break;\n// }\n// }\n\n //update index of columns[i]\n lastSeen.put(columns[i], i);\n }\n }",
"public void balayer()\r\n {\r\n int tot=0;\r\n for (int i=0;i<LONGUEUR;i++ )\r\n {\r\n for (int j=0; j<LARGEUR; j++ )\r\n {\r\n tot=0;\r\n Haut = lignesHor[i][j];\r\n Droite = lignesVert[i+1][j];\r\n Bas = lignesHor[i][j+1];\r\n Gauche = lignesVert[i][j];\r\n\r\n if (Haut)\r\n {\r\n tot++;\r\n Vision[i][j][1]=1;\r\n }\r\n\r\n if (Droite)\r\n {\r\n tot++;\r\n Vision[i][j][2]=1;\r\n }\r\n\r\n if (Bas)\r\n {\r\n tot++;\r\n Vision[i][j][3]=1;\r\n }\r\n\r\n\r\n if (Gauche)\r\n {\r\n tot++;\r\n Vision[i][j][4]=1;\r\n }\r\n\r\n Vision[i][j][0]=Vision[i][j][1]+Vision[i][j][2]+Vision[i][j][3]+Vision[i][j][4];\r\n }\r\n }\r\n }",
"private void removeALakeTile(Game game) {\n\t\tLakeTile[][] board = game.getPlayArea().getLakeTilesOnBoard();\n\t\tArrayList<Position> positions = new ArrayList<Position>();\n\t\tfor (int y = 0; y < board.length; y++) {\n\t\t\tfor (int x = 0; x < board[y].length; x++) {\n\t\t\t\tLakeTile laketile = board[x][y];\n\t\t\t\tif (laketile != null) {\n\t\t\t\t\tint connect_laketile = 4;\n\t\t\t\t\tif (x + 1 < board.length && board[x + 1][y] == null)\n\t\t\t\t\t\tconnect_laketile -= 1;\n\t\t\t\t\tif (y + 1 < board.length && board[x][y + 1] == null)\n\t\t\t\t\t\tconnect_laketile -= 1;\n\t\t\t\t\tif (x - 1 >= 0 && board[x - 1][y] == null)\n\t\t\t\t\t\tconnect_laketile -= 1;\n\t\t\t\t\tif (y - 1 >= 0 && board[x][y - 1] == null)\n\t\t\t\t\t\tconnect_laketile -= 1;\n\t\t\t\t\tif (connect_laketile == 1) {\n\t\t\t\t\t\tPosition p = new Position(x, y);\n\t\t\t\t\t\tpositions.add(p);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (countLakeTileOnBoard(board) != 0 && positions.size() == 0) {\n\t\t\tpositions = getAllLakeTilePositionOnBoard(board);\n\t\t}\n\t\tCollections.shuffle(positions);\n\t\tPosition pos = positions.get(0);\n\t\tint x = pos.getX();\n\t\tint y = pos.getY();\n\t\tremoved_laketile.add(board[x][y]);\n\t\tremoved_position.add(pos);\n\t\tboard[x][y] = null;\n\t}"
]
| [
"0.60639286",
"0.60322833",
"0.6013991",
"0.59027076",
"0.5881361",
"0.5863212",
"0.5803562",
"0.57946694",
"0.57297593",
"0.5715571",
"0.5707527",
"0.57014966",
"0.5665475",
"0.56453377",
"0.5619723",
"0.5619706",
"0.5605848",
"0.559065",
"0.55900186",
"0.5556765",
"0.55244666",
"0.54666144",
"0.5453612",
"0.5451391",
"0.541621",
"0.5414098",
"0.54129356",
"0.539966",
"0.5390699",
"0.5387129",
"0.53839475",
"0.5380517",
"0.5378504",
"0.53775537",
"0.53749746",
"0.53672653",
"0.53625643",
"0.53559184",
"0.53523123",
"0.5345969",
"0.5332855",
"0.5330634",
"0.532916",
"0.53164953",
"0.53145295",
"0.53067225",
"0.53066117",
"0.53034323",
"0.5285573",
"0.5285296",
"0.52831966",
"0.5278824",
"0.52630836",
"0.52595234",
"0.52531755",
"0.5238888",
"0.5236113",
"0.5235575",
"0.5234914",
"0.5234848",
"0.5229647",
"0.52269036",
"0.52268624",
"0.5226674",
"0.52173114",
"0.5216488",
"0.52141726",
"0.5204871",
"0.5202528",
"0.5201934",
"0.51982623",
"0.5191811",
"0.5190095",
"0.5183724",
"0.5183399",
"0.5174603",
"0.51706374",
"0.51696867",
"0.5161339",
"0.5161112",
"0.51531565",
"0.5137692",
"0.5137563",
"0.5125971",
"0.5120615",
"0.51170355",
"0.5115713",
"0.51107955",
"0.5109088",
"0.510823",
"0.5099915",
"0.5096014",
"0.5095244",
"0.5088097",
"0.5088001",
"0.5086582",
"0.5082785",
"0.50811774",
"0.5079804",
"0.5076175",
"0.5076035"
]
| 0.0 | -1 |
This is used to determine the turn of a player This constructor instantiate all the attributes that are defined with the help of GameConfiguration interface like number of players, number of coins and its type, etc. | public MatchController()
{
// Here from Game_Constants interface constants such as number of players, black coins count
// and red coins count are fetched.
this.playerControllerList = new PriorityQueue<PlayerController>(new Comparator<PlayerController>(){
@Override
public int compare(PlayerController p1, PlayerController p2)
{
return (p1.getPoints() > p2.getPoints() ) ? -1: (p1.getPoints() < p2.getPoints()) ? 1:0 ;
}
});
for(int i=0; i<GameConfiguration.NUMBER_OF_PLAYERS; i++)
{
this.playerControllerList.add(new PlayerController(i));
}
this.gameController = new GameController(GameConfiguration.BLACK_COINS_COUNT, GameConfiguration.RED_COINS_COUNT);
this.turn = 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Player() {\n\n\t\tnumberOfPlayers++;\n\t\tthis.playerNumber = \"Player \" + numberOfPlayers; \n\t\tthis.balance = 500.00; \n\t\tthis.numberOfLoans = 0;\n\t\tthis.score = 0;\n\t\tthis.inRound = true; \n\t}",
"public GameTurn(int playerId) {\n this.playerId = playerId;\n }",
"public UserPlayer(){\n this.playerNum = 0;\n this.isLead = false;\n this.playerHand = new Hand();\n this.suitUserChose = null;\n }",
"public Player(int balance){\n this.hand = new Hand();\n this.balance = balance;\n this.scoreboard = new Scoreboard(balance);\n }",
"public Player(String name) {\n this.NAME = name;\n this.ownedCountries = new ArrayList<>();\n this.totArmyCount = 0;\n this.PlayerTurn = false;\n }",
"public Tournament(){\n simplePlayer = new SimpleFakeGinRummyPlayer(new ParamList(new double[]{}));\n\n knockOnGinPlayer = new EnsembleHandEvalPlayer(ParamList.getRandomParamList(1), new DeadwoodHandEvaluator());\n knockOnGinPlayer.setKnockDecider(new KnockOnGinKnockDecider() );\n knockOnGinPlayer.setDrawDecider(new MeldOnlyDrawDecider());\n\n ExperimentalRuns.fixTwoStageKnockDecider101();\n // paramOfTunedTwoStagePlayer.set(ParamList.TS_KNOCK_THRESHOLD_EARLY, 0);\n // paramOfTunedTwoStagePlayer.set(ParamList.TS_KNOCK_THRESHOLD_LATE, 0);\n // paramOfTunedTwoStagePlayer.set(ParamList.TS_KNOCK_MIDDLE, 6);\n ParamList.setFixedValue(ParamList.TS_DRAW_MIDDLE, 14);\n ParamList paramOfTunedTwoStagePlayer = ParamList.getRandomParamList(1);\n System.out.println(paramOfTunedTwoStagePlayer);\n tunedTwoStagePlayer = new IndexEnsembleHandEvalPlayer(paramOfTunedTwoStagePlayer, new DeadwoodHandEvaluator());\n tunedTwoStagePlayer.setKnockDecider(new TwoStageKnockDecider(paramOfTunedTwoStagePlayer) );\n tunedTwoStagePlayer.setDrawDecider(new MeldOnlyDrawDecider());\n tunedTwoStagePlayer.setDrawDecider(new TwoStageDrawDecider(paramOfTunedTwoStagePlayer));\n\n resultSimpleVsKnockGin = 0;\n resultKnockGinVsTwoStage = 0;\n resultTwoStageVsSimple = 0;\n\n numGamePerPair = 2000;\n\n }",
"public Player() {\r\n\t\tname=null;\r\n\t\tinitializeGameboard();\r\n\t\tlastRedNumber=2; \r\n\t\tlastYellowNumber=2;\r\n\t\tlastGreenNumber=12;\r\n\t\tlastBlueNumber=12;\r\n\t\tnegativePoints=0;\r\n }",
"public Player(String name) {\n setName(name);\n setId(++idCounter);\n setHealthPoints(100);\n setYourTurn(false);\n }",
"public GamePlayer() {}",
"public Player(String name){\n this.name = name;\n this.gold = 0;\n this.score = 0;\n this.ressource = new HashMap<Ressource, Integer>();\n this.ressource.put(Ressource.ROCHE, 0);\n this.ressource.put(Ressource.BLE, 0);\n this.ressource.put(Ressource.SABLE, 0);\n this.ressource.put(Ressource.BOIS, 0);\n }",
"public Player_ex1(String playerName){\n this.name = playerName;\n winner = false;\n }",
"public Player(String name) {\r\n\t\tthis.name=name;\r\n\t\tinitializeGameboard();\r\n\t\tlastRedNumber=2; \r\n\t\tlastYellowNumber=2;\r\n\t\tlastGreenNumber=12;\r\n\t\tlastBlueNumber=12;\r\n\t\tnegativePoints=0;\r\n\t}",
"public Turn(Player player) {\n this.player = player;\n this.actionPoints = player.getFireEngines().stream()\n .collect(Collectors.toMap((f) -> f, (f) -> INITIAL_ACTION_POINTS, (l, r) -> l, HashMap::new));\n this.positionsExtinguished = new HashMap<>();\n this.stationaryEngines = new HashSet<>();\n }",
"public Player(Game game){\r\n this.game = game;\r\n }",
"public Player(){\r\n\t\tname = \"\";\r\n\t\tchip = 0;\r\n\t\tbet = 0;\r\n\t\tplayerHand = new PlayerHand();\r\n\t\ttable = null;\r\n\t}",
"public Player(String name,String birthdate,int height,int goal,String clubName,String role){\r\n this.name = name;\r\n this.birthdate = birthdate;\r\n this.height = height;\r\n this.goal = goal;\r\n this.clubName = clubName;\r\n this.role = role;\r\n }",
"public Player()\n\t{\n\t\tthis.name = \"\";\n\t\tthis.numPlayed = 0;\n\t\tthis.numCompleted = 0;\n\t\tthis.averageTime = new Time(0);\n\t\tthis.bestTime = new Time(0);\n\t\tthis.accuracy = 0;\n\t}",
"Turn createTurn();",
"Player(String playerName) {\n this.playerName = playerName;\n }",
"public Player()\n\t{\n\t\tmyName = DEFAULT_NAME;\n\t\tmyHand = new PokerHand(5);\n\t\tmyNumberWins = 0;\n\t\tmyAmAI = false;\n\t}",
"public Game() {\n\t\tbPlayer = new Player(false);\n\t\twPlayer = new Player(true);\n\t\t// TODO Auto-generated constructor stub\n\t}",
"public BoardState(int typeOfPlayer){\n board = new char[boardSize][boardSize];\n //ai\n if(typeOfPlayer == 0){\n aiInitBoard();\n }\n //human\n else if(typeOfPlayer == 1){\n initBoard();\n }\n }",
"public Game()\n {\n // initialise instance variables\n playerName = \"\";\n gameTotal = 0;\n }",
"public GameState(){\n this.gameResults = \"\";\n initVars();\n this.theme = DEFAULT_THEME;\n this.board = new Board(DEFAULT_BOARD);\n createSetOfPlayers(DEFAULT_PLAYERS, DEFAULT_AUTOPLAYER, DEFAULT_AUTOMODE);\n }",
"public Player(boolean isMyTurn) {\r\n this.pits = new int[6];\r\n Arrays.fill(pits, 6);\r\n this.bigPit = 0;\r\n this.pitIndex = -1;\r\n setMyTurn(isMyTurn);\r\n }",
"public GamePlayerManager(int players, int ai){\n playerAmount = players;\n aiAmount = ai;\n colorArray[0] = \"RED\";\n colorArray[1] = \"BLUE\";\n colorArray[2] = \"YELLOW\";\n colorArray[3] = \"GREEN\";\n colorArray[4] = \"WHITE\";\n colorArray[5] = \"BLACK\";\n colorArray[6] = \"CYAN\";\n colorArray[7] = \"ORANGE\";\n colorArray[8] = \"MAGENTA\";\n colorArray[9] = \"PINK\";\n }",
"public Game() {\n generatePort();\n status = Status.ATTENTE;\n generateGameID();\n name = \"GameG4B\";\n players = new ArrayList<>();\n maxRealPlayer = 0;\n maxVirtualPlayer = 0;\n realPlayerNb = 0;\n virtualPlayerNb = 0;\n rounds = new ArrayList<>();\n currentRound = 0;\n }",
"Player(String name, int playerNumber, int age, int salary, PlayerStat playerStats) {\n this.name = name; \n this.playerNumber = playerNumber;\n this.age = age;\n this.salary = salary; \n this.playerStats = playerStats;\n\n this.playerRating = -1; //sets the rating as a clear wrong value\n }",
"public Player(String password) {\n\t\tsuper(/* Settings.HOSTED ? */Settings.START_PLAYER_LOCATION);\n\t\tsetHitpoints(Settings.START_PLAYER_HITPOINTS);\n\t\tthis.password = password;\n\t\tappearence = new Appearence();\n\t\tsof = new SquealOfFortune();\n\t\tcurrencypouch = new CurrencyPouch();\n\t\tpouch = new MoneyPouch();\n\t\tinventory = new Inventory();\n\t\tequipment = new Equipment();\n\t\tskills = new Skills();\n\t\tcombatDefinitions = new CombatDefinitions();\n\t\tfarmingManager = new FarmingManager();\n\t\tprayer = new Prayer();\n\t\tbank = new Bank();\n\t\ttoolbelt = new Toolbelt(this);\n\t\tsecondbank = new Bank();\n\t\tpreset = new BankPreset(this);\n\t\tpreset2 = new BankPreset(this);\n\t\tpreset3 = new BankPreset(this);\n\t\tpreset4 = new BankPreset(this);\n\t\tkeybindfunctions = new KeybindFunctions(this);\n\t\tcontrolerManager = new ControlerManager();\n\t\tmusicsManager = new MusicsManager();\n\t\temotesManager = new EmotesManager();\n\t\tfriendsIgnores = new FriendsIgnores();\n\t\tdominionTower = new DominionTower();\n\t\tcharges = new ChargesManager();\n\t\tauraManager = new AuraManager();\n\t\tlendManager = new LendingManager();\n\t\tquestManager = new QuestManager();\n\t\texquestManager = new EXQuestManager();\n\t\tpetManager = new PetManager();\n\t\tperksManager = new PerksManager();\n\t\trunEnergy = 100;\n\t\tallowChatEffects = true;\n\t\tmouseButtons = true;\n\t\tcompleted = true;\n\t\tpouches = new int[4];\n\t\trolls = new int[300];\n\t\tfor (int i = 0; i < rolls.length; i++)\n\t\t\trolls[i] = -1;\n\t\tresetBarrows();\n\t\tSkillCapeCustomizer.resetSkillCapes(this);\n\t\townedObjectsManagerKeys = new LinkedList<String>();\n\t\tpasswordList = new ArrayList<String>();\n\t\tipList = new ArrayList<String>();\n\t\tsetCreationDate(Utils.currentTimeMillis());\n\t}",
"TurnController createTurnController(PlayerTurn turn);",
"private static void initStatistics(Player p){\n }",
"public Player(int playerNumber, boolean isAIPlayer, String phase) {\n this.playerNumber = playerNumber;\n coins = 3;\n this.isAIPlayer = isAIPlayer;\n if (phase.equals(\"phase1\")) {\n Establishments.add(new Establishment(Card.Color.BLUE, Card.Icon.WHEAT, 1, \"Wheat Field\", \"[1]\", 1, 1));\n Landmarks.add(new Landmark(Card.Color.NONE, Card.Icon.NONE, 7, \"City Hall\"));\n }\n if (phase.equals(\"phase2\")) {\n Establishments.add(new Establishment(Card.Color.BLUE, Card.Icon.WHEAT, 1, \"Wheat Field\", \"[1]\", 1, 1));\n Establishments.add(new Establishment(Card.Color.GREEN, Card.Icon.BREAD, 1, \"Bakery\", \"[2-3]\", 1, 1));\n Landmarks.add(new Landmark(Card.Color.NONE, Card.Icon.TOWER, 4, \"Train Station\"));\n Landmarks.add(new Landmark(Card.Color.NONE, Card.Icon.NONE, 7, \"City Hall\"));\n }\n if (phase.equals(\"phase3\")) {\n Establishments.add(new Establishment(Card.Color.BLUE, Card.Icon.WHEAT, 1, \"Wheat Field\", \"[1]\", 1, 1));\n Establishments.add(new Establishment(Card.Color.GREEN, Card.Icon.BREAD, 1, \"Bakery\", \"[2-3]\", 1, 1));\n Landmarks.add(new Landmark(Card.Color.NONE, Card.Icon.TOWER, 4, \"Train Station\"));\n Landmarks.add(new Landmark(Card.Color.NONE, Card.Icon.NONE, 7, \"City Hall\"));\n Landmarks.add(new Landmark(Card.Color.NONE, Card.Icon.TOWER, 10, \"Shopping Mall\"));\n }\n if (phase.equals(\"phase4\")) {\n Establishments.add(new Establishment(Card.Color.BLUE, Card.Icon.WHEAT, 1, \"Wheat Field\", \"[1]\", 1, 1));\n Establishments.add(new Establishment(Card.Color.GREEN, Card.Icon.BREAD, 1, \"Bakery\", \"[2-3]\", 1, 1));\n Landmarks.add(new Landmark(Card.Color.NONE, Card.Icon.TOWER, 4, \"Train Station\"));\n Landmarks.add(new Landmark(Card.Color.NONE, Card.Icon.TOWER, 10, \"Shopping Mall\"));\n Landmarks.add(new Landmark(Card.Color.NONE, Card.Icon.TOWER, 16, \"Amusement Park\"));\n }\n if (phase.equals(\"phase5\") || phase.equals(\"phase6\")) {\n Establishments.add(new Establishment(Card.Color.BLUE, Card.Icon.WHEAT, 1, \"Wheat Field\", \"[1]\", 1, 1));\n Establishments.add(new Establishment(Card.Color.GREEN, Card.Icon.BREAD, 1, \"Bakery\", \"[2-3]\", 1, 1));\n Landmarks.add(new Landmark(Card.Color.NONE, Card.Icon.TOWER, 4, \"Train Station\"));\n Landmarks.add(new Landmark(Card.Color.NONE, Card.Icon.TOWER, 10, \"Shopping Mall\"));\n Landmarks.add(new Landmark(Card.Color.NONE, Card.Icon.TOWER, 16, \"Amusement Park\"));\n Landmarks.add(new Landmark(Card.Color.NONE, Card.Icon.TOWER, 22, \"Radio Tower\"));\n }\n }",
"public Player()\n\t{\n\t\tsetUserName(\"\");\n\t\tsetFamilyName(\"\");\n\t\tsetGivenName(\"\");\n\t\tsetGamesPlayed(0);\n\t\tsetGamesWon(0);\n\t\tsetGamesDrawn(0);\n\t}",
"public PlayerPiece()\n {\n // initialise instance variables\n //Use the values listed in the comments\n //above that are next to each instance variable\n pieceName = \"no name\";\n pieceType = \"human\";\n currentHealth = 100;\n maxHealth = 100;\n locX = 7;\n locY = 8;\n attackPower = 25;\n defensePower = 20;\n currentSpecialPower = 50;\n maxSpecialPower = 50;\n \n }",
"public Player()\r\n\t{\r\n\t\tscore = 0;\r\n\t\tsetPlayerName();\r\n\t}",
"public GameTurn(PlayerID player){\n\t\tPreconditions.checkNotNull(player);\n\t\tthis.player = player;\n\t}",
"public Player(double money)\n {\n spendingMoney = money;\n }",
"public SetPlayerTurnAction() {}",
"Player() {\r\n setPlayerType(\"HUMAN\");\r\n\t}",
"Player(String name){\n this.name = name;\n funds = 500;\n shares = new ArrayList<>(5);\n votedStocks = new StringBuilder();\n votesLeft = 2;\n tradesLeft = 2;\n playerWorth = 0;\n botMode = false;\n addShares();\n }",
"public Player(String name)\n {\n // initialise instance variables\n this.name = name;\n // start out with $100 in your wallet\n wallet = new Wallet(100);\n inventory = new HashMap<String, Item>();\n currentRoom = null;\n olcc = new OLCC();\n\n }",
"public Game() {\n playerBlack = new Player(Player.BLACK);\n playerBlack.setIsTurn(true);\n playerWhite = new Player(Player.WHITE);\n playerWhite.setIsTurn(false);\n boardObject = new Board();\n\n // Set invalid parameters to start. This is used in move verification.\n potentialSuccessiveSlot = new Slot(Board.MAX_ROW, Board.MAX_COLUMN, 2);\n slotFrom = boardObject.getSlot(-1, -1);\n slotTo = boardObject.getSlot(-1, -1);\n\n // First click is always true in the starting game state.\n firstClick = true;\n\n successiveMove = false;\n turnColor = Slot.BLACK;\n\n rootValues = new ArrayList<>();\n plyCutoff = 0;\n minimaxMove = null;\n firstClickCompMove = true;\n alphaBetaEnable = false;\n }",
"public Player(String name)\n {\n this.name = name;\n cash = 0;\n }",
"public Player() {\n hand = new Hand();\n }",
"public Player() {}",
"public Player() {}",
"public Player() {}",
"public Player() {}",
"public Player(Playground_Registration pgr) {\n this.pgr = pgr;\n pgr.setPName(\"barca\");\n System.out.println(pgr.getPName());\n pgr.setLocation(\"naser city\");\n System.out.println(pgr.getLocation());\n pgr.setSize(5);\n System.out.println(pgr.getSize());\n pgr.setAvailable_Hour(3);\n System.out.println(pgr.getAvailable_Hour());\n pgr.setPrice_Of_hour(120);\n System.out.println(pgr.getPrice_Of_hour());\n pgr.setPlayground_Status(\"available\");\n System.out.println(pgr.getPlayground_Status());\n pgr.setCancelation_Perioud(\"\");\n System.out.println(pgr.getCancelation_Perioud());\n System.out.println(\"i want to book this play ground\");\n\n }",
"public Player2(State state){\n super(state);\n name=\"110\";\n }",
"Player(String name, Board myBoard, Board opponentsBoard) {\n this.name = name;\n this.myBoard = myBoard;\n this.opponentsBoard = opponentsBoard;\n }",
"public DefensivePlayers(){}",
"private Game(Player player1, Player player2){\n\t\tplayer1.setGame(this);\n\t\tplayer2.setGame(this);\n\n\t\t//todo: We should be satisfied we only having turnManager not also Player array\n\t\tplayers = new Player[]{player1, player2};\n\n\t\tturnManager.addPlayer(player2); // want player2 to start, so add it first.\n\t\t//todo: we should want player1 to start because that's more logical.\n\t\tturnManager.addPlayer(player1);\n\n\t\t//Create Dealer\n\t\tdealer = new Dealer();\n\n\t\t// First Card\n\t\tUnoCard firstCard = getNextCard();\n\t\tplayedCards().add(firstCard);\n\n\t\tdealer.spreadOut(players);\n\t\t\n\t\tisOver = false;\n\t\t// Start the turn.\n\t\tturnManager.startTurn();\n\t}",
"DefensivePlayers(String name, String college, String highschool, String position,\r\n\t\t\tString team, int experience, int number, int age, String height, int weight, int tackles,\r\n\t\t\tint sacks, int interceptions){\r\n\t\tsuper();//pulls the properties from the abstract Players class\r\n\t}",
"public SoccerPlayer(String name, String position, TeamDB team){\n\n// Random num = new Random();\n// int randInt1;\n// int randInt2;\n// int randInt3;\n// int randInt4;\n//\n// randInt1 = num.nextInt(10); //fix for height and weight.\n// randInt2 = num.nextInt(190);\n// randInt3 = num.nextInt(300);\n// randInt4 = num.nextInt(10);\n\n playerName = name;\n playerPosition = position;\n playerTeam = new TeamDB(\"\");\n// playerUniform = randInt1;\n// playerHeight = randInt2;\n// playerWeight = randInt3;\n// playerGoals = randInt4;\n }",
"public Player(String name)\n\t{\n\t\tthis.money = START_MONEY;\n\t\tthis.name = name;\n\t}",
"public Player(){}",
"public Player(){}",
"public Player() {\t\n\t}",
"public Player(int r, int c) { // contructor that makes the player object and declares the varaibles\r\n\t\t_row = r;\r\n\t\t_col = c;\r\n\t\t_isAlive = true;\r\n\t}",
"void initializePlayer();",
"private GameState(int numPlayers, int startingPlayer) {\n this.rng = new Random();\n\n this.numPlayers = numPlayers;\n this.currentTurn = startingPlayer < 0\n ? rng.nextInt(numPlayers)\n : startingPlayer % numPlayers;\n\n // Initialize the deck\n drawPile = new LinkedList<>();\n initializeDeck();\n Collections.shuffle(drawPile, rng);\n\n // Initialize player hands\n hands = new ArrayList<>(numPlayers);\n for (int i = 0; i < numPlayers; i++) {\n ArrayList<ICard> hand = new ArrayList<>(INITIAL_HAND_SIZE * 2);\n for (int j = 0; j < INITIAL_HAND_SIZE; j++) {\n hand.add(drawPile.pop());\n }\n\n hands.add(i, hand);\n }\n\n // Initialize discard pile\n discardPile = new LinkedList<>();\n discardPile.add(drawPile.pop());\n }",
"public Player(){\r\n\r\n }",
"public Player(){\n\n }",
"public SinglePlayerGameController() {\n player1 = new Player(\"Player 1\");\n computer = new Player(\"Computer\");\n game = new Game(new Dice(), player1, computer);\n player1.setColor(\"blue\");\n computer.setColor(\"red\");\n diceImage = new DiceImage();\n }",
"public Player getPlayerInTurn();",
"public Player1() {\n dbg = new DBG(DBG.PLAYERS, \"Player1\");\n }",
"public Player(String username)\n\t{\n\t\tm_username = username;\n\t\tm_requests = new HashMap<String, RequestType>();\n\t}",
"public Player(int i){\r\n playerID=i;\r\n }",
"public Player(){\n default_init();\n }",
"public Player(String name) {\r\n this.name = name;\r\n// Maxnum = 0;\r\n special = 0;\r\n index = 0;\r\n }",
"Player(Board board, Collection<Move> legalMoves, Collection<Move> opponentMoves){\n this.board = board;\n this.playerChief = establishChief();\n this.legalMoves = legalMoves;\n }",
"private MyGameState(int[][] board, int turn) {\n this.board = board;\n this.turn = turn;\n }",
"public void createTurn() {\n Turn turn = new Turn(this.getOnlinePlayers());\n this.setCurrentTurn(turn);\n }",
"private GameVariableRepository() {\r\n\t\tthis.playerTurn = 0;\r\n\t}",
"public Game() \n {\n parser = new Parser();\n name = new String();\n player = new Player();\n ai = new AI();\n createRooms();\n rand = -1;\n enemyPresent = false;\n wantToQuit = false;\n alive = true;\n createItems();\n createWeapons();\n createEnemy();\n setEnemy();\n setItems();\n setWeapons();\n setExits();\n }",
"public PlayerInfo(int playerID, boolean AI) {\r\n\t\tthis.playerID = playerID;\r\n\t\tthis.AI = AI;\r\n\t\tthis.robots = new ArrayList<Robot>(3);\r\n\t\t\r\n\t\t/* 0 = scout , 1 = sniper, 2 = tank */\r\n\t\tthis.robots.add(new Robot(playerID, 0));\r\n\t\tthis.robots.add(new Robot(playerID, 1));\r\n\t\tthis.robots.add(new Robot(playerID, 2));\r\n\t\t\r\n\t\tthis.curRobotType = 0;\r\n\t}",
"public Game(){\n player = new Player(createRooms());\n parser = new Parser(); \n }",
"public Player(String name) {\n this.name = name;\n gameDeck = new Deck(false);\n wonDeck = new Deck(false);\n }",
"public BSState() {\n this.playerTurn=1;\n this.p1TotalHits=0;\n this.p2TotalHits=0;\n this.shipsAlive=10;\n this.shipsSunk=0;\n this.isHit=false;\n this.phaseOfGame=\"SetUp\";\n this.shotLocations=null;\n this.shipLocations=null;\n this.shipType=1;\n this.board=new String[10][20];\n //this.player1=new HumanPlayer;\n //this.player2=new ComputerPlayer;\n\n }",
"public Player() {\n fleetMap = new Map();\n battleMap = new Map();\n sunkShipNum = 0;\n }",
"public Game()//Method was given\n {\n parser = new Parser();\n player = new Player();\n }",
"Player(String name, int health)\r\n {\r\n this.name = name;\r\n this.health = health;\r\n }",
"public Player() {\r\n\t\tthis.gemPile = new int[4];\r\n\t\tthis.hand = new ArrayList<Card>();\r\n\t\tthis.bag = new ArrayList<Card>();\r\n\t\tthis.discard = new ArrayList<Card>();\r\n\t\tthis.lockedCards = new ArrayList<Card>();\r\n\t\tthis.toUse = new ArrayList<Integer>();\r\n\t\tnewTurn();\r\n\t}",
"public Skill(Player player){\n this.player = player;\n this.name = player.name;\n this.intellect = player.intellect;\n this.defense = player.defense;\n this.attack = player.attack;\n this.weapon = player.weapon;\n this.armor = player.armor;\n this.defense = player.defense;\n\n }",
"private GameInformation() {\n }",
"private void initPlayers() {\n this.playerOne = new Player(1, 5, 6);\n this.playerTwo = new Player(2, 0, 1);\n this.currentPlayer = playerOne;\n\n }",
"public interface Player {\n\n\n /**\n * Represents the attack result of random strategy.\n *\n * @return an attack result\n */\n AttackResult randomAttack();\n\n /**\n * Represents the attack result of user strategy.\n *\n * @return an attack result\n */\n AttackResult userAttack();\n\n /**\n * Represents the attack result of smart strategy.\n *\n * @return an attack result\n */\n AttackResult smartAttack();\n\n /**\n * Tells if one of the players has win the game.\n *\n * @return true if wins the game and false otherwise\n */\n boolean winGame();\n\n /**\n * Prints the fleet map.\n *\n * @param printer the printer to print the map\n */\n void printFleet(ConsolePrinter printer);\n\n /**\n * Prints the battle map.\n *\n * @param printer the printer to print the map\n */\n void printBattle(ConsolePrinter printer);\n\n /**\n * Creates a user player.\n *\n * @param randPlace true if place the ship randomly and false to place the ship by the player\n * @param fleetMap the fleet map of the player\n * @param battleMap the battle map of the player\n * @return a new user player\n */\n static Player createUserPlayer(boolean randPlace, FleetMap fleetMap, BattleMap battleMap) {\n return new AbstractPlayer(fleetMap, battleMap, randPlace);\n }\n\n /**\n * Creates a robot player.\n *\n * @param fleetMap the fleet map of the player\n * @param battleMap the battle map of the player\n * @return a new robot player\n */\n static Player createRobotPlayer(FleetMap fleetMap, BattleMap battleMap) {\n return new AbstractPlayer(fleetMap, battleMap, true);\n }\n}",
"public Player(){\n this.health = 9;\n this.orientation = Orientation.FACING_NORTH;\n evaluateSprite();\n }",
"public Command(int Player) {\r\n\t\tmyPlayer = Player;\r\n\t}",
"Player(String name){\n\t\tthis.name = name;\n\t}",
"public GameManager(){\r\n init = new Initialisation();\r\n tower=init.getTower();\r\n courtyard=init.getCourtyard();\r\n kitchen=init.getKitchen();\r\n banquetHall=init.getBanquetHall();\r\n stock=init.getStock();\r\n throneHall=init.getThroneHall();\r\n vestibule=init.getVestibule();\r\n stables=init.getStables();\r\n\r\n this.player = new Player(tower);\r\n\r\n push(new IntroductionState());\r\n\t}",
"public GameOptions(int numPlayers) {\n\t\tthis(numPlayers, 10, 22, Mode.LEVEL, AiDiff.HUMAN, 0, 0, 0);\n\t}",
"public Player() {\n\t\t\n\t\tif (Main.role == 0) this.role = Role.Attacker;\n\t\tif (Main.role == 1) this.role = Role.Defender;\n\t\t\n\t\tnavigator = Main.nav;\n\t\t\n\t\tballGrabber = new BallGrab();\n\t\t\n\t\tballPlatform[0] = Main.upperRightX + 35; //120\n\t\tballPlatform[1] = Main.upperRightY - 8; //165\n\t\t\n\t\tstartingCorner = Main.startingCorner;\n\t\t\n\t\t\n\t}",
"public Player(String name, Piece figure) {\n\t\tthis.name = name;\n\t\tthis.piece = figure;\n\t\t\n\t\tisBot = false;\n\n\t\tisReverse = false; // initial direction\n\t\tmoney = startingMoney; // initial money\n\n\t\tpropertyList = new ArrayList<>();\n\t\tcardList = new ArrayList<>();\n\t\troll3Cards = new ArrayList<>();\n\t\tisInJail = false;\n\t\tresetTurnInJail();\n\t}",
"private void initVars(){\n this.dice = new Dice();\n this.playing = true;\n this.currentPlayer = 0;\n this.turn = 0;\n this.xPlayers=new ArrayList<>(); \n this.players = new Player[4];\n this.diceRoller=true;\n this.xTokens=new ArrayList<>();\n this.winners=new ArrayList<>();\n this.computerPlayer= new Autoplay();\n this.gameResults = \"\";\n this.debug = false;\n }",
"public Pawn(String player){\r\n this.player=player;\r\n\r\n }",
"public void createChallenger() {\n\n Random random = new Random();\n if(currentTurn.getActivePlayers().size() != 1) {\n currentTurn.setCurrentPlayer(currentTurn.getActivePlayers().get(random.nextInt(currentTurn.getActivePlayers().size() - 1)));\n } else {\n currentTurn.setCurrentPlayer(currentTurn.getActivePlayers().get(0));\n }\n int i = onlinePlayers.indexOf(currentTurn.getCurrentPlayer());\n stateList.set(i, new Initialized(getCurrentTurn().getCurrentPlayer(), this));\n\n }",
"public Player2(){\n super();\n name=\"110\";\n }",
"public PlayerFighter create(GamePlayer player);"
]
| [
"0.6688044",
"0.66577214",
"0.6447663",
"0.6427625",
"0.6406992",
"0.6401066",
"0.63639885",
"0.6315547",
"0.6286774",
"0.6276742",
"0.6195263",
"0.61935365",
"0.6186296",
"0.6174083",
"0.6171001",
"0.616212",
"0.6161546",
"0.6134053",
"0.6105499",
"0.6092324",
"0.608664",
"0.60631686",
"0.6053868",
"0.6046784",
"0.6021098",
"0.60144943",
"0.59858334",
"0.5973208",
"0.5968387",
"0.59465206",
"0.59418684",
"0.59395844",
"0.5936068",
"0.59322876",
"0.59317106",
"0.59245336",
"0.59223014",
"0.5920779",
"0.5920458",
"0.5910757",
"0.5910248",
"0.5900421",
"0.58966005",
"0.5896398",
"0.58926284",
"0.58926284",
"0.58926284",
"0.58926284",
"0.58916986",
"0.5888738",
"0.58885235",
"0.5886427",
"0.5882455",
"0.5869815",
"0.5869025",
"0.58666307",
"0.58594364",
"0.58594364",
"0.5853972",
"0.58526117",
"0.58501834",
"0.58488494",
"0.58450556",
"0.58445066",
"0.58337075",
"0.5828044",
"0.5825403",
"0.582098",
"0.5817898",
"0.58167547",
"0.5809558",
"0.5805201",
"0.5790643",
"0.57882184",
"0.578587",
"0.5777187",
"0.5772614",
"0.57680255",
"0.57602584",
"0.5758063",
"0.5756494",
"0.57465225",
"0.5745653",
"0.57444066",
"0.5743351",
"0.57290274",
"0.57195836",
"0.57184756",
"0.5714791",
"0.571284",
"0.57121533",
"0.5709945",
"0.5709642",
"0.57066435",
"0.57042605",
"0.5703674",
"0.5703503",
"0.5699002",
"0.5687134",
"0.5677929"
]
| 0.57677275 | 78 |
Following funtion returns plaeyerController and it finds the playerController from playerControllerList. if not found the player having playerId equal to playerId then it returns null | public PlayerController findPlayerById(int playerId)
{
// By iterating through all the players it will return player object with the matching id provided
// in case of not matching id it will return null
for(PlayerController player : this.playerControllerList)
{
if(player.getPlayerId() == playerId)
{
return player;
}
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private PlayerController playerControllerFor(int player)\n {\n switch (player) {\n case PLAYER_1_FLAG:\n return player1;\n case PLAYER_2_FLAG:\n return player2;\n default:\n return null;\n }\n }",
"public Player getPlayer(int id)\n\t{\n\t\tif (playerList != null)\n\t\t{\n\t\t\tfor(Player player : playerList)\n\t\t\t{\n\t\t\t\tif (player.getId() == id)\n\t\t\t\t{\n\t\t\t\t\treturn player;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public Player findPlayer(String p_PlayerName) {\n for (Player l_Player : d_PlayerList) {\n if (l_Player.getD_Name().equals(p_PlayerName))\n return l_Player;\n }\n if (d_NeutralPlayer.getD_Name().equals(p_PlayerName))\n return d_NeutralPlayer;\n return null;\n }",
"private Optional<Player> findPlayer(String playerName, StrategyType strategyType) {\n for (Player player : players) {\n if (player.getName().equals(playerName) && (player.getStrategyType() == strategyType)) {\n return Optional.of(player);\n }\n }\n return Optional.empty();\n }",
"public Player getPlayer(UUID id) {\r\n for (Player player : players) {\r\n if (player.getId().equals(id)) {\r\n return player;\r\n }\r\n }\r\n return null;\r\n }",
"public Player getPlayerFromList(String name){\n for (Player player : players){\n if (player.getName().equals(name)){\n return player;\n }\n }\n return null; //This will never happen. Will always be found. Only called from the takeoverTerritory method\n }",
"Player getPlayer(int playerNumber){\n return players.get(playerNumber);\n }",
"public PlayerProfile getPlayer(P player){\n\n if(playerMap.containsKey(player)){\n //Player is safe to send\n return playerMap.get(player);\n } else {\n //Player isn't safe to send\n System.out.println(\"Tried to grab player \" + player.getName() + \"'s data, but it's not available\");\n return null;\n }\n }",
"public PlayerParticipant getPlayer(int playerId) {\n try {\n String query = \"SELECT * from playerparticpant WHERE Id = \" + playerId;\n ResultSet resultSet = dbhelper.ExecuteSqlQuery(query);\n if (resultSet.next()) {\n PlayerParticipant playerParticipant = new PlayerParticipant();\n playerParticipant.matchHistoryUri = resultSet.getString(\"MatchHistoryUri\");\n playerParticipant.profileIcon = resultSet.getInt(\"ProfileIconId\");\n playerParticipant.summonerId = resultSet.getLong(\"SummonerId\");\n playerParticipant.summonerName = resultSet.getString(\"SummonerName\");\n \n return playerParticipant;\n }\n } catch (SQLException | IllegalStateException ex) {\n System.out.println(\"An error occurred: \" + ex.getMessage());\n }\n \n return null;\n }",
"Player getPlayer(UUID playerId);",
"public BasketballPlayer getPlayer(String player){\n\t\tfor(int i=0; i<5; i++){\n\t\t\tif(player.equals(_homeTeam.getPlayer(i).getpname())){\n\t\t\t\treturn _homeTeam.getPlayer(i);\n\t\t\t}\n\t\t}\n\t\tfor(int i=0; i<5; i++){\n\t\t\tif(player.equals(_awayTeam.getPlayer(i).getpname())){\n\t\t\t\treturn _awayTeam.getPlayer(i);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public Player getPlayer(String playerId) {\n\t\topen();\n\t\tPlayer retVal = null;\n\t\tCursor cursor = db.query(PlayerTable.DB_TABLE_PLAYER, null, PlayerTable.KEY_ID + \"='\" + playerId + \"';\",\n\t\t\t\tnull, null, null, null);\n\t\tif(cursor.getCount()>0){\n\t\t\tLog.i(TAG, \"Found player in database with id [\" + playerId +\"]\");\n\t\t\tcursor.moveToFirst();\n\t\t\tint idIndex = cursor.getColumnIndex(PlayerTable.KEY_ID);\n\t\t\tString playerDBId = cursor.getString(idIndex);\n\t\t\tint nameIndex = cursor.getColumnIndex(PlayerTable.KEY_NAME);\n\t\t\tString playerDBName = cursor.getString(nameIndex);\n\t\t\tint descriptionIndex = cursor.getColumnIndex(PlayerTable.KEY_DESCRIPTION);\n\t\t\tString playerDBDescription = cursor.getString(descriptionIndex);\n\t\t\tint eloIndex = cursor.getColumnIndex(PlayerTable.KEY_ELO);\n\t\t\tDouble playerDBElo = cursor.getDouble(eloIndex);\n\t\t\tint matchesIndex = cursor.getColumnIndex(PlayerTable.KEY_NROFMATCHES);\n\t\t\tint matchesPlayed = cursor.getInt(matchesIndex);\n\t\t\tint createdIndex = cursor.getColumnIndex(PlayerTable.KEY_CREATED);\n\t\t\tString playerCreated = cursor.getString(createdIndex);\n\t\t\tDate created = null;\n\t\t\tif(playerCreated!=null){\n\t\t\t\ttry {\n\t\t\t\t\tcreated = sdf.parse(playerCreated);\n\t\t\t\t} catch (ParseException e) {\n\t\t\t\t\tLog.w(TAG, \"Error parsing date from DB : \", e);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//create a Player-object that has all the properties fetched from DB\n\t\t\tretVal = new Player(playerDBName, playerDBDescription);\n\t\t\tretVal.setId(playerDBId);\n\t\t\tretVal.setCurrentElo(playerDBElo);\n\t\t\tretVal.setNrOfMatches(matchesPlayed);\n\t\t\tretVal.setCreated(created);\n\t\t\tLog.d(TAG, \"Objectified player : \" + retVal.getId());\n\t\t}\n\t\tclose();\n\t\tif(cursor!=null)\n\t\t\tcursor.close();\n\t\treturn retVal;\n\t}",
"public GamePlayer getPlayerByPlayerID(String playerID) {\n\t\tfor (GamePlayer player : listOfPlayers) {\n\t\t\tif (player != null && player.playerID.contains(playerID)) {\n\t\t\t\treturn player;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// no player with playerID found\n\t\treturn null;\n\t}",
"public Player getPlayerFromList(String name){\n for (BrPlayer p : playerList){\n if (p.getBukkitPlayer().getDisplayName().equalsIgnoreCase(name)){\n return p.getBukkitPlayer();\n }\n }\n return null;\n }",
"public Optional<Player> getPlayer(String playerName) {\n List<Player> filterResult = gamePlayers.stream().filter(x -> x.getName().equals(playerName)).collect(Collectors.toList());\n return filterResult.size() == 1 ? of(filterResult.get(0)) : Optional.empty();\n }",
"public Player getPlayer(String username) {\n for (Player p : players) {\n if (p.username.equals(username))\n return p;\n }\n return null;\n }",
"public Player getPlayerByName(String name){\n for (Player player : players){\n if (name.equals(player.getName())){\n return player;\n }\n }\n return null;\n }",
"public PlayerController calculateWinner()\n {\n // This function will find the winner based on the move that is made by player\n // Here we are checking only the two players who are leading the match\n PlayerController player1 = this.playerControllerList.poll();\n PlayerController player2 = this.playerControllerList.poll();\n this.playerControllerList.add(player1);\n this.playerControllerList.add(player2);\n if(player1.getPoints() >= player2.getPoints()+GameConfiguration.MINIMUM_DIFF_POINTS && player1.getPoints() >= GameConfiguration.MINIMUM_POINTS_REQUIRED)\n {\n return player1;\n }\n else if(this.gameController.isBoardEmpty() == true)\n {\n if(player1.getPoints() >= player2.getPoints()+GameConfiguration.MINIMUM_DIFF_POINTS || player1.getPoints() >= GameConfiguration.MINIMUM_POINTS_REQUIRED)\n {\n return player1;\n }\n }\n return null;\n }",
"private WarPlayer tryGetPlayerWithLessThanThreeCards() {\n for (WarPlayer player : players) {\n if (player.getHand().size() < 3)\n return player;\n }\n return null;\n\n }",
"public Player lookForWinner(){\n\t\tfor(int i = 0; i < this.players.size(); i++){\n\t\t\tif(this.players.get(i).numCards() == 0)\n\t\t\t\treturn this.players.get(i);\n\t\t}\n\t\t\n\t\treturn null;\n\t}",
"public static Player getPlayer(Player player){\n Player returnPlayer = null;\n if (player != null) {\n try {\n returnPlayer = mapper.readValue(new File(\"Data\\\\PlayerData\\\\\" + getFileName(player) + \".json\"), Player.class);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n return returnPlayer;\n }",
"@RequestMapping(\"/players/{playerName}\")\n public Player getPlayer(@PathVariable String playerName) {\n return playerService.getPlayer(playerName);\n\n }",
"private void getPlayerList(){\r\n\r\n PlayerDAO playerDAO = new PlayerDAO(Statistics.this);\r\n players = playerDAO.readListofPlayerNameswDefaultFirst();\r\n\r\n }",
"@Override\r\n\tpublic ArrayList<PlayerPO> findPlayerByName(String name) {\n\t\treturn playerController.findPlayerByName(name);\r\n\t}",
"public static Player findPlayer(String str) {\n\t\tList<Player> plist = getTrackablePlayers();\n\t\tfor (int i = 0; i < plist.size(); i++) {\n\t\t\tif (((Player) plist.get(i)).getName().equals(str)) {\n\t\t\t\treturn (Player) plist.get(i);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public Player getCurrentPlayer(){\n String playerId = getUser().get_playerId();\n\n Player player = null;\n\n try {\n player = getCurrentGame().getPlayer(playerId);\n } catch(InvalidGameException e) {\n e.printStackTrace();\n System.out.println(\"This is the real Error\");\n }\n\n return player;\n }",
"public Player getPlayer();",
"public Player getPlayer();",
"@SuppressWarnings(\"unused\")\n public static IHubParkourPlayer getPlayer(Player player) throws NullPointerException {\n if (player == null) {\n throw new NullPointerException(\"Player cannot be null\");\n }\n return CacheManager.getPlayer(player);\n }",
"private TennisPlayerContainerNode getPlayerNodeRec(TennisPlayerContainerNode currRoot, String playerId) {\n\t\t\t\n\t\t\t if (currRoot == null) { \n\t\t\t\t \n\t\t\t\t return null; \n\t\t\t\t \n\t\t\t\t } else {// 3-way comparison to understand how to proceed the search\n\t\t \n\t\t\t\t\t// Get player from current root and compare their ID's\n\t\t int comparisonResult = currRoot.getPlayer().getId().compareTo(playerId);\n\t\t \n\t\t if (comparisonResult == 0) {//if they are the same\n\t\t \t\n\t\t return currRoot;\n\t\t \n\t\t } else if (comparisonResult < 0) {\n\t\t \t\n\t\t return getPlayerNodeRec(currRoot.getRight(), playerId);\n\t\t \n\t\t } else {\n\t\t \t\n\t\t return getPlayerNodeRec(currRoot.getLeft(), playerId);\n\t\t }\n\t\t }\n\t\t\t\n\t\t}",
"public Player isMatchWon(final String matchId) throws MatchNotFoundException {\r\n LOGGER.debug(\"--> isMatchWon: matchId=\" + matchId);\r\n Match match = getMatchById(matchId);\r\n Player player1 = match.getPlayer1();\r\n Player player2 = match.getPlayer2();\r\n int sunkBoatsP1 = countOfStatus(player1, FIELD_SUNK);\r\n int sunkBoatsP2 = countOfStatus(player2, FIELD_SUNK);\r\n if(sunkBoatsP1 == 30){\r\n return player2;\r\n }else if(sunkBoatsP2 == 30){\r\n return player1;\r\n } else {\r\n return null;\r\n }\r\n}",
"Player getPlayer();",
"public Player getPlayer(String userName,ArrayList<Player> list) {\r\n\t\tIterator<Player> aa = list.iterator();\r\n\t\twhile (aa.hasNext()) {\r\n\t\t\tPlayer in = aa.next();\r\n\t\t\tif(in.getUserName().equals(userName)){\r\n\t\t\t\tif(in.getID().equals(\"AI\"))\r\n\t\t\t\t\treturn (NimAIPlayer)in;\r\n\t\t\t\telse\r\n\t\t\t\t\treturn (NimPlayer)in;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\treturn null;\r\n\t\t}",
"protected Entity findPlayerToAttack()\n {\n EntityPlayer var1 = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D);\n return var1 != null && this.canEntityBeSeen(var1) ? var1 : null;\n }",
"public Player getPlayer()\r\n {\r\n return player;\r\n }",
"public Player getPlayer(long usernameHash) {\n\t\tfor (Player p : players) {\n\t\t\tif (p.getUsernameHash() == usernameHash) {\n\t\t\t\treturn p;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public Player getPlayer() { return player;}",
"@Override\n public Player getPlayerById(long id) {\n Player player=entityManager.find(Player.class,id);\n return player;\n }",
"private EntityLivingBase findPlayerToAttack() {\n EntityPlayer player = entity.worldObj.getClosestVulnerablePlayerToEntity(entity, aggroRange);\n if ( player != null && !player.capabilities.isCreativeMode && entity.canEntityBeSeen(player) )\n \treturn player;\n\n EntityLivingBase target = entity.getLastAttacker();\n if ( isTargetValid(target) && entity.canEntityBeSeen(target) )\n \treturn target;\n\n \treturn null;\n }",
"public Match getMatchById(String matchId) throws MatchNotFoundException {\r\n LOGGER.debug(\"--> getMatchById\");\r\n Match match = null;\r\n Optional<Match> optionalMatch = matchRepository.findById(matchId);\r\n if(optionalMatch.isPresent()){\r\n match = optionalMatch.get();\r\n \r\n \r\n }else{\r\n throw new MatchNotFoundException(\"Match nicht gefunden\");\r\n }\r\n \r\n if(match.getPlayer1()!=null&& match.getPlayer2()!=null){\r\n match.setCurrentPlayer(2);\r\n }else if((match.getPlayer1()==null||match.getPlayer2()==null)&&(match.getPlayer1()!=null ||match.getPlayer2()==null)){\r\n match.setCurrentPlayer(1);\r\n }\r\n \r\n \r\n return match;\r\n }",
"public List<PlayerItem> getSpecific(int playerItemId);",
"Optional<Player> getHoldingPlayer();",
"public Player getPlayerinTable(String name) {\r\n for (Player player : this.players) {\r\n if (player.getName().equals(name)) {\r\n return player;\r\n }\r\n }\r\n return null;\r\n }",
"public TennisPlayer getPlayer(String playerId) throws TennisDatabaseRuntimeException {\n\t\t\n\t\tTennisPlayerContainerNode playerNode = getPlayerNodeRec(this.root, playerId);\n\t\t\n if (playerNode == null) { \n \t\n \tthrow new TennisDatabaseRuntimeException(\"Player's ID could not be found\"); \n \n } else {\n \t\n return playerNode.getPlayer();\n }\n \n\t}",
"public Player getPlayer(){\r\n return player;\r\n }",
"public Player getPlayer(int idx) {\n\t\ttry {\n\t\t\tPlayer p = players.get(idx);\n\t\t\treturn p;\n\t\t} catch(Exception e) {\n\t\t\treturn null;\n\t\t}\n\t\n\t}",
"private void findFirstPlayer() { \n if(isFirstTurn) {\n for(PlayerId p: PlayerId.ALL) {\n if(handsOfCards.get(p).contains(Card.of(Color.DIAMOND, Rank.SEVEN))) {\n firstPlayer = p;\n }\n }\n }\n else {\n firstPlayer = PlayerId.ALL.get((firstPlayer.ordinal()+1)%PlayerId.COUNT);\n }\n }",
"public Player getPlayer() {\r\n return player;\r\n }",
"public User getPlayer(String name) {\n\t\tUser ret = null;\n\t\tList<User> searchResult = this.players.stream().filter(x->x.name.equals(name)).collect(Collectors.toList());\n\t\tif (!searchResult.isEmpty()) {\n\t\t\tret = searchResult.get(0);\n\t\t}\n\t\treturn ret;\n\t}",
"public Player getPlayer() { return player; }",
"public Player getPlayer() {\n return p;\n }",
"public ArrayList<GameContinent> checkContinentsOwnedByOnePlayer(int playerID) {\n try {\n ArrayList<GameContinent> continentsOwnedByPlayer = new ArrayList<>(gameMap.getContinentHashMap().values());\n for(String continentName : gameMap.getContinentHashMap().keySet()) {\n for (GameCountry country: gameMap.getContinentHashMap().get(continentName).getCountries().values() ) {\n if (country.getCurrentPlayer().getId()!=playerID) {\n continentsOwnedByPlayer.remove(gameMap.getContinentHashMap().get(continentName));\n break;\n }\n }\n }\n return continentsOwnedByPlayer;\n } catch (Exception e) {\n return null;\n }\n\n }",
"public Player getPlayer() {\n return player;\n }",
"public Player getPlayer() {\n return player;\n }",
"public Player getPlayer() {\n return player;\n }",
"public Player getPlayer() {\n return player;\n }",
"public Player getPlayer() {\n return player;\n }",
"public Player getPlayer() {\n return player;\n }",
"public List<PlayerItem> getAllPlayerItemById(Player player);",
"static List<Player> getAllPlayers() {\n\t\treturn null;\r\n\t}",
"public Player getController() {\n return sourceCard.getController();\n }",
"public static EntityPlayer getPlayer(String name) {\r\n\t\tfor (EntityPlayer player : getAll()) {\r\n\t\t\tif (player.getName().equals(name)) {\r\n\t\t\t\treturn player;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn null;\r\n\t}",
"public static Player matchPlayer(String player) {\n\t\tList<Player> players = Bukkit.matchPlayer(player);\n\n\t\tif (players.size() == 1) {\n\t\t\treturn (Player) players.get(0);\n\t\t}\n\t\treturn null;\n\t}",
"public int getPlayerId();",
"public Player getPlayer() {\n return player;\n }",
"public Player getPlayerById(int id) {\n\t\tPlayer p = null;\n\t\tPreparedStatement statement = null;\n\t\tResultSet rs = null;\n\t\tString playerByIdRecords_sql = \"SELECT * FROM \" + player_table + \" WHERE id='\" + id + \"'\";\n\t\tconnection = connector.getConnection();\n\t\ttry {\n\t\t\tstatement = connection.prepareStatement(playerByIdRecords_sql);\n\t\t\trs = statement.executeQuery();\n\t\t\tif (rs.next()) {\n\t\t\t\tp = new Player(rs.getString(3), rs.getString(4), rs.getDate(5), rs.getInt(6));\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t\treturn p;\n\t}",
"public Player getLeadingPlayer() {\n\t\tif (this.getStones() > this.getOpponentKalaha().getStones()) {\n\t\t\treturn this.Owner;\n\t\t} else if (this.getStones() < this.getOpponentKalaha().getStones()) {\n\t\t\treturn this.Owner.getOpponent();\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}",
"public Player getPlayer(int index) {\r\n return players[index];\r\n }",
"@RequestMapping(value = \"/associations/{associationId}/players\", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)\n\t@Timed\n\tpublic ResponseEntity<List<Player>> getPlayers(@PathVariable Long associationId,Player player,Pageable pageable) throws URISyntaxException {\n\t\tlog.debug(\"REST request to get Association Players: {}\", associationId);\n\t\tPlayer example = new Player();\n\t\tAssociation exampleAssociation = new Association();\n\t\texampleAssociation.setId(associationId);\n\t\tTeam exampleTeam = new Team();\n\t\tClub exampleClub = new Club();\n\t\texampleClub.setAssociation(exampleAssociation);\n\t\texampleTeam.setClub(exampleClub);\n\t\texample.setTeam(exampleTeam);\n\t\texampleClub.setAssociation(exampleAssociation);\n example.setTeam(exampleTeam);\n Page<Player> page = playerRepository.findAll(Example.of(example),pageable);\n HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, \"/api/associations/\"+associationId+\"/players\");\n\t\treturn new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK);\n\t}",
"public PlayerController getNextPlayer()\n {\n // This will return a player who is going to make a move\n int turn = this.turn;\n int NUMBER_OF_PLAYERS = GameConfiguration.NUMBER_OF_PLAYERS;\n if(turn%NUMBER_OF_PLAYERS == 0) \n {\n turn = 0;\n }\n else\n {\n turn = turn%NUMBER_OF_PLAYERS;\n }\n PlayerController player = findPlayerById(turn);\n return player;\n }",
"BPlayer getPlayer(Player player);",
"SoccerPlayer find(Integer number);",
"public Product[] get(String player) throws NullPointerException {\n\t\tif (playerMap.containsKey(player)) {\n\t\t\treturn playerMap.get(player);\n\t\t} else {\n\t\t\tthrow new NullPointerException();\n\t\t}\n\t}",
"protected Player getPlayer() { return player; }",
"public Player getTeam(Player player) {\n if (teams.containsKey(player)) {\n return player;\n }\n for (Player p : teams.keySet()) {\n if (teams.get(p).contains(player)) {\n return p;\n }\n }\n return null;\n }",
"public PlayerItem getPlayerItemById(int playerItemId);",
"public Player getCurrent(){\n\t\tPlayer p;\n\t\ttry{\n\t\t\tp = this.players.get(this.currElem);\n\t\t\t\n\t\t} catch(IndexOutOfBoundsException e){\n\t\t\tSystem.out.println(\"There isn't any players.\");\n\t\t\tp = null;\n\t\t}\n\t\t\t\n\t\treturn p; \n\t}",
"Player getDormantPlayer();",
"public User getPlayer(Board.CHARACTER character) {\n\t\tUser ret = null;\n\t\tList<User> searchResult = this.players.stream().filter(x->x.character.equals(character)).collect(Collectors.toList());\n\t\tif (!searchResult.isEmpty()) {\n\t\t\tret = searchResult.get(0);\n\t\t}\n\t\treturn ret;\n\t}",
"public Player getPlayer(String username){\n return this.players.get(username);\n }",
"public MatchController()\n {\n // Here from Game_Constants interface constants such as number of players, black coins count\n // and red coins count are fetched.\n this.playerControllerList = new PriorityQueue<PlayerController>(new Comparator<PlayerController>(){\n @Override\n public int compare(PlayerController p1, PlayerController p2) \n {\n return (p1.getPoints() > p2.getPoints() ) ? -1: (p1.getPoints() < p2.getPoints()) ? 1:0 ;\n }\n });\n for(int i=0; i<GameConfiguration.NUMBER_OF_PLAYERS; i++)\n {\n this.playerControllerList.add(new PlayerController(i));\n }\n this.gameController = new GameController(GameConfiguration.BLACK_COINS_COUNT, GameConfiguration.RED_COINS_COUNT);\n this.turn = 0;\n }",
"public List<Player> getPlayerList(){\n return this.players;\n }",
"public Player getPlayer(){\n\t\treturn this.player;\n\t}",
"java.lang.String getPlayerId();",
"public PlayerID getPlayer(){\n\t\treturn this.player;\n\t}",
"public Player getByPlayerID(String playerID) {\n PlayerDB pdb = new PlayerDB(); \n return pdb.getByPlayerID(playerID);\n }",
"public AIPlayer getAIPlayer(Player player) {\n AIObject aio = getAIObject(player.getId());\n return (aio instanceof AIPlayer) ? (AIPlayer) aio : null;\n }",
"private void initializePlayerController (Player player) {\n if (player1 instanceof InteractivePlayer)\n new PlayerController(\n (InteractivePlayer)player,game,in);\n }",
"@Override\n protected Entity findPlayerToAttack() {\n EntityPlayer player = this.worldObj.getClosestVulnerablePlayerToEntity(this, 64.0);\n if (player != null) {\n if (this.shouldAttackPlayer(player)) {\n if (this.lookDelay++ == 5) {\n this.lookDelay = 0;\n return player;\n }\n }\n else {\n this.lookDelay = 0;\n }\n }\n return null;\n }",
"@Override\n\tpublic void onLookUp(PlatformPlayer player) {\n\t\t\n\t}",
"public Integer getIDByPlayer(Player player){\n // This is operating under the assumption that\n // a player is only in one game.\n\n synchronized (games) {\n for (Integer id: games.keySet()){\n CheckersGame game = games.get(id);\n if (game.hasPlayer(player) && !game.isGameOver()) {\n return id;\n }\n }\n return null;\n }\n }",
"@RequestMapping(\"/playernames/{playerName}\")\n public String getPlayerName(@PathVariable String playerName){\n return playerService.getPlayerName(playerName);\n }",
"@Override\n\tpublic Player getPlayer() {\n\t\treturn null;\n\t}",
"public String getPlayerWithGamePiece(GamePiece gamePiece)\n\t{\n\t\tSet<String> player = playerPieces.keySet();\n\t\tfor (String name : player)\n\t\t{\n\t\t\tif(playerPieces.get(name) == gamePiece) \n\t\t\t{\n\t\t\t\treturn name;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"Player getSelectedPlayer();",
"protected Player getOpponentPlayer(Match match) {\r\n LOGGER.debug(\"--> getOpponentPlayer: match=\" + match);\r\n Player opponentPlayer;\r\n\r\n if (match.getCurrentPlayer() == 2) {\r\n opponentPlayer = match.getPlayer1();\r\n } else if (match.getCurrentPlayer() == 1) {\r\n opponentPlayer = match.getPlayer2();\r\n } else {\r\n throw new GeneralException(\"match has no defined opponentPlayer!\");\r\n }\r\n\r\n LOGGER.debug(\"<-- getOpponentPlayer\");\r\n return opponentPlayer;\r\n }",
"public PlayerGame findByGameAndPlayer(Long gameId, Long playerId) {\n return playerGames.stream()\n .filter(p -> p.getGame().getId().equals(gameId) && p.getPlayer().getId().equals(playerId))\n .findFirst()\n .orElse(null);\n }",
"private Player playOneGame() {\n\t\tCountry.Counter = map.countries.size();\n\t\tPlayer winner = null;\n\t\tint turn = 0;\n\t\t\n\t\tstartUpPhase();\n\t\t\n\t\tdo\n\t\t{\n\t\t\tturn++;\n\t\t\tSystem.out.println(\"\\n - TURN \" + turn + \" -\");\n\n\t\t\tfor(Player p : map.players) \n\t\t\t{\n\t\t\t\tif(p.ownedCountries.size() > 0)\n\t\t\t\t{\n\t\t\t\t\treinforcementPhase(p);\n\t\t\t\t\tattackPhase(p);\n\t\t\t\t\t\n\t\t\t\t\tif(map.isOwned()) {\n\t\t\t\t\t\twinner = p;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tfortificationPhase(p);\n\t\t\t\t}\n\t\t\t}\n\t\t}while(!map.isOwned() && turn < maximumTurns); /* When map is owned, end of the game */\n\t\t\n\t\treturn winner;\n\t}",
"private Player checkIfEatsRedPlayer(Player player)\n {\n int x_cord = getMidPoint(player.x_cordinate);//player.x_cordinate;\n int y_cord = getMidPoint(player.y_cordinate);//player.y_cordinate;\n int redx1 = getMidPoint(getRed_player1().x_cordinate);\n int redx2 = getMidPoint(getRed_player2().x_cordinate);\n int redx3 = getMidPoint(getRed_player3().x_cordinate);\n int redx4 = getMidPoint(getRed_player4().x_cordinate);\n int redy1 = getMidPoint(getRed_player1().y_cordinate);\n int redy2 = getMidPoint(getRed_player2().y_cordinate);\n int redy3 = getMidPoint(getRed_player3().y_cordinate);\n int redy4 = getMidPoint(getRed_player4().y_cordinate);\n if (collisionDetection(x_cord, y_cord, redx1, redy1) == 1)\n {\n return getRed_player1();\n }\n else if (collisionDetection(x_cord, y_cord, redx2, redy2) == 1)\n {\n return getRed_player2();\n }\n else if (collisionDetection(x_cord, y_cord, redx3, redy3) == 1)\n {\n return getRed_player3();\n }\n else if (collisionDetection(x_cord, y_cord, redx4, redy4) == 1)\n {\n return getRed_player4();\n }\n else\n {\n return null;\n }\n }",
"Player getCurrentPlayer();"
]
| [
"0.71769977",
"0.6424693",
"0.6370243",
"0.6337173",
"0.63118315",
"0.62900704",
"0.628581",
"0.6259317",
"0.6208082",
"0.6184997",
"0.6174717",
"0.61728513",
"0.61625373",
"0.6158026",
"0.6137043",
"0.6134497",
"0.6108419",
"0.6055072",
"0.60311717",
"0.60076576",
"0.5996508",
"0.5971873",
"0.59646404",
"0.5927999",
"0.5890413",
"0.58827996",
"0.58775675",
"0.58775675",
"0.58775306",
"0.5858208",
"0.5832799",
"0.58290213",
"0.5820342",
"0.5817974",
"0.5796872",
"0.57954365",
"0.5780452",
"0.57720995",
"0.5771462",
"0.57581884",
"0.5755838",
"0.5744292",
"0.5738133",
"0.57362735",
"0.57219887",
"0.57173663",
"0.5709519",
"0.57079625",
"0.56890714",
"0.56614333",
"0.56416684",
"0.5640012",
"0.56380814",
"0.56380814",
"0.56380814",
"0.56380814",
"0.56380814",
"0.5636676",
"0.5630233",
"0.5628186",
"0.56240356",
"0.56204414",
"0.56150496",
"0.5609615",
"0.5585047",
"0.5579925",
"0.5578522",
"0.5573484",
"0.557332",
"0.55711734",
"0.5569242",
"0.5560204",
"0.55539256",
"0.55273587",
"0.55209315",
"0.5520608",
"0.55085605",
"0.55061215",
"0.55053216",
"0.5496677",
"0.54956514",
"0.5484368",
"0.54798174",
"0.5476655",
"0.54765904",
"0.5473263",
"0.5465871",
"0.5457616",
"0.54530656",
"0.54363716",
"0.5433541",
"0.54324085",
"0.54242456",
"0.5418853",
"0.54080176",
"0.5393332",
"0.53909135",
"0.5387199",
"0.5386387",
"0.53839284"
]
| 0.7726453 | 0 |
This function will return the playerController of the player who is going to make a move | public PlayerController getNextPlayer()
{
// This will return a player who is going to make a move
int turn = this.turn;
int NUMBER_OF_PLAYERS = GameConfiguration.NUMBER_OF_PLAYERS;
if(turn%NUMBER_OF_PLAYERS == 0)
{
turn = 0;
}
else
{
turn = turn%NUMBER_OF_PLAYERS;
}
PlayerController player = findPlayerById(turn);
return player;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Player getController() {\n return sourceCard.getController();\n }",
"private PlayerController playerControllerFor(int player)\n {\n switch (player) {\n case PLAYER_1_FLAG:\n return player1;\n case PLAYER_2_FLAG:\n return player2;\n default:\n return null;\n }\n }",
"public Player getPlayerToMove()\n {\n return playerToMove;\n }",
"public static GameController getGameController() {\n\t\treturn controller;\n\t}",
"@Override\n\tpublic GameController getController() {\n\t\treturn gameController;\n\t}",
"public PlayerController calculateWinner()\n {\n // This function will find the winner based on the move that is made by player\n // Here we are checking only the two players who are leading the match\n PlayerController player1 = this.playerControllerList.poll();\n PlayerController player2 = this.playerControllerList.poll();\n this.playerControllerList.add(player1);\n this.playerControllerList.add(player2);\n if(player1.getPoints() >= player2.getPoints()+GameConfiguration.MINIMUM_DIFF_POINTS && player1.getPoints() >= GameConfiguration.MINIMUM_POINTS_REQUIRED)\n {\n return player1;\n }\n else if(this.gameController.isBoardEmpty() == true)\n {\n if(player1.getPoints() >= player2.getPoints()+GameConfiguration.MINIMUM_DIFF_POINTS || player1.getPoints() >= GameConfiguration.MINIMUM_POINTS_REQUIRED)\n {\n return player1;\n }\n }\n return null;\n }",
"public Player getClientPlayer() {\n\t\treturn players.get(0);\n\t}",
"Player getCurrentPlayer();",
"Player getCurrentPlayer();",
"Player currentPlayer();",
"public Player getWinner(){\r\n if(!hasMovements(model.getPlayerA().getColor()))\r\n return model.getPlayerB();\r\n if(!hasMovements(model.getPlayerB().getColor()))\r\n return model.getPlayerA();\r\n // In case of draw\r\n return null;\r\n }",
"public int getComputerMove()\n {\n int move;\n\n // First see if there's a move O can make to win\n for (int i = 0; i < BOARD_SIZE; i++) {\n if (mBoard[i] != HUMAN_PLAYER && mBoard[i] != COMPUTER_PLAYER) {\n char curr = mBoard[i];\n mBoard[i] = COMPUTER_PLAYER;\n if (checkForWinner() == 3) {\n mBoard[i] = curr;\n return i;\n }\n else\n mBoard[i] = curr;\n }\n }\n\n // See if there's a move O can make to block X from winning\n for (int i = 0; i < BOARD_SIZE; i++) {\n if (mBoard[i] != HUMAN_PLAYER && mBoard[i] != COMPUTER_PLAYER) {\n char curr = mBoard[i]; // Save the current number\n mBoard[i] = HUMAN_PLAYER;\n if (checkForWinner() == 2) {\n //mBoard[i] = COMPUTER_PLAYER;\n mBoard[i] = curr;\n return i;\n }\n else\n mBoard[i] = curr;\n }\n }\n\n // Generate random move\n do\n {\n move = mRand.nextInt(BOARD_SIZE);\n } while (mBoard[move] == HUMAN_PLAYER || mBoard[move] == COMPUTER_PLAYER);\n\n return move;\n }",
"Player getPlayer();",
"public int getComMove() {\n\n int move;\n\n // Checks if a computer played a move in that spot\n for (int i = 0; i < getBoardSize(); i++) {\n if (playBoard[i] != REAL_PLAYER && playBoard[i] != COM_PLAYER) {\n char currPlace = playBoard[i];\n playBoard[i] = COM_PLAYER;\n\n if (winCheck() == 3) {\n setMove(COM_PLAYER, i);\n return i;\n }\n else {\n playBoard[i] = currPlace;\n }\n }\n }\n\n // Check to block human player from winning\n for (int i = 0; i < getBoardSize(); i++) {\n if (playBoard[i] != REAL_PLAYER && playBoard[i] != COM_PLAYER) {\n char currPlace = playBoard[i];\n playBoard[i] = REAL_PLAYER;\n\n if (winCheck() == 2) {\n setMove(COM_PLAYER, i);\n return i;\n }\n else {\n playBoard[i] = currPlace;\n }\n }\n }\n\n // If play spot is empty, then make move\n do {\n move = randMove.nextInt(getBoardSize());\n } while (playBoard[move] == REAL_PLAYER || playBoard[move] == COM_PLAYER);\n setMove(COM_PLAYER, move);\n\n return move;\n }",
"public Player getPlayer() {\r\n return world.getPlayer();\r\n }",
"public int getWhoseMove() {\n\t\treturn playerToMove;\n\t}",
"public Player getPlayer();",
"public Player getPlayer();",
"public Player getFromPlayer()\n {\n // RETURN the CardMessage's fromPlayer\n return this.fromPlayer;\n }",
"public static BaseStationController getController()\r\n {\r\n \treturn controller;\r\n }",
"public Player getToPlayer()\n {\n // RETURN the CardMessage's toPlayer\n return this.toPlayer;\n }",
"public Player getCurrentPlayer(){\n return this.currentPlayer;\n }",
"public Player getCurrentPlayer()\n\t{\n\t\treturn current;\n\t}",
"public static Player getCurrPlayer(){\n\t\treturn players.get(curr);\n\t}",
"public final AbstractControlComponent getController() {\n\t\treturn this.controller;\n\t}",
"public Player currentPlayer() {\n\t\treturn (currentPlayer);\n\t}",
"public Player getPlayerFromBoard(Move move) {\n return getPlayerFromBoard(move.x, move.y);\n }",
"public MediaController getController() {\n return mController;\n }",
"Player getSelectedPlayer();",
"public char getPlayer() {\n return player;\n }",
"public ChatController getBaseController()\n\t{\n\t\treturn botController;\n\t}",
"public MWPlayerDataController getPlayerDataController() {\n\t\treturn dataController;\n\t}",
"public char getCurrentPlayer() {\n\t\treturn currentPlayer;\n\t}",
"public Controller getController();",
"public int getCurrentPlayer() {\n\t\treturn player;\n\t}",
"public Player getCurrentPlayer() {\n return currentPlayer;\n }",
"public Player getCurrentPlayer() {\n return currentPlayer;\n }",
"public int getCurrentPlayer() {\n return player;\n }",
"public DuxComController getController() {\n return this.controller;\n }",
"public Player getPlayer()\r\n {\r\n return player;\r\n }",
"private void getPlayer(){\n /** We need to have the correct child index from the scene **/\n //Spatial spatialNode = animation_Scene.getChild(16);\n //spatialNode\n animCharacter = (Node) animation_Scene.getChild(16);\n //rootNode.attachChild(animCharacter);\n animCharacter.setLocalTranslation(0, 0, 0);\n \n \n /** Get the animation control **/\n control = animCharacter.getChild(0).getControl(AnimControl.class);\n \n /** Print the names of animations**/\n Collection<String> animationNames = control.getAnimationNames();\n Object[] nameArray = animationNames.toArray();\n for(int a = 0; a < animationNames.size(); a++){\n System.out.println(\"Animation \" + a + \": \" + nameArray[a]);\n }\n \n /** Get Animation Channel **/\n channel = control.createChannel();\n walk = control.getAnim(\"Walk\");\n run = control.getAnim(\"Run\");\n stand = control.getAnim(\"Action_Stand\");\n \n channel.setAnim(\"Action_Stand\");\n }",
"public Player getPlayer() {\r\n\t\treturn player;\r\n\t}",
"public Strider getPlayer() {\n return player;\n }",
"public Player getLeadingPlayer() {\n\t\tif (this.getStones() > this.getOpponentKalaha().getStones()) {\n\t\t\treturn this.Owner;\n\t\t} else if (this.getStones() < this.getOpponentKalaha().getStones()) {\n\t\t\treturn this.Owner.getOpponent();\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}",
"protected Player getPlayer() {\n return getGame().getPlayers().get(0);\n }",
"public Player getOtherPlayer() {\n if (getCurrentPlayer().getNumber() == 1) {\n return joueur2;\n } else {\n return joueur1;\n }\n }",
"Player getDormantPlayer();",
"public Player getPlayer()\r\n\t{\r\n\t\treturn mPlayer;\r\n\t}",
"public ServerPlayer getCurrentPlayer() {\r\n\t\treturn this.currentPlayer;\r\n\t}",
"public Player getPlayer() {\r\n return player;\r\n }",
"public Player getPlayer() {\n\t\treturn this.player;\r\n\t}",
"private float getPlayerMove() {\r\n\t\treturn 1.0f / 5;\r\n\t}",
"public Player getPlayer() {\n\t\treturn player;\n\t}",
"public Player getPlayer() {\n\t\treturn player;\n\t}",
"public Player getPlayer() {\n\t\treturn player;\n\t}",
"public Player getPlayer() {\n\t\treturn player;\n\t}",
"public Player getPlayer() {\n\t\treturn player;\n\t}",
"public Player getPlayer() {\n\t\treturn player;\n\t}",
"public Player getPlayer() {\n\t\treturn player;\n\t}",
"public int getCurrentPlayer(){\n return this.currentPlayer;\n }",
"public int getPlayerPosition(int player)\n {\n return players[player];\n }",
"public Player getPlayer(){\n\t\treturn this.player;\n\t}",
"public Player getPlayer() {\n return player;\n }",
"public int getPlayer() {\r\n\t\treturn player;\r\n\t}",
"@Override\n public int getWinner()\n {\n return currentPlayer;\n }",
"public WizardController controller()\r\n\t{\r\n\t\treturn _controller;\r\n\t}",
"public Player getInteractingPlayer() {\n\t\treturn interactWith;\n\t}",
"@Override\n public Player getWinningPlayer() {\n return wonGame ? currentPlayer : null;\n }",
"public Controller getController() {\n\t\treturn this.controller;\n\t}",
"public Controller getController() {\n\t\treturn this.controller;\n\t}",
"public Player getWinner();",
"public final StandbyPriorityController getController() {\n return controller;\n }",
"public Player getPlayer() {\n return player;\n }",
"public Player getPlayer() {\n return player;\n }",
"public Player getPlayer() {\n return player;\n }",
"public Player getPlayer() {\n return player;\n }",
"public Player getPlayer() {\n return player;\n }",
"public Player getPlayer() {\n return humanPlayer;\n }",
"public Player getWinner() {\n if (winner == null) {\n winner = winnerStrategy.winner(this);\n }\n return winner;\n }",
"public Player getPlayer() {\n\t\treturn this.player;\n\t}",
"public Player getPlayer() {\n return player;\n }",
"public Controller getController()\n {\n return this.controller;\n }",
"public final Player getPlayer() {\n return player;\n }",
"public Controller getController() {\n\t\treturn controller;\n\t}",
"public Controller getController() {\n\t\treturn controller;\n\t}",
"public Player nextMove() {\n\t\treturn null;\n\t\t\n\t}",
"public Player getPlayer() {\n\t\t\treturn player;\n\t\t}",
"boolean makeMove(int index, Player player);",
"void userMoveRequested(int playerIndex);",
"public Player getCurrentPlayer(){\n String playerId = getUser().get_playerId();\n\n Player player = null;\n\n try {\n player = getCurrentGame().getPlayer(playerId);\n } catch(InvalidGameException e) {\n e.printStackTrace();\n System.out.println(\"This is the real Error\");\n }\n\n return player;\n }",
"public Player getWinner() {\n return winner;\n }",
"public Player getPlayer() { return player; }",
"public AbstractGameObject getPlayer() {\n return this.player;\n }",
"public Player getCurrentPlayer(Match match) {\r\n LOGGER.debug(\"--> getCurrentPlayer: match=\" + match);\r\n Player currentPlayer;\r\n\r\n if (match.getCurrentPlayer() == 1) {\r\n currentPlayer = match.getPlayer1();\r\n } else if (match.getCurrentPlayer() == 2) {\r\n currentPlayer = match.getPlayer2();\r\n } else if (match.getCurrentPlayer() == 0) {\r\n currentPlayer = match.getPlayer1();\r\n } else {\r\n throw new GeneralException(\"match has no defined currentPlayer!\");\r\n }\r\n\r\n LOGGER.debug(\"<-- getCurrentPlayer\");\r\n return currentPlayer;\r\n }",
"public PlayerModel getOwnerPlayer() {\r\n\t\treturn ownerPlayer;\r\n\t}",
"public Player getPlayer() {\n\t\treturn p;\n\t}",
"public int getPlayer() {\r\n\t\treturn myPlayer;\r\n\t}",
"public Player getPlayerInTurn();",
"public abstract Player getWinner();",
"public Player getOtherPlayer(Player player) {\n return (sender == player) ? recipient : sender;\n }"
]
| [
"0.7801322",
"0.74070895",
"0.68488365",
"0.6771833",
"0.6709577",
"0.6657456",
"0.6381336",
"0.636258",
"0.636258",
"0.6339741",
"0.63379365",
"0.62439305",
"0.62295246",
"0.6205639",
"0.61918104",
"0.6189511",
"0.6148086",
"0.6148086",
"0.6142402",
"0.613915",
"0.6132798",
"0.61051613",
"0.610323",
"0.6038745",
"0.60218126",
"0.6003696",
"0.59849787",
"0.59763294",
"0.59754676",
"0.59713864",
"0.5965175",
"0.5964714",
"0.5964641",
"0.59600675",
"0.5953342",
"0.5950533",
"0.5950533",
"0.59441954",
"0.5942755",
"0.5936395",
"0.5930405",
"0.59100765",
"0.590276",
"0.58957344",
"0.5892889",
"0.58921194",
"0.588746",
"0.58835447",
"0.5871587",
"0.58686864",
"0.5867776",
"0.58604467",
"0.5848464",
"0.5848464",
"0.5848464",
"0.5848464",
"0.5848464",
"0.5848464",
"0.5848464",
"0.5840587",
"0.5840177",
"0.58364993",
"0.5835895",
"0.5835838",
"0.5835448",
"0.5833844",
"0.58331573",
"0.58319896",
"0.5831563",
"0.5831563",
"0.5825746",
"0.5823656",
"0.5823538",
"0.5823538",
"0.5823538",
"0.5823538",
"0.5823538",
"0.5821522",
"0.58201844",
"0.5818882",
"0.58156794",
"0.580141",
"0.57942337",
"0.57862926",
"0.57862926",
"0.5779467",
"0.57727945",
"0.5765396",
"0.57638985",
"0.5755811",
"0.57487696",
"0.5738758",
"0.5736053",
"0.57350266",
"0.57344043",
"0.57340777",
"0.57257485",
"0.57165366",
"0.570726",
"0.57019883"
]
| 0.72891575 | 2 |
This functions returns a string stating the points, fouls count, etc.. of the player who is passed as a parameter | public String getStateOfPlayer(PlayerController playerController)
{
// This function is used to print the state of the player
String str = "";
str += "Player ID:"+playerController.getPlayerId()+" Points-> "+playerController.getPoints()+" Total_Fouls_Count-> "+ playerController.getTotalFoulsCount()+ " Recent_Unsuccessful_Attempts_Count -> "+ playerController.getRecentUnsuccessfulAttemptsCount();
return str;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getPoints ( Player player );",
"public String playerStatsToString() {\r\n\t\t\tString stats = \"\";\r\n\t\t\tstats = stats + username + \"\\n\";\r\n\t\t\tstats = stats + numberOfWins + \"\\n\";\r\n\t\t\tstats = stats + numberOfGames + \"\\n\";\r\n\t\t\tstats = stats + numberOfAttacks + \"\\n\";\r\n\t\t\tstats = stats + numberOfSPAttacks + \"\\n\";\r\n\t\t\tstats = stats + numberOfMeals + \"\\n\";\r\n\t\t\treturn stats;\r\n\t\t}",
"public void printPlayerStat(Player player);",
"@Override\n public String toString() {\n newPlayer.addPoints(players[0].getPoints());\n WarPlayer winner = players[mostNumOfCards(players)];\n\n if (winner.getPoints() == players[0].getPoints())\n return \"YOU WON!!! With a score of \" + players[0].getPoints();\n return \"Player\" + mostNumOfCards(players) + \" won!!! With a score of \" + winner.getPoints();\n }",
"public String gameTie(){\n return points[player1Score] + \"-All\";\n }",
"private String getPoints(){\n\t\tString pu = \" punts.\";\n\t\tif(points == 1){\n\t\t\tpu = \" punt.\";\n\t\t}\n\t\treturn \"Puntuació de \" + points + pu;\n\t}",
"public static String getPlayerString(float[] playerInfo){\n\t\tif(playerInfo.length!=4)throw new IllegalArgumentException(\"Method only accepts playerinfo of length 4: ID,X,Y,ROT\");\n\t\tplayerInfo[1]*=100.0f;\n\t\tplayerInfo[2]*=100.0f;\n\t\t//P [ID] [X*100] [Y*100] [ROT]\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"P \");\n\t\tfor(int i =0;i<4;i++){\n\t\t\tsb.append((int)playerInfo[i]);\n\t\t\tsb.append(\" \");\n\t\t}\n\t\treturn sb.toString();\n\t}",
"public String toString() {\n String player = new String(penalty + \",\" + secsTillUnpenalise);\n return player;\n }",
"public String playerString() {\n String outString = \"\";\n outString = (playerName + \",\" + String.valueOf(ID) + \",\" + club + \",\" + position + \",\" +\n String.valueOf(age) + \",\" + String.valueOf(projectedScore)\n + \",\" + String.valueOf(available) + \",\" + String.valueOf(onTeam) + \",\"+String.valueOf(draftPick)+\",\"+String.valueOf(predictedPick));\n\n return outString;\n }",
"public String currentScore(){\n return points[player1Score] + \"-\" + points[player2Score];\n }",
"public int getPoints(){\n\t\t//add the player socres(including monster killing, powerUp points and winning points\n\t\tint points = this.player.getScore() + 200*this.player.getHealth();\n\t\t\n\t\t//since the better the less time used, we use 600 seconds to minus the total seconds being used\n\t\t//and add it to the points\n\t\t//600 seconds is 10 minutes, which is definity long enough\n\t\t//if exceeds 10 minutes, we will subtract total score\n\t\tif(this.player.win()){\t//only if the player wins will we calculate the time\n\t\t\tpoints += (int)(3600 - (this.time / 1000000000));\n\t\t}\n\t\t\n\t\tthis.totalLabel.setText(String.valueOf(points));\t//set the value of the JLabel\n\t\t\n\t\treturn points;\n\t\t\n\t}",
"public void playerDetailedInfo(Player p){\n System.out.println(\"Indicator: \" + indicator + \"\\nJoker: \"+joker);\n System.out.println(\"Winner: Player\" + p.getPlayerNo());\n System.out.println(\"Tile size: \" + p.getTiles().size());\n System.out.println(\"Joker count: \" + p.getJokerCount());\n System.out.println(\"Double score: \" + p.getDoubleCount()*2);\n System.out.println(\"All tiles in ascending order:\\t\" + p.getTiles());\n System.out.println(\"Clustered according to number: \\t\" + p.getNoClus());\n System.out.println(\"Total number clustering score: \" + p.totalNoClustering());\n System.out.println(\"Clustered according to color: \\t\" + p.getColClus());\n System.out.println(\"Total color clustering score: \" + p.totalColCluster());\n System.out.println(\"Final score of Player\"+p.getPlayerNo()+\": \" + p.getPlayerScore());\n }",
"public String countScore() {\n String str =\"\";\n System.out.println(\"Game has ended\");\n int playerOneCount = 0;\n int playerTwoCount = 0;\n System.out.println(\"this is size of computer board\" + player2.playerTwoDomino.size());\n System.out.println(\"this is size of boneyard \" + allElements.size());\n System.out.println(\"this is size of human board \" + human1.playerOneDomino.size());\n System.out.println(\"this is size of game board \" + gameBoard.size());\n for (int i = 0; i < human1.playerOneDomino.size(); i++) {\n playerOneCount = playerOneCount + human1.playerOneDomino.get(i).getX() + human1.playerOneDomino.get(i).getX();\n }\n for (int j = 0; j < player2.playerTwoDomino.size(); j++) {\n playerTwoCount = playerTwoCount + player2.playerTwoDomino.get(j).getX() + player2.playerTwoDomino.get(j).getY();\n }\n\n if (playerOneCount < playerTwoCount) {\n str = \"Winner is Human by \" + (playerTwoCount - playerOneCount) + \" points\";\n\n\n } else {\n str = \"Winner is Computer by \" + (playerOneCount - playerTwoCount) + \" points\";\n\n }\n\n return str;\n }",
"@Override\r\n//displays the property of defensive players to console\r\npublic String toString() {\r\n\t\r\n\tdouble feet = getHeight()/12;\r\n\tdouble inches = getHeight()%12;\r\n\t\r\n\treturn \"\\n\" + \"\\nDefensive Player: \\n\" + getName() \r\n\t+ \"\\nCollege: \" + getCollege() \r\n\t+ \"\\nHighschool: \" + getHighschool() \r\n\t+ \"\\nAge: \" + getAge() \r\n\t+ \"\\nWeight: \" + getWeight() \r\n\t+ \"\\nHeight: \" + feet + \" ft\" + \" \" + inches + \" in\" \r\n\t+ \"\\nTeam Number: \" + getNumber() \r\n\t+ \"\\nExperience: \" + getExperience()\r\n\t+ \"\\nTeam: \" + getTeam() \r\n\t+ \"\\nPosition: \" +getPosition() \r\n\t+ \"\\nTackles : \" + getTackles() \r\n\t+ \"\\nSacks: \" +getSacks() \r\n\t+ \"\\nInterceptions: \" + getInterceptions();\r\n}",
"public String stats()\n\t{\n\t\tString a = \"\"; //initialize string\n\t\t\n\t\tString size1 = points.length + \"\"; //put size into string\n\t\t\n\t\twhile(size1.length() < 12) //go until string is 12 long\n\t\t{\n\t\t\tsize1 += \" \"; //add a new blank space\n\t\t}\n\t\ta = a + algorithm + \" \" + size1 + time; //put string together \n\t\treturn a; \n\t}",
"public static void main(String[] args) {\n String player1 = displayHighScorePosition(\"aldi\") + calculateHighScorePosition(1500);\n System.out.println(player1);\n\n String player2 = displayHighScorePosition(\"nana\") + calculateHighScorePosition(900);\n System.out.println(player2);\n\n String player3 = displayHighScorePosition(\"muhrim\") + calculateHighScorePosition(400);\n System.out.println(player3);\n\n String player4 = displayHighScorePosition(\"ununu\") + calculateHighScorePosition(50);\n System.out.println(player4);\n\n }",
"public String toString()\n {\n return \"Player's name: \" + playersName + \". Player's current score: \" + currentScore;\n }",
"String displayShotsTaken();",
"@Override\n\tpublic String toString() {\n\t\treturn Globals.currentScore + \" \" + String.valueOf(points);\n\t}",
"String getPlayer();",
"String getPlayerName();",
"public String toStringCurrentPositions() {\n String playerPosition = \"\";\n int count = 0;\n while(count < NUM_PLAYERS){\n playerPosition += count + \":\" + getPlayerPosition(count) +\" \";\n count++;\n }\n return playerPosition;\n }",
"private String getPlayersInfo(List<LightPlayer> players, String name){\n StringBuilder stringBuilder = new StringBuilder();\n for (LightPlayer player : players){\n stringBuilder.append(player.getName());\n if (player.getName().equals(name)) {\n stringBuilder.append(\" (you)\");\n }\n\n stringBuilder\n .append(\"\\n\")\n .append(player.getColor().name())\n .append(\" \")\n .append(\"[\")\n .append(player.getColor().name().toCharArray()[0])\n .append(\"]\")\n .append(\"\\n\");\n\n if (player.getCard() != null) {\n stringBuilder.append(player.getCard().getName().name());\n }\n\n stringBuilder.append(\"\\n\\n\\n\");\n }\n\n return stringBuilder.toString();\n }",
"public static String printStats() {\n return \"Your Statistics:\" + \"\\n\" +\n \"Total Time in Game (Seconds): \" + timeElapsedSeconds + \"\\n\" +\n \"Total Points: \" + totalScore + \"\\n\" +\n \"Total Number of Taps on Screen: \" + counterClicks + \"\\n\" +\n \"Thanks for Playing!\";\n }",
"public void printDetailedPlayer(Player player);",
"public static String winner() {\n\t\tList<List<Integer>> winCon = new ArrayList<List<Integer>>();\n\t\twinCon.add(Arrays.asList(1, 2, 3, 4, 5)); // first Row of the table\n\t\twinCon.add(Arrays.asList(6, 7, 8, 9, 10)); // Second Row of the table\n\t\twinCon.add(Arrays.asList(11, 12, 13, 14, 15)); // Third Row of the table\n\t\twinCon.add(Arrays.asList(16, 17, 18, 19, 20)); // Fourth Row of the table\n\t\twinCon.add(Arrays.asList(21, 22, 23, 24, 25)); // Fifth Row of the table\n\t\twinCon.add(Arrays.asList(1, 6, 11, 16, 21)); // First Column of the table\n\t\twinCon.add(Arrays.asList(2, 7, 12, 17, 22)); // Second Column of the table\n\t\twinCon.add(Arrays.asList(3, 8, 13, 18, 23)); // Third Column of the table\n\t\twinCon.add(Arrays.asList(4, 9, 14, 19, 24)); // Fourth Column of the table\n\t\twinCon.add(Arrays.asList(5, 10, 15, 20, 25)); // Fifth Column of the table\n\t\twinCon.add(Arrays.asList(1, 7, 13, 19, 25)); // first diagonal of the table\n\t\twinCon.add(Arrays.asList(5, 9, 13, 17, 21)); // Second diagonal of the table\n\n\t\tfor (List<Integer> l : winCon) {\n\t\t\tif (playerPosition.containsAll(l)) {\n\t\t\t\treturn \"Congratulations! \"+user+\", You Won.\";\n\t\t\t} else if (cpuPosition.containsAll(l)) {\n\t\t\t\treturn \"Cpu Won!, Sorry :( \";\n\t\t\t} else if (playerPosition.size() + cpuPosition.size() == 25) {\n\t\t\t\treturn \"Draw!!!\";\n\t\t\t} \n\t\t}\n\t\treturn \"\";\n\t}",
"public void getScores(){\n String p1 = \"Player 1 has \" + Integer.toString(player1.getWins());\n String p2 = \"Player 2 has \" + Integer.toString(player2.getWins());\n String winner = \"tie\";\n if(player1.getWins()>player2.getWins()){\n winner = player1.getName() + \" wins!!!!\";\n }\n else if(player2.getWins()>player1.getWins()){\n winner = player2.getName() + \" Wins!!!\";\n }\n JOptionPane.showMessageDialog(null, (p1 + \"\\n\" + p2 + \"\\n\" + winner));\n }",
"public String position() {\n\t\t\treturn \"\\n\"\n\t\t\t+ \"Player 1 owns: \"\n\t\t\t+ printSet(moves1)\n\t\t\t+ \"Player 2 owns: \"\n\t\t\t+ printSet(moves2)\n\t\t\t+ (isGameOver() ? \"Game is over.\\n\" : \"Player \"\n\t\t\t\t\t+ whoseTurn() + \" moves next.\\n\");\n\t\t}",
"public void printAssistants(Player player);",
"public String stats() { \r\n String stats; \r\n stats = getWins() + \" wins, \" + getLosses() + \" losses, \" \r\n + getSaves() + \" saves, \" + getEra() + \" ERA\"; \r\n return stats;\r\n }",
"public String toString() {\n\t\treturn \"player \" + player.id + \"\\n\";\n\t}",
"public String getWinner(){\n\tif (p1.getPoints()==p2.getPoints()){\n\t return \"Tie. Good food, bad outcome.\";\n\t}\n\treturn (p1.getPoints()>p2.getPoints()?\"Player Row\":\"Player Column\")+\" is the winner!\";\n }",
"public String getPlayername(Player player) {\n System.out.println(\"――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――\");\n System.out.println(\"Merci de d'indiquer le nom du joueur \"+player.getColor().toString(false)+\" : \");\n String name = readInput.nextLine();\n return name;\n }",
"public String playerNear(){\r\n\t\tif(AdventureManager.toon.x + 25 > x-200 && AdventureManager.toon.x +25 < x) return \"left\";\r\n\t\telse if(AdventureManager.toon.x +25 < x+250 && AdventureManager.toon.x +25 > x) return \"right\";\r\n\t\telse return \"n\";\r\n\t}",
"String getName() {\n return getStringStat(playerName);\n }",
"public void displayPlayerWinnings()\n {\n for(int card = 0; card < playerCardsWon; card++)\n {\n System.out.println(playerWinnings[card].toString());\n }\n }",
"@Override\r\n public String toString() {\r\n return \"Player name:\" + name + \", team: \" + team + \", Batting Average\" + battingAverage + '.';\r\n }",
"public String getScoreBoardText() {\n putListInPointOrder();\n String scoreText;\n StringBuilder sb = new StringBuilder();\n\n for (Player player : players)\n sb.append(player.toString() + \"\\n\");\n\n scoreText = sb.toString();\n return scoreText;\n }",
"public void updatePlayerPoints() {\n setText(Integer.toString(owner.getPlayerPoints()) + \" points\");\n }",
"public String playerRealNear(){\r\n\t\tif(AdventureManager.toon.x + 25 > x-50 && AdventureManager.toon.x +25 < x) return \"left\";\r\n\t\telse if(AdventureManager.toon.x +25 < x+100 && AdventureManager.toon.x +25 > x) return \"right\";\r\n\t\telse return \"n\";\r\n\t}",
"public String toString() {\n\t\treturn \"Player \" + playerNumber + \": \" + playerName;\n\t}",
"public int whoWin(){\r\n int winner = -1;\r\n \r\n int highest = 0;\r\n \r\n for(Player player : discWorld.getPlayer_HASH().values()){\r\n if(getPlayerPoints(player) > highest){\r\n highest = getPlayerPoints(player);\r\n winner = player.getID();\r\n }\r\n \r\n }\r\n \r\n return winner;\r\n }",
"public void printPoliticCards(Player player);",
"public void score(){\r\n\t\tint playerLocation = player.getLocationX();\r\n\t\tint obstacleX = obstacle.getLocationX();\r\n\t\tint obstacleY = obstacle.getLocationY();\r\n\r\n\r\n\t\tstr =\"\" + countCoins;\r\n\r\n\t\t//if you hit a coin, the number of points goes up by one.\r\n\t\tif(obstacleY == 280 && obstacleX==300 && playerLocation == 250){\r\n\t\t\tcountCoins++;\r\n\t\t}\r\n\t\tif(obstacleY== 450 && obstacleX==300 && playerLocation ==450){\r\n\t\t\tcountCoins++;\r\n\t\t}\r\n\r\n\t\t//if you hit the green monster, you lose one point.\r\n\t\tif((obstacleX-50) == 250 && (obstacleY-240) == 250 && playerLocation ==250){\r\n\t\t\tcountCoins--;\r\n\t\t}\r\n\r\n\t\t//if you hit the blue monster, you lose 3 points.\r\n\t\tif((obstacleX+180) == 480 && (obstacleY+180) == 250 && playerLocation ==450){\r\n\t\t\tcountCoins-=3;\r\n\t\t}\r\n\t}",
"static String showPlayerGemsAndPokeballs()\n {\n return \"\\nYou have \" + Player.current.gems + \" gems and \" + Player.current.pokeballs + \" pokeball(s).\\n\";\n }",
"public String getPlayersStatus(){\n\t\tString pStatus = \"\";\n\t\tPlayer player;\n\t\tfor(int i = 0; i < this.players.size(); i++){\n\t\t\tplayer = this.players.get(i);\n\t\t\tpStatus += \"[\" +player.getName() + \": \";\n\t\t\tpStatus += Integer.toString(player.numCards()) + \"] \";\n\t\t} \n\t\t\n\t\treturn pStatus;\n\t}",
"public String displayWinnings(){\n int totalWinnings = 0;\n for(int i = 0; i < numPulls; i++){\n totalWinnings += pullWinnings[i];\n }\n return \"Your total Winnings: $\" + totalWinnings;\n }",
"private String getScore(){\n return whiteName + \" : \" + blackName + \" - \" + whiteScore + \" : \" + blackScore;\n }",
"public static String getScoreboard(List<Player> players) {\n // Team Rock Adam Points: 20\n // Team Paper Eve Points: 10\n // Team Scissors Abel Points: 5 DEAD\n\n throw new RuntimeException(\"Method not implemented!\");\n }",
"@Override\n\tpublic void getScoreCardByPlayer(Player player) {\n\t\tSystem.out.printf(\"%12s: \", player.getName());\n\t\tChance[] chances = player.getScoreCard().getChances();\n\t\tfor (int i = 0; i < chances.length; i++) {\n\t\t\tif (i == chances.length - 1) {\n\t\t\t\tSystem.out.printf(\"|~ %02d|%02d ~|\", chances[i].getThrow1(), chances[i].getThrow2());\n\t\t\t} else {\n\t\t\t\tSystem.out.printf(\"| %02d|%02d |\", chances[i].getThrow1(), chances[i].getThrow2());\n\t\t\t}\n\t\t}\n\t\tSystem.out.printf(\" => %03d \", player.getScoreCard().getTotalScore());\n\t\tSystem.out.printf(\"Total Spare: %02d \", player.getScoreCard().getTotalSpare());\n\t\tSystem.out.printf(\"Total Strike: %02d%n\", player.getScoreCard().getTotalStrike());\n\t}",
"private String calculateScore(DiceModel Player1, DiceModel Player2) {\n\t\tint p1d1 = Player1.getDie1();\n\t\tint p1d2 = Player1.getDie2();\n\t\tint p1d3 = Player1.getDie3();\n\t\t\n\t\tint p2d1 = Player2.getDie1();\n\t\tint p2d2 = Player2.getDie2();\n\t\tint p2d3 = Player2.getDie3();\n\t\t\n\t\tint p1P = Player1.getPoints();\n\t\tint p2P = Player2.getPoints();\n\t\n\t\t// impParts stands for the 'important parts' used when calculating pairs (the pair)\n\t\tint impPartsP1;\n\t\tint impPartsP2;\n\t\t\n\t\t// for when the sum is needed\n\t\tint sumP1 = (p1d1 + p1d2 + p1d3);\n\t\tint sumP2 = (p2d1 + p2d2 + p2d3);\n\t\t\n\t\t// ranks are the first step in determining who won\n\t\tint rankP1 = getRank(Player1);\n\t\tint rankP2 = getRank(Player2);\n\n\t\t// now that ranks have been gotten, calculate winner\n\t\t// if P1 had higher rank, he wins. the end.\n\t\tif (rankP1 > rankP2) {\n\t\t\twinner = \"Player1\";\n\t\t} else if (rankP2 > rankP1) { // if player2 has higher rank\n\t\t\twinner = \"Player2\";\n\t\t} else if (rankP1 == rankP2) { // if ranks are same\n\t\t\tif (rankP1 == 4) {\t\t\t// if player 1 rolled 421\n\t\t\t\tif (winner.equals(\"Player1\")) {\n\t\t\t\t\twinner = \"Player1\";\n\t\t\t\t} else {\n\t\t\t\t\twinner = \"Player2\";\n\t\t\t\t}\n\t\t\t\twinner = \"Player1\";\n\t\t\t} else if (rankP1 == 3) { // if they are triples;\n\t\t\t\tif (sumP1 >= sumP2) { // highest wins\n\t\t\t\t\twinner = \"Player1\";\n\t\t\t\t} else if (sumP2 > sumP1) {\n\t\t\t\t\twinner = \"Player2\";\n\t\t\t\t} else {\n\t\t\t\t\tif (winner.equals(\"Player1\")) {\n\t\t\t\t\t\twinner = \"Player1\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\twinner = \"Player2\";\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (rankP1 == 2) { // if they are doubles\n\t\t\t\tif (p1d1 == p1d2) {\n\t\t\t\t\timpPartsP1 = p1d1; // set the important part to the pair\n\t\t\t\t} else {\n\t\t\t\t\timpPartsP1 = p1d3;\n\t\t\t\t}\n\t\t\t\tif (p2d1 == p2d2) { // do it for player 2 also\n\t\t\t\t\timpPartsP2 = p2d1;\n\t\t\t\t} else {\n\t\t\t\t\timpPartsP2 = p2d3;\n\t\t\t\t}\n\t\t\t\tif (impPartsP1 > impPartsP2) { //if player1 pair is better\n\t\t\t\t\twinner = \"Player1\";\n\t\t\t\t} else if (impPartsP2 > impPartsP1) { // or p2's > p1's\n\t\t\t\t\twinner = \"Player2\";\n\t\t\t\t} else if (impPartsP1 == impPartsP2) { // if same pair\n\t\t\t\t\tif (sumP1 >= sumP2) {\t\t\t\t// add them up\n\t\t\t\t\t\twinner = \"Player1\";\n\t\t\t\t\t} else if (sumP2 > sumP1) {\n\t\t\t\t\t\twinner = \"Player2\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (winner.equals(\"Player1\")) {\n\t\t\t\t\t\t\twinner = \"Player1\";\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\twinner = \"Player2\";\n\t\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} else {\n\t\t\t\tif (sumP1 >= sumP2) { // if no pairs or better, take sums\n\t\t\t\t\twinner = \"Player1\";\n\t\t\t\t} else if (sumP2 > sumP1){\n\t\t\t\t\twinner = \"Player2\";\n\t\t\t\t} else {\n\t\t\t\t\tif (winner.equals(\"Player1\")) {\n\t\t\t\t\t\twinner = \"Player1\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\twinner = \"Player2\";\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} \t\n\t\t\n\t\tif (winner.equals(\"Player1\")) {\n\t\t\tplayer1.setPoints(p1P + 1);\n\t\t} else {\n\t\t\tplayer2.setPoints(p2P + 1);\n\t\t}\n\t\treturn winner;\n\t}",
"public String getTurnInfo(){\n if(gameState == GAME_STATE.CREATED){\n return \"Game has not been started!\";\n }\n\n String currentPlayerName;\n\n if( currentPlayerTurn == 1 ){\n currentPlayerName = player1Name;\n }else{\n currentPlayerName = player2Name;\n }\n\n StringBuilder reply = new StringBuilder();\n if( gameState == GAME_STATE.WIN ){\n reply.append(\"Game has ended \")\n .append(currentPlayerName)\n .append(\" wins!\");\n }\n else if(gameState == GAME_STATE.DRAW){\n reply.append(\"Game has ended in a draw\");\n }else{\n reply.append(\"<@\")\n .append(currentPlayerName)\n .append(\"> it is your turn to play\");\n }\n return reply.toString();\n }",
"String getNewPlayerName();",
"public String playerToString(Player player){\r\n StringBuilder toReturn = new StringBuilder(\"\");\r\n String playerName = player.getName();\r\n playerName = playerName.replace(\" \", \"_\");\r\n toReturn.append(playerName + \" \" + player.getIndex());\r\n \r\n return toReturn.toString();\r\n }",
"public String info()\n {\n String display = \"The player has $\" + spendingMoney + \" left to spend, and has won \" + prizesWon;\n return display;\n }",
"public String toString()\n {\n String result;\n result = \"Player Name: \" + playerName + \"\\tPlayer Score: \" + playerScore;\n return result;\n }",
"abstract public String getNameFor(Player player);",
"public int getPlayerScore();",
"final public int getPoints() {\r\n\t\tif (wildcard) {\r\n\t\t\treturn 20;\r\n\t\t}\r\n\t\t\r\n\t\tif (isJoker()) {\t\t\t\r\n\t\t\treturn 50;\r\n\t\t}\r\n\t\t\r\n\t\treturn face;\r\n\t}",
"@Override\n protected String checkIfGameOver() {\n if(pgs.getP0Score() >= 50){\n return playerNames[0] + \" \" + pgs.getP0Score();\n }else if(pgs.getP1score() >= 50){\n return playerNames[1] + \" \" + pgs.getP1score();\n }\n\n return null;\n }",
"String getFPS();",
"public String getPoints();",
"public String printRecord() {\n int win = 0;\n int total = gameList.size();\n for (Game g : gameList) {\n if (g.isWinner(this)) {\n win++;\n }\n }\n return \"(\" + win + \"-\" + (total - win) + \")\";\n }",
"public String getPlayerName(){\n return player1Score > player2Score ? player1Name : player2Name;\n }",
"public static void playerpoints(String board[][]){\n\t\tint player1pointcount=0, player2pointcount=0;\n\t\tfor(int x=1;x<=boardwidth;x++){\n\t\t\tfor(int i=1;i<=boardlength;i++){\n\t\t\t\tif(board[x][i]==\"x\"){\n\t\t\t\t\tplayer1pointcount++;\n\t\t\t\t}\n\t\t\t\tif(board[x][i]==\"o\"){\n\t\t\t\t\tplayer2pointcount++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tplayer1score=player1pointcount;\n\t\tplayer2score=player2pointcount;\n\t}",
"private static String playersToDrawOnSquare(SquareLM squareLM) throws NullPointerException{\n if(squareLM == null){\n throw new NullPointerException(\"The parameter should not be null\");\n }\n String stringToReturn = \"\";\n for(int idPlayer : squareLM.getPlayers()){\n //'P' if the player is up, 'p' if the player is down\n String markerPlayer;\n if(InfoOnView.getPlayers()[idPlayer].getDown()){\n markerPlayer = \"p\";\n }\n else{\n markerPlayer = \"P\";\n }\n //eg: the player with id 0 is the player 1\n stringToReturn += markerPlayer + (idPlayer + 1);\n }\n //all the rest of the line is blank (' ')\n return lineInsideSquareWithBlankAtTheEnd(stringToReturn);\n }",
"@Override\r\n public String toString()\r\n {\r\n //Returns String representation of this Player object\r\n return (\"Player: \" + username + \" is a \" + title + \" ranked \" + rank\r\n + \", has completed \" + gamesCompleted \r\n + \" with a fastest time of \" + fastestTime + \", and an average time of \" + averageTime\r\n + \" currently completing a game: \" + isCompletingGame);\r\n }",
"public static String[] displayleader(boolean[] ineligible, String[] name, float []top3, float[] stat, int numberofplayer)\n {\n\n String top1name,top2name,top3name;\n top1name = top2name = top3name = \"\"; // initialize null value of all names \n int top1counter,top2counter,top3counter;\n top1counter = top2counter = top3counter = 0; // initialize 0 to all counters\n String top1namearray[] = new String[50]; // arrays to hold top3 names\n String top2namearray[] = new String[50];\n String top3namearray[] = new String[50];\n int a,b,c;\n a=b=c= 0;\n for (int i=0;i<numberofplayer;i++)\n {\t\n if (top3[0]==stat[i] && ineligible[i] != true) { // if the value of top1 equals the stat of player\n if (top1counter < 1) { // if the first place is only one person\n \ttop1namearray[a]=name[i]; // putting in array to sort\n top1name=name[i]; // assign name to top1name array\n a++;\n } else {\n top1namearray[a]=name[i]; // if there is more than one person with the top1 value\n top1name = top1name + \", \" + name[i];//if there is more than one leader, it prints out the names of the leader with comma between.\n a++;\n }\n top1counter++;\n }\n if (top3[1]==stat[i] && ineligible[i] != true) { // if the value of top2 equals the stat of player\n if (top2counter < 1) {\n \ttop2namearray[b]=name[i];\n top2name=name[i];\n b++;\n } else {\n \ttop2namearray[b]=name[i];\n top2name = top2name + \", \" + name[i];//if there is more than one leader, it prints out the names of the leader with comma between.\n b++;\n }\n top2counter++;\n }\n if (top3[2]==stat[i] && ineligible[i] != true) {// if the value of top1 equals the stat of player\n if (top3counter < 1) {\n \ttop3namearray[c]=name[i];\n top3name=name[i];\n c++;\n } else {\n \ttop3namearray[c]=name[i];\n top3name = top3name + \", \" + name[i];//if there is more than one leader, it prints out the names of the leader with comma between.\n c++;\n }\n top3counter++;\n }\n }\n sortname(top1namearray);// sorting the names of top1players in alphabetical order\n sortname(top2namearray);// sorting the names of top2players in alphabetical order\n sortname(top3namearray);// sorting the names of top3players in alphabetical order\n int q =1;\n if(top1counter >1) { top1name = top1namearray[0];} // reassigning name of top 1 value in alphabetical order if there is more than one\n while (top1namearray[q]!=null&&top1counter!=1) { // while there is more than 1 player with top1value and while top1name is not null\n \ttop1name = top1name + \", \" + top1namearray[q]; //inserting comma between names\n \tq++;\n }\n q=1;\n if(top2counter >1) { top2name = top2namearray[0];}// reassigning name of top 1 value in alphabetical order if there is more than one\n while (top2namearray[q]!=null&&top2counter!=1) { // while there is more than 1 player with top2value and while top2name is not null\n \ttop2name = top2name + \", \" + top2namearray[q]; //inserting comma between names\n \tq++;\n }\n q=1;\n if(top3counter >1) { top3name = top3namearray[0];}// reassigning name of top 1 value in alphabetical order if there is more than one\n while (top3namearray[q]!=null&&top3counter!=1) { // while there is more than 1 player with top3value and while top3name is not null\n \ttop3name = top3name + \", \" + top3namearray[q]; //inserting comma between names\n \tq++;\n }\n if(numberofplayer ==1) {top2name = null; top3name = null;} // if there is only one player top2 and top3 does not exist\n else if (numberofplayer==2&&top1counter<2) {top3name =null;} // if there is only 2 players top3 is null\n else if(numberofplayer==2&&top1counter>1) {top2name =null;top3name=null;} // if there is 2 players but 2players have tie value then top2 and top3 is null\n else if(top1counter>2) {top2name=null;top3name=null;} // if there is more than 2 ties with top1value, top2 and top3 does not exist\n else if(top2counter>1||top1counter>1) {top3name=null;} // if there is more than one top1 or top2, then top3 does not exist\n String []top3names = {top1name,top2name,top3name};\n return top3names;\n }",
"public void showResult(NimPlayer player1, NimPlayer player2) {\n String g1 = \"game\";\n String g2 = \"game\";\n\n // check the sigular\n if (player1.getWinTimes() >= 2) {\n g1 = \"games\";\n }\n if (player2.getWinTimes() >= 2) {\n g2 = \"games\";\n }\n System.out.println(player1.getName() + \" won \" +\n player1.getWinTimes() + \" \" + g1 + \" out of \" +\n player1.getTotalTimes() + \" played\");\n System.out.println(player2.getName() + \" won \" +\n player2.getWinTimes() + \" \" + g2 + \" out of \" +\n player2.getTotalTimes() + \" played\");\n }",
"@SuppressWarnings(\"ResultOfObjectAllocationIgnored\")\n private String getWinnerList() {\n String list = \"\";\n\n ArrayList<IPlayer> arrlist = sortPlayerAfterPoints();\n\n for (IPlayer i : arrlist) {\n try {\n list += i.getName();\n list += \": \" + i.getPoints() + \"\\n\";\n } catch (RemoteException e) {\n e.printStackTrace();\n }\n }\n\n try {\n if (dialog.getSoundBox().isSelected()) {\n if (iPlayerList.size() > 0) {\n if (playersAgentsMap.get(arrlist.get(0).getName()).get(0).getColor().equals(Color.decode(AgentUtils.ROT))) {\n new SoundClip(\"red_team_is_the_winner\");\n } else if (playersAgentsMap.get(arrlist.get(0).getName()).get(0).getColor().equals(Color.decode(AgentUtils.BLAU))) {\n new SoundClip(\"blue_team_is_the_winner\");\n } else {\n new SoundClip(\"Flawless_victory\");\n }\n } else {\n new SoundClip(\"players_left\");\n }\n }\n } catch (NumberFormatException | RemoteException e) {\n e.printStackTrace();\n }\n\n return list;\n }",
"public String toString() {\n\t\tcreatePlayers(playerInfo);\n\t\tString result = \"\";\n\t\t//splits each player in the create players method\n\t\tfor (NFL_Player player : playerInfo) {\n\t\t\tresult += player.toString() + \"\\r------------------------------------------------------\\r\";\n\n\t\t}\n\t\treturn result;\n\t}",
"String player1GetName(){\n return player1;\n }",
"@Override\n public String getMessage(int player) {\n if (player == 0) {\n return \"Player\";\n }\n return \"CPU\";\n }",
"public int getPlayerOnePoints() {\n if (gameStatus == null) return -1;\n return gameStatus.getPlayerOnePoints();\n }",
"private String whoIsMVP() {\n int highestValue = 0;\n String mvp = null;\n for (String player : mvpPlayersMap.keySet()) {\n if (highestValue < mvpPlayersMap.get(player)) {\n highestValue = mvpPlayersMap.get(player);\n mvp = player;\n }\n }\n log.info(\"MVP player: {} with {} points\", mvp, highestValue);\n return mvp;\n }",
"public abstract void info(Player p);",
"public int getGoalTally(Player player){\r\n return player.getGoal();\r\n }",
"private String playerToString(int turn){ \r\n\t\tif (turn == 1) { \r\n\t\t\treturn \"You\";\r\n\t\t}\r\n\t\telse{ \r\n\t\t\treturn \"Computer\";\r\n\t\t}\r\n\t}",
"public String whoWon()\n { \n String win=\"\";\n if (player1Hand.isEmpty())\n {\n win=(\"player 2 wins!\");\n }\n \n if(player2Hand.isEmpty())\n {\n win=(\"player 1 wins\");\n } \n \n return win;\n }",
"@Override\n public String toString() {\n return String.valueOf(playerPiece);\n }",
"public void printAllPlayerStats(List<Player> players);",
"String getWinner();",
"public static String getPlayerOutput(ClientController game_client){\n\t\tfloat[] info = game_client.getPlayerInfo();\n\t\tStringBuilder toReturn = new StringBuilder();\n\t\ttoReturn.append(getPlayerString(info));\n\n\t\tEntity pickedUp = game_client.getToInteract();\n\t\tif(pickedUp !=null){\n\t\t\t//if we want to pick up an item, send a pick up request in the form INTERACT [Item ID] [Player ID]\n\t\t\ttoReturn.append(\" \");\n\t\t\tif(game_client.useOnSelf){\n\t\t\t\ttoReturn.append(\"USE \");\n\t\t\t}else{\n\t\t\t\ttoReturn.append(\"INTERACT \");\n\t\t\t}\n\t\t\ttoReturn.append(pickedUp.getID());\n\t\t\ttoReturn.append(\" \");\n\t\t\ttoReturn.append(game_client.getCurrentPlayer().getID());\n\t\t}\n\t\treturn toReturn.toString();\n\t}",
"public String toString()\n\t{\n\t\treturn Integer.toString(playerList.size());\n\t}",
"public String Winner() {\r\n if(Main.player1.SuaVida()==0)\r\n return \"player2\";\r\n else\r\n return \"player1\";\r\n }",
"public String callPlayer() {\n\t\treturn \"OVER HERE!!\";\n\t}",
"public int getPointsP() {\r\n\r\n pointsP = getPointsPlayer() + getPointsPlayer2();\r\n\r\n if (pointsP >= 10) {\r\n pointsP -= 10;\r\n }\r\n return pointsP;\r\n }",
"public int getPlayerCount() {\n return 0;\n }",
"public String getPlayer() {\n return p;\n }",
"@Override\n public String toString() {\n if(piece instanceof King) return player + 'K';\n if(piece instanceof Queen) return player + 'Q';\n if(piece instanceof Rook) return player + 'R';\n if(piece instanceof Knight) return player + 'N';\n if(piece instanceof Bishop) return player + 'B';\n if(piece instanceof Pawn) return player + 'p';\n else return \" \";\n }",
"public String toString(){\n return player.toString() + \"\\nGained a new Skill\";\n }",
"public String toString() {\r\n return \"\\n\\nTrainer: \"+ name + \", Wins: \" + win + \", team:\" + team;\r\n }",
"public String getWinner() {\n\t\tif (this.getScore(this.player1Name) > this.getScore(this.player2Name)) {\n\t\t\treturn this.player1Name;\n\t\t} else if (this.getScore(this.player1Name) == this.getScore(this.player2Name)) {\n\t\t\treturn \"Tie\";\n\t\t}\n\t\treturn this.player2Name;\n\t}",
"public String describeLocation(Player player)\n {\n StringBuilder narration = new StringBuilder(\"You are in \");\n narration.append(getDescription()).append(\".\\n\");\n narration.append(\"You can see:\\n\");\n // we want all entities present, not including the player that is looking\n for(int i = 0; i < getAllOtherEntities(player).size(); i++){\n narration.append(getAllOtherEntities(player).get(i).getDescription()).append(\"\\n\");\n }\n narration.append(\"You can access from here:\\n\");\n narration.append(pathList());\n return narration.toString();\n }",
"public String winner() {\r\n\t\tif(player1.isDone() || player2.isDone()) {\r\n\t\t\tint count1 = player1.winningsCount();\r\n\t\t\tint count2 = player2.winningsCount();\r\n\t\t\tif(count1 > count2) {\r\n\t\t\t\treturn \"Player 1 wins, \" + count1 + \" to \" + count2 + \"!\";\r\n\t\t\t}else if(count2 > count1) {\r\n\t\t\t\treturn \"Player 2 wins, \" + count2 + \" to \" + count1 + \"!\";\r\n\t\t\t}else {\r\n\t\t\t\treturn \"The Game ends in a tie!\";\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t}",
"public int differencePoints(){\n return player1Score - player2Score;\n }",
"@Override\r\n\tpublic String toString() {\r\n return rank + \" of \" + suit + \" - Point value: \" + pointValue;\r\n }",
"public static void displayStats(int draws, int cpuWins, int playerWins, int rounds, String userName) {\n if(rounds == 1) {\n System.out.println(\"\\n\\nWe played \" + rounds + \" game of Rock Paper Scissors.\");\n }\n \n else {\n System.out.println(\"\\n\\nWe played \" + rounds + \" games of Rock Paper Scissors.\");\n }\n //Display final stats of all rounds, note the check for grammar!\n if(cpuWins == 1) {\n System.out.println(\"The computer won \" + cpuWins + \" time.\");\n }\n else {\n System.out.println(\"The computer won \" + cpuWins + \" times.\");\n }\n if(playerWins == 1) {\n System.out.println(userName + \" won \" + playerWins + \" time.\");\n }\n else {\n System.out.println(userName + \" won \" + playerWins + \" times.\");\n }\n if(draws == 1) {\n System.out.println(\"There was \" + draws + \" draw.\");\n }\n else {\n System.out.println(\"There were \" + draws + \" draws.\");\n }\n \n //if player is better than cpu\n if(playerWins > cpuWins) {\n System.out.println(\"You are a master at Rock, Paper, Scissors.\");\n }\n \n //if cpu is better than player\n if(cpuWins > playerWins) {\n System.out.println(\"I am a master at Rock, Paper, Scissors.\");\n }\n \n //if cpu and player are evenly matched\n if(playerWins == cpuWins) {\n System.out.println(\"We are evenly matched at this game.\");\n }\n }",
"private static int gainStatPoints(int statPoints){\r\n statPoints++;\r\n System.out.println(\"You have \" + statPoints + \" stat points available.\");\r\n return statPoints;\r\n }",
"String randomPlayer1GetName(){\n return randomPlayer1;\n }"
]
| [
"0.71114606",
"0.70150816",
"0.6971925",
"0.6947097",
"0.69400233",
"0.6937908",
"0.6751858",
"0.6638341",
"0.6606202",
"0.65818286",
"0.6569323",
"0.6568551",
"0.654815",
"0.6539671",
"0.6482487",
"0.64528453",
"0.6441248",
"0.6418859",
"0.6416617",
"0.6396923",
"0.63838834",
"0.63150936",
"0.6314364",
"0.6298764",
"0.62094456",
"0.62084055",
"0.6190423",
"0.6177329",
"0.6162013",
"0.61450595",
"0.6141729",
"0.613256",
"0.61173326",
"0.6089525",
"0.6082014",
"0.607912",
"0.6077272",
"0.6069943",
"0.60575587",
"0.60466945",
"0.60382086",
"0.60374624",
"0.6035501",
"0.6029448",
"0.6015277",
"0.60125786",
"0.5987457",
"0.598484",
"0.5983691",
"0.5978629",
"0.59784836",
"0.59772956",
"0.59754795",
"0.59742457",
"0.597228",
"0.59660375",
"0.59447855",
"0.59418184",
"0.59385896",
"0.5937873",
"0.5935824",
"0.59321916",
"0.59314215",
"0.5922034",
"0.5922015",
"0.5920206",
"0.5914529",
"0.5906659",
"0.5892342",
"0.58895844",
"0.5869142",
"0.58621746",
"0.5861833",
"0.5857812",
"0.584629",
"0.584388",
"0.5843227",
"0.58393633",
"0.5834917",
"0.58341235",
"0.5829877",
"0.5827965",
"0.58211577",
"0.5799103",
"0.5796025",
"0.57851416",
"0.57663155",
"0.5759877",
"0.5758457",
"0.57535803",
"0.57499385",
"0.5742616",
"0.57378405",
"0.5737527",
"0.5735133",
"0.57335716",
"0.57276386",
"0.5723666",
"0.5720504",
"0.571853"
]
| 0.5886796 | 70 |
This function returns the state of the board.like number of coins of each type in the form of string. | public String getStateOfBoard()
{
// This function is used to print state of the board. such as number of coins present on the board
String str="";
str += "Black_Coins Count:"+this.gameController.getCoinsCount(CoinType.BLACK) +" Red_Coins Count:"+this.gameController.getCoinsCount(CoinType.RED);
return str;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private float getStateCost(int[] board) {\r\n\t\tfloat cost = 0;\r\n\t\tfor (int i = 0; i < this.checkBoardSide; i++) {\r\n\t\t\tif (isQueenAttacked(i, board[i], board)) {\r\n\t\t\t\tcost++;\r\n\t\t\t\t// System.out.println(\"row: \" + i + \" attacked\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn cost;\r\n\r\n\t}",
"public int numberOfStates();",
"public int numStates();",
"public String getState() {\n StringBuilder builder = new StringBuilder();\n //builder.append(muteMusic.getBackground().getLevel());\n //builder.append(',');\n builder.append(muteClicked);\n builder.append(',');\n builder.append(gameOver);\n builder.append(',');\n builder.append(wordsDetectedByUser.size());\n builder.append(',');\n for(int i =0;i<wordsDetectedByUser.size();i++)\n { builder.append(wordsDetectedByUser.get(i));\n builder.append(',');}\n builder.append(notValidWord);\n builder.append(',');\n // m1Handler.removeCallbacks(m1Runnable);\n mHandler.removeCallbacks(mRunnable);\n builder.append(phaseTwo);\n builder.append(',');\n builder.append(currentScore); //storing current score\n builder.append(',');\n builder.append(t); //storing timer state\n builder.append(',');\n Object a[] = DoneTiles.toArray();\n builder.append(a.length);\n builder.append(',');\n for(int i=0;i<a.length;i++) {\n builder.append(a[i].toString());\n builder.append(',');\n }\n builder.append(mLastLarge);\n builder.append(',');\n builder.append(mLastSmall);\n builder.append(',');\n for (int large = 0; large < 9; large++) {\n for (int small = 0; small < 9; small++) {\n builder.append(mSmallTiles[large][small].getOwner().name());\n builder.append(',');\n builder.append((((Button)mSmallTiles[large][small].getView()).getText()).toString());\n builder.append(',');\n //Log.d(DoneTiles);\n }\n }\n return builder.toString();\n }",
"public abstract int numStates();",
"private int evaluateState() {\r\n\r\n\t\t// add up score\r\n\t\t//\r\n\t\tint scoreWhite = 0;\r\n\t\tint scoreBlack = 0;\r\n\t\tfor (Piece piece : this.chessGame.getPieces()) {\r\n\t\t\tif(piece.getColor() == Piece.COLOR_BLACK){\r\n\t\t\t\tscoreBlack +=\r\n\t\t\t\t\tgetScoreForPieceType(piece.getType());\r\n\t\t\t\tscoreBlack +=\r\n\t\t\t\t\tgetScoreForPiecePosition(piece.getRow(),piece.getColumn());\r\n\t\t\t}else if( piece.getColor() == Piece.COLOR_WHITE){\r\n\t\t\t\tscoreWhite +=\r\n\t\t\t\t\tgetScoreForPieceType(piece.getType());\r\n\t\t\t\tscoreWhite +=\r\n\t\t\t\t\tgetScoreForPiecePosition(piece.getRow(),piece.getColumn());\r\n\t\t\t}else{\r\n\t\t\t\tthrow new IllegalStateException(\r\n\t\t\t\t\t\t\"unknown piece color found: \"+piece.getColor());\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// return evaluation result depending on who's turn it is\r\n\t\tint gameState = this.chessGame.getGameState();\r\n\t\t\r\n\t\tif( gameState == ChessGame.GAME_STATE_BLACK){\r\n\t\t\treturn scoreBlack - scoreWhite;\r\n\t\t\r\n\t\t}else if(gameState == ChessGame.GAME_STATE_WHITE){\r\n\t\t\treturn scoreWhite - scoreBlack;\r\n\t\t\r\n\t\t}else if(gameState == ChessGame.GAME_STATE_END_WHITE_WON\r\n\t\t\t\t|| gameState == ChessGame.GAME_STATE_END_BLACK_WON){\r\n\t\t\treturn Integer.MIN_VALUE + 1;\r\n\t\t\r\n\t\t}else{\r\n\t\t\tthrow new IllegalStateException(\"unknown game state: \"+gameState);\r\n\t\t}\r\n\t}",
"protected abstract int numStates();",
"public static long getNumberStates(Component comp) {\n\t\tAtomType atomicType = (AtomType) comp.getType();\n\t\treturn ( (PetriNet) atomicType.getBehavior()).getState().size();\n\t}",
"public void countCoins() {\r\n\t\tthis.coinCount = 0;\r\n\t\tfor (int x = 0; x < WIDTH; x++) {\r\n\t\t\tfor (int y = 0; y < HEIGHT; y++) {\r\n\t\t\t\tif (this.accessType(x, y) == 'C')\r\n\t\t\t\t\tthis.coinCount++;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private int checkerboardToState(int[][] paraCheckerboard) {\n\t\tint resultState = 0;\n\t\tint tempExponential = 1;\n\t\tfor (int i = 0; i < SIZE; i++) {\n\t\t\tfor (int j = 0; j < SIZE; j++) {\n\t\t\t\tresultState += paraCheckerboard[i][j] * tempExponential;\n\t\t\t\ttempExponential *= SIZE;\n\t\t\t} // Of for j\n\t\t} // Of for i\n\n\t\treturn resultState;\n\t}",
"int getNumberOfStonesOnBoard();",
"@Override\n\tpublic String toString() {\n\t\tString countCell = \"\";\n\t\tfor ( int row = 0; row < gameGrid.length; row++){\n\t\t\tfor ( int column = 0; column < gameGrid[0].length; column++){\n\t\t\t\tif(gameGrid[row][column] == 1) //this represents a live cell or exist\n\t\t\t\t\tcountCell = countCell + \"0\"; \n\t\t\t\telse{\n\t\t\t\t\tcountCell = countCell + \".\";//this will create little dots if there is no live cell...\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tcountCell = countCell + \"\\n\"; //creates a new line and moves down in the array\n\t\t}\n\n\t\treturn countCell;\n\t}",
"private char getGameStatus() {\n int row;\n int col;\n\n Map<Character, Integer> lineCounts = new HashMap<>();\n\n for (row = 0; row < this.boardSize; row++) {\n countLine(getLineStatus(this.board[row]), lineCounts);\n }\n\n for (col = 0; col < this.boardSize; col++) {\n countLine(getLineStatus(getColumn(col)), lineCounts);\n }\n\n countLine(getLineStatus(getMajorDiag()), lineCounts);\n countLine(getLineStatus(getSubDiag()), lineCounts);\n\n boolean player1Won = lineCounts.getOrDefault(players[0].symbol, 0) > 0;\n boolean player2Won = lineCounts.getOrDefault(players[1].symbol, 0) > 0;\n boolean boardIsFull = lineCounts.getOrDefault(' ', 0) == 0;\n if (player1Won && player2Won) // both players completed lines, it is a tie\n return 'T';\n if (player1Won)\n return players[0].symbol;\n if (player2Won)\n return players[1].symbol;\n if (boardIsFull)\n return 'T';\n return '?';\n }",
"public int getCoinsNum();",
"public void printStateInt() {\n StringBuilder out = new StringBuilder();\n for (int r = 0; r < rows; r++) {\n out.append(\"[\");\n for (int c = 0; c < columns; c++) {\n int number = currentState[r][c];\n out.append(number);\n if (number < 10) {\n out.append(\" \");\n }\n if (c != columns - 1)\n out.append(\" \");\n }\n out.append(\"]\");\n if (r != rows - 1)\n out.append(\"\\n\");\n\n }\n System.out.println(out);\n }",
"static int score(int[] state) {\n int no = 0;\n for (int i = 1; i < 10; i++) {\n if (state[i] == 1) {\n no *= 10; no += i;\n }\n }\n return no;\n }",
"public static int getCount(char type) {\n if (type == CARD) {\n return globalCardCount;\n } else {\n return globalRiderCount;\n }\n }",
"public int numberOfKnightsIn() { // numero di cavalieri a tavola\n \n return numeroCompl;\n }",
"int getStateValuesCount();",
"public String getState() {\r\n StringBuilder builder = new StringBuilder();\r\n builder.append(mLastLarge);\r\n builder.append(',');\r\n builder.append(mLastSmall);\r\n builder.append(',');\r\n for (int large = 0; large < 9; large++) {\r\n for (int small = 0; small < 9; small++) {\r\n builder.append(mSmallTiles[large][small].getOwner().name());\r\n builder.append(',');\r\n }\r\n }\r\n return builder.toString();\r\n }",
"public int computeGameSituation(int paraState) {\n\t\tint[][] tempCheckerboard = stateToCheckerboard(paraState);\n\t\t// System.out.println(\"The checkerboard is: \" +\n\t\t// Arrays.deepToString(tempCheckerboard));\n\n\t\treturn computeGameSituation(tempCheckerboard);\n\t}",
"int count(State state);",
"private int hashType() {\n // Twelve possibilities\n int answer;\n if (isBomb()) {\n answer = 1;\n } else if (isShield()) {\n answer = 2;\n } else {\n answer = 3;\n }\n if (isFire() && !isKing()) {\n answer += 3 * 1;\n }\n if (!isFire() && isKing()) {\n answer += 3 * 2;\n }\n if (isFire() && isKing()) {\n answer += 3 * 3;\n }\n return answer - 1;\n }",
"public String stateToCheckerboardString(int paraState) {\n\t\tint[][] tempCheckerboard = stateToCheckerboard(paraState);\n\t\tString resultString = \"\\r\\n\";\n\t\t//resultString += \"Checkerboard state: \\r\\n\";\n\t\tfor (int i = 0; i < tempCheckerboard.length; i++) {\n\t\t\tfor (int j = 0; j < tempCheckerboard[0].length; j++) {\n\t\t\t\tif (tempCheckerboard[i][j] == WHITE) {\n\t\t\t\t\tresultString += \"o \";\n\t\t\t\t} else if (tempCheckerboard[i][j] == BLACK) {\n\t\t\t\t\tresultString += \"x \";\n\t\t\t\t} else {\n\t\t\t\t\tresultString += \"- \";\n\t\t\t\t}//Of if\n\t\t\t}//Of for j\n\t\t\tresultString += \"\\r\\n\";\n\t\t}//Of for i\n\t\t\n\t\t//resultString += currentState;\n\t\treturn resultString;\n\t}",
"public static String[][] createBoardState() {\n String[][] initialBoardState = {\n {\"Rw\", \"Nw\", \"Bw\", \"Qw\", \"Kw\", \"Bw\", \"Nw\", \"Rw\"},\n {\"Pw\", \"Pw\", \"Pw\", \"Pw\", \"Pw\", \"Pw\", \"Pw\", \"Pw\"},\n {\" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \"},\n {\" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \"},\n {\" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \"},\n {\" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \"},\n {\"Pb\", \"Pb\", \"Pb\", \"Pb\", \"Pb\", \"Pb\", \"Pb\", \"Pb\"},\n {\"Rb\", \"Nb\", \"Bb\", \"Qb\", \"Kb\", \"Bb\", \"Nb\", \"Rb\"}\n };\n\n return initialBoardState;\n }",
"private static int evalState(GameState state){\n Move m = state.getMove();\n int counter = 0;\n\n // return directly if we encouter win or loss\n if(m.isXWin()){\n return 10000;\n }\n else if(m.isOWin()){\n return -1;\n }\n\n Vector<Integer> points = new Vector<Integer>();\n points.setSize(state.BOARD_SIZE*2+2);\n int player;\n Collections.fill(points, 1);\n int scaling = 4;\n int value = 0;\n\n for(int row = 0; row < state.BOARD_SIZE; row ++){\n for(int col = 0; col < state.BOARD_SIZE; col ++){\n player = state.at(row, col);\n\n // add points to the vector, increase by a factor for every new entry\n if(player == 1){\n points.set(row, points.get(row)*scaling);\n points.add(state.BOARD_SIZE + col, points.get(state.BOARD_SIZE - 1 + col)*scaling);\n\n // if it's in the first diagonal\n if(counter%state.BOARD_SIZE+1 == 0){\n points.add(state.BOARD_SIZE*2, points.get(state.BOARD_SIZE*2)*scaling);\n }\n\n // checking other diagonal\n if(counter%state.BOARD_SIZE-1 == 0 && row+col != 0){\n points.add(state.BOARD_SIZE*2 + 1, points.get(state.BOARD_SIZE*2)*scaling);\n }\n }\n // if an enemy player is encoutered null the value of the row/col\n else if(player == 2){\n points.set(row, 0);\n points.set(state.BOARD_SIZE + col, 0);\n if(counter%state.BOARD_SIZE+1 == 0){\n points.add(state.BOARD_SIZE*2, 0);\n }\n if(counter%state.BOARD_SIZE-1 == 0){\n points.add(state.BOARD_SIZE*2 + 1, 0);\n }\n }\n counter++;\n }\n }\n\n // if we have nulled the point we don't count it for the value of the state\n for(Integer i: points){\n if(i > 1){\n value += i;\n }\n }\n //System.err.println(\"Value: \" + value);\n return value;\n }",
"public int getMyNumStates() { return myNumStates; }",
"public int giveChange(Coin coinType)\n {\n numberofcoins = 0;\n while(balance> coinType.getValue()-1E-12){\n numberofcoins++;\n balance = balance - coinType.getValue();\n }\n System.out.println(balance);\n System.out.println(numberofcoins);\n return numberofcoins;\n }",
"public int evaluate(PentagoBoardState pbs) {\n PentagoBoardState.Piece[][] pieces = pbs.getBoard();\n\n\n int whitescore =0; //keep track of white's total score\n int blackscore = 0;//keep track of black's total score\n\n //Check rows\n for (int x = 0; x <6 ; x++) {\n int countWHori = 0;\n int countBHori = 0;\n\n int blacks = 0;\n int whites = 0;\n\n\n for (int y = 0; y <5 ; y++) {\n //Count how many black and white pieces\n if (pieces[x][y].ordinal() == 0 ) {\n\n //countBHori = countBHori + countvalue;\n blacks++;\n }\n if (pieces[x][y].ordinal() == 1) {\n\n //countWHori = countWHori +countvalue;\n whites++;\n }\n\n //Check for consecutive\n if (pieces[x][y].ordinal() == 0 && pieces[x][y+1].ordinal() == 0 ) {\n\n countBHori = countBHori +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 0 && pieces[x][y+1].ordinal() == 2 ) {\n\n countBHori = countBHori + blankspaceconsec;\n }\n else if (pieces[x][y].ordinal() == 2 && pieces[x][y+1].ordinal() == 0 ) {\n\n countBHori = countBHori + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x][y+1].ordinal() == 1 ) {\n\n countWHori = countWHori +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x][y+1].ordinal() == 2 ) {\n\n countWHori = countWHori + blankspaceconsec;\n }\n else if (pieces[x][y].ordinal() == 2 && pieces[x][y+1].ordinal() == 1 ) {\n\n countWHori = countWHori + blankspaceconsec;\n }\n\n //Check for disjoint and joint set If * B B W * * then disjoint and * B B * B * Then joint set for B * B\n if (y!=4){\n if (pieces[x][y].ordinal() == 0 && pieces[x][y+1].ordinal() == 0 && pieces[x][y+2].ordinal() == 1){\n countBHori = countBHori +disjointset;\n }\n else if (pieces[x][y].ordinal() == 1 && pieces[x][y+1].ordinal() == 1 && pieces[x][y+2].ordinal() == 0){\n countWHori = countWHori +disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x][y+1].ordinal() == 2 && pieces[x][y+2].ordinal() == 0){\n countBHori = countBHori +jointset;\n }\n else if (pieces[x][y].ordinal() == 1 && pieces[x][y+1].ordinal() == 2 && pieces[x][y+2].ordinal() == 1){\n countWHori = countWHori +jointset;\n }\n }\n }\n //check if unwinnable\n if (blacks == 4 && whites==2){\n countBHori += unwinnable;\n }\n if (blacks == 2 && whites==4){\n countWHori += unwinnable;\n }\n if (blacks == 3 && whites==3){\n countWHori += unwinnable;\n countBHori += unwinnable;\n }\n\n\n //Run value for row in evaluation scheme and add to total score\n int valuew = consecutivevalue(countWHori);\n whitescore = whitescore +valuew;\n int valueb = consecutivevalue(countBHori);\n blackscore = blackscore + valueb;\n //System.out.println(\"Black consec hori \" + valueb + \"White consec hori \" + valuew);\n\n }\n\n //Check Verticals\n for (int y = 0; y <6 ; y++) {\n int countWvert = 0;\n int countBvert = 0;\n int blacks = 0;\n int whites = 0;\n\n\n for (int x = 0; x <5 ; x++) {\n if (pieces[x][y].ordinal() == 0) {\n\n //countBvert = countBvert +1;\n blacks++;\n }\n if (pieces[x][y].ordinal() == 1) {\n\n //countWvert = countWvert +1;\n whites++;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y].ordinal() == 0 ) {\n\n countBvert = countBvert +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y].ordinal() == 2 ) {\n\n countBvert = countBvert + blankspaceconsec;\n }\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y].ordinal() == 0 ) {\n\n countBvert = countBvert + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y].ordinal() == 1 ) {\n\n countWvert = countWvert +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y].ordinal() == 2 ) {\n\n countWvert = countWvert + blankspaceconsec;\n }\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y].ordinal() == 1 ) {\n\n countWvert = countWvert + blankspaceconsec;\n }\n\n if (x!=4){\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y].ordinal() == 0 && pieces[x+1][y].ordinal() == 1){\n countBvert = countBvert +disjointset;\n }\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y].ordinal() == 1 && pieces[x+1][y].ordinal() == 0){\n countWvert = countWvert +disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y].ordinal() == 2 && pieces[x+1][y].ordinal() == 0){\n countBvert = countBvert +jointset;\n }\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y].ordinal() == 2 && pieces[x+1][y].ordinal() == 1){\n countWvert = countWvert +jointset;\n }\n }\n }\n\n if (blacks == 4 && whites==2){\n countBvert += unwinnable;\n }\n if (blacks == 3 && whites==3){\n countBvert += unwinnable;\n countWvert += unwinnable;\n }\n if (blacks == 2 && whites==4){\n countWvert += unwinnable;\n }\n //System.out.println(\"Black consec vert \" + countBvert + \"White consec \" + countWvert);\n int valuew = consecutivevalue(countWvert);\n whitescore = whitescore +valuew;\n int valueb = consecutivevalue(countBvert);\n blackscore = blackscore + valueb;\n //System.out.println(\"Black consec VERT \" + valueb + \"White consec hori \" + valuew);\n }\n\n //S West N EAST Top\n for (int a = 1; a <6 ; a++) { //loop through all diagonal lines\n int countWdiagSoNe = 0;\n int countBdiagSoNe = 0;\n int x=0;\n int blacks = 0;\n int whites = 0;\n\n\n for (int y = a; y !=0 ; y--) { //loop through one diagonal line\n\n int r = pieces[x][y].ordinal();\n int s =pieces[x+1][y-1].ordinal();\n //System.out.println(\"x \" + x+ \" y \" +y);\n //System.out.println(\"first \" + r+ \" second \" +s);\n if (pieces[x][y].ordinal() == 0) {\n\n //countBdiagSoNe = countBdiagSoNe +2;\n blacks++;\n }\n if (pieces[x][y].ordinal() == 1 ) {\n\n //countWdiagSoNe = countWdiagSoNe +2;\n whites++;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 ) {\n\n countBdiagSoNe = countBdiagSoNe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 ) {\n\n countBdiagSoNe = countBdiagSoNe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y-1].ordinal() == 0 ) {\n\n countBdiagSoNe = countBdiagSoNe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 ) {\n\n countWdiagSoNe = countWdiagSoNe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 ) {\n\n countWdiagSoNe = countWdiagSoNe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y-1].ordinal() == 1 ) {\n\n countWdiagSoNe = countWdiagSoNe + blankspaceconsec;\n }\n\n // check for joint and disjoint set at these x y coordinates by looking 2 pieces ahead\n if (x==0 && y==4){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==1 && y==3){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==2 && y==2){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==0 && y==5){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==1 && y==4){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==2 && y==3){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==3 && y==2){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n\n x++;\n\n\n }\n if (blacks == 4 && whites==2){\n countBdiagSoNe += unwinnable;\n }\n if (blacks == 3 && whites==3){\n countBdiagSoNe += unwinnable;\n countWdiagSoNe += unwinnable;\n }\n if (blacks == 2 && whites==4){\n countWdiagSoNe += unwinnable;\n }\n if (a==4 && blacks == 4 && whites==1){\n countBdiagSoNe += unwinnable;\n }\n if (a==4 && blacks == 1 && whites==4){\n countWdiagSoNe += unwinnable;\n }\n\n //System.out.println(\"Black consec vert \" + countBdiagSoNe + \"White consec \" + countWdiagSoNe);\n int valuew = consecutivevalue(countWdiagSoNe);\n whitescore = whitescore +valuew;\n int valueb = consecutivevalue(countBdiagSoNe);\n blackscore = blackscore + valueb;\n //System.out.println(\"Black consec DIAGOMAAL \" + valueb + \" \" + countBdiagSoNe + \"White consec hori \" + valuew + \" \" + countWdiagSoNe);\n }\n //S West N EAST Bot\n for (int a = 1; a <5 ; a++) {\n int countWdiagSoNe = 0;\n int countBdiagSoNe = 0;\n int y=5;\n int blacks = 0;\n int whites = 0;\n\n for (int x = a; x <5 ; x++) {\n\n int r = pieces[x][y].ordinal();\n int s =pieces[x+1][y-1].ordinal();\n //System.out.println(\"x \" + x+ \" y \" +y);\n //System.out.println(\"first \" + r+ \" second \" +s);\n if (pieces[x][y].ordinal() == 0) {\n\n //countBdiagSoNe = countBdiagSoNe +\n blacks++;\n }\n if (pieces[x][y].ordinal() == 1 ) {\n\n //countWdiagSoNe = countWdiagSoNe +2;\n whites++;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 ) {\n\n countBdiagSoNe = countBdiagSoNe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 ) {\n\n countBdiagSoNe = countBdiagSoNe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y-1].ordinal() == 0 ) {\n\n countBdiagSoNe = countBdiagSoNe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 ) {\n\n countWdiagSoNe = countWdiagSoNe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 ) {\n\n countWdiagSoNe = countWdiagSoNe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y-1].ordinal() == 1 ) {\n\n countWdiagSoNe = countWdiagSoNe + blankspaceconsec;\n }\n if (x==1 && y==5){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==2 && y==4){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n if (x==3 && y==3){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 1 && pieces[x+2][y-2].ordinal() == 0) {\n\n countWdiagSoNe = countWdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 0 && pieces[x+2][y-2].ordinal() == 1) {\n\n countBdiagSoNe = countBdiagSoNe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 1) {\n\n countWdiagSoNe = countWdiagSoNe +jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y-1].ordinal() == 2 && pieces[x+2][y-2].ordinal() == 0) {\n\n countBdiagSoNe = countBdiagSoNe + jointset;\n }\n }\n //System.out.println(x + \" y:\" + y +\" Black consec DIAGOMAAL \" + countBdiagSoNe + \"White consec hori \" + countWdiagSoNe);\n y--;\n\n\n }\n if (a==1 && blacks == 4 && whites==1){\n countBdiagSoNe += unwinnable;\n }\n /*if (blacks == 3 && whites==3){\n countBdiagSoNe += unwinnable;\n countWdiagSoNe += unwinnable;\n }*/\n if (a==1&& blacks == 1 && whites==4){\n countWdiagSoNe += unwinnable;\n }\n //System.out.println(\"Black consec vert \" + countBdiagSoNe + \"White consec \" + countWdiagSoNe);\n int valuew = consecutivevalue(countWdiagSoNe);\n whitescore = whitescore +valuew;\n int valueb = consecutivevalue(countBdiagSoNe);\n blackscore = blackscore + valueb;\n //System.out.println(\"Black consec DIAGOMAAL \" + valueb + \" \" + countBdiagSoNe + \"White consec hori \" + valuew + \" \" + countWdiagSoNe);\n }\n\n //NorthWest S EAST Left\n for (int a = 0; a <5 ; a++) {\n int countWdiagNoSe = 0;\n int countBdiagNoSe = 0;\n int y=0;\n int blacks = 0;\n int whites = 0;\n\n for (int x = a; x <5 ; x++) {\n //System.out.println(pbs+\"x \" + x+ \" y \" +y);\n int r = pieces[x][y].ordinal();\n int s =pieces[x+1][y+1].ordinal();\n //System.out.println(\"x \" + x+ \" y \" +y);\n //System.out.println(\"first \" + r+ \" second \" +s);\n if (pieces[x][y].ordinal() == 0) {\n blacks++;\n //countBdiagNoSe = countBdiagNoSe +2;\n }\n if (pieces[x][y].ordinal() == 1) {\n whites++;\n //countWdiagNoSe = countWdiagNoSe +2;\n }\n\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 ) {\n\n countBdiagNoSe = countBdiagNoSe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 ) {\n\n countBdiagNoSe = countBdiagNoSe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y+1].ordinal() == 0 ) {\n\n countBdiagNoSe = countBdiagNoSe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 ) {\n\n countWdiagNoSe = countWdiagNoSe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 ) {\n\n countWdiagNoSe= countWdiagNoSe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y+1].ordinal() == 1 ) {\n\n countWdiagNoSe = countWdiagNoSe + blankspaceconsec;\n }\n\n if (x==0 && y==0){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==1 && y==1){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==2 && y==2){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==3 && y==3){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==1 && y==0){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==2 && y==1){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==3 && y==2){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n y++;\n\n\n }\n //System.out.println(\"Black consec vert \" + countBdiagSoNe + \"White consec \" + countWdiagSoNe);\n if (blacks == 4 && whites==2){\n countBdiagNoSe += unwinnable;\n }\n if (a==1 && blacks == 4 && whites==1){\n countBdiagNoSe += unwinnable;\n }\n if (blacks == 3 && whites==3){\n countBdiagNoSe += unwinnable;\n countWdiagNoSe += unwinnable;\n }\n if (blacks == 2 && whites==4){\n countWdiagNoSe += unwinnable;\n }\n if (a==1 && blacks == 1 && whites==4){\n countWdiagNoSe += unwinnable;\n }\n\n int valuew = consecutivevalue(countWdiagNoSe);\n whitescore = whitescore +valuew;\n int valueb = consecutivevalue( countBdiagNoSe);\n blackscore = blackscore + valueb;\n //System.out.println(\"Black consec DIAGOMAAL \" + valueb + \" \" + countBdiagNoSe + \"White consec hori \" + valuew + \" \" + countWdiagNoSe);\n }\n //NorthWest S EAST Right\n for (int a = 1; a <5 ; a++) {\n int countWdiagNoSe = 0;\n int countBdiagNoSe = 0;\n int x=0;\n int blacks = 0;\n int whites = 0;\n\n for (int y = a; y <5 ; y++) {\n //System.out.println(\"x \" + x+ \" y \" +y);\n int r = pieces[x][y].ordinal();\n int s =pieces[x+1][y+1].ordinal();\n //System.out.println(\"x \" + x+ \" y \" +y);\n //System.out.println(\"first \" + r+ \" second \" +s);\n if (pieces[x][y].ordinal() == 0 ) {\n blacks++;\n //countBdiagNoSe = countBdiagNoSe +2;\n }\n if (pieces[x][y].ordinal() == 1) {\n whites++;\n //countWdiagNoSe = countWdiagNoSe +2;\n }\n\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 ) {\n\n countBdiagNoSe = countBdiagNoSe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 ) {\n\n countBdiagNoSe = countBdiagNoSe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y+1].ordinal() == 0 ) {\n\n countBdiagNoSe = countBdiagNoSe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 ) {\n\n countWdiagNoSe = countWdiagNoSe +consecvalue;\n }\n\n else if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 ) {\n\n countWdiagNoSe= countWdiagNoSe + blankspaceconsec;\n }\n\n else if (pieces[x][y].ordinal() == 2 && pieces[x+1][y+1].ordinal() == 1 ) {\n\n countWdiagNoSe = countWdiagNoSe + blankspaceconsec;\n }\n\n if (x==0 && y==1){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==1 && y==2){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n if (x==2 && y==3){\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 1 && pieces[x+2][y+2].ordinal() == 0) {\n\n countWdiagNoSe = countWdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 0 && pieces[x+2][y+2].ordinal() == 1) {\n\n countBdiagNoSe = countBdiagNoSe + disjointset;\n }\n if (pieces[x][y].ordinal() == 1 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 1) {\n\n countWdiagNoSe = countWdiagNoSe + jointset;\n }\n else if (pieces[x][y].ordinal() == 0 && pieces[x+1][y+1].ordinal() == 2 && pieces[x+2][y+2].ordinal() == 0) {\n\n countBdiagNoSe = countBdiagNoSe + jointset;\n }\n }\n x++;\n\n\n }\n if (a==1 && blacks == 1 && whites==4){\n countWdiagNoSe += unwinnable;\n }\n if (a==1 && blacks == 4 && whites==1){\n countBdiagNoSe += unwinnable;\n }\n //System.out.println(\"Black consec vert \" + countBdiagSoNe + \"White consec \" + countWdiagSoNe);\n int valuew = consecutivevalue(countWdiagNoSe);\n whitescore = whitescore +valuew;\n int valueb = consecutivevalue( countBdiagNoSe);\n blackscore = blackscore + valueb;\n //System.out.println(\"Black consec DIAGOMAAL \" + valueb + \" \" + countBdiagNoSe + \"White consec hori \" + valuew + \" \" + countWdiagNoSe);\n }\n\n\n\n\n\n //System.out.println(\"Black consec score \" + blackscore +\" \" + \"White consec scpre \" + whitescore);\n //System.out.println(\"max player is \" + maxplayer + \"My colour is \" + mycolour);\n int i = -123456789;\n if (mycolour == 0){\n //System.out.println(blackscore-whitescore +\" I am black\");\n\n\n i= blackscore-whitescore;\n return i;\n\n }\n else {\n //System.out.println(whitescore-blackscore +\" I am white\");\n i= whitescore-blackscore;\n return i;\n }\n /*\n if(i>0 && i<1000){\n return 100; //i*2;\n }\n else if(i>=1000 && i<10000){\n return 1000; //i*10;\n }\n else if(i>=10000 && i<100000){\n return 10000; //i*50;\n }\n else if(i>=100000){\n return 100000;//i*500;\n }\n else if(i<=0 && i>-100){\n return -100; //i*2;\n }\n else if(i<=-100 && i>-1000){\n return -1000; //i*10;\n }\n else if(i<=-1000 && i>-10000){\n return -10000; //i*50;\n }\n else if(i<=0 && i>-100000){\n return -100000;//i*500;\n }\n\n */\n\n\n }",
"private int computeState() {\n int state;\n if (corePd)\n state = 1; //power down state\n else\n state = 2; // core, e.g. crystal on state\n if (!corePd && !biasPd)\n state = 3; // crystal and bias on state\n if (!corePd && !biasPd && !fsPd)\n state = 4; // crystal, bias and synth. on\n if (!corePd && !biasPd && !fsPd && !rxtx && !rxPd)\n state = 5; // receive state\n if (!corePd && !biasPd && !fsPd && rxtx && !txPd)\n state = PA_POW_reg.getPower() + 6;\n return state;\n }",
"public BigInteger getUniqueCode() {\n\t\t\n\t\tBigInteger ret = BigInteger.ZERO;\n\t\t\n\t\tBigInteger BASE = new BigInteger(\"\" + Constants.NUM_STATES_PER_ELEMENT);\n\n\t\tBigInteger TWO = new BigInteger(\"2\");\n\t\t\n\t\tfor(int i=0; i<this.table.length; i++) {\n\t\t\tfor(int j=0; j<this.table[i].length; j++) {\n\t\t\t\t\n\t\t\t\tif(table[i][j] == Constants.EMPTY) {\n\t\t\t\t\tret = ret.multiply(BASE);\n\t\t\t\t\t\n\t\t\t\t} else if(table[i][j] == Constants.P1_COLOUR) {\n\t\t\t\t\tret = ret.multiply(BASE).add(BigInteger.ONE);\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tret = ret.multiply(BASE).add(TWO);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn ret;\n\t}",
"public BigInteger getUniqueCode() {\n\t\t\n\t\tBigInteger ret = BigInteger.ZERO;\n\t\t\n\t\tBigInteger BASE = new BigInteger(\"\" + Constants.NUM_STATES_PER_ELEMENT);\n\n\t\tBigInteger TWO = new BigInteger(\"2\");\n\t\t\n\t\tfor(int i=0; i<this.table.length; i++) {\n\t\t\tfor(int j=0; j<this.table[i].length; j++) {\n\t\t\t\t\n\t\t\t\tif(table[i][j] == Constants.EMPTY) {\n\t\t\t\t\tret = ret.multiply(BASE);\n\t\t\t\t\t\n\t\t\t\t} else if(table[i][j] == Constants.P1_COLOUR) {\n\t\t\t\t\tret = ret.multiply(BASE).add(BigInteger.ONE);\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tret = ret.multiply(BASE).add(TWO);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn ret;\n\t}",
"@Override\n public int numStatesExplored(){\n return numstatesexplored;\n }",
"public String toString(){\n \tif(state){\n\t\treturn (\"1\");\n\t }\n\t else{\n\t\t return(\"0\");\n\t }\n }",
"public int evalBoard(){\n if (wins('o')){\n return 3;\n }\n // Return 0 if human wins\n else if (wins('b')){\n return 0;\n }\n //Return 2 if game is draw\n else if (isDraw()){\n return 2;\n }\n // Game is not a draw and no player has won. Game is still undecided.\n else {\n return 1;\n }\n }",
"public String countScore() {\n String str =\"\";\n System.out.println(\"Game has ended\");\n int playerOneCount = 0;\n int playerTwoCount = 0;\n System.out.println(\"this is size of computer board\" + player2.playerTwoDomino.size());\n System.out.println(\"this is size of boneyard \" + allElements.size());\n System.out.println(\"this is size of human board \" + human1.playerOneDomino.size());\n System.out.println(\"this is size of game board \" + gameBoard.size());\n for (int i = 0; i < human1.playerOneDomino.size(); i++) {\n playerOneCount = playerOneCount + human1.playerOneDomino.get(i).getX() + human1.playerOneDomino.get(i).getX();\n }\n for (int j = 0; j < player2.playerTwoDomino.size(); j++) {\n playerTwoCount = playerTwoCount + player2.playerTwoDomino.get(j).getX() + player2.playerTwoDomino.get(j).getY();\n }\n\n if (playerOneCount < playerTwoCount) {\n str = \"Winner is Human by \" + (playerTwoCount - playerOneCount) + \" points\";\n\n\n } else {\n str = \"Winner is Computer by \" + (playerOneCount - playerTwoCount) + \" points\";\n\n }\n\n return str;\n }",
"private static String gameStatus(char[][] board){\n\t\t\n\t\tfor (int i = 0; i < 3; i++){\n\t\t\t// check horizontal lines && vertical lines for player x\n\t\t\tif ((board[i][0] == 'X' && board[i][1] == 'X' && board[i][2] == 'X') || \n\t\t\t\t\t(board[0][i] == 'X' && board[1][i] == 'X' && board[2][i] == 'X')){\n\t\t\t\twinner = 'X';\n\t\t\t\treturn \"true\";\n\t\t\t}\n\t\t}\n\t\t//check diags for x\n\t\tif ((board[0][0] == 'X' && board[1][1] == 'X' && board[2][2] == 'X') || \n\t\t\t\t(board[0][2] == 'X' && board[1][1] == 'X' && board[2][0] == 'X')){\n\t\t\twinner = 'X';\n\t\t\treturn \"true\";\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < 3 ; i++) {\n\t\t\t// check horizontal and vertical lines for player o\n\t\t\tif ((board[i][0] == 'O' && board[i][1] == 'O' && board[i][2] == 'O') || \n\t\t\t\t\t(board[0][i] == 'O' && board[1][i] == 'O' && board[2][i] == 'O')){\n\t\t\t\twinner = 'O';\n\t\t\t\treturn \"true\";\n\t\t\t}\n\t\t}\n\t\t//check diags for o\n\t\tif ((board[0][0] == 'O' && board[1][1] == 'O' && board[2][2] == 'O') || \n\t\t\t\t(board[0][2] == 'O' && board[1][1] == 'O' && board[2][0] == 'O')){\n\t\t\twinner = 'O';\n\t\t\treturn \"true\";\n\t\t}\n\n\t\t// check for tie\n\t\tint emptyCells = 9;\n\t\tfor (int i = 0; i < 3; i++){\n\t\t\tfor (int j = 0; j < 3; j++){\n\t\t\t\tif (board[i][j]!='\\0') emptyCells -= 1;\t\t\n\t\t\t}\n\t\t}\n\t\t// if all cells are filled, game is over with a tie\n\t\tif (emptyCells == 0) return \"tie\";\n\n\t\t// otherwise game is not over and return false\n\t\t//printBoard(board);\n\n\t\treturn \"false\";\n\t}",
"private int getType(String type) {\n\t\tint i=0;\n\t\tif(type.equals(\"rxpck\"))\n\t\t\t i=3;\n\t\telse if(type.equals(\"txpck\"))\n\t\t\t\ti=4;\n\t\telse if(type.equals(\"rxkB\"))\n\t\t\t\ti=5; \n\t\telse if(type.equals(\"txkB\"))\n\t\t\t\ti=6;\n\t\telse if(type.equals(\"rxcmp\"))\n\t\t\t\ti=7;\n\t\telse if(type.equals(\"txcmp\"))\n\t\t\t\ti=8;\n\t\telse if(type.equals(\"rxmsct\"))\n\t\t\t i=9;\n\t\treturn i;\n\t}",
"public int gameState() {\n \tboolean check = isCheck(turn);\n \t\n \t//change this code to be some sort of checkmate detection\n \tif(check) {\n \t\t//we need to check whether there is a legal move that puts the king out of check\n \t\t//we need to loop through all pieces of the same color as the turn and make all legal moves\n \t\t//then after each move, check whether the king is still in check\n \t\t\n \t\t//first generate a list of all pieces for the turn color\n \t\tArrayList<Piece> pieces = getPieces(turn);\n \t\t\n \t\tboolean freedom;\n \t\t\n \t\t//now for each piece, check whether moving that piece can get the king out of check\n \t\tfor(int i = 0; i < pieces.size(); i++) {\n \t\t\tfreedom = simulate(pieces.get(i));\n \t\t\tif(freedom) {\n \t \t\tupdateCheckMove(false);\n \t \t\tSystem.out.println(\"Check on \" + turn + \" King!\");\n \t\t\t\treturn 2; //if the king can move, then the game isn't over yet\n \t\t\t}\n \t\t}\n \t\t\n \t\t//the game is over if we reach this far, so we can assume checkmate\n \t\t//resignation logic will probably be specific to Display class\n \t\t\n \t\tupdateCheckMove(true);\n \t\t\n \t\tif(turn == PieceColor.White) return -1; //black win if white king in check and can't move\n \t\tif(turn == PieceColor.Black) return 1;\n \t}\n \t\n \t//if all of these fail, the game isn't over yet\n \treturn 2;\n }",
"int getStateValue();",
"int getStateValue();",
"int getStateValue();",
"private int evaluate(Board board)\n {\n if (computerWin(board))\n return 4*size;\n else if (playerWin(board))\n return -4*size;\n else if (draw(board))\n return 3*size;\n else\n return count(board, COMPUTER);\n }",
"int getBlockNumsCount();",
"int getBlockNumsCount();",
"private static void generateState() {\n byte[] array = new byte[7]; // length is bounded by 7\n new Random().nextBytes(array);\n STATE = new String(array, Charset.forName(\"UTF-8\"));\n }",
"public String toString() {\n\tStringBuffer buffer = new StringBuffer();\n\t//\tbuffer.append(\" 6 5 4 3 2 1 \\n\");\n\tbuffer.append(\"+---------------------------------------+\\n\");\n\t\n\tbuffer.append(\"| |\");\n\tfor (int i = 12; i >= 7; --i) {\n\t buffer.append(toString(state[i]));\n\t}\n\tbuffer.append(\" |\\n\");\n\t\n\tbuffer.append(\"|\");\n\tbuffer.append(toString(state[13]));\n\tbuffer.append(\"-----------------------------|\");\n\tbuffer.append(toString(state[6]));\n\tbuffer.append(\"\\n\");\n\t\n\tbuffer.append(\"| |\");\n\tfor (int i = 0; i <= 5; ++i) {\n\t buffer.append(toString(state[i]));\n\t}\n\tbuffer.append(\" |\\n\");\n\t\n\tbuffer.append(\"+---------------------------------------+\\n\");\n\tbuffer.append(\" 0 1 2 3 4 5 \\n\");\n\t\n\treturn buffer.toString();\n }",
"private int count(Board board, char symbol)\n {\n int answer = 0;\n \n for (int i = 0; i < size; i++)\n if (testRow(board, i, symbol))\n answer++;\n \n for (int i = 0; i < size; i++)\n if (testColumn(board, i, symbol))\n answer++;\n \n if (testLeftDiagonal(board, symbol))\n answer++;\n \n if (testRightDiagonal(board, symbol))\n answer++;\n \n return answer;\n }",
"public int stoneCount(int bin)\n {\n \treturn state[bin];\n }",
"public static String turnState(double sot, double eot) {\n\t\t// check if we are in the beginning of the turn and return the corresponding bin\n\t\tfor (int i = 0; i < SOT_BINS.length; i++) {\n\t\t\tif (sot < SOT_BIN_ENDS[i]) {\n\t\t\t\treturn SOT_BINS[i];\n\t\t\t}\n\t\t}\n\t\t// otherwise return bin relative to eot\n\t\treturn eotBin(eot);\n\t}",
"@Override\n public String getState() {\n StringBuilder builder = new StringBuilder();\n StringBuilder listPitches = listAllPitches(this.getFinalBeat());\n int length = this.getFinalBeat();\n\n builder.append(listPitches);\n\n for (int i = 0; i < length; i++) {\n builder.append(\"\\n\" + padded(i, length) + notesToString(getNotesPlayingAtBeat(i), i));\n }\n return builder.toString();\n }",
"int getStateValue3();",
"int getState();",
"int getState();",
"int getState();",
"int getState();",
"int getState();",
"int getState();",
"@Override\n public int howManyCoins() {\n return 7;\n }",
"void printBoardState(Piece[] B,Player J,int N);",
"@Override\n\tpublic int numCubies () {\n\t\treturn state_.length;\n\t}",
"com.google.protobuf.ByteString\n getStateBytes();",
"public int getNumberOfCoins() {\n return coins;\n }",
"public String countAndSay(int n)\n {\n if(n<=0)\n return \"\";\n String origin=\"1\";\n //we iterate n-1 times\n for(int i=1; i<n; i++)\n {\n //we generate a string for each level\n StringBuffer sb=new StringBuffer();\n int count=1;\n char lastChar=origin.charAt(0);\n for(int j=1; j<origin.length(); j++)\n {\n if(origin.charAt(j)==lastChar)\n count++;\n else\n {\n sb.append(count);\n sb.append(lastChar);\n count=1;\n lastChar=origin.charAt(j);\n }\n }\n sb.append(count);\n sb.append(lastChar);\n origin=sb.toString();\n }\n return origin;\n }",
"private double evalState(LabyrinthGameState state) {\n double score = 0;\n\n //Assign Percentages of Score\n final double treasureValTotal = 80; //Based on number of treasures left\n final double nearTreasureValTotal = 15; //Based on proximity to treasure\n final double typeTileValTotal = 1; //Based on which tile you are on\n final double numberOfConnectionsValTotal = 4; //Based on how many places you can move\n\n double treasureVal = 0;\n double nearTreasureVal = 0;\n double typeTileVal = 0;\n double numberOfConnectionsVal = 0;\n\n //calculating your treasure points\n treasureVal = (6.0 - (double)(state.getPlayerDeckSize(\n Player.values()[playerNum])))/6.0*treasureValTotal;\n\n int [] yourPos = state.getPlayerLoc(Player.values()[playerNum]).getLoc();\n int [] treasurePos = state.findTreasureLoc(Player.values()[playerNum]);\n if (treasurePos[0] == -1) {\n nearTreasureVal = (10.0 - findDistance(yourPos, findHome()))\n / 10.0 * nearTreasureValTotal;\n } else {\n nearTreasureVal = (10.0 - findDistance(yourPos, treasurePos))\n / 10.0 * nearTreasureValTotal;\n }\n\n //calculating points for the type of tile it can end on\n switch (state.getPlayerLoc(Player.values()[playerNum]).getType()) {\n case STRAIGHT:\n typeTileVal = 5.0 / 10.0 * typeTileValTotal;\n break;\n case INTERSECTION:\n typeTileVal = typeTileValTotal;\n break;\n default:\n typeTileVal = 3.0 / 10.0 * typeTileValTotal;\n break;\n }\n\n //calculating points based on # of connections created\n numberOfConnectionsVal = ((double)generatePossibleMoveActions(state).size()\n /49.0*numberOfConnectionsValTotal);\n\n //calculating final score\n score = (treasureVal + nearTreasureVal +\n typeTileVal + numberOfConnectionsVal)/100.0;\n\n return score;\n }",
"java.lang.String getState();",
"public static int heuristic(PentagoBoardState boardState) {\n\t\tint value = 0;\n\t\t\n\t\tfor (int i = 0; i<size; i++) {\n\t\t\tfor (int j = 0; j<size; j++) {\n\t\t\t\tif (boardState.getPieceAt(i, j) == PentagoBoardState.Piece.BLACK) {\n\t\t\t\t\tvalue += 10;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn value;\n\t}",
"public char[][] getBoardState(){\n return board;\n }",
"private int nobValue() {\n int numberOfCards= cards.length;\n int nValue = 0;\n \n for (int i = 0; i < numberOfCards - 1; i++) {\n char cardRank = cards[i].charAt(0);\n char cardSuit = cards[i].charAt(1);\n char startSuit = cards[numberOfCards - 1].charAt(1);\n \n if (cardRank=='J'&&cardSuit == startSuit) {\n nValue += 1;\n }\n } \n return nValue;\n }",
"public String printState(){\n if (this.state.equals(\"unstarted\")) return \"unstarted 0\";\n\n else if (this.state.equals(\"terminated\")) return \"terminated 0\";\n else if (this.state.equals(\"blocked\")) {\n return String.format(\"blocked %d\", ioBurstTime);\n }\n else if (this.state.equals(\"ready\")) {\n if (remainingCPUBurstTime !=null){\n return String.format(\"ready %d\", remainingCPUBurstTime);\n }\n return \"ready 0\";\n }\n\n else if (this.state.equals(\"running\")){\n return String.format(\"running %d\", cpuBurstTime);\n }\n\n else return \"Something went wrong.\";\n }",
"String getBoardString();",
"public String state() {\n\treturn state(points, temperature, currentStateEnergy);\n }",
"int findState(String str){\n int i = 0;\n\n for (i = 0; i < states.size(); i++) {\n if(Objects.equals(str, states.get(i))){\n return i;\n }\n }\n /** Could not find the state */\n return -1;\n }",
"public String countAndSay(int n) {\n String input = \"1\";\n String immediate_str = \"\";\n\n \n for (int i = 1; i < n; i++) {\n //System.out.println(input);\n char [] nums = input.toCharArray();\n int count = 0;\n int prev = -1;\n for (int j = 0; j < nums.length; j++) {\n //System.out.println(j + \",\"+ nums[j]);\n if ((nums[j] - '0') == prev) {\n count ++;\n }\n else {\n if (prev != -1)\n immediate_str += Integer.toString(count) + Integer.toString(prev);\n count = 1;\n }\n prev = nums[j] - '0';\n }\n immediate_str += Integer.toString(count) + Integer.toString(prev);\n input = immediate_str;\n immediate_str = \"\";\n }\n return input; \n }",
"String getState();",
"String getState();",
"String getState();",
"public int getValue(State state) {\n if (state.isGoal())\n return 0;\n\n int count = 1;\n int cx = state.getVariablePosition(0);\n int cy = puzzle.getFixedPosition(0);\n\n int grid[][] = state.getGrid();\n int gn = puzzle.getGridSize();\n\n for (int i = cx; i < gn; i++) {\n for (int j = 0; j < gn; j++) {\n if (grid[i][j] != -1)\n count++;\n }\n }\n\n return count;\n }",
"private int totalCount(Piece side) {\n int sum = 0;\n for (int i = 0; i < M; i++) {\n for (int j = 0; j < M; j++) {\n if (boardArr[i][j].abbrev().equals(sideAbbrev)) {\n sum++;\n }\n }\n }\n return sum;\n }",
"@Test\n public void stateExample4() {\n MarbleSolitaireModel exampleBoard =\n new TriangleSolitaireModelImpl(7, 6, 6);\n assertEquals(\" O\\n\" +\n \" O O\\n\" +\n \" O O O\\n\" +\n \" O O O O\\n\" +\n \" O O O O O\\n\" +\n \" O O O O O O\\n\" +\n \"O O O O O O _\", exampleBoard.getGameState());\n }",
"public char[][] getBoardState(){\n\t\treturn board;\n\t}",
"public int status() \n {\n \tif (stonesCount(7,12) != 0 && stonesCount(0,5) != 0)\n \t\treturn GAME_NOT_OVER;\n \telse if (stonesCount(7,13) < stonesCount(0,6))\n \t\treturn GAME_OVER_WIN;\n \telse if (stonesCount(7,13) == stonesCount(0,6))\n \t\treturn GAME_OVER_TIE;\n \telse\n \t\treturn GAME_OVER_LOSE;\n }",
"private String happiness() {\r\n\t\tint[] temp=tile.getHappiness();\r\n\t\tString out=\"Tile Happiness: \\n\\n\";\r\n\t\tint square=(int)Math.sqrt(temp.length);\r\n\t\tif(square*square<temp.length) {\r\n\t\t\tsquare++;\r\n\t\t}\r\n\t\tfor(int i=0; i<temp.length;) {\r\n\t\t\tfor(int j=0; j<square; j++) {\r\n\t\t\t\tif(i<temp.length) {\r\n\t\t\t\t\tout=out.concat(String.format(\"%4s\", temp[i]));\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tj=square;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tout=out.concat(\"\\n\");\r\n\t\t}\r\n\t\treturn out;\r\n\t}",
"public abstract int numOfFoodCellToReproduce();",
"public java.lang.String getStateCode() {\n\t\treturn _tempNoTiceShipMessage.getStateCode();\n\t}",
"public String getBaseCropState(Material material) {\n\t\tswitch (material) {\n\t\tcase COCOA:\n\t\t\treturn \"SMALL\";\n\t\tcase MELON_STEM:\n\t\t\treturn \"0\";\n\t\tcase PUMPKIN_STEM:\n\t\t\treturn \"0\";\n\t\tcase CACTUS:\n\t\t\treturn null;\n\t\tcase BROWN_MUSHROOM:\n\t\t\treturn null;\n\t\tcase RED_MUSHROOM:\n\t\t\treturn null;\n\t\tcase SUGAR_CANE:\n\t\t\treturn null;\n\t\tdefault:\n\t\t\treturn \"SEEDED\";\n\t\t}\n\t}",
"public int getState();",
"public int getState();",
"public int getState();",
"public int getState();",
"public static String[][] getBoardState() {\n return boardState;\n }",
"private int calcNumParticlesInState(byte state){\n //use bitwise operators to determine the number of particles in the incomingState\n int count = 0;\n for(int n = 0; n < SMASKS.length; n++){\n if((state & SMASKS[n]) == SMASKS[n]){\n count++;\n }\n }\n return count;\n }",
"@Test\n public void stateExample3() {\n MarbleSolitaireModel exampleBoard = new MarbleSolitaireModelImpl(2, 4);\n assertEquals(\" O O O\\n\"\n + \" O O O\\n\"\n + \"O O O O _ O O\\n\"\n + \"O O O O O O O\\n\"\n + \"O O O O O O O\\n\"\n + \" O O O\\n\"\n + \" O O O\", exampleBoard.getGameState());\n }",
"int getStateValue1();",
"public static String getChange(int amount){\n String result = \"\";\n for (Coins c : Coins.values()) {\n if(amount >= c.value()){\n int numberOfCoins = amount / c.value();\n amount = amount % c.value();\n result += c + \" : \" + numberOfCoins + \"\\n\";\n }\n }\n return result;\n }",
"public BoardState(int typeOfPlayer){\n board = new char[boardSize][boardSize];\n //ai\n if(typeOfPlayer == 0){\n aiInitBoard();\n }\n //human\n else if(typeOfPlayer == 1){\n initBoard();\n }\n }",
"protected int count_nbr_in_state ( int state )\r\n {\r\n OSPF_Interface oif;\r\n int count = 0;\r\n int i, j; \r\n int if_no, nbr_no;\r\n \r\n if_no = if_list.size();\r\n for ( i = 0; i < if_no; i++) {\r\n oif = (OSPF_Interface) if_list.elementAt(i);\r\n nbr_no = oif.neighbor_list.size();\r\n for ( j = 0; j < nbr_no; j++) {\r\n OSPF_Neighbor nbr = (OSPF_Neighbor) oif.neighbor_list.elementAt(j);\r\n if (nbr.state == state)\r\n count++;\r\n }\r\n }\r\n return count;\r\n }",
"public static int hammingWeight(int n) {\n if(n == 0) return 0;\n\n String s = n + \"\";\n int counter = 0;\n char[] chars = s.toCharArray();\n for(int i = 0; i < chars.length; i++)\n {\n if(chars[i] == '1')\n {\n counter++;\n }\n }\n return counter;\n }",
"public BlackjackClientState get_state() {\n ArrayList<String> cards = new ArrayList<>();\n ArrayList<String> cards2 = new ArrayList<>();\n for (Card c : player_cards)\n cards.add(c.toString());\n\n // Calculate the current state of the game\n int player_hand = get_hand_val(player_cards);\n if (player_hand > 21)\n player_busted = true;\n else if (player_hand == 21)\n player_stand = true;\n\n String player_count = Integer.toString(player_hand);\n\n if (player_stand || player_busted) {\n house_deal();\n for (Card c : house_cards)\n cards2.add(c.toString());\n int house_hand = get_hand_val(house_cards);\n String house_count = Integer.toString(house_hand);\n if (house_hand > 21)\n return new BlackjackClientState(id, true, player_busted ? \"Draw\" : \"You Win!\", player_count,\n house_count, cards, cards2);\n else if (house_hand > player_hand)\n return new BlackjackClientState(id, true, \"You lose\", player_count, house_count, cards, cards2);\n else if (!player_busted)\n return new BlackjackClientState(id, true, house_hand == player_hand ? \"Draw\" : \"You Win!\", player_count,\n house_count, cards, cards2);\n else\n return new BlackjackClientState(id, true, \"You lose\", player_count, house_count, cards, cards2);\n }\n\n return new BlackjackClientState(id, false, null, player_count, \"?\", cards, cards2);\n }",
"interface Cnst {\r\n\r\n /////////////////////////////////////////////////////////////\r\n // These constants can be changed to edit the big bang ran //\r\n /////////////////////////////////////////////////////////////\r\n\r\n //full size is eight, scales the size of the board\r\n int scale = 8;\r\n\r\n //numbers of blocks in a row and a column\r\n int blocks = 10;\r\n\r\n //number of colors the game will use, between 2-8 inclusive\r\n int numOfColors = 8;\r\n\r\n //the number of turns you have to win the game\r\n int maxTurns = 25;\r\n\r\n\r\n ////////////////////////////////////////\r\n // Please do not edit these constants //\r\n ////////////////////////////////////////\r\n\r\n //the visible board width, scales with scale\r\n int boardWidth = 70 * scale;\r\n\r\n //the visible board height, scales with scale\r\n int boardHeight = 70 * scale;\r\n\r\n //cell width scales with the board and scale\r\n int cellWidth = boardWidth / blocks;\r\n\r\n //cell height scales with board and scale\r\n int cellHeight = boardHeight / blocks;\r\n\r\n //new constant for text on the board\r\n int textHeight = boardWidth / 12;\r\n\r\n //the 8 colors that can be selected by the user\r\n ArrayList<Color> colorsToChoose =\r\n new ArrayList<Color>(Arrays.asList(\r\n Color.CYAN, Color.PINK, Color.ORANGE,\r\n Color.BLUE, Color.RED, Color.GREEN,\r\n Color.MAGENTA, Color.YELLOW));\r\n}"
]
| [
"0.62217784",
"0.61583763",
"0.60574794",
"0.59886277",
"0.5870141",
"0.5859091",
"0.58425474",
"0.5779432",
"0.5770462",
"0.5750159",
"0.5749859",
"0.5748402",
"0.5739354",
"0.5706661",
"0.56954837",
"0.56771576",
"0.56661135",
"0.5644036",
"0.56264484",
"0.55804276",
"0.55635566",
"0.55296993",
"0.5525776",
"0.55250114",
"0.55010766",
"0.54982084",
"0.54958564",
"0.5481297",
"0.5470688",
"0.54638606",
"0.5426524",
"0.5426524",
"0.54225856",
"0.54223955",
"0.54126954",
"0.53993446",
"0.5380119",
"0.5378393",
"0.5361177",
"0.5344843",
"0.5344843",
"0.5344843",
"0.5341386",
"0.5336656",
"0.5336656",
"0.53351575",
"0.5333853",
"0.5331159",
"0.53308296",
"0.5318192",
"0.5315038",
"0.53120124",
"0.5305399",
"0.5305399",
"0.5305399",
"0.5305399",
"0.5305399",
"0.5305399",
"0.529514",
"0.5288611",
"0.52884835",
"0.5276796",
"0.5273586",
"0.52640486",
"0.525913",
"0.5252138",
"0.5240631",
"0.5237122",
"0.5234413",
"0.52272093",
"0.52193666",
"0.5213083",
"0.5208595",
"0.52040064",
"0.52015096",
"0.52015096",
"0.52015096",
"0.5193544",
"0.51872396",
"0.51857555",
"0.518528",
"0.518208",
"0.51797205",
"0.51753604",
"0.51715666",
"0.5171076",
"0.5162335",
"0.5162335",
"0.5162335",
"0.5162335",
"0.51598597",
"0.5159493",
"0.51570785",
"0.5157013",
"0.5151871",
"0.51465005",
"0.51414996",
"0.51312447",
"0.5122513",
"0.51220167"
]
| 0.7490061 | 0 |
This function returns the winner after playing a move if none of the player is winner then it returns null | public PlayerController calculateWinner()
{
// This function will find the winner based on the move that is made by player
// Here we are checking only the two players who are leading the match
PlayerController player1 = this.playerControllerList.poll();
PlayerController player2 = this.playerControllerList.poll();
this.playerControllerList.add(player1);
this.playerControllerList.add(player2);
if(player1.getPoints() >= player2.getPoints()+GameConfiguration.MINIMUM_DIFF_POINTS && player1.getPoints() >= GameConfiguration.MINIMUM_POINTS_REQUIRED)
{
return player1;
}
else if(this.gameController.isBoardEmpty() == true)
{
if(player1.getPoints() >= player2.getPoints()+GameConfiguration.MINIMUM_DIFF_POINTS || player1.getPoints() >= GameConfiguration.MINIMUM_POINTS_REQUIRED)
{
return player1;
}
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Player checkForWinner() {\n if (playersInGame.size() == 1) {\n Player winner = playersInGame.get(0);\n\n // --- DEBUG LOG ---\n // The winner of the game\n Logger.log(\"WINNING PLAYER:\", winner.toString());\n\n return winner;\n } else {\n return null;\n }\n }",
"private boolean winner() {\n\t\t\n\t\tif(( gameBoard[TOP_LEFT] + gameBoard[TOP_CENTER] + gameBoard[TOP_RIGHT]) == P1_WINNER){\n\t\t\t//player 1 winner\n\t\t\twinner = P1_WINNER;\n\t\t}else if((gameBoard[CTR_LEFT] + gameBoard[CTR_CENTER] + gameBoard[CTR_RIGHT]) == P1_WINNER){\n\t\t\t//player 1 winner\n\t\t\twinner = P1_WINNER;\n\t\t}else if((gameBoard[BTM_LEFT] + gameBoard[BTM_CENTER] + gameBoard[BTM_RIGHT]) == P1_WINNER){\n\t\t\t//player 1 winner\n\t\t\twinner = P1_WINNER;\n\t\t}else if((gameBoard[TOP_LEFT] + gameBoard[CTR_LEFT] + gameBoard[BTM_LEFT]) == P1_WINNER){\n\t\t\t//player 1 winner\n\t\t\twinner = P1_WINNER;\n\t\t}else if((gameBoard[TOP_CENTER] + gameBoard[CTR_CENTER] + gameBoard[BTM_CENTER]) == P1_WINNER){\n\t\t\t//player 1 winner\n\t\t\twinner = P1_WINNER;\n\t\t}else if((gameBoard[TOP_RIGHT] + gameBoard[CTR_RIGHT] + gameBoard[BTM_RIGHT]) == P1_WINNER){\n\t\t\t//player 1 winner\n\t\t\twinner = P1_WINNER;\n\t\t}else if((gameBoard[TOP_LEFT] + gameBoard[CTR_CENTER] + gameBoard[BTM_RIGHT]) == P1_WINNER){\n\t\t\t//player 1 winner\n\t\t\twinner = P1_WINNER;\n\t\t}else if((gameBoard[TOP_RIGHT] + gameBoard[CTR_CENTER] + gameBoard[BTM_LEFT]) == P1_WINNER){\n\t\t\t//player 1 winner\n\t\t\twinner = P1_WINNER;\n\t\t}else if((gameBoard[TOP_LEFT] + gameBoard[TOP_CENTER] + gameBoard[TOP_RIGHT]) == P2_WINNER){\n\t\t\t//player 2 winner\n\t\t\twinner = P2_WINNER;\n\t\t}else if((gameBoard[CTR_LEFT] + gameBoard[CTR_CENTER] + gameBoard[CTR_RIGHT]) == P2_WINNER){\n\t\t\t//player 2 winner\n\t\t\twinner = P2_WINNER;\n\t\t}else if((gameBoard[BTM_LEFT] + gameBoard[BTM_CENTER] + gameBoard[BTM_RIGHT]) == P2_WINNER){\n\t\t\t//player 2 winner\n\t\t\twinner = P2_WINNER;\n\t\t}else if((gameBoard[TOP_LEFT] + gameBoard[CTR_LEFT] + gameBoard[BTM_LEFT]) == P2_WINNER){\n\t\t\t//player 2 winner\n\t\t\twinner = P2_WINNER;\n\t\t}else if((gameBoard[TOP_CENTER] + gameBoard[CTR_CENTER] + gameBoard[BTM_CENTER]) == P2_WINNER){\n\t\t\t//player 2 winner\n\t\t\twinner = P2_WINNER;\n\t\t}else if((gameBoard[TOP_RIGHT] + gameBoard[CTR_RIGHT] + gameBoard[BTM_RIGHT]) == P2_WINNER){\n\t\t\t//player 2 winner\n\t\t\twinner = P2_WINNER;\n\t\t}else if((gameBoard[TOP_LEFT] + gameBoard[CTR_CENTER] + gameBoard[BTM_RIGHT]) == P2_WINNER){\n\t\t\t//player 2 winner\n\t\t\twinner = P2_WINNER;\n\t\t}else if((gameBoard[TOP_RIGHT] + gameBoard[CTR_CENTER] + gameBoard[BTM_LEFT]) == P2_WINNER){\n\t\t\t//player 2 winner\n\t\t\twinner = P2_WINNER;\n\t\t}else if(gameBoard[TOP_LEFT] + gameBoard[TOP_CENTER] + gameBoard[TOP_RIGHT] + \n\t\t\t\t gameBoard[CTR_LEFT] + gameBoard[CTR_CENTER] + gameBoard[CTR_RIGHT] +\n\t\t\t\t gameBoard[BTM_LEFT] + gameBoard[BTM_CENTER] + gameBoard[BTM_RIGHT] == CAT){\n\t\t\t//cat winner player_1 goes first\n\t\t\twinner = CAT;\n\t\t}else if(gameBoard[TOP_LEFT] + gameBoard[TOP_CENTER] + gameBoard[TOP_RIGHT] + \n\t\t\t\t gameBoard[CTR_LEFT] + gameBoard[CTR_CENTER] + gameBoard[CTR_RIGHT] +\n\t\t\t\t gameBoard[BTM_LEFT] + gameBoard[BTM_CENTER] + gameBoard[BTM_RIGHT] == (CAT + 3)){\n\t\t\t//cat winner player_2 goes first\n\t\t\twinner = CAT;\n\t\t} \n\t\t\n\t\tif(winner > 0){\n\t\t\treturn true;//there is a winner\n\t\t}else{\n\t\t\treturn false;//still no winner yet\n\t\t}\t\n\t}",
"public Player getWinner(){\r\n if(!hasMovements(model.getPlayerA().getColor()))\r\n return model.getPlayerB();\r\n if(!hasMovements(model.getPlayerB().getColor()))\r\n return model.getPlayerA();\r\n // In case of draw\r\n return null;\r\n }",
"public Player winner() {\n Player result = null;\n boolean humanResult = board.fiveInARow(humanPlayer.getPiece());\n boolean player2Result = board.fiveInARow(aiPlayer.getPiece());\n if(humanResult && player2Result) {\n result = new Player(\"Tie\", 'T');\n } else if (humanResult && !player2Result) {\n result = humanPlayer;\n } else if (!humanResult && player2Result) {\n result = aiPlayer;\n }\n return result;\n }",
"public int winner(){\n getValidMoves();\n if(check(1)!=0) return 1;\n else if(check(-1)!=0) return -1;\n else if(validX.size()==0) return 2;\n else return 0;\n }",
"public static Player whoWonGame() {\r\n\t\tint highest = Main.winScoreNumb;\r\n\t\tPlayer winner = null;\r\n\t\t\r\n\t\t//Three handed play.\r\n\t\tif (Main.isThreeHanded){\r\n\t\t\tif (Utils.stringToInt(Main.player1Score) >= highest) {\r\n\t\t\t\thighest = Utils.stringToInt(Main.player1Score);\r\n\t\t\t\twinner = Main.playerOne;\r\n\t\t\t}\r\n\t\t\tif (Utils.stringToInt(Main.player2Score) >= highest) {\r\n\t\t\t\thighest = Utils.stringToInt(Main.player2Score);\r\n\t\t\t\twinner = Main.playerTwo;\r\n\t\t\t}\r\n\t\t\tif (Utils.stringToInt(Main.player3Score) >= highest) {\r\n\t\t\t\thighest = Utils.stringToInt(Main.player3Score);\r\n\t\t\t\twinner = Main.playerThree;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Four handed play with no teams.\r\n\t\tif (Main.isFourHandedSingle){\r\n\t\t\tif (Utils.stringToInt(Main.player1Score) >= highest) {\r\n\t\t\t\thighest = Utils.stringToInt(Main.player1Score);\r\n\t\t\t\twinner = Main.playerOne;\r\n\t\t\t}\r\n\t\t\tif (Utils.stringToInt(Main.player2Score) >= highest) {\r\n\t\t\t\thighest = Utils.stringToInt(Main.player2Score);\r\n\t\t\t\twinner = Main.playerTwo;\r\n\t\t\t}\r\n\t\t\tif (Utils.stringToInt(Main.player3Score) >= highest) {\r\n\t\t\t\thighest = Utils.stringToInt(Main.player3Score);\r\n\t\t\t\twinner = Main.playerThree;\r\n\t\t\t}\r\n\t\t\tif (Utils.stringToInt(Main.player4Score) >= highest) {\r\n\t\t\t\thighest = Utils.stringToInt(Main.player4Score);\r\n\t\t\t\twinner = Main.playerFour;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn winner;\r\n\t}",
"public int checkForWinner() {\n\n // Check horizontal wins\n for (int i = 0; i <= 6; i += 3)\t{\n if (mBoard[i] == HUMAN_PLAYER &&\n mBoard[i+1] == HUMAN_PLAYER &&\n mBoard[i+2]== HUMAN_PLAYER)\n return 2;\n if (mBoard[i] == COMPUTER_PLAYER &&\n mBoard[i+1]== COMPUTER_PLAYER &&\n mBoard[i+2] == COMPUTER_PLAYER)\n return 3;\n }\n\n // Check vertical wins\n for (int i = 0; i <= 2; i++) {\n if (mBoard[i] == HUMAN_PLAYER &&\n mBoard[i+3] == HUMAN_PLAYER &&\n mBoard[i+6]== HUMAN_PLAYER)\n return 2;\n if (mBoard[i] == COMPUTER_PLAYER &&\n mBoard[i+3] == COMPUTER_PLAYER &&\n mBoard[i+6]== COMPUTER_PLAYER)\n return 3;\n }\n\n // Check for diagonal wins\n if ((mBoard[0] == HUMAN_PLAYER &&\n mBoard[4] == HUMAN_PLAYER &&\n mBoard[8] == HUMAN_PLAYER) ||\n (mBoard[2] == HUMAN_PLAYER &&\n mBoard[4] == HUMAN_PLAYER &&\n mBoard[6] == HUMAN_PLAYER))\n return 2;\n if ((mBoard[0] == COMPUTER_PLAYER &&\n mBoard[4] == COMPUTER_PLAYER &&\n mBoard[8] == COMPUTER_PLAYER) ||\n (mBoard[2] == COMPUTER_PLAYER &&\n mBoard[4] == COMPUTER_PLAYER &&\n mBoard[6] == COMPUTER_PLAYER))\n return 3;\n\n // Check for tie\n for (int i = 0; i < BOARD_SIZE; i++) {\n // If we find a number, then no one has won yet\n if (mBoard[i] != HUMAN_PLAYER && mBoard[i] != COMPUTER_PLAYER)\n return 0;\n }\n\n // If we make it through the previous loop, all places are taken, so it's a tie\n return 1;\n }",
"public Player lookForWinner(){\n\t\tfor(int i = 0; i < this.players.size(); i++){\n\t\t\tif(this.players.get(i).numCards() == 0)\n\t\t\t\treturn this.players.get(i);\n\t\t}\n\t\t\n\t\treturn null;\n\t}",
"public int winner() {\n if (player1Wins())\n return 1;\n if (player2Wins())\n return 2;\n return -1; // No one has won\n }",
"public PlayerNumber winner() {\n\t\tif (someoneQuit) {\n\t\t\treturn onePlayerLeft;\n\t\t}\n\t\tif (winningPlayer == Game.FIRST_PLAYER) {\n\t\t\treturn Game.FIRST_PLAYER;\n\t\t}\n\t\tif (winningPlayer == Game.SECOND_PLAYER) {\n\t\t\treturn Game.SECOND_PLAYER;\n\t\t}\n\t\tif (movesLeft() > 0) {\n\t\t\treturn Game.GAME_NOT_OVER;\n\t\t}\n\t\treturn Game.DRAW;\n\t}",
"public void determineWinner() {\n\t\twinner = \"\";\n\t\tif (board[6] > board[13])\n\t\t\twinner = player1.getName();\n\t\telse if (board[6] < board[13])\n\t\t\twinner = player2.getName();\n\t\telse {\n\t\t\tSystem.out.println(\"The game is a tie\");\n\t\t\treturn;\n\t\t}\n\t\tSystem.out.println(winner + \" is the winner\");\n\t}",
"private boolean isWinner(byte player) {\n for (int row = 0; row <= 2; row++) {\n if (board[row][0] == player && board[row][1] == player && board[row][2] == player) {\n return true;\n }\n }\n for (int column = 0; column <= 2; column++) {\n if (board[0][column] == player && board[1][column] == player && board[2][column] == player) {\n return true;\n }\n }\n if (board[0][0] == player && board[1][1] == player && board[2][2] == player) {\n return true;\n } else if (board[0][2] == player && board[1][1] == player && board[2][0] == player) {\n return true;\n } else {\n return false;\n }\n }",
"public String winner(){\n\t\tString winner =\"\";\n\t\tif(board.isWin() == \"blue\")\n\t\t\t{\n\t\t\twinner= \"blue\";\n\t\t\t}\n\t\telse if(board.isWin()==\"red\")\n\t\t\t{\n\t\t\twinner= \"red\";\n\t\t\t}\n\t\treturn winner; \n\t}",
"public Player getWinner();",
"public int getWinner()\n {\n //Loops to get the winner\n for(int i = 0; i < NUM_PLAYERS; i++){\n if(isPlayerWinner(i)) return i; //This player is a winner\n }\n return -1; //no one is a winner so far\n }",
"public ServerPlayer whoWon() {\r\n\t\tif (winner(CROSS)) {\r\n\t\t\treturn getP1();\r\n\t\t} else if (winner(NOUGHT)) {\r\n\t\t\treturn getP2();\r\n\t\t} else {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}",
"public char findWinner() {\n char[] winners = {\n checkRowVictory(getTopRow()),\n checkRowVictory(getMidRow()),\n checkRowVictory(getLowRow()),\n checkRowVictory(getVerticalMidRow()),\n checkRowVictory(getVerticalLeftRow()),\n checkRowVictory(getVerticalRightRow()),\n checkDiagonalVictory()\n };\n\n for (char winner : winners) {\n if (winner != 0) {\n return winner;\n }\n }\n\n return 0;\n }",
"public String win() {\r\n\t\tint blackCount = 0;\r\n\t\tint whiteCount = 0;\r\n\t\tfor (int i=0; i<piece.size(); i++) {\r\n\t\t\tif (piece.get(order[i]).chessPlayer.equals(\"black\")) {\r\n\t\t\t\tblackCount++;\r\n\t\t\t} else if (piece.get(order[i]).chessPlayer.equals(\"white\")) {\r\n\t\t\t\twhiteCount++;\r\n\t\t\t} else continue;\r\n\t\t}\r\n\t\tif (blackCount == 0) {\r\n\t\t\treturn \"white\";\r\n\t\t} else if (whiteCount == 0) {\r\n\t\t\treturn \"black\";\r\n\t\t} else return null;\r\n\t}",
"public Winner whoWins(){\r\n\r\n /* transfer the matrix to an array */\r\n Sign[] flatBoard = flattenBoard();\r\n\r\n /* check if someone has won */\r\n if (CompPlayer.compWon(flatBoard))\r\n return Winner.COMPUTER;\r\n else if (CompPlayer.playerWon(flatBoard))\r\n return Winner.PLAYER;\r\n else\r\n return Winner.NON;\r\n }",
"public String Winner() {\r\n if(Main.player1.SuaVida()==0)\r\n return \"player2\";\r\n else\r\n return \"player1\";\r\n }",
"public static Score4MoveType findWinner(Player[] winners) {\n\t\tint countOpponent = 0;\n\t\tint countMe = 0;\n\t\tfor (int i = 0; i < winners.length; i++) {\n\t\t\tif (winners[i] == Player.OPPONENT) {\n\t\t\t\tcountOpponent++;\n\t\t\t} else if (winners[i] == Player.ME) {\n\t\t\t\tcountMe++;\n\t\t\t}\n\t\t}\n\t\treturn winnerDecission(countOpponent, countMe);\n\t}",
"public GameState won() {\n if ( (board[0][0] != TileState.BLANK) && (board[0][0] == board[0][1]) && (board[0][0] == board[0][2])) {\n if (playerOneTurn)\n return GameState.PLAYER_TWO;\n else\n return GameState.PLAYER_ONE;\n } else if ((board[1][0] != TileState.BLANK) && (board[1][0] == board[1][1]) && (board[1][0] == board[1][2])) {\n if (playerOneTurn)\n return GameState.PLAYER_TWO;\n else\n return GameState.PLAYER_ONE;\n } else if ((board[2][0] != TileState.BLANK) && (board[2][0] == board[2][1]) && (board[2][0] == board[2][2])) {\n if (playerOneTurn)\n return GameState.PLAYER_TWO;\n else\n return GameState.PLAYER_ONE;\n } else if ((board[0][0] != TileState.BLANK) && (board[0][0] == board[1][1]) && (board[0][0] == board[2][2])) {\n if (playerOneTurn)\n return GameState.PLAYER_TWO;\n else\n return GameState.PLAYER_ONE;\n } else if ( (board[0][2] != TileState.BLANK) && (board[0][2] == board[1][1]) && (board[0][2] == board[2][0])) {\n if (playerOneTurn)\n return GameState.PLAYER_TWO;\n else\n return GameState.PLAYER_ONE;\n } else if ((board[0][0] != TileState.BLANK) && (board[0][0] == board[1][0]) && (board[0][0] == board[2][0])) {\n if (playerOneTurn)\n return GameState.PLAYER_TWO;\n else\n return GameState.PLAYER_ONE;\n } else if ((board[0][1] != TileState.BLANK) && (board[0][1] == board[1][1]) && (board[0][1] == board[2][1])) {\n if (playerOneTurn)\n return GameState.PLAYER_TWO;\n else\n return GameState.PLAYER_ONE;\n } else if ((board[0][2] != TileState.BLANK) && (board[0][2] == board[1][2]) && (board[0][2] == board[2][2])) {\n if (playerOneTurn)\n return GameState.PLAYER_TWO;\n else\n return GameState.PLAYER_ONE;\n } else if (movesPlayed == 9)\n return GameState.DRAW;\n return GameState.IN_PROGRESS;\n }",
"@Override\n public Player getWinningPlayer() {\n return wonGame ? currentPlayer : null;\n }",
"private int Win_Move() {\n\t\tfinal int POSSIBLE_WIN = 8;\n\t\tint move = NO_MOVE;\n\t\tif(( gameBoard[TOP_LEFT] + gameBoard[TOP_CENTER] + gameBoard[TOP_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_LEFT] == EMPTY){\n\t\t\t\tmove = TOP_LEFT;\n\t\t\t}else if (gameBoard[TOP_CENTER] == EMPTY){\n\t\t\t\tmove = TOP_CENTER;\n\t\t\t}else if (gameBoard[TOP_RIGHT] == EMPTY){\n\t\t\t\tmove = TOP_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[CTR_LEFT] + gameBoard[CTR_CENTER] + gameBoard[CTR_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[CTR_LEFT] == EMPTY){\n\t\t\t\tmove = CTR_LEFT;\n\t\t\t}else if (gameBoard[CTR_CENTER] == EMPTY){\n\t\t\t\tmove = CTR_CENTER;\n\t\t\t}else if (gameBoard[CTR_RIGHT] == EMPTY){\n\t\t\t\tmove = CTR_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[BTM_LEFT] + gameBoard[BTM_CENTER] + gameBoard[BTM_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[BTM_LEFT] == EMPTY){\n\t\t\t\tmove = BTM_LEFT;\n\t\t\t}else if (gameBoard[BTM_CENTER] == EMPTY){\n\t\t\t\tmove = BTM_CENTER;\n\t\t\t}else if (gameBoard[BTM_RIGHT] == EMPTY){\n\t\t\t\tmove = BTM_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_LEFT] + gameBoard[CTR_LEFT] + gameBoard[BTM_LEFT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_LEFT] == EMPTY){\n\t\t\t\tmove = TOP_LEFT;\n\t\t\t}else if (gameBoard[CTR_LEFT] == EMPTY){\n\t\t\t\tmove = CTR_LEFT;\n\t\t\t}else if (gameBoard[BTM_LEFT] == EMPTY){\n\t\t\t\tmove = BTM_LEFT;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_CENTER] + gameBoard[CTR_CENTER] + gameBoard[BTM_CENTER]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_CENTER] == EMPTY){\n\t\t\t\tmove = TOP_CENTER;\n\t\t\t}else if (gameBoard[CTR_CENTER] == EMPTY){\n\t\t\t\tmove = CTR_CENTER;\n\t\t\t}else if (gameBoard[BTM_CENTER] == EMPTY){\n\t\t\t\tmove = BTM_CENTER;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_RIGHT] + gameBoard[CTR_RIGHT] + gameBoard[BTM_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_RIGHT] == EMPTY){\n\t\t\t\tmove = TOP_RIGHT;\n\t\t\t}else if (gameBoard[CTR_RIGHT] == EMPTY){\n\t\t\t\tmove = CTR_RIGHT;\n\t\t\t}else if (gameBoard[BTM_RIGHT] == EMPTY){\n\t\t\t\tmove = BTM_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_LEFT] + gameBoard[CTR_CENTER] + gameBoard[BTM_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_LEFT] == EMPTY){\n\t\t\t\tmove = TOP_LEFT;\n\t\t\t}else if (gameBoard[CTR_CENTER] == EMPTY){\n\t\t\t\tmove = CTR_CENTER;\n\t\t\t}else if (gameBoard[BTM_RIGHT] == EMPTY){\n\t\t\t\tmove = BTM_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_RIGHT] + gameBoard[CTR_CENTER] + gameBoard[BTM_LEFT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_RIGHT] == EMPTY){\n\t\t\t\tmove = TOP_RIGHT;\n\t\t\t}else if (gameBoard[CTR_CENTER] == EMPTY){\n\t\t\t\tmove = CTR_CENTER;\n\t\t\t}else if (gameBoard[BTM_LEFT] == EMPTY){\n\t\t\t\tmove = BTM_LEFT;\n\t\t\t}\n\t\t}\n\t\treturn move;\n\t}",
"public abstract Player getWinner();",
"public int winner() {\n if(humanPlayerHits == 17) {\n return 1;\n }\n if(computerPlayerHits == 17){\n return 2;\n }\n return 0;\n }",
"public String getWinner(){\n if(whiteWins && blackWins){\n return \"ITS A DRAW\";\n } else if(whiteWins){\n return \"WHITE WINS\";\n } else if(blackWins){\n return \"BLACK WINS\";\n } else {\n return \"NO WINNER\";\n }\n }",
"public Player getWinner() {\n \tif (!isOver())\n \t\treturn null;\n \tif (player1.getScore() > player2.getScore())\n \t\treturn player1;\n \tif (player2.getScore() > player1.getScore())\n \t\treturn player2;\n \treturn null;\n }",
"private void getWinner() {\r\n int nWhite = 0, nBlack = 0;\r\n if(nextPlayer.getChecks() == 0 && nextPlayer.getQueens() == 0){\r\n winner = currentPlayer;\r\n }\r\n else if(currentPlayer.getQueens() == nextPlayer.getQueens()){\r\n for (int i = 1; i<8; i++){\r\n for (int x = 0; x<8; x++) {\r\n if (checks[i][x] == 1) nBlack++;\r\n if (checks[7 - i][x] == 2) nWhite++;\r\n }\r\n if (nWhite>nBlack) winner = getPlayer(WHITE);\r\n else if(nBlack>nWhite)winner = getPlayer(BLACK);\r\n nWhite = 0;\r\n nBlack = 0;\r\n }\r\n }\r\n else if (currentPlayer.getQueens() > nextPlayer.getQueens()){ winner = currentPlayer;}\r\n else{winner = nextPlayer; }\r\n }",
"public boolean winner(){ \r\n\t\tif (rowWin() || colWin() || diagWin()){ \r\n\t\t\tchangeTurn(); \r\n\t\t\tSystem.out.println(\"Winner: \" + playerToString(currentTurn) + \"!\"); \r\n\t\t\treturn true; \r\n\t\t}\r\n\t\telse if (tie()){\r\n\t\t\tSystem.out.println(\"There is a tie.\");\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse{ \r\n\t\t\tSystem.out.println(\"No winner yet.\\n\"); \r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t}",
"public int getComMove() {\n\n int move;\n\n // Checks if a computer played a move in that spot\n for (int i = 0; i < getBoardSize(); i++) {\n if (playBoard[i] != REAL_PLAYER && playBoard[i] != COM_PLAYER) {\n char currPlace = playBoard[i];\n playBoard[i] = COM_PLAYER;\n\n if (winCheck() == 3) {\n setMove(COM_PLAYER, i);\n return i;\n }\n else {\n playBoard[i] = currPlace;\n }\n }\n }\n\n // Check to block human player from winning\n for (int i = 0; i < getBoardSize(); i++) {\n if (playBoard[i] != REAL_PLAYER && playBoard[i] != COM_PLAYER) {\n char currPlace = playBoard[i];\n playBoard[i] = REAL_PLAYER;\n\n if (winCheck() == 2) {\n setMove(COM_PLAYER, i);\n return i;\n }\n else {\n playBoard[i] = currPlace;\n }\n }\n }\n\n // If play spot is empty, then make move\n do {\n move = randMove.nextInt(getBoardSize());\n } while (playBoard[move] == REAL_PLAYER || playBoard[move] == COM_PLAYER);\n setMove(COM_PLAYER, move);\n\n return move;\n }",
"public int determineWinner() {\n\t\tif(board[1][1] != 0 && (\n\t\t\t(board[1][1] == board[0][0] && board[1][1] == board[2][2]) ||\n\t\t\t(board[1][1] == board[0][2] && board[1][1] == board[2][0]) ||\n\t\t\t(board[1][1] == board[0][1] && board[1][1] == board[2][1]) ||\n\t\t\t(board[1][1] == board[1][0] && board[1][1] == board[1][2]))){\n\t\t\treturn board[1][1];\n\t\t}\n\t\telse if (board[0][0] != 0 &&(\n\t\t\t(board[0][0] == board[0][1] && board[0][0] == board[0][2]) ||\n\t\t\t(board[0][0] == board[1][0] && board[0][0] == board[2][0]))){\n\t\t\treturn board[0][0];\n\t\t}\n\t\telse if (board [2][2] != 0 && (\n\t\t\t(board[2][2] == board[2][0] && board[2][2] == board[2][1]) ||\n\t\t\t(board[2][2] == board[0][2] && board[2][2] == board[1][2]))) {\n\t\t\treturn board[2][2];\n\t\t}\n\t\t\n\t\t//See if every square has been marked, return still in progress if not\n\t\tfor(int i = 0; i < 3; ++i) {\n\t\t\tfor(int j = 0; j < 3; ++j) {\n\t\t\t\tif (board[i][j] == 0)\n\t\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Return tie\n\t\treturn 3;\n\t}",
"public int winningPlayerIndex(int[][] board, Move lastMove) {\n int m = board.length;\n int n = board[0].length;\n\n\n int player = lastMove.playerIndex;\n int curRow = lastMove.row;\n int curCol = lastMove.col;\n\n\n int start = Math.max(0, curCol - 3);\n for (int i = start; i + 3 < n; i++) {\n if (board[curRow][i] == player && board[curRow][i + 1] == player\n && board[curRow][i + 2] == player && board[curRow][i + 3] == player) {\n return player;\n }\n }\n\n int startRow = Math.max(0, curRow - 3);\n for (int i = start; i + 3 < m; i++) {\n if (board[i][curCol] == player && board[i + 1][curCol] == player\n && board[i + 2][curCol] == player && board[i + 3][curCol] == player) {\n return player;\n }\n }\n\n int count = 0;\n int x = curRow;\n int y = curCol;\n while (x >= 0 && y >= 0) {\n if (board[x][y] == player) {\n count++;\n x--;\n y--;\n if (count >= 4) {\n return player;\n }\n } else {\n break;\n }\n }\n\n x = curRow + 1;\n y = curCol + 1;\n while (x < m && y < n) {\n if (board[x][y] == player) {\n count++;\n x++;\n y++;\n if (count >= 4) {\n return player;\n }\n } else {\n break;\n }\n }\n\n int count1 = 0;\n int x1 = curRow;\n int y1 = curCol;\n while (x1 < m && y1 >= 0) {\n if (board[x1][y1] == player) {\n count1++;\n x1++;\n y1--;\n if (count1 >= 4) {\n return player;\n }\n } else {\n break;\n }\n }\n\n x1 = curRow - 1;\n y1 = curCol + 1;\n while (x1 >= 0 && y1 < n) {\n if (board[x1][y1] == player) {\n count1++;\n x1--;\n y1++;\n if (count1 >= 4) {\n return player;\n }\n } else {\n break;\n }\n }\n\n\n\n// //horizontal\n// for (int i = 0; i < m; i++) {\n// for (int j = 0; j + 3 < n; j++) {\n// if (board[i][j] == player && board[i][j + 1] == player && board[i][j + 2] == player && board[i][j + 3] == player) {\n// return player;\n// }\n// }\n// }\n\n// //vertical\n// for (int i = 0; i + 3 < m; i++) {\n// for (int j = 0; j < n; j++) {\n// if (board[i][j] == player && board[i + 1][j] == player && board[i + 2][j] == player && board[i + 3][j] == player) {\n// return player;\n// }\n// }\n// }\n\n// //diagonal from upper left to lower right\n// for (int i = 3; i < m; i++) {\n// for (int j = 3; j < n; j++) {\n// if (board[i][j] == player && board[i - 1][j - 1] == player && board[i - 2][j - 2] == player && board[i - 3][j - 3] == player) {\n// return player;\n// }\n// }\n// }\n\n// //diagnoal from lower left to upper right\n// for (int i = 3; i < m; i++) {\n// for (int j = 0; j + 3 < n; j++) {\n// if (board[i][j] == player && board[i - 1][j + 1] == player && board[i - 2][j + 2] == player && board[i - 3][j + 3] == player) {\n// return player;\n// }\n// }\n// }\n\n return -1;\n }",
"public boolean winner() {\r\n return winner;\r\n }",
"public int getWinner() {return winner();}",
"public Player checkWin ()\n {\n //checks rows\n for (int row = 0; row < 3; row++)\n if (getGridElement(row, 0).getPlayer() == getGridElement(row, 1).getPlayer() &&\n getGridElement(row, 1).getPlayer() == getGridElement(row, 2).getPlayer() &&\n getGridElement(row, 0).getPlayer() != Player.NONE)\n return getGridElement(row, 0).getPlayer();\n\n //checks columns\n for (int column = 0; column < 3; column++)\n if (getGridElement(0, column).getPlayer() == getGridElement(1, column).getPlayer() &&\n getGridElement(1, column).getPlayer() == getGridElement(2, column).getPlayer() &&\n getGridElement(0, column).getPlayer() != Player.NONE)\n return getGridElement(0, column).getPlayer();\n\n //checks diagonals\n if (getGridElement(0, 0).getPlayer() == getGridElement(1, 1).getPlayer() &&\n getGridElement(1, 1).getPlayer() == getGridElement(2, 2).getPlayer() &&\n getGridElement(0, 0).getPlayer() != Player.NONE)\n return getGridElement(0, 0).getPlayer();\n if (getGridElement(2, 0).getPlayer() == getGridElement(1, 1).getPlayer() &&\n getGridElement(1, 1).getPlayer() == getGridElement(0, 2).getPlayer() &&\n getGridElement(0, 0).getPlayer() != Player.NONE)\n return getGridElement(2, 0).getPlayer();\n\n return Player.NONE;\n }",
"public Player getWinner() {\n return winner;\n }",
"private boolean winner(int player) {\r\n\t\treturn (board[0][0] == player && board[0][1] == player && board[0][2] == player)\r\n\t\t\t\t|| (board[1][0] == player && board[1][1] == player && board[1][2] == player)\r\n\t\t\t\t|| (board[2][0] == player && board[2][1] == player && board[2][2] == player)\r\n\t\t\t\t|| (board[0][0] == player && board[1][0] == player && board[2][0] == player)\r\n\t\t\t\t|| (board[0][1] == player && board[1][1] == player && board[2][1] == player)\r\n\t\t\t\t|| (board[0][2] == player && board[1][2] == player && board[2][2] == player)\r\n\t\t\t\t|| (board[0][0] == player && board[1][1] == player && board[2][2] == player)\r\n\t\t\t\t|| (board[0][2] == player && board[1][1] == player && board[2][0] == player);\r\n\t}",
"public Player getWinner() {\n if (winner == null) {\n winner = winnerStrategy.winner(this);\n }\n return winner;\n }",
"public Optional<String> getWinner() {\n for (int win = 0; win < 8; win++) {\n String line = null;\n switch (win) {\n case 0:\n line = boardArray[0][0] + boardArray[0][1] + boardArray[0][2];\n break;\n case 1:\n line = boardArray[1][0] + boardArray[1][1] + boardArray[1][2];\n break;\n case 2:\n line = boardArray[2][0] + boardArray[2][1] + boardArray[2][2];\n break;\n case 3:\n line = boardArray[0][0] + boardArray[1][0] + boardArray[2][0];\n break;\n case 4:\n line = boardArray[0][1] + boardArray[1][1] + boardArray[2][1];\n break;\n case 5:\n line = boardArray[0][2] + boardArray[1][2] + boardArray[2][2];\n break;\n case 6:\n line = boardArray[0][0] + boardArray[1][1] + boardArray[2][2];\n break;\n case 7:\n line = boardArray[0][2] + boardArray[1][1] + boardArray[2][0];\n break;\n }\n if (line.equals(\"XXX\")) {\n return Optional.of(\"X\");\n } else if (line.equals(\"OOO\")) {\n return Optional.of(\"O\");\n }\n }\n return Optional.empty();\n }",
"@Override\n public Player getWinner(Player lastPlayer, Piece lastPiece, Move lastMove) {\n Player winner;\n\n // no winner within numMovesProtection moves\n if (this.numMoves <= this.configuration.getNumMovesProtection()) {\n return null;\n }\n\n // first way to win: a piece leaves the central square, the piece should not be an Archer\n if ((lastPiece instanceof Knight) && lastMove.getSource().equals(this.configuration.getCentralPlace())\n && !lastMove.getDestination().equals(this.configuration.getCentralPlace())) {\n winner = lastPlayer;\n } else {\n // second way to win: one player captures all the pieces of other players\n Player remainingPlayer = null;\n for (int i = 0; i < this.configuration.getSize(); i++) {\n for (int j = 0; j < this.configuration.getSize(); j++) {\n var piece = this.getPiece(i, j);\n if (piece == null) {\n continue;\n }\n if (remainingPlayer == null) {\n remainingPlayer = piece.getPlayer();\n } else if (remainingPlayer != piece.getPlayer()) {\n // there are still two players having pieces on board\n return null;\n }\n }\n }\n // if the previous for loop terminates, then there must be 1 player on board (it cannot be null).\n // then winner appears\n winner = remainingPlayer;\n }\n\n return winner;\n }",
"public boolean topPlayerWon() {\n return winner == 2;\n }",
"public Winner whoWon() {\n\t\tif (!isGameOver()) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// REPLACE NEXT LINE WITH YOUR IMPLEMENTATION\n\t\tint countBLACK = discBlackCount();\n\t\tint countWHITE = discWhiteCount();\n\t\t\n\t\tif (countWHITE == countBLACK) {\n\t\t\t\n\t\t\treturn Winner.TIE;\n\t\t\t\n\t\t} else if (countWHITE > countBLACK) {\n\t\t\t\n\t\t\tif (player1Disc == Disc.WHITE) {\n\t\t\t\t\n\t\t\t\treturn Winner.PLAYER1;\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\treturn Winner.PLAYER2;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\tif (player1Disc == Disc.BLACK) {\n\t\t\t\t\n\t\t\t\treturn Winner.PLAYER1;\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\treturn Winner.PLAYER2;\n\t\t\t\t\n\t\t\t}\n\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t}",
"public static Player getWinnerIfPresent(Game game) {\r\n\r\n Map<Player,Integer> scoreMap = new HashMap<>();\r\n\r\n for (Player player : game.getPlayers()) {\r\n int numFrames = player.getFrames().size();\r\n if (numFrames == 10\r\n && player.getFrames().get(numFrames -1).getWasScored()) {\r\n scoreMap.put(player,player.getFrames().get(numFrames -1).getScore());\r\n }\r\n\r\n }\r\n\r\n //set the winner\r\n Optional<Map.Entry<Player, Integer>> entry = scoreMap.entrySet().stream().max(Map.Entry.comparingByValue());\r\n if (entry.isPresent()) {\r\n entry.get().getKey().setWinner(true);\r\n game.setOver(true);\r\n return entry.get().getKey();\r\n }\r\n\r\n return null;\r\n }",
"Piece winner() {\r\n return _winner;\r\n }",
"public int checkForWin() \r\n {\r\n \twinner = null;\r\n \tint winrole = -1;\r\n \tif(isBoardFull()){\r\n \t\tint white = 0;\r\n \t\tint black = 0;\r\n\t\t\tfor(int i = 0; i < boardsize; ++i){\r\n\t\t\t\tfor(int j = 0; j<boardsize; ++j){\r\n\t\t\t\t\tif(board[i][j] == 0){\r\n\t\t\t\t\t\twhite++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(board[i][j] == 1){\r\n\t\t\t\t\t\tblack++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(white > black){\r\n\t\t\t\twinrole = 0;\r\n\t\t\t\twinner = agent[winrole];\r\n\t\t\t}\t\r\n\t\t\telse if(black > white){\r\n\t\t\t\twinrole = 1;\r\n\t\t\t\twinner = agent[winrole];\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\twinrole=2;\r\n\t\t\t}\r\n\t\t\treturn winrole;\r\n \t}\r\n \treturn -1;\r\n }",
"public void checkWinner(){\n \n if ((board[0][0] == 'X' && board[0][1] == 'X' && board[0][2] == 'X')||(board[1][0] == 'X' && board[1][1] == 'X' && board[1][2] == 'X')||(board[2][0] == 'X' && board[2][1] == 'X' && board[2][2] == 'X')){\n winner();\n }\n else if ((board[0][0] == 'X' && board[1][0] == 'X' && board[2][0] == 'X')||(board[0][1] == 'X' && board[1][1] == 'X' && board[2][1] == 'X')||(board[0][2] == 'X' && board[1][2] == 'X' && board[2][2] == 'X')){\n winner();\n }\n else if ((board[0][0] == 'X' && board[1][1] == 'X' && board[2][2] == 'X')||(board[0][2] == 'X' && board[1][1] == 'X' && board[2][0] == 'X')){\n winner();\n }\n else if ((board[0][0] == 'O' && board[0][1] == 'O' && board[0][2] == 'O')||(board[1][0] == 'O' && board[1][1] == 'O' && board[1][2] == 'O')||(board[2][0] == 'O' && board[2][1] == 'O' && board[2][2] == 'O')){\n winner();\n }\n else if ((board[0][0] == 'O' && board[1][0] == 'O' && board[2][0] == 'O')||(board[0][1] == 'O' && board[1][1] == 'O' && board[2][1] == 'O')||(board[0][2] == 'O' && board[1][2] == 'O' && board[2][2] == 'O')){\n winner();\n }\n else if ((board[0][0] == 'O' && board[1][1] == 'O' && board[2][2] == 'O')||(board[0][2] == 'O' && board[1][1] == 'O' && board[2][0] == 'O')){\n winner();\n }\n \n }",
"public int getComputerMove()\n {\n int move;\n\n // First see if there's a move O can make to win\n for (int i = 0; i < BOARD_SIZE; i++) {\n if (mBoard[i] != HUMAN_PLAYER && mBoard[i] != COMPUTER_PLAYER) {\n char curr = mBoard[i];\n mBoard[i] = COMPUTER_PLAYER;\n if (checkForWinner() == 3) {\n mBoard[i] = curr;\n return i;\n }\n else\n mBoard[i] = curr;\n }\n }\n\n // See if there's a move O can make to block X from winning\n for (int i = 0; i < BOARD_SIZE; i++) {\n if (mBoard[i] != HUMAN_PLAYER && mBoard[i] != COMPUTER_PLAYER) {\n char curr = mBoard[i]; // Save the current number\n mBoard[i] = HUMAN_PLAYER;\n if (checkForWinner() == 2) {\n //mBoard[i] = COMPUTER_PLAYER;\n mBoard[i] = curr;\n return i;\n }\n else\n mBoard[i] = curr;\n }\n }\n\n // Generate random move\n do\n {\n move = mRand.nextInt(BOARD_SIZE);\n } while (mBoard[move] == HUMAN_PLAYER || mBoard[move] == COMPUTER_PLAYER);\n\n return move;\n }",
"public char checkWinner() {\r\n // Vertical\r\n if (board[0][0] == board[0][1] && board[0][1] == board[0][2] && board[0][0] != '-') {\r\n return board[0][0];\r\n }\r\n else if (board[1][0] == board[1][1] && board[1][1] == board[1][2] && board[1][0] != '-') {\r\n return board[1][0];\r\n }\r\n else if (board[2][0] == board[2][1] && board[2][1] == board[2][2] && board[2][0] != '-') {\r\n return board[2][0];\r\n }\r\n // Horizontal\r\n else if (board[0][0] == board[1][0] && board[1][0] == board[2][0] && board[0][0] != '-') {\r\n return board[0][0];\r\n }\r\n else if (board[0][1] == board[1][1] && board[1][1] == board[2][1] && board[0][1] != '-') {\r\n return board[0][1];\r\n }\r\n else if (board[0][2] == board[1][2] && board[1][2] == board[2][2] && board[0][2] != '-') {\r\n return board[0][2];\r\n }\r\n // Diagonal\r\n else if (board[0][0] == board[1][1] && board[1][1] == board[2][2] && board[0][0] != '-') {\r\n return board[0][0];\r\n }\r\n else if (board[0][2] == board[1][1] && board[1][1] == board[2][0] && board[0][2] != '-') {\r\n return board[0][2];\r\n }\r\n // Tie\r\n else {\r\n for (int y = 0; y < 3; y++) {\r\n for (int x = 0; x < 3; x++) {\r\n if (board[x][y] == '-')\r\n return 'N';\r\n }\r\n }\r\n return 'T';\r\n }\r\n }",
"private static void winner()\n {\n if ((board[1] == userLetter && board[2] == userLetter && board[3] == userLetter) ||\n (board[4] == userLetter && board[5] == userLetter && board[6] == userLetter) ||\n (board[7] == userLetter && board[8] == userLetter && board[9] == userLetter) ||\n (board[1] == userLetter && board[5] == userLetter && board[9] == userLetter) ||\n (board[3] == userLetter && board[5] == userLetter && board[7] == userLetter))\n {\n showBoard();\n System.out.println(\"Player win the game\");\n System.exit(0);\n }\n }",
"public static boolean checkWinner(){\n \n if(board[0][0] == board[0][1] && board[0][1] == board[0][2] && (board[0][0] == 'x' || board [0][0] == 'o'))\n return true;\n else if(board[1][0] == board[1][1] && board[1][1] == board[1][2] && (board[1][0] == 'x' || board[1][0] == 'o'))\n return true;\n else if(board[2][0] == board[2][1] && board[2][1] == board[2][2] && (board[2][0] == 'x' || board[2][0] == 'o'))\n return true;\n else if(board[0][0] == board[1][0] && board[1][0] == board[2][0] && (board[0][0] == 'x' || board[0][0] == 'o'))\n return true;\n else if(board[0][1] == board[1][1] && board[1][1] == board[2][1] && (board[0][1] == 'x' || board[0][1] == 'o'))\n return true;\n else if(board[0][2] == board[1][2] && board[1][2] == board[2][2] && (board[0][2] == 'x' || board[0][2] == 'o'))\n return true;\n else if(board[0][0] == board[1][1] && board[1][1] == board[2][2] && (board[0][0] == 'x' || board[0][0] == 'o'))\n return true;\n else if(board[0][2] == board[1][1] && board[1][1] == board[2][0] && (board[0][2] == 'x' || board[0][2] == 'o'))\n return true;\n else\n return false;\n \n }",
"public SoccerTeam getWinner() {\n SoccerTeam winner = null;\n\n if (this.scoreOne > this.scoreTwo) {\n winner = this.teamOne;\n }\n else if (this.scoreOne < this.scoreTwo) {\n winner = this.teamTwo;\n }\n\n return winner;\n }",
"private int checkWinner() {\n if (this.turnCount >= 2) {\n int colWin = this.checkColumn();\n if (colWin > 0) {\n return colWin;\n }\n\n int rowWin = this.checkRow();\n if (rowWin > 0) {\n return rowWin;\n }\n\n int diagWin = checkDiagonal();\n if (diagWin > 0) {\n return diagWin;\n }\n }\n return 0;\n }",
"public String winner() {\r\n\t\tif(player1.isDone() || player2.isDone()) {\r\n\t\t\tint count1 = player1.winningsCount();\r\n\t\t\tint count2 = player2.winningsCount();\r\n\t\t\tif(count1 > count2) {\r\n\t\t\t\treturn \"Player 1 wins, \" + count1 + \" to \" + count2 + \"!\";\r\n\t\t\t}else if(count2 > count1) {\r\n\t\t\t\treturn \"Player 2 wins, \" + count2 + \" to \" + count1 + \"!\";\r\n\t\t\t}else {\r\n\t\t\t\treturn \"The Game ends in a tie!\";\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t}",
"public boolean winner(){\n\t\treturn goals1 > goals2;\n\t}",
"@Override\n public int getWinner()\n {\n return currentPlayer;\n }",
"public Player nextMove() {\n\t\treturn null;\n\t\t\n\t}",
"public Mark getWinner() {\n\t\t\n\t\tassert isGameOver();\n\t\t\n\t\tif (gameState() == 1) {\n\t\t\treturn Mark.X;\n\t\t}\n\t\tif (gameState() == 2) {\n\t\t\treturn Mark.O;\n\t\t}\n\t\tif (gameState() == 3) {\n\t\t\treturn null;\n\t\t}\n\t\treturn null;\n\t\t\n\t}",
"public Player<T> findWinner(){\n\tPlayer<T> highPlayer = this.currentPlayer;\n\tPlayer<T> tempPlayer = this.currentPlayer;\n\tfor (int i = 0; i < getNumPlayers(); i++) {\n\t\tif (tempPlayer.getPoints() > highPlayer.getPoints()) {\n\t\t\thighPlayer = getCurrentPlayer();\n\t\t}\n\t\ttempPlayer = tempPlayer.getNext();\n\t}\n\treturn tempPlayer;\n}",
"public Integer getWinner() {\n if (isWinner(PLAYER_X)) {\n return (int) PLAYER_X;\n } else if (isWinner(PLAYER_O)) {\n return (int) PLAYER_O;\n } else if (getFreeFields().isEmpty()) {\n return 0;\n } else {\n return null;\n }\n }",
"public final boolean checkForWin() {\r\n boolean result = false;\r\n String player = \"\";\r\n \r\n for (Rail rail : rails) {\r\n if (rail.isWinner()) {\r\n result = true;\r\n for(Tile tile : rail.getTiles()) {\r\n tile.setBackground(Color.GREEN);\r\n player = tile.getText();\r\n }\r\n if (player.equals(\"X\")) {\r\n winningPlayer = \"X\";\r\n this.xWins++;\r\n } else if (player.equals(\"0\")) {\r\n winningPlayer = \"0\";\r\n this.oWins++;\r\n }\r\n break;\r\n }\r\n }\r\n \r\n return result;\r\n }",
"public static Team whoWonGameTeam() {\r\n\t\tint highest = Main.winScoreNumb;\r\n\t\tTeam winner = null;\r\n\t\t\r\n\t\t//Winner is team one.\r\n\t\tif (Utils.stringToInt(Main.team1Score) >= highest) {\r\n\t\t\thighest = Utils.stringToInt(Main.team1Score);\r\n\t\t\twinner = Main.teamOne;\r\n\t\t}\r\n\t\t//Winner is team two.\r\n\t\tif (Utils.stringToInt(Main.team2Score) >= highest) {\r\n\t\t\thighest = Utils.stringToInt(Main.team2Score);\r\n\t\t\twinner = Main.teamTwo;\r\n\t\t}\r\n\t\t\r\n\t\treturn winner;\r\n\t}",
"public boolean checkForWinner(String player) {\r\n\t\t\r\n\t\t// check rows\r\n\t\tfor (int row = 0; row < board.length; row++) {\r\n\t\t\tint markCounter = 0;\r\n\t\t\tfor (int col = 0; col < board[row].length; col++) {\r\n\t\t\t\tif (board[row][col].getText().contains(player)) {\r\n\t\t\t\t\tmarkCounter++;\r\n\t\t\t\t}\r\n\t\t\t\telse if(! (board[row][col].getText().contains(player)) ) {\r\n\t\t\t\t\tmarkCounter = 0;\r\n\t\t\t\t}\r\n\t\t\t\tif (markCounter == connectX) {\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\t\r\n\t\t\r\n\t\t// check columns\r\n\t\tfor (int col = 0; col < 7; col++) {\r\n\t\t\tint markCounter = 0;\r\n\t\t\tfor (int row = board.length - 1; row >= 0; row--) {\r\n\t\t\t\tif(board[row][col].getText().contains(player)) {\r\n\t\t\t\t\tmarkCounter++;\r\n\t\t\t\t}\r\n\t\t\t\telse if(! (board[row][col].getText().contains(player)) ) {\r\n\t\t\t\t\tmarkCounter = 0;\r\n\t\t\t\t}\r\n\t\t\t\tif (markCounter == connectX) {\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\t\r\n\t\t/*\r\n\t\t * This algorithm checks the right side of the second diagonal on the board. The while loop iterates four times from bottom \r\n\t\t * to top, right to left. \r\n\t\t * The reason it only iterates four times is because after a certain point, it is impossible for a player to connect four\r\n\t\t * so the code does'nt have to check the corners.\r\n\t\t * \t\tO X X X O O O\r\n\t\t * \t\tO O X X X O O\r\n\t\t * \t\tO O O X X X O\r\n\t\t *\t\tO O O O X X X\r\n\t\t * \t\tO O O O O X X\r\n\t\t * \t\tO O O O O O X\r\n\t\t * \r\n\t\t */\r\n\t\tint diag2Count = 0;\r\n\t\tint row = board.length - 1;\r\n\t\tint col = 6;\r\n\t\tint iteration = 0;\r\n\t\tint rowPlace = row;\r\n\t\twhile (iteration < 4) {\r\n\t\t\trow = rowPlace;\r\n\t\t\tcol = 6;\r\n\t\t\twhile (row >= 0 && col >= 1) {\r\n\t\t\t\tif (board[row][col].getText().contains(currPlayer)) {\r\n\t\t\t\t\tdiag2Count++;\r\n\t\t\t\t}\r\n\t\t\t\tif (!(board[row][col].getText().contains(player))) {\r\n\t\t\t\t\tdiag2Count = 0; //If there is a chip which does not belong to a player in the sequence, the counter is reset.\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (diag2Count == connectX) {\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\trow--;\r\n\t\t\t\tcol--;\r\n\t\t\t}\r\n\t\t\titeration++;\r\n\t\t\trowPlace--;\r\n\t\t}\r\n\r\n\t\t/*\r\n\t\t * Checks the left hand side of the secondary diagonal. Iterates only 3 times.\r\n\t\t * of the board.\r\n\t\t * \t\t\tX O O O O O O\r\n\t\t * \t\t\tX X O O O O O\r\n\t\t * \t\t\tX X X O O O O\r\n\t\t * \t\t\tO X X X O O O\r\n\t\t * \t\t\tO O X X X O O\r\n\t\t * \t\t\tO O O X X X O\r\n\t\t */\r\n\t\trow = board.length - 1;\r\n\t\tcol = 3;\r\n\t\titeration = 0;\r\n\t\tint colPlace = col;\r\n\t\twhile (iteration < 4) {\r\n\t\t\tcol = colPlace;\r\n\t\t\trow = board.length -1;\r\n\t\t\twhile (row >= 0 && col >= 0) {\r\n\t\t\t\tif (board[row][col].getText().contains(currPlayer)) {\r\n\t\t\t\t\tdiag2Count++;\r\n\t\t\t\t}\r\n\t\t\t\tif (!(board[row][col].getText().contains(player))) {\r\n\t\t\t\t\tdiag2Count = 0; //If there is a chip which does not belong to a player in the sequence, the counter is reset.\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (diag2Count == connectX) {\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\trow--;\r\n\t\t\t\tcol--;\r\n\t\t\t}\r\n\t\t\titeration++;\r\n\t\t\tcolPlace++;\r\n\t\t}\r\n\t\t\r\n\t\t/*\r\n\t\t * Checks the left hand main Diagonals and iterates 3 times.\r\n\t\t * \t\t\tO O O X X X O\r\n\t\t * \t\t\tO O X X X O O\r\n\t\t * \t\t\tO X X X O O O \r\n\t\t * \t\t\tX X X O O O O\r\n\t\t * \t\t\tX X O O O O O\r\n\t\t * \t\t\tX O O O O O O\r\n\t\t * \r\n\t\t */\r\n\t\trow = 3;\r\n\t\tcol = 0;\r\n\t\trowPlace = row;\r\n\t\titeration = 0;\r\n\t\tint diagMainCounter = 0;\r\n\t\twhile (iteration < 3) {\r\n\t\t\trow = rowPlace;\r\n\t\t\tcol = 0;\r\n\t\t\twhile (row >= 0 && col <= 6) {\r\n\t\t\t\tif (board[row][col].getText().contains(currPlayer)) {\r\n\t\t\t\t\tdiagMainCounter++;\r\n\t\t\t\t}\r\n\t\t\t\tif (!(board[row][col].getText().contains(player))) {\r\n\t\t\t\t\tdiagMainCounter = 0; //If there is a chip which does not belong to a player in the sequence, the counter is reset.\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (diagMainCounter == connectX) {\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\trow--;\r\n\t\t\t\tcol++;\r\n\t\t\t}\r\n\t\t\titeration++;\r\n\t\t\trowPlace++;\r\n\t\t}\r\n\t\t\r\n\t\t/*\r\n\t\t * Checks the right hand side of the main diagonal and iterates 4 times.\r\n\t\t * \r\n\t\t *\t\t\tO O O O O O X\r\n\t\t *\t\t\tO O O O O X X\r\n\t\t *\t\t\tO O O O X X X\r\n\t\t *\t\t\tO O O X X X O\r\n\t\t *\t\t\tO O X X X O O\r\n\t\t *\t\t\tO X X X O O O\r\n\t\t */\r\n\t\trow = board.length -1;\r\n\t\tcol = 0;\r\n\t\tcolPlace = col;\r\n\t\titeration = 0;\r\n\t\tdiagMainCounter = 0;\r\n\t\twhile (iteration < 4) {\r\n\t\t\tcol = colPlace;\r\n\t\t\trow = board.length -1;\r\n\t\t\twhile (row >= 0 && col <= 6) {\r\n\t\t\t\tif (board[row][col].getText().contains(currPlayer)) {\r\n\t\t\t\t\tdiagMainCounter++;\r\n\t\t\t\t}\r\n\t\t\t\tif (!(board[row][col].getText().contains(player))) {\r\n\t\t\t\t\tdiagMainCounter = 0; //If there is a chip which does not belong to a player in the sequence, the counter is reset.\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (diagMainCounter == connectX) {\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\trow--;\r\n\t\t\t\tcol++;\r\n\t\t\t}\r\n\t\t\titeration++;\r\n\t\t\tcolPlace++;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"private MNKCell findOneMoveWin(final MNKGameState winState) {\n for (MNKCell c : board.getFreeCells()) {\n MNKGameState result = board.markCell(c.i, c.j);\n board.unmarkCell();\n if (result == winState) return c;\n }\n return null;\n }",
"public int whoWin(){\r\n int winner = -1;\r\n \r\n int highest = 0;\r\n \r\n for(Player player : discWorld.getPlayer_HASH().values()){\r\n if(getPlayerPoints(player) > highest){\r\n highest = getPlayerPoints(player);\r\n winner = player.getID();\r\n }\r\n \r\n }\r\n \r\n return winner;\r\n }",
"public boolean isWinner(int player) {\n\n\t\tint winnerCounter1 = 0;\n\t\tint winnerCounter2 = 0;\n\t\tint winnerCounter3 = 0;\n\t\tint delta = 0;\n\n//\t\t * grid [size][size] där size = 4;\n//\t\t * for (int x = 0; x < grid.length; x++)\n//\t\t * for (int y = 0; y < grid[x].length; y++)\n//\t\t * Här förklarar jag hur funkar de här två forloop:\n//\t\t * nummert efter siffran är indexet\n//\t\t * X0Y0 X1Y0 X2Y0 X3Y0\n//\t\t * X0Y1 X1Y1 X2Y1 X3Y1\n//\t\t * X0Y2 X1Y2 X2Y2 X3Y2\n//\t\t * X0Y3 X1Y3 X2Y3 X3Y3\n\n\t\tfor (int x = 0; x < getSize(); x++) {\n\t\t\tfor (int y = 0; y < getSize(); y++) {\n\t\t\t\tif (grid[y][x] == player)\n\t\t\t\t\twinnerCounter1++;\n\t\t\t\telse\n\t\t\t\t\twinnerCounter1 = 0;\n\t\t\t\tif (winnerCounter1 >= INROW) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tif (grid[x][y] == player)\n\t\t\t\t\twinnerCounter2++;\n\t\t\t\telse\n\t\t\t\t\twinnerCounter2 = 0;\n\t\t\t\tif (winnerCounter2 >= INROW) {\n\t\t\t\t\tSystem.out.println(\"2\");\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\twinnerCounter1 = 0;\n\t\t\twinnerCounter2 = 0;\n\t\t}\n\n\t\tfor (int x = 0; x < getSize(); x++) { // diagonally\n\t\t\tfor (int y = 0; y < getSize(); y++) {\n\t\t\t\twhile (x + delta < grid.length - 1 && y + delta < grid.length - 1) {\n\t\t\t\t\tif (grid[x + delta][y + delta] == player) {\n\t\t\t\t\t\twinnerCounter3++;\n\t\t\t\t\t\tdelta++;\n\t\t\t\t\t\tif (winnerCounter3 == INROW) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\twinnerCounter3 = 0;\n\t\t\t\t\t\tdelta++;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\twinnerCounter3 = 0;\n\t\t\t\tdelta = 0;\n\t\t\t\twhile (x - delta >= 0 && y + delta < grid.length - 1) {\n\t\t\t\t\tif (grid[x - delta][y + delta] == player) {\n\t\t\t\t\t\twinnerCounter3++;\n\t\t\t\t\t\tdelta++;\n\t\t\t\t\t\tif (winnerCounter3 == INROW) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\twinnerCounter3 = 0;\n\t\t\t\t\t\tdelta++;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\treturn false;\n\n\t}",
"public String getWinner() {\n\t\tif (this.getScore(this.player1Name) > this.getScore(this.player2Name)) {\n\t\t\treturn this.player1Name;\n\t\t} else if (this.getScore(this.player1Name) == this.getScore(this.player2Name)) {\n\t\t\treturn \"Tie\";\n\t\t}\n\t\treturn this.player2Name;\n\t}",
"private static Score4MoveType winnerDecission(int opponentPawns, int mePawns) {\n\t\tif (opponentPawns == mePawns && opponentPawns > 0) {\n\t\t\treturn Score4MoveType.DRAW;\n\t\t}\n\t\tif (opponentPawns > mePawns) {\n\t\t\treturn Score4MoveType.LOST;\n\t\t}\n\t\tif (opponentPawns < mePawns) {\n\t\t\treturn Score4MoveType.WON;\n\t\t}\n\t\treturn null;\n\t}",
"public static Player whoLostGame() {\r\n\t\tint lowest = Main.loseScoreNumb;\r\n\t\tPlayer loser = null;\r\n\t\t\r\n\t\t\r\n\t\t//Three handed play.\r\n\t\tif (Main.isThreeHanded){\r\n\t\t\tif (Utils.stringToInt(Main.player1Score) <= lowest) {\r\n\t\t\t\tlowest = Utils.stringToInt(Main.player1Score);\r\n\t\t\t\tloser = Main.playerOne;\r\n\t\t\t}\r\n\t\t\tif (Utils.stringToInt(Main.player2Score) <= lowest) {\r\n\t\t\t\tlowest = Utils.stringToInt(Main.player2Score);\r\n\t\t\t\tloser = Main.playerTwo;\r\n\t\t\t}\r\n\t\t\tif (Utils.stringToInt(Main.player3Score) <= lowest) {\r\n\t\t\t\tlowest = Utils.stringToInt(Main.player3Score);\r\n\t\t\t\tloser = Main.playerThree;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Four handed play with no teams.\r\n\t\tif (Main.isFourHandedSingle){\r\n\t\t\tif (Utils.stringToInt(Main.player1Score) <= lowest) {\r\n\t\t\t\tlowest = Utils.stringToInt(Main.player1Score);\r\n\t\t\t\tloser = Main.playerOne;\r\n\t\t\t}\r\n\t\t\tif (Utils.stringToInt(Main.player2Score) <= lowest) {\r\n\t\t\t\tlowest = Utils.stringToInt(Main.player2Score);\r\n\t\t\t\tloser = Main.playerTwo;\r\n\t\t\t}\r\n\t\t\tif (Utils.stringToInt(Main.player3Score) <= lowest) {\r\n\t\t\t\tlowest = Utils.stringToInt(Main.player3Score);\r\n\t\t\t\tloser = Main.playerThree;\r\n\t\t\t}\r\n\t\t\tif (Utils.stringToInt(Main.player4Score) <= lowest) {\r\n\t\t\t\tlowest = Utils.stringToInt(Main.player4Score);\r\n\t\t\t\tloser = Main.playerFour;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn loser;\r\n\t}",
"public void announceWinner() {\r\n Piece winer;\r\n if (_board.piecesContiguous(_board.turn().opposite())) {\r\n winer = _board.turn().opposite();\r\n } else {\r\n winer = _board.turn();\r\n }\r\n if (winer == WP) {\r\n _command.announce(\"White wins.\", \"Game Over\");\r\n System.out.println(\"White wins.\");\r\n } else {\r\n _command.announce(\"Black wins.\", \"Game Over\");\r\n System.out.println(\"Black wins.\");\r\n }\r\n }",
"public static Team getWinner() {\n\t\tif (matches != null && matches.length > 0 && matches[0] != null)\n\t\t\treturn matches[0].getWinner();\n\t\treturn null;\n\t}",
"public IChessPiece checkForAndCapture(Move move, IChessPiece[][] board) {\n IChessPiece tempPiece = board[move.newRow][move.newColumn];\n //if the player of the place to move to is opposite of the player of the moving piece\n if (!tempPiece.player().equals(board[move.oldRow][move.oldColumn].opponent())) {\n return tempPiece;\n }\n return null;\n }",
"Piece getWinner();",
"public Player isMatchWon(final String matchId) throws MatchNotFoundException {\r\n LOGGER.debug(\"--> isMatchWon: matchId=\" + matchId);\r\n Match match = getMatchById(matchId);\r\n Player player1 = match.getPlayer1();\r\n Player player2 = match.getPlayer2();\r\n int sunkBoatsP1 = countOfStatus(player1, FIELD_SUNK);\r\n int sunkBoatsP2 = countOfStatus(player2, FIELD_SUNK);\r\n if(sunkBoatsP1 == 30){\r\n return player2;\r\n }else if(sunkBoatsP2 == 30){\r\n return player1;\r\n } else {\r\n return null;\r\n }\r\n}",
"public long getWinner() {\n long winner = member_1_id;\n if (getMember2Score() > getMember1Score()) {\n winner = member_2_id;\n }\n return winner;\n }",
"boolean isWinner() {\n boolean win = true;\n // first method to win\n for (int i = 0; i < 9; i++) {\n for (int j = 0; j < 9; j++) {\n if ((state[i][j] == 'X' && stateGame[i][j] != '*') || (state[i][j] != 'X' && stateGame[i][j] == '*'))\n win = false;\n }\n }\n if (win)\n return true;\n\n win = true;\n // second method to win\n for (int i = 0; i < 9; i++) {\n for (int j = 0; j < 9; j++) {\n if (state[i][j] == '.' && stateGame[i][j] == '.')\n win = false;\n }\n }\n return win;\n }",
"public String winner() {\n\t\tif (numFire == 0 && numWater != 0) {\n\t\t\treturn \"Water\";\n\t\t} else if (numWater == 0 && numFire != 0) {\n\t\t\treturn \"Fire\";\n\t\t} else if (numWater == 00 && numFire == 0) {\n\t\t\treturn \"No one\";\n\t\t}\n\t\treturn null;\n\t}",
"private TeamId findWinningTeam(){\n if (state.score().totalPoints(TeamId.TEAM_1)>=Jass.WINNING_POINTS) {\n return TeamId.TEAM_1;\n }\n else {\n return TeamId.TEAM_2;\n }\n }",
"private static void winnerOrTie()\n\t{\n\t\t//Check each row for winning or tie condition.\n\t\tif(tictactoeBoard[0] == tictactoeBoard[1] && tictactoeBoard[1] == tictactoeBoard[2] && tictactoeBoard[0] != 1)\n\t\t{\n\t\t\tSystem.out.println(\"Winner\");\n\t\t}\n\t\tif(tictactoeBoard[3] == tictactoeBoard[4] && tictactoeBoard[4] == tictactoeBoard[5] && tictactoeBoard[3] != 4)\n\t\t{\n\t\t\tSystem.out.println(\"Winner\");\n\t\t}\n\t\tif(tictactoeBoard[6] == tictactoeBoard[7] && tictactoeBoard[7] == tictactoeBoard[8] && tictactoeBoard[6] != 7)\n\t\t{\n\t\t\tSystem.out.println(\"Winner\");\n\t\t}\n\t\t//Check diagonally for winning or tie condition.\n\t\tif(tictactoeBoard[0] == tictactoeBoard[4] && tictactoeBoard[4] == tictactoeBoard[8] && tictactoeBoard[0] != 1)\n\t\t{\n\t\t\tSystem.out.println(\"Winner\");\n\t\t}\n\t\tif(tictactoeBoard[6] == tictactoeBoard[4] && tictactoeBoard[4] == tictactoeBoard[2] && tictactoeBoard[6] != 7)\n\t\t{\n\t\t\tSystem.out.println(\"Winner\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//nobody has won yet.\n\t\t\t//changeTurn();\n\t\t}\n\t}",
"public String getWinner(){\n\tif (p1.getPoints()==p2.getPoints()){\n\t return \"Tie. Good food, bad outcome.\";\n\t}\n\treturn (p1.getPoints()>p2.getPoints()?\"Player Row\":\"Player Column\")+\" is the winner!\";\n }",
"public int getResult() {\n whiteTotal = 0;\n blackTotal = 0;\n rest = 0;\n for (int row = 0; row < BOARD_SIZE; row++) {\n for (int column = 0; column < BOARD_SIZE; column++) {\n if (board[row][column] == BLACK) {\n blackTotal++;\n } else if (board[row][column] == WHITE) {\n whiteTotal++;\n } else {\n rest++;\n }\n }\n }\n int winner = -1;\n if (rest == 0) {\n if (blackTotal < whiteTotal) {\n winner = 1;\n } else if (blackTotal > whiteTotal) {\n winner = 2;\n } else {\n winner = 0;\n }\n }\n\n if (blackTotal == 0 || whiteTotal == 0) {\n\n if (blackTotal != 0) {\n winner = 2;\n } else if (whiteTotal != 0) {\n winner = 1;\n }\n }\n\n if (getValidateMoveList('W', 'B').isEmpty() && getValidateMoveList('B', 'W').isEmpty()) {\n\n if (blackTotal < whiteTotal) {\n winner = 1;\n } else if (blackTotal > whiteTotal) {\n winner = 2;\n } else {\n winner = 0;\n }\n }\n return winner;\n }",
"private String getWinner() {\n\t\treturn winner;\n\t}",
"boolean isWinner(GameState state, String username) throws GameStateException;",
"public boolean isWinner() {\n\t\treturn winner;\n\t}",
"public String winner() {\n if (isGameOver()) {\n return poolFront.name;\n } else {\n return null;\n }\n }",
"@Override\n\tpublic boolean checkWinner( int player) {\n\t\t\n\t\treturn didWin(player, -1, 0) ||\n\t\t\t\tdidWin(player, 0, -1) ||\n didWin(player, -1, -1) ||\n didWin(player, 1, -1);\n\t}",
"public boolean winner() {\n String result = winType();\n if (result == null || result.equals(\"\"))\n return false;\n if (result.equals(\"horizontal\") || result.equals(\"vertical\") || result.equals(\"diagonal\") || result.equals(\"diagonal2\"))\n return true;\n return false;\n }",
"public String whoWon()\n { \n String win=\"\";\n if (player1Hand.isEmpty())\n {\n win=(\"player 2 wins!\");\n }\n \n if(player2Hand.isEmpty())\n {\n win=(\"player 1 wins\");\n } \n \n return win;\n }",
"@Override\n public int getWinner() {\n return this.board.getWinner();\n }",
"@Override\n public int getWinner() {\n /*\n * To please the test as well as the game\n * Temporarily change the turn colour\n */\n int temp;\n if (whoseTurn() == RED) {\n temp = YELLOW;\n } else {\n temp = RED;\n }\n\n //test horizontally\n //set x to 1 as the placed counter will always be correct\n int x = 1;\n int i = 1;\n //to check if zero has been found\n boolean leftZeroFound = false;\n boolean rightZeroFound = false;\n while (!rightZeroFound || !leftZeroFound) {\n //check to right of last placed\n if (!rightZeroFound && inBounds(0, i)\n && board[lastPlacedRow][lastPlacedCol + i] == temp) {\n x++;\n } else {\n rightZeroFound = true;\n }\n\n //check to left of last placed\n if (!leftZeroFound && inBounds(0, -i)\n && board[lastPlacedRow][lastPlacedCol - i] == temp) {\n x++;\n } else {\n leftZeroFound = true;\n }\n\n i++;\n }\n //return the winning colour if a row has been found\n if (x >= NUM_IN_A_ROW_TO_WIN) {\n return temp;\n }\n\n //check vertically\n //reset x to 1 as the placed counter will always be correct\n x = 1;\n i = 1;\n //to check if zero has been found\n boolean zeroFound = false;\n while (!zeroFound) {\n //check below last placed\n if (inBounds(-i, 0) && board[lastPlacedRow - i][lastPlacedCol] == temp) {\n x++;\n } else {\n zeroFound = true;\n }\n\n i++;\n }\n //return the winning colour if a row has been found\n if (x >= NUM_IN_A_ROW_TO_WIN) {\n return temp;\n }\n\n //check top right diagonal\n //reset x to 1 as the placed counter will always be correct\n x = 1;\n i = 1;\n //to check if zero has been found\n leftZeroFound = false;\n rightZeroFound = false;\n while (!rightZeroFound || !leftZeroFound) {\n //check top right diagonal\n if (!rightZeroFound && inBounds(i, i)\n && board[lastPlacedRow + i][lastPlacedCol + i] == temp) {\n x++;\n } else {\n rightZeroFound = true;\n }\n\n //check bottom left\n if (!leftZeroFound && inBounds(-i, -i)\n && board[lastPlacedRow - i][lastPlacedCol - i] == temp) {\n x++;\n } else {\n leftZeroFound = true;\n }\n\n i++;\n }\n if (x >= NUM_IN_A_ROW_TO_WIN) {\n return temp;\n }\n\n //check top left\n //set x to 1 as the placed counter will always be correct\n x = 1;\n i = 1;\n //to check if zero has been found\n leftZeroFound = false;\n rightZeroFound = false;\n while (!rightZeroFound || !leftZeroFound) {\n //check top left\n if (!leftZeroFound && inBounds(i, -i)\n && board[lastPlacedRow + i][lastPlacedCol - i] == temp) {\n x++;\n } else {\n leftZeroFound = true;\n }\n\n //check bottom right\n if (!rightZeroFound && inBounds(-i, i)\n && board[lastPlacedRow - i][lastPlacedCol + i] == temp) {\n x++;\n } else {\n rightZeroFound = true;\n }\n\n i++;\n }\n //return the winning colour if a row has been found\n if (x >= NUM_IN_A_ROW_TO_WIN) {\n return temp;\n }\n\n //return Empty if a winner has not been found\n return EMPTY;\n }",
"public static String winner() {\n\t\t// Behavior if the Player 1 won the most games.\n\t\tif (score1 > score2) {\n\t\t\treturn (player1 + \" is the winner! Congratulations \" + player1 + \" !\");\n\t\t}\n\t\t// Behavior if both players won the same number of games.\n\t\tif (score1 == score2) {\n\t\t\treturn (\"It's a tie! Both players won the same number of games. Congratulations \" + player1 + \" & \" + player2 + \" !\");\n\t\t}\n\t\t// Behavior if the Player 1 won the most games.\n\t\telse {\n\t\t\treturn (player2 + \" is the winner! Congratulations \" + player2 + \" !\");\n\t\t}\n\t}",
"public char getWinner() {\n\t\treturn winner;\n\t}",
"public Player roundWinner() {\n\t\tfor(Player player : gamePlayers){\n\t\t\tEvaluator eval = new Evaluator(player, communityCards);\n\t\t\t\n\t\t\tplayer.setHandRank(eval.evaluate());\n\t\t\tplayersByHandRank.add(player);\n\t\t}\n\t\t\n\t\t//lambdas are magic. Sorts players from lowest to highest rank starting with the lowest at the first\n\t\t//index, and the highest at the last.\n\t\tCollections.sort(playersByHandRank, (p1, p2) -> p1.getHandRank().compareTo(p2.getHandRank()));\n\t\t\n\t\t//TODO: Needs to evaluate high card in case of two or more players have the same high hand rank.\n\t\t//the evaluate method in Evaluator sets high card == to the highest card in a pairSet, flush, or straight,\n\t\t//but needs to be able to add it in the event HIGH_CARD is the highest hand a player has.\n\n\t\treturn playersByHandRank.get(playersByHandRank.size() -1);\n\t}",
"private boolean playerWin(Board board)\n {\n return check(board, PLAYER);\n }",
"Move getBestMove() {\n //System.out.println(\"AI chooses: \" + m.toString());\n return moves.get((int) (Math.random() * moves.size()));\n }",
"public String getWinner() {\n\t\treturn winner;\n\t}",
"public String getWinner() {\n return winner;\n }",
"public String computerMove() {\n\t\t// Look to win in a row\n\t\tfor (int r = 0; r < 3; r++) {\n\t\t\tif (rowSum[r] == -2) {\n\t\t\t\t// Find the empty space\n\t\t\t\tfor (int c = 0; c < 3; c++) {\n\t\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\t\treturn done(r, c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Look to win in a col\n\t\tfor (int c = 0; c < 3; c++) {\n\t\t\tif (colSum[c] == -2) {\n\t\t\t\t// Find the empty space\n\t\t\t\tfor (int r = 0; r < 3; r++) {\n\t\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\t\treturn done(r, c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Look to win a diag\n\t\tfor (int d = 0; d < 2; d++) {\n\t\t\tif (diagSum[d] == -2) {\n\t\t\t\t// Find the empty space\n\t\t\t\tfor (int r = 0; r < 3; r++) {\n\t\t\t\t\tint c = d == 0 ? r : 2 - r;\n\t\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\t\treturn done(r, c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Look to block a row\n\t\tfor (int r = 0; r < 3; r++) {\n\t\t\tif (rowSum[r] == 2) {\n\t\t\t\t// Find the empty space\n\t\t\t\tfor (int c = 0; c < 3; c++) {\n\t\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\t\treturn done(r, c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Look to block a col\n\t\tfor (int c = 0; c < 3; c++) {\n\t\t\tif (colSum[c] == 2) {\n\t\t\t\t// Find the empty space\n\t\t\t\tfor (int r = 0; r < 3; r++) {\n\t\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\t\treturn done(r, c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Look to block a diag\n\t\tfor (int d = 0; d < 2; d++) {\n\t\t\tif (diagSum[d] == 2) {\n\t\t\t\t// Find the empty space\n\t\t\t\tfor (int r = 0; r < 3; r++) {\n\t\t\t\t\tint c = d == 0 ? r : 2 - r;\n\t\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\t\treturn done(r, c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Find the non-full row and col w/ least val\n\t\tint bestR = -1;\n\t\tint bestC = -1;\n\t\tint minSum = 10;\n\t\tfor (int r = 0; r < 3; r++) {\n\t\t\tfor (int c = 0; c < 3; c++) {\n\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\tint sum = rowSum[r] + colSum[c];\n\t\t\t\t\tif (sum < minSum) {\n\t\t\t\t\t\tminSum = sum;\n\t\t\t\t\t\tbestR = r;\n\t\t\t\t\t\tbestC = c;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn done(bestR, bestC);\n\t}",
"@Test\n public void testRandomPlayerWinner()\n {\n player2.placeChecker(0, 0);\n player1.placeChecker(1, 0);\n player2.placeChecker(2,0);\n player1.placeChecker(2,1);\n player2.placeChecker(2,2);\n player1.placeChecker(1,2);\n player2.placeChecker(0,2);\n player1.placeChecker(0,1);\n player2.placeChecker(1,1);\n \n // Generate a Random Move\n Move randomMove = player1.generateRandomMove();\n \n // There are no Available Moves\n assertNull(randomMove);\n \n assertTrue(game.isWinner(player1));\n }",
"public int getWinner() {\n return winner;\n }"
]
| [
"0.79929596",
"0.78232384",
"0.7727885",
"0.760407",
"0.75417024",
"0.7499759",
"0.7475678",
"0.7418142",
"0.7405978",
"0.73937535",
"0.72592914",
"0.7213445",
"0.7205172",
"0.7136351",
"0.71254015",
"0.7113446",
"0.7092484",
"0.70903045",
"0.70782757",
"0.7073469",
"0.7067301",
"0.7062808",
"0.7036857",
"0.7007159",
"0.69963074",
"0.69956523",
"0.69919795",
"0.69913566",
"0.69818056",
"0.69691247",
"0.6968574",
"0.6967772",
"0.6963124",
"0.6961173",
"0.6960767",
"0.6953477",
"0.6953353",
"0.6940032",
"0.6917265",
"0.6904875",
"0.68978333",
"0.68973285",
"0.688088",
"0.68806076",
"0.68788755",
"0.68520314",
"0.68486094",
"0.6846278",
"0.6830537",
"0.6811342",
"0.68108916",
"0.6803324",
"0.6788871",
"0.67754734",
"0.6751318",
"0.6746999",
"0.67406744",
"0.6731726",
"0.6726498",
"0.6687493",
"0.66768605",
"0.6669634",
"0.6642037",
"0.66367537",
"0.66345096",
"0.6621676",
"0.6615137",
"0.6610833",
"0.6597868",
"0.6596117",
"0.6582258",
"0.6575429",
"0.65742344",
"0.65507895",
"0.65468657",
"0.6546033",
"0.6537587",
"0.6536392",
"0.6533973",
"0.6529796",
"0.6524002",
"0.65119004",
"0.6487839",
"0.6485325",
"0.6479353",
"0.64791584",
"0.6478388",
"0.6461479",
"0.6456893",
"0.6444015",
"0.6442424",
"0.6439747",
"0.64343226",
"0.6431041",
"0.6422089",
"0.6421718",
"0.64094913",
"0.6408342",
"0.6402694",
"0.64015865"
]
| 0.75212234 | 5 |
This function changes the turn variable which then later on used to get the player who is going to play the move | public void changeTurn(){
// this function is used to calculate the turn of a player after every move is played
int turn = this.turn;
turn++;
this.turn = turn%GameConfiguration.NUMBER_OF_PLAYERS;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void changeTurn()\r\n {\r\n isPlayersTurn = !isPlayersTurn;\r\n }",
"private void changeTurn(){ \r\n\t\tif (currentTurn == 1)\r\n\t\t\tcurrentTurn = 0; \r\n\t\telse\r\n\t\t\tcurrentTurn = 1; \r\n\t}",
"public void changePlayerTurn()\n {\n if (player_turn == RED)\n player_turn = BLACK;\n else\n player_turn = RED;\n }",
"@Override\n public int turn() {\n return moveOnTurn;\n }",
"void setTurn(int turn);",
"@Override\n\tpublic void changeTurn() {\n\t\tcomputerCall();\n\t\tplayerTurn = 1;\n\t}",
"@Override\n\tpublic void changeTurn() {\n\t\t\n\t}",
"private void setTurn() {\n if (turn == black) {\n turn = white;\n } else {\n turn = black;\n }\n }",
"private void changeTurn() {\n if (turn == RED) {\n turn = YELLOW;\n } else {\n turn = RED;\n }\n }",
"public void setCurrentTurn(Player player) {\r\n\t\tthis.currentTurn = player;\r\n\t}",
"public void changeTurn() {\n\t\t\n\t\tif(currentTurn == white) {\n\t\t\t\n\t\t\tcurrentTurn = black;\n\t\t}\n\t\telse if(currentTurn == black){\n\t\t\t\n\t\t\tcurrentTurn = white;\n\t\t}\n\t}",
"public static void switchPlayers(){\n\t\tif(turn.equals(\"white\")){\n\t\t\tturn = \"black\";\n\t\t}\n\t\telse{\n\t\t\tturn = \"white\";\n\t\t}\n\t}",
"public void setTurn(int turn) {\n this.turn = turn; \n }",
"public void setTurn(int turn){\n this.turn = turn;\n }",
"public void switchPlayer() {\n \tisWhitesTurn = !isWhitesTurn;\n }",
"public void changeTurn(){\r\n model.setCheckPiece(null);\r\n model.swapPlayers();\r\n }",
"public void changeTurn(int newTurn) {\r\n turnChoice = newTurn;\r\n }",
"private void HandleOnChangeTurn(Board board, Piece turn){\n\t\tthis.turn = turn;\n\t\tif(multiview())decidesActivateBoard(turn);\n\t\tdecideMakeAutomaticMove();\n\t\tif(playerModes.get(turn)==PlayerMode.RANDOM)Utils.sleep(300);\n\t}",
"public static void NextTurn() {\n if (num_of_players == turn)\n turn=0;\n turn++;\n }",
"public void nextTurn() {\n visionChanged = true;\n SoundPlayer.playEndTurn();\n // Check if any protection objectives have failed\n gameState.updateAllHeroProtectionGoals(getHeroManager());\n // hook the next turn\n if (!multiplayerGameManager.hookNextTurn()) {\n\n if (map.enemyPerformingMove()) {\n return;\n }\n // Enemy action was made\n if (playerTurn && map.hasEnemy()) {\n try {\n map.enemyTurn(this);\n } catch (InterruptedException e) {\n logger.error(\"ayylmao at the GameManager.nextTurn(..) Method\");\n Platform.exit();\n Thread.currentThread().interrupt();\n }\n } else {\n map.playerTurn(this);\n updateBuffIcons();\n updateTempVisiblePoints();\n map.turnTick();\n for(CurrentHeroChangeListener listener:heroChangeListeners){\n \tlistener.onHeroChange(getHeroManager().getCurrentHero());\n }\n }\n\n } else {\n moveViewTo(getHeroManager().getCurrentHero().getX(), getHeroManager().getCurrentHero().getY());\n updateBuffIcons();\n updateTempVisiblePoints();\n }\n\n map.updateVisibilityArray();\n dayNightClock.tick();\n turnTickLiveTiles();\n abilitySelected = AbilitySelected.MOVE;\n abilitySelectedChanged = true;\n backgroundChanged = true;\n gameChanged = true;\n minimapChanged = true;\n saveOriginator.writeMap(this.map, this.getObjectives(), this.gameState);\n // update(this.tracker,null);\n }",
"public void setTurn(int a_turn)\n {\n if(a_turn > m_numPlayers)\n {\n m_turn = 1;\n }\n else\n {\n m_turn = a_turn;\n }\n }",
"void setPlayerTurn() throws RemoteException;",
"public void switchTurn(Player player) {\n\t\t// debugMove(player.color, board);\n\n\t\t// If one player can't make a move, switch who's turn it is...\n\t\tif (noWinnerCount == 1) {\n\t\t\t// This player can't make a move so set it's turn to false\n\t\t\tplayer.setTurn(true);\n\n\t\t\t// Now set the other player's turn to true\n\t\t\tif (player.color == player1.color) {\n\t\t\t\tplayer2.setTurn(false);\n\t\t\t} else {\n\t\t\t\tplayer1.setTurn(false);\n\t\t\t}\n\t\t} else if (noWinnerCount == 3) {\n\t\t\t// If both players can't move, end the game\n\t\t\tif (player2.getScore() > player1.getScore()) {\n\t\t\t\tSystem.out.println(\"Black wins!\");\n\t\t\t} else if (player2.getScore() < player1.getScore()) {\n\t\t\t\tSystem.out.println(\"White wins!\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Draw!\");\n\t\t\t}\n\t\t} else {\n\t\t\t// Switch turns\n\t\t\tif (player1.hasTurn()) {\n\t\t\t\tplayer1.setTurn(false);\n\t\t\t\tplayer2.setTurn(true);\n\t\t\t} else {\n\t\t\t\tplayer1.setTurn(true);\n\t\t\t\tplayer2.setTurn(false);\n\t\t\t}\n\t\t}\n\t}",
"private void doGameTurn()\n\t{\n\t\tif (!lost && !won)\n\t\t{\n\t\t\trefreshMapAndFrame();\n\t\t\t\n\t\t\tcheckPlayerCondition();\n\t\t\tElementAccess.openExit();\n\t\t\tSystem.out.println(turn);\n\t\t}\n\t\telse if (lost)\n\t\t{\n\t\t\tSound.lost();\n\t\t\trefreshMapAndFrame();\n\n\t\t\tif (playerHasLost())\n\t\t\t{\n\t\t\t\tstop = true;\n\t\t\t}\n\n\t\t\tMapInstance.getInstance().levelRestart();\n\t\t\tlost = false;\n\t\t}\n\t\telse if (won)\n\t\t{\n\t\t\tSound.won();\n\t\t\trefreshMapAndFrame();\n\n\t\t\twon = false;\n\t\t\tif (playerNotInLevel())\n\t\t\t{\n\t\t\t\tstop = true;\n\t\t\t}\n\n\t\t\tnextLevel();\n\t\t\tMapInstance.getInstance().levelRestart();\n\t\t}\n\t}",
"private void setPlayerTurn(int turn, Controller controller){\n this.activePlayer = controller.getMainGameModel().getPlayerList().get(turn);\n }",
"public void setNextTurn() {\n\t\t// COMPLETE THIS METHOD\n\t\tif (turn == 1) {\n\t\t\t\n\t\t\tturn = 2;\n\t\t\tcurrentDisc = getPlayer2Disc();\n\t\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\tturn = 1;\n\t\t\tcurrentDisc = getPlayer1Disc();\n\t\t\t\n\t\t}\n\t}",
"public void turn()\n {\n turn(90);\n }",
"public void turn(){ \r\n\t\tif (currentTurn == 0){ \r\n\t\t\tSystem.out.println(\"Computer's Turn\");\r\n\t\t\tnextRowWin();\r\n\t\t\tnextColWin(); \r\n\t\t\tnextDiagWin();\r\n\t\t\t//check if next move is row win\r\n\t\t\tif (!Arrays.equals(rowWin, checkWin)){\r\n\t\t\t\tcounter(rowWin); \r\n\t\t\t}\r\n\t\t\t//check if next move is column win \r\n\t\t\telse if (!Arrays.equals (colWin, checkWin)) {\r\n\t\t\t\tcounter(colWin); \r\n\t\t\t}\r\n\t\t\t//check if next move is diagonal win\r\n\t\t\telse if (!Arrays.equals(diagWin, checkWin)){\r\n\t\t\t\tcounter(diagWin);\r\n\t\t\t}\r\n\t\t\t//computer moves based on priority positions\r\n\t\t\telse\r\n\t\t\t\tcompMove(); \r\n\t\t\tchangeTurn(); \r\n\t\t}\r\n\t\telse { \r\n\t\t\tSystem.out.println(\"Player's Turn\");\r\n\t\t\tint nextCol, nextRow; \r\n\t\t\tScanner in = new Scanner (System.in); \r\n\t\t\tSystem.out.print (\"Please enter row and column to place your piece [Enter as col row]: \");\r\n\t\t\tif (in.hasNext()) { \r\n\t\t\t\tnextCol = in.nextInt(); \r\n\t\t\t\tnextRow = in.nextInt(); \r\n\t\t\t\tif (nextCol == 3 || nextRow == 3)\r\n\t\t\t\t\tSystem.out.println(\"Input of of range. col and row must be between 0-2.\");\r\n\t\t\t\telse if (board[nextCol][nextRow] == '-') {\r\n\t\t\t\t\tboard[nextCol][nextRow] = 'X'; \r\n\t\t\t\t\tchangeTurn(); \r\n\t\t\t\t}\r\n\t\t\t\telse { \r\n\t\t\t\t\tSystem.out.println(\"Invalid Input. There is already a piece in that location.\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse { \r\n\t\t\t\tSystem.out.println(\"Invalid Input. Please input integers for col row.\");\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void changeTurn() {\n if (turn == 1) {\n turn = 2;\n\n } else {\n turn = 1;\n\n }\n setTextBackground();\n }",
"public Player whosTurn() {\n return turn;\n }",
"public void changeTurn(){\n\t\tif (this.turn ==\"blue\")\n\t\t{\n\t\t\tthis.turn = \"red\";\n\t\t\t\n\t\t}else{\n\t\t\tthis.turn =\"blue\";\n\t\t}\n\t}",
"public void nextTurn() {\r\n activePlayer = nextPlayer;\r\n advanceNextPlayer();\r\n }",
"public void changeTurnOfPlayer(PlayerState player)\n {\n if(player.getColorOfPlayer() == Color.BLACK)\n {\n this.turnOfPlayer = playerWhite;\n }\n else\n {\n this.turnOfPlayer = playerBlack;\n }\n }",
"void onTurn(GameIO io, GameState move);",
"void turnStarted(int playerIndex);",
"private void humanTurn() \n {\n \n playTurn();\n }",
"public int changeTurn(int currentTurn)\n {\n if (currentTurn + 1 >= players.size())\n {\n\n currentTurn = 0;\n }\n\n // It's the next player's turn, add one more to whoseTurn\n else\n {\n currentTurn++;\n }\n\n return currentTurn;\n }",
"public void setPlayerTurn(boolean playerTurn) {\n this.playerTurn = playerTurn;\n }",
"@Override\r\n\tint[] move( int turnNo ) {\n\t\treturn getUserMove();\r\n\t}",
"public void turn(Player player,String move) {\n String[] art = move.split(\" \");\n int x=Integer.parseInt(art[1]);\n int y=Integer.parseInt(art[2]);\n board.mark(player.getMark(),x-1,y-1);\n board.checkFinishCondition();\n if(board.isFinished()){\n finished = true;\n winner = order;\n }\n int aux = (order + 1) % 2;\n order = aux;\n }",
"public void switchTurns()\n\t{\n\t\tif(current.equals(playerA))\n\t\t\tcurrent = playerB;\n\t\telse\n\t\t\tcurrent = playerA;\n\t}",
"private void myTurn()\n\t{\n\t\t\n\t\tif (canPlay())\n\t\t{\n\t\t\tif (isTop())\n\t\t\t{\n\t\t\t\traise();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tequal();\n\t\t\t}\n\t\t}\n\t\ttable.nextPlayer();\n\t\t\n\t}",
"public static void changePlayer() {\n\t\tvariableReset();\n\t\tif (curPlayer == 1)\n\t\t\tcurPlayer = player2;\n\t\telse\n\t\t\tcurPlayer = player1;\n\t}",
"private int getTurn() {\n\t\treturn turn;\n\t}",
"public void extraTurn() {\r\n\t\textraTurn = true;\r\n\t}",
"void turn(int move, int piece, int player) {\n //checks if the player is a computer. If it is it gets a move from the computer\n //otherwise it inputs the move from the argument\n if (!players[player].getName().equals(\"Computer\" + Integer.toString(piece))) {\n doMove(move, piece);\n } else {\n move = compPlayer.getMove(currentBoard, players[player].getWins(), piece);\n doMove(move, piece);\n }\n //checks if there is a winner. If there is it runs endGame\n if (Checker.checker(currentBoard, piece) == piece) {\n endGame(players[player].getName(), player);\n return;\n\n } //checks if there is a tie. If there is it runs end game\n else if (Checker.tieChecker(currentBoard)) {\n endGame(\"It's a Tie!\", player);\n return;\n }\n\n //ensures that the computer will always go next\n if (players[(player + 1) % 2].getName().equals(\"Computer\" + Integer.toString((piece % 2) + 1))) {\n game(0);\n }\n\n }",
"public void nextTurn(){\r\n removeIceAndFire();\r\n currentTurn++;\r\n }",
"private void switchPlayer() {\n Player player;\n playerManager.switchPlayer();\n\n if(playerManager.getCurrentPlayer() == 1)\n player = playerManager.getPlayer(1);\n else if(playerManager.getCurrentPlayer() == 2)\n player = playerManager.getPlayer(2);\n else\n player = new Player(\"No Player exists\");\n\n updateLiveComment(\"Turn : \" + player.getName());\n }",
"public int nextTurn(int turn) {\n\t\tif(turn == 1) {\n\t\t\tturn = 2;\n\t\t\tSystem.out.println(\"It's White's turn\");\n\t\t} else if(turn == 2){\n\t\t\tturn = 1;\n\t\t\tSystem.out.println(\"It's Black's turn\");\n\t\t}\n\t\t\n\t\treturn turn;\n\t}",
"int getTurn();",
"public void setTurn(Boolean turn) {\n this.turn = turn;\n }",
"public void incrTurn(){\n this.turn++;\n }",
"protected abstract void takeTurn(int player);",
"int getCurrentTurn();",
"public void nextTurn() {\n\t\tusedPocket = false;\n\t\ttookFromPot = false;\n\t\tcurrentTurn++;\n\t\tcurrentTurn = currentTurn%2;\n\t\tif(currentTurn == 0) {\n\t\t\tcurrentPlayer = player1;\n\t\t\topponentPlayer = player2;\n\t\t} else {\n\t\t\tcurrentPlayer = player2;\n\t\t\topponentPlayer = player1;\n\t\t}\n\t}",
"private void calculateTurn () {\n // Do we need a turn? If not, we're done.\n if (dirOne.opposite() == dirTwo) return;\n /*\n * We need a turn. The coordinates of the turn point will be the x\n * coordinate of the north/south leg and the y coordinate of the\n * east/west leg.\n */\n if (dirOne == Direction.north || dirOne == Direction.south) {\n xTurn = xOne;\n yTurn = yTwo;\n } else {\n xTurn = xTwo;\n yTurn = yOne;\n }\n }",
"public void playTurn() {\r\n\r\n }",
"@Override\r\n\tpublic void startTurn() {\n\t\t\r\n\t}",
"public void play() {\n\n int turn = 1;\n\n while (!isCheckMate()) {\n System.out.println(\"Turn \" + turn++);\n board.print();\n playTurn(whitePlayer);\n board.print();\n playTurn(blackPlayer);\n }\n }",
"public void beginTurn(){\n }",
"public void updateTurn(int turn)\n\t{\n\t\tcurTurn = turn;\n\t\trepaint();\n\t}",
"public void setMove(char player, int place) {\n\n playBoard[place] = player;\n }",
"@Override\n\tpublic void setPlayerTurn(int playerTurn) {\n\t\tsuper.setPlayerTurn(playerTurn);\n\t}",
"protected abstract int getTurn();",
"public void setIsTurn()\n\t{\n\t\tthis.isTurn = true;\n\t}",
"public void setTurn(boolean turn) {\n\t\tthis.turn = turn;\n\t}",
"private void playTurn(Player player) {\n\n System.out.println(player.toString() + \"'s turn\");\n\n if (!player.getOccupiedSet().isEmpty())\n while(true) {\n Movement move = player.getMove();\n if (validMove(player, move)) {\n move(player, move);\n break;\n }\n }\n }",
"public void newTurn() {\r\n\t\tthis.money = 0;\r\n\t\tthis.blackTurns = 1;\r\n\t\tthis.blueTurns = 0;\r\n\t\tthis.purpleTurns = 0;\r\n\t\tthis.brownTurns = 0;\r\n\t\tthis.redTurns = 0;\r\n\t}",
"private void swapPlayer(){\r\n resetTurn();\r\n tries = 0;\r\n Player temp = currentPlayer;\r\n currentPlayer = nextPlayer;\r\n nextPlayer = temp;\r\n if(!gameOver()){\r\n if(currentPlayer.getClass() == Ia.class) {\r\n int[] result = currentPlayer.estimateNextMove(this.getClone());\r\n if (result[0] == 0 && result[1] == 0 && result[2] == 0 && result[3] == 0) currentPlayer.setCanMove(false);\r\n else {\r\n currentPlayer.setCanMove(true);\r\n int row = result[0];\r\n int col = result[1];\r\n int nextRow = result[2];\r\n int nextCol = result[3];\r\n makeMove(row, col, nextRow, nextCol);\r\n }\r\n swapPlayer();\r\n }\r\n }\r\n else {\r\n getWinner();\r\n if(winner == null) System.out.println(\"DRAW!\");\r\n else {\r\n System.out.println(winner.getPlayerName() + \" WIN!\");\r\n if (winner.getClass() == Ia.class)\r\n System.out.println(\"Max time used to move: \" + winner.getMaxTime() + \" seconds\");\r\n }\r\n isOver = true;\r\n }\r\n\r\n }",
"public int getTurn() {\n return turn;\n }",
"@Override\npublic boolean changeTurn() {\n\tif (currentPlayer.hasNext()) {\n\t\tcurrentPlayer = currentPlayer.getNext();\n\t\treturn true;\n\t}\nreturn false;\n}",
"void provideNewTurn();",
"public void switchPlayer() {\r\n\t\tif (player == player1) {\r\n\t\t\tplayer = player2;\r\n\t\t} else {\r\n\t\t\tplayer = player1;\r\n\t\t}\r\n\t}",
"public void turnOver() {\n if(firstPlayer == whosTurn()) {\n turn = secondPlayer;\n } else {\n turn = firstPlayer;\n }\n hasPlacedPiece = false;\n hasRotatedBoard = false;\n }",
"public void checkSetPlayerTurn() // Check and if needed set the players turns so it is their turn.\n\t{\n\t\tswitch (totalPlayers) // Determine how many players there are...\n\t\t{\n\t\tcase 2: // For two players...\n\t\t\tswitch (gameState)\n\t\t\t{\n\t\t\tcase twoPlayersNowPlayerOnesTurn: // Make sure it's player one's turn.\n\t\t\t\tplayers.get(0).setIsPlayerTurn(true);\n\t\t\t\tbreak;\t\t\t\t\n\t\t\tcase twoPlayersNowPlayerTwosTurn: // Make sure it's player two's turn.\n\t\t\t\tplayers.get(1).setIsPlayerTurn(true);\n\t\t\t\tbreak;\t\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t}",
"public void turnLeft() { turn(\"LEFT\"); }",
"private void playTurn()\n {\n try\n {\n XMLHandler.saveGame(game, GAME_CLONE_PATH);\n }\n catch(IOException | JAXBException | SAXException ex)\n {\n // TODO... ConsoleUtils.message(\"An internal save error has occured, terminating current game\");\n gameEnded = true;\n return;\n }\n \n moveCycle();\n \n if (!game.validateGame()) \n {\n IllegalBoardPenalty();\n }\n \n String gameOverMessage = game.isGameOver();\n if (gameOverMessage != null) \n {\n //TODO: ConsoleUtils.message(gameOverMessage);\n gameEnded = true;\n }\n \n game.switchPlayer();\n }",
"public Move movePiece(int turn) {\n\t\tboolean error = false;\n\t\tString moveInput = null;\n\t\tString origin = null;\n\t\tboolean isCorrectTurn = false;\n\t\t@SuppressWarnings(\"resource\")\n\t\tScanner keyboard = new Scanner(System.in);\n\n\t\tdo {\n\t\t\t\n\t\t\ttry {\n\t\t\t\tdo {\n\t\t\t\t\tSystem.out.println(\"Which piece would you like to move?\");\n\t\t\t\t\torigin = keyboard.next();\n\n\t\t\t\t\tif(validateInput(origin)) {\n\t\t\t\t\t\tSystem.out.println(\"Error in input, please try again\");\n\t\t\t\t\t\terror = true; \n\t\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\t\terror = false;\n\t\t\t\t\t}\n\n\t\t\t\t}while(error);\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tString xOrigin = origin.substring(0, 1);\n\t\t\t\tint yOrigin = Integer.parseInt(origin.substring(1,2));\n\t\t\t\tint convertedXOrigin = convertXPosition(xOrigin);\n\t\t\t\tyOrigin -= 1;\n\t\t\t\t\nif((board.getBoard()[yOrigin][convertedXOrigin] == turn) || (board.getBoard()[yOrigin][convertedXOrigin] == (turn + 2))) {\n\t\t\t\tisCorrectTurn = true;\n\t\t\t\tChecker checker = validatePiece(convertedXOrigin, yOrigin);\t\n\t\t\t\tdo {\n\t\t\t\t\t\n\t\t\t\t\t\tSystem.out.println(\"Where would you like to move\");\n\t\t\t\t\t\t moveInput = keyboard.next();\n\t\t\t\t\t\tif(validateInput(moveInput)) {\n\t\t\t\t\t\t\tSystem.out.println(\"Error in Input, please try again\");\n\t\t\t\t\t\t\terror = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\terror = false;\n\t\t\t\t\t\t//\tSystem.out.println(\"No errors found with input move\");\n\t\t\t\t\t\t}\n\n\t\t\t\t} while(error);\n\t\t\t\t\n\t\t\t\tString xMove = moveInput.substring(0, 1);\n\t\t\t\tint yMove = Integer.parseInt(moveInput.substring(1,2));\n\t\t\t\tint convertedXMove = convertXPosition(xMove);\n\t\t\t\tyMove -= 1;\n\t\t\t\tboolean isMovingRight = isMovingRight(convertedXOrigin, yOrigin, convertedXMove, yMove);\n\t\t\t\tboolean isMovingDown = isMovingDown(convertedXOrigin, yOrigin, convertedXMove, yMove);\n\t\t\t\tMove move = null;\n\t\t\t\t\n\t\t\t\t//checks to see if the move itself is valid\n\t\t\t\ttry {\nif(isMoveValid(convertedXOrigin, yOrigin, convertedXMove, yMove, isMovingRight, isMovingDown)) {\n\t\t\t\tif(isSpaceTaken(convertedXMove, yMove)) {\n\t\t\t\t\t//System.out.println(\"Space is taken\");\n\t\t\t\t\tif(isPieceEnemy(convertedXMove, yMove, checker, turn)) {\n\t\t\t\t\t\tif(isJumpValid(convertedXOrigin, yOrigin, convertedXMove, yMove, isMovingRight, isMovingDown)) {\n\t\t\t\t\t\t\tif(isMovingRight) {\n\t\t\t\t\t\t\t\t//checks to see if the piece is moving up or down\n\t\t\t\t\t\t\t\tif(isMovingDown) {\n\t\t\t\t\t\t\t\t\t//means the piece is moving right and down\n\t\t\t\t\t\t\t\t\t move = new Move(convertedXOrigin, yOrigin, convertedXMove + 1, yMove + 1);\n\t\t\t\t\t\t\t\t\tmodel.moves.add(move);\t\n\t\t\t\t\t\t\t\t\tremoveTakenPiece(convertedXMove, yMove);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t//means the piece is moving right, but up\n\t\t\t\t\t\t\t\t\t move = new Move(convertedXOrigin, yOrigin, convertedXMove + 1, yMove - 1);\n\t\t\t\t\t\t\t\t\tmodel.moves.add(move);\n\t\t\t\t\t\t\t\t\tremoveTakenPiece(convertedXMove, yMove);\n\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\tif(isMovingDown) {\n\t\t\t\t\t\t\t\t\t//means its moving left and down\n\t\t\t\t\t\t\t\t\tmove = new Move(convertedXOrigin, yOrigin, convertedXMove - 1, yMove + 1);\n\t\t\t\t\t\t\t\t\tmodel.moves.add(move);\n\t\t\t\t\t\t\t\t\tremoveTakenPiece(convertedXMove, yMove);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t//means it's moving left and up\n\t\t\t\t\t\t\t\t\tmove = new Move(convertedXOrigin, yOrigin, convertedXMove - 1, yMove - 1);\n\t\t\t\t\t\t\t\t\tmodel.moves.add(move);\t\n\t\t\t\t\t\t\t\t\tremoveTakenPiece(convertedXMove, yMove);\n\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\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t//System.out.println(\"Space isn't taken\");\n\t\t\t\t\tmove = new Move(convertedXOrigin, yOrigin, convertedXMove, yMove);\n\t\t\t\t\tmodel.moves.add(move);\n\t\t\t\t\tif(canBeKing(checker, move)) {\n\t\t\t\t\t\tchecker = convertToKing(checker, move);\n\t\t\t\t\t\tmodel.updateChecker(move, checker, turn);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tprintBoard();\n\t\t\t\t\t\treturn move;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tmodel.updateChecker(move, checker, turn);\n\t\t\t\t\tupdateBoard(move);\n\t\t\t\t\t\n\t\t\t\t\tprintBoard();\n\t\t\t\t\treturn move;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Error in move\");\n\t\t\t\t//System.out.println(\"It's not your turn\");\n\t\t\t\tisCorrectTurn = false;\n\t\t\t\t}\n\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\tSystem.out.println(\"NullPointerException - Error\");\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tif(canBeKing(checker, move)) {\n\t\t\t\tchecker = convertToKing(checker, move);\n\t\t\t\tmodel.updateChecker(move, checker, turn);\n\t\t\t\t\n\t\t\t\tprintBoard();\n\t\t\t\treturn move;\n}\n\n\n\n\t\t\t\t\n\t\t\t\tmodel.updateChecker(move, checker, turn);\n\t\t\t\tupdateBoard(move);\n\t\t\t\t\n\t\t\t\tprintBoard();\n\t\t\t\treturn move;\n\t\t\t\t}\n\t\t\t} catch (NumberFormatException e) {\n\t\t\t\tSystem.out.println(\"Error in Input. Please try again\");\n\t\t\t}\n\t\t\n\t\t}while(!isCorrectTurn);\n\n\t\tprintBoard();\n\t\treturn null;\n\t\t\n\t}",
"void gameTurn(int move){\n int gameWon = -1;\n boolean gameTie = false;\n //set the board to a move and print it\n if (loggedInUser.myGame.currentLetter.equals(\"X\")){\n gameBoard [move] = 1;\n printMove(move,\"X\");\n }\n else{\n gameBoard[move] = 2;\n printMove(move,\"O\");\n }\n //Update the status of the buttons graying out the ones that were played\n updateButtons();\n\n //checks if the game has been won or not\n gameWon = checkGameWon();\n\n //check of the game has been tied\n gameTie = checkTie();\n\n Game game = new Game(loggedInUser.opponentId);\n game.currentMove = move;\n\n if (loggedInUser.myGame.currentLetter.equals(\"X\")){\n game.currentLetter = \"O\";\n }else {\n game.currentLetter = \"X\";\n }\n\n //if the game hasn't been won and the game hasnt been tied the other playesr turn is made\n if(gameWon != 0 && !gameTie){\n game.gameInProgress = true;\n }\n //if game won\n else if (gameWon != 0){\n //remove all of the buttons\n removeAllButtons();\n game.gameInProgress = false;\n }\n else{\n playerText.setText(\"The game is tie\");\n turn.setText(\"No one wins\");\n game.gameInProgress = false;\n }\n\n //set data\n mDatabaseRef.child(loggedInUser.myId).child(\"myGame\").setValue(game);\n mDatabaseRef.child(loggedInUser.opponentId).child(\"myGame\").setValue(game);\n }",
"public void setWhoseMove(int id) {\n\t\tplayerToMove = id;\n\t}",
"Piece turn() {\r\n return _turn;\r\n }",
"public void setWhoGoesFirst(Player playerToGoFirst) {\n if(playerToGoFirst.equals(humanPlayer)) {\n firstPlayer = humanPlayer;\n secondPlayer = aiPlayer;\n } else {\n firstPlayer = aiPlayer;\n secondPlayer = humanPlayer;\n }\n turn = firstPlayer;\n }",
"@Override\n\tpublic int getPlayerTurn() {\n\t\treturn super.getPlayerTurn();\n\t}",
"public int incrementPlayerTurn() {\r\n\t\tthis.playerTurn++;\r\n\t\tif ( playerTurn >= 3 ) {\r\n\t\t\tthis.playerTurn = 0;\r\n\t\t}\r\n\t\t\r\n\t\treturn this.playerTurn;\r\n\t}",
"public PlayerNumber whoseTurn() {\n\t\tif (isGameOver()) {\n\t\t\treturn Game.GAME_OVER;\n\t\t}\n\t\treturn nextPlayer;\n\t}",
"@Override\r\n\tpublic void makeRandonMove() {\r\n\t\tif (randPlayer.getPlayerNumber() == game.getState().getTurn() && !game.getState().isFinished()) game.execute(randPlayer.requestAction(game.getState()));\r\n\t}",
"public int playerTurn() {\n\t\treturn partita.getPlayerTurnNumber();\n\t}",
"public void nextTurn(){\n\t\tplayers[currentPlayer].setNotCurrentPlayer();\n\t\t\n\t\t//increment current player to advance to next player\n\t\tcurrentPlayer = (currentPlayer + 1) % players.length;\n\t\t\n\t\t//update the new current player\n\t\tupdateCurrentPlayerView();\n\t}",
"public int getTurn() {\n\t\treturn turn;\n\t}",
"public void setPlayerTurnName(){\n game.setPlayerTurn();\n String playerTurnName = game.getPlayerTurnName();\n playerturntextID.setText(playerTurnName + \" : Turn !!\");\n }",
"public void nextTurn() {\r\n\r\n\t\t// System.out.println(\"nextTurn================================================================================================\" + this.DiceNumber);\r\n\t\tif (gameState == GameState.Playing) {\r\n\t\t\tif (!isPlayerCall && currentTurnPlayer != null && !currentTurnPlayer.getPlayerDetail().getIsRobot()) {\r\n\t\t\t\tif (currentTurnPlayer.PlayerTimeOutCall()) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tcurrentTurnPlayer.addNoOperateTime();\r\n\r\n\t\t\t}\r\n\r\n\t\t\t// current turn count add one.\r\n\t\t\tturnIndex++;\r\n\t\t\tisPlayerCall = false;\r\n\t\t\tcurrentTurnPlayer = findNextLiving();\r\n\t\t\tsendGameNextTurn(currentTurnPlayer, this);\r\n\r\n\t\t\t// if current player is robot,add robot logical action.\r\n\t\t\tif (currentTurnPlayer.getPlayerDetail().getIsRobot()\r\n\t\t\t\t\t|| currentTurnPlayer.getPlayerDetail().getIsRobotState()) {\r\n\t\t\t\tThreadSafeRandom random = new ThreadSafeRandom();\r\n\t\t\t\tAddAction(new RobotProcessAction(random.next(1, 6) * 1000, currentTurnPlayer));// 机器人随机一个叫的时间\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// if the player has trusteed the game,add trustee action to deal\r\n\t\t\t// with the condition.\r\n\t\t\t// if (currentTurnPlayer.getPlayerState() == PlayerState.Trustee)\r\n\t\t\t// {\r\n\t\t\t// AddAction(new TrusteePlayerAction(random.next(3, 6) * 1000,\r\n\t\t\t// currentTurnPlayer));\r\n\t\t\t// return;\r\n\t\t\t// }\r\n\r\n\t\t\t// this turn wait for 20 seconds.\r\n\t\t\tWaitTime(1000 * 20);// csf0423 以前是12 + 8\r\n\t\t\tonBeginNewTurn();\r\n\t\t}\r\n\t}",
"Piece turn() {\n return _turn;\n }",
"@java.lang.Override\n public int getCurrentTurn() {\n return currentTurn_;\n }",
"private void changeCurrentPlayer() {\n switch (currentPlayer) {\n case 0: currentPlayer = 1;\n return;\n default: currentPlayer = 0;\n return;\n }\n }",
"public void playerTurnStart() {\n\r\n\t}",
"public void setTurn(PieceColor color) {\n \tturn = color;\n }",
"public void playMove(int turn)\t{\n\t\tString command;\n\t\tint index = -1;\n\t\tCard dealt;\n\t\tCard drawn;\n\t\tboolean illegal = false;\n\t\tSystem.out.println(\"\\n\" + hand[turn].toString() + \"\\n\");\n\t\tSystem.out.println(\"Choose a number, or 'd' for draw, or 'p' for pass.\");\n\t\tcommand = input.nextLine();\n\t\trecord[turn] = command;\n\t\tif(command.equalsIgnoreCase(\"d\"))\t{\n\t\t\tdrawn = deck1.deal();\n\t\t\tif(drawn!=null)\t{\n\t\t\t\thand[turn].addCard(drawn);\n\t\t\t}\n\t\t\telse\t{\n\t\t\t\tSystem.out.print(\"\\n+++++No cards in deck!\");\n\t\t\t}\n\t\t\tplayMove(turn);\n\t\t}\n\t\telse if(command.equalsIgnoreCase(\"p\"))\t{\n\t\t\tif(deck1.isEmpty() || !hand[turn].playable(top))\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse\t{\n\t\t\t\tSystem.out.print(\"\\n+++++Cannot pass!+++++\\n\");\n\t\t\t\tplayMove(turn);\n\t\t\t}\n\t\t}\n\t\telse\t{\n\t\t\tif(isNumber(command))\t{\n\t\t\t\tindex = Integer.parseInt(command);\n\t\t\t}\n\t\t\telse\t{\n\t\t\t\tSystem.out.println(\"Invalid Command!\");\n\t\t\t\tplayMove(turn);\n\t\t\t}\n\t\t\tif(index>=0 && index<hand[turn].countCards())\t{\n\t\t\t\tdealt = hand[turn].seekCard(index);\n\t\t\t\tif(top.getValue()!=8)\t{\n\t\t\t\t\tif(top.getSuit().equals(dealt.getSuit()) || \n\t\t\t\t\t\t\ttop.getValue()==dealt.getValue() || \n\t\t\t\t\t\t\tdealt.getValue()==8)\t{\n\t\t\t\t\t\tif(dealt.getValue()==8)\t{\n\t\t\t\t\t\t\tdealt.setSuit(chooseSuit());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\t{\n\t\t\t\t\t\tillegal = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\t{\n\t\t\t\t\tif(dealt.getValue()==8 || \n\t\t\t\t\t\t\ttop.getChosenSuit().equalsIgnoreCase(dealt.getSuit()))\t{\n\t\t\t\t\t\tillegal = false;\n\t\t\t\t\t}\n\t\t\t\t\telse\t{\n\t\t\t\t\t\tillegal = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(illegal)\t{\n\t\t\t\t\tSystem.out.println(\"Illegal Move!\");\n\t\t\t\t\tplayMove(turn);\n\t\t\t\t}\n\t\t\t\telse\t{\n\t\t\t\t\ttop = dealt;\n\t\t\t\t\thand[turn].removeCard(index);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\t{\n\t\t\t\tSystem.out.println(\"Card does not exist!\");\n\t\t\t\tplayMove(turn);\n\t\t\t}\n\t\t}\n\t\treturn;\n\t}",
"public void newTurnCountdown() {\n newTurn = true;\n newTurnTimer = 77;\n }",
"private PlayerType GetPlayerForTurn(int turn) {\n switch ((turn - 1) % 6) {\n case 0:\n case 4:\n case 5:\n return PlayerType.One;\n\n case 1:\n case 2:\n case 3:\n return PlayerType.Two;\n\n default:\n return PlayerType.Empty;\n }\n }",
"private String playerToString(int turn){ \r\n\t\tif (turn == 1) { \r\n\t\t\treturn \"You\";\r\n\t\t}\r\n\t\telse{ \r\n\t\t\treturn \"Computer\";\r\n\t\t}\r\n\t}"
]
| [
"0.79224145",
"0.79003215",
"0.78565294",
"0.76723814",
"0.755856",
"0.7527337",
"0.7522169",
"0.74380606",
"0.74170566",
"0.7314854",
"0.7305002",
"0.7301413",
"0.7169581",
"0.71569276",
"0.7108231",
"0.71027917",
"0.7090796",
"0.7082339",
"0.7050803",
"0.70324814",
"0.70107126",
"0.70090985",
"0.6998742",
"0.69925267",
"0.6954688",
"0.69506115",
"0.6932741",
"0.6931035",
"0.69296473",
"0.69184023",
"0.6893219",
"0.6879551",
"0.6872458",
"0.686069",
"0.6840082",
"0.68271667",
"0.6826542",
"0.681928",
"0.6814421",
"0.6803207",
"0.67998046",
"0.67914516",
"0.67880106",
"0.6743309",
"0.67417395",
"0.6720511",
"0.6719637",
"0.6715651",
"0.67142206",
"0.6708488",
"0.67061454",
"0.6690978",
"0.6671326",
"0.6649085",
"0.6634018",
"0.66223264",
"0.6614997",
"0.66119707",
"0.6611259",
"0.66020817",
"0.659827",
"0.65911144",
"0.65911025",
"0.65901965",
"0.65841883",
"0.6578267",
"0.6572267",
"0.6567443",
"0.6561534",
"0.6560969",
"0.655842",
"0.6555655",
"0.6549126",
"0.6543874",
"0.65402853",
"0.6537874",
"0.6530264",
"0.6496986",
"0.64818746",
"0.64802474",
"0.6474182",
"0.6461741",
"0.6453044",
"0.6451528",
"0.64461446",
"0.6446079",
"0.64378804",
"0.64357895",
"0.64238095",
"0.6419676",
"0.64167154",
"0.6413929",
"0.641172",
"0.64103323",
"0.6407846",
"0.64068556",
"0.64020693",
"0.63991785",
"0.639819",
"0.63909066"
]
| 0.8140697 | 0 |
This function accepts command and plays the move and returns false if enough commands are processed if board is not empty and winner is not present then it returns true | public boolean playMove(String input_command) {
// This function will take a command, validates input and calls for a move for a
// player
// whoes turn is there.
String[] inputs = input_command.split(" ");
String move = inputs[0];
PlayerController playerController = getNextPlayer();
this.playerControllerList.remove(playerController);
System.out.println("\nPlayer" + playerController.getPlayerId() + " choosed:" + input_command + " move");
System.out.println("Before playing move=>" + getStateOfPlayer(playerController));
System.out.println("Before playing move=> Board State:" + getStateOfBoard());
switch (move) {
case "STRIKE":
this.gameController.strikeMove(playerController);
break;
case "MULTI_STRIKE":
// We should take one more input that is count of striked coins
this.gameController.multiStrikeMove(playerController, Integer.parseInt(inputs[1]));
break;
case "RED_STRIKE":
this.gameController.redStrikeMove(playerController);
break;
case "NONE":
this.gameController.noneMove(playerController);
break;
case "DEFUNCT_COIN":
if(inputs[1].equals("BLACK")){
this.gameController.defunctCoinMove(playerController, CoinType.BLACK);
}else if(inputs[1].equals("RED")){
this.gameController.defunctCoinMove(playerController, CoinType.RED);
}
break;
case "STRIKER_STRIKE":
this.gameController.strikerStrikeMove(playerController);
break;
}
this.playerControllerList.add(playerController);
System.out.println("After playing move=> Board State:" + getStateOfBoard());
System.out.println("After playing move=>" + getStateOfPlayer(playerController) + "\n");
changeTurn();
PlayerController winner = calculateWinner();
if (winner != null) {
System.out.println("Winner is:Player" + winner.getPlayerId() + " having points:" + winner.getPoints());
return false;
} else {
if (this.gameController.isBoardEmpty() == true) {
System.out.println("Match is draw");
return false;
}
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public MoveResult canMovePiece(Alignment player, Coordinate from, Coordinate to);",
"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 abstract boolean validMove(ChessBoard board, Square from, Square to);",
"public boolean validMove(int x, int y, boolean blackPlayerTurn)\n\t{\n\t\t// check holds 'B' if player black or 'W' if player white\n\t\tchar check;\n\t\tchar checkNot;\n\t\tcheck = blackPlayerTurn ? 'B' : 'W';\n\t\tcheckNot = !blackPlayerTurn ? 'B' : 'W';\n\t\tchar[][] arrayClone = cloneArray(currentBoard);\n\t\t// check if board position is empty\n\t\tif (currentBoard[x][y] == ' ')\n\t\t{\n\t\t\t// prime arrayClone by placing piece to be place in spot\n\t\t\tarrayClone[x][y] = check;\n\t\t\t// check if capture of other players pieces takes place (up, right, left, down)\n\t\t\t// checkNot\n\t\t\tcaptureCheck(x, y, checkNot, arrayClone);\n\t\t\t// if our candidate placement has liberties after capture check then place\n\t\t\t// piece!\n\t\t\tif (hasLibTest(x, y, check, arrayClone))\n\t\t\t{\n\t\t\t\tif (pastBoards.contains(arrayClone))\n\t\t\t\t{\n\t\t\t\t\t// do not allow repeat boards\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tcurrentBoard = cloneArray(arrayClone);\n\t\t\t\t// make move handles actually piece placement so remove check from board\n\t\t\t\tarrayClone[x][y] = ' ';\n\t\t\t\t// arrayClone contains updated positions with captured pieces removed\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn false;\n\t\t\n\t}",
"private void checkWinningMove(TicTacToeElement element,int x,int y) {\n int logicalSize = boardProperties.getBoardLength()-1;\r\n // Check column (only the one we just played)\r\n for(int i=0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[x][i] != element.getValue()){\r\n break;\r\n }\r\n // Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n\r\n }\r\n // Check row (only the one we just played)\r\n for(int i=0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[i][y] != element.getValue()){\r\n break;\r\n }\r\n // Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n }\r\n // Check diagonal\r\n // normal diagonal\r\n for(int i= 0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[i][i] != element.getValue()){\r\n break;\r\n }\r\n // Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n }\r\n // anti diagonal\r\n for(int i= 0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[i][logicalSize-i] != element.getValue()){\r\n break;\r\n }\r\n //Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n }\r\n // check draw\r\n if(gameState.getMoveCount() == Math.pow(logicalSize,2)-1){\r\n gameState.setDraw(true);\r\n }\r\n\r\n }",
"public boolean playGame() {\n\t\tboolean movePlayed = false;\n\t\twhile (!gameOver) {\n\t\t\tSystem.out.println(board);\n\t\t\tmovePlayed = false;\n\t\t\twhile(!movePlayed) {\n\t\t\t\ttry {\n\t\t\t\t\tplayNextTurn();\n\t\t\t\t\tmovePlayed = true;\n\t\t\t\t}\n\t\t\t\tcatch (RuntimeException e) {\n\t\t\t\t\tSystem.out.println(\"Error: \" + e.getMessage());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis.checkWin = board.checkWin();\n\t\treturn true;\n\t}",
"public void makeMove(String token, boolean playVsComp) throws InputMismatchException { \r\n int choice;\r\n System.out.println(\"Player\" + token + \" - your turn. Please select a column number 1-7\");\r\n if (!in.hasNextInt()) {\r\n String input = (String) in.next();\r\n System.out.println(input + \" is not a valid number.\");\r\n makeMove(token, playVsComp);\r\n }\r\n choice = in.nextInt();\r\n if (choice < 1 || choice > 7){\r\n System.out.println(\"Invalid choice, you should choose a number between 1 and 7. Try again!\");\r\n makeMove(token, playVsComp);\r\n } else {\r\n if (!board.getPiece(5, choice).equals(\" |\")){\r\n System.out.println(\"This column is full, try choosing another one\");\r\n makeMove(token, playVsComp);\r\n } else { \r\n board.addPiece(choice, token);\r\n displayBoard();\r\n if (board.checkForWinner()){\r\n System.out.println(\"Player \" + token + \" won the Game!\");\r\n System.exit(0);\r\n }\r\n if (board.checkForDraw()){\r\n System.out.println(\"It is a draw!\");\r\n System.exit(0);\r\n }\r\n if (token.equals(\"X\")){\r\n token = \"O\"; \r\n } else { \r\n token = \"X\";\r\n }\r\n if (playVsComp){\r\n int moved = comp.computerMove(token);\r\n System.out.println(\"Computer put an O into column number \" + moved);\r\n displayBoard();\r\n if (board.checkForWinner()){\r\n System.out.println(\"Player \" + token + \" won the Game!\");\r\n System.exit(0);\r\n }\r\n if (board.checkForDraw()){\r\n System.out.println(\"It is a draw!\");\r\n System.exit(0);\r\n }\r\n token = \"X\";\r\n } \r\n makeMove(token, playVsComp); \r\n }\r\n } \r\n }",
"public static boolean checkWinner(){\n \n if(board[0][0] == board[0][1] && board[0][1] == board[0][2] && (board[0][0] == 'x' || board [0][0] == 'o'))\n return true;\n else if(board[1][0] == board[1][1] && board[1][1] == board[1][2] && (board[1][0] == 'x' || board[1][0] == 'o'))\n return true;\n else if(board[2][0] == board[2][1] && board[2][1] == board[2][2] && (board[2][0] == 'x' || board[2][0] == 'o'))\n return true;\n else if(board[0][0] == board[1][0] && board[1][0] == board[2][0] && (board[0][0] == 'x' || board[0][0] == 'o'))\n return true;\n else if(board[0][1] == board[1][1] && board[1][1] == board[2][1] && (board[0][1] == 'x' || board[0][1] == 'o'))\n return true;\n else if(board[0][2] == board[1][2] && board[1][2] == board[2][2] && (board[0][2] == 'x' || board[0][2] == 'o'))\n return true;\n else if(board[0][0] == board[1][1] && board[1][1] == board[2][2] && (board[0][0] == 'x' || board[0][0] == 'o'))\n return true;\n else if(board[0][2] == board[1][1] && board[1][1] == board[2][0] && (board[0][2] == 'x' || board[0][2] == 'o'))\n return true;\n else\n return false;\n \n }",
"public abstract boolean canMove(Board board, Spot from, Spot to);",
"public void play() {\n HashSet<Board> positionsPlayed = new HashSet<Board>();\n _board = new Board();\n\n while (true) {\n int playerInd = _board.turn().ordinal();\n Move next;\n if (_playing) {\n if (_board.gameOver()) {\n announceWinner();\n _playing = false;\n continue;\n }\n if (_hasGUI) {\n if (_players[playerInd].type().equals(\"human\")) {\n if (_ready) {\n next = _nextMove;\n } else if (_readyCommand) {\n processCommand(_nextCommand);\n next = null;\n } else {\n continue;\n }\n } else {\n next = _players[playerInd].makeMove();\n }\n } else {\n next = _players[playerInd].makeMove();\n }\n assert !_playing || next != null;\n } else {\n if (_hasGUI) {\n System.out.print(\"\");\n if (_readyCommand) {\n processString(_nextCommand);\n }\n } else {\n getMove();\n }\n next = null;\n }\n if (next != null) {\n assert _board.isLegal(next);\n _board.makeMove(next);\n if (_players[playerInd].type().equals(\"machine\") && !_hasGUI) {\n System.out.println(_players[playerInd].side().abbrev().toUpperCase() + \"::\" + next.toString());\n if (_autoprint) {\n System.out.println(_board.toString2());\n }\n }\n if (_board.gameOver()) {\n announceWinner();\n _playing = false;\n }\n }\n _ready = false;\n }\n }",
"public static boolean checkForObviousMove(char[][] a){\r\n int rowNumber = a.length;\r\n int colNumber = a[0].length;\r\n //AI obvious to win\r\n for (int i = 0; i<rowNumber; i++){\r\n for (int j = 0; j<colNumber; j++){\r\n //check if on diagnol\r\n if (i == j && countDiag1(a, 'o')== (rowNumber-1) && spotIsEmpty(a[i][j])){\r\n writeOnBoard(a,'o',i,j);\r\n return true;\r\n }\r\n if (i+j == rowNumber-1 && countDiag2(a,'o')==(rowNumber-1) && spotIsEmpty(a[i][j])){\r\n writeOnBoard(a,'o',i,j);\r\n return true;\r\n }\r\n //check on a row\r\n if(countRow(a[i], 'o') == (colNumber-1) && spotIsEmpty(a[i][j])){\r\n writeOnBoard(a,'o',i,j);\r\n return true;\r\n }\r\n //check on a column\r\n if(countCol(a,j,'o') == (rowNumber-1) && spotIsEmpty(a[i][j])){\r\n writeOnBoard(a,'o',i,j);\r\n return true;\r\n }\r\n }\r\n }\r\n //when user obvious to win\r\n for (int i = 0; i<rowNumber; i++){\r\n for (int j = 0; j<colNumber; j++){\r\n //check if on diagnol\r\n if (i == j && countDiag1(a, 'x')== (rowNumber-1) && spotIsEmpty(a[i][j])){\r\n writeOnBoard(a,'o',i,j);\r\n return true;\r\n }\r\n if (i+j == rowNumber-1 && countDiag2(a,'x')==(rowNumber-1) && spotIsEmpty(a[i][j])){\r\n writeOnBoard(a,'o',i,j);\r\n return true;\r\n }\r\n //check on a row\r\n if(countRow(a[i], 'x') == (colNumber-1) && spotIsEmpty(a[i][j])){\r\n writeOnBoard(a,'o',i,j);\r\n return true;\r\n }\r\n //check on a column\r\n if(countCol(a,j,'x') == (rowNumber-1) && spotIsEmpty(a[i][j])){\r\n writeOnBoard(a,'o',i,j);\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }",
"private boolean processCommand(Command command) \n {\n boolean wantToQuit = false;\n\n if(command.isUnknown()) {\n System.out.println(\"I don't know what you mean...\");\n return false;\n }\n\n String commandWord = command.getCommandWord();\n if (commandWord.equals(\"help\")) {\n printHelp();\n }\n else if (commandWord.equals(\"go\")) {\n player.goRoom(command); \n }\n else if (commandWord.equals(\"look\")) { \n player.look();\n }\n else if (commandWord.equals(\"eat\")) {\n player.eat();\n }\n else if (commandWord.equals(\"quit\")) {\n wantToQuit = quit(command);\n }\n else if (commandWord.equals(\"back\")) {\n player.goBack(); \n }\n else if (commandWord.equals(\"take\")) {\n player.take(command);\n }\n else if (commandWord.equals(\"drop\")) {\n player.drop(command);\n }\n else if (commandWord.equals(\"items\")) {\n player.getItems();\n }\n else if (commandWord.equals(\"equipar\")) {\n player.equipar(command);\n }\n return wantToQuit;\n }",
"private boolean win(int row, int col, int player)\n {\n int check;\n // horizontal line\n // Start checking at a possible and valid leftmost point\n for (int start = Math.max(col - 3, 0); start <= Math.min(col,\n COLUMNS - 4); start++ )\n {\n // Check 4 chess horizontally from left to right\n for (check = 0; check < 4; check++ )\n {\n // The coordinate of column increases 1 every time\n if (chessBoard[row][start + check] != player)\n {\n break;\n }\n }\n // If the checking passed, win\n if (check == 4)\n {\n return true;\n }\n }\n\n // vertical line\n // Start checking at the point inputed if there exists at least 3 rows under\n // it.\n if (row + 3 < ROWS)\n {\n // Check another 3 chess vertically from top to bottom\n for (check = 1; check < 4; check++ )\n {\n // The coordinate of row increases 1 every time\n // Check if the chess all belong to the player\n if (chessBoard[row + check][col] != player)\n {\n break;\n }\n }\n // If the checking passed, win\n if (check == 4)\n {\n return true;\n }\n }\n\n // diagonal line \"\\\"\n // Start checking at a possible and valid leftmost and upmost point\n for (int start = Math.max(Math.max(col - 3, 0), col - row); start <= Math\n .min(Math.min(col, COLUMNS - 4), col + ROWS - row - 4); start++ )\n {\n // Check 4 chess diagonally from left and top to right and bottom\n for (check = 0; check < 4; check++ )\n {\n // The coordinate of row increases 1 every time\n // The coordinate of column increases 1 every time\n // Check if the chess all belong to the player\n if (chessBoard[row - col + start + check][start + check] != player)\n {\n break;\n }\n }\n // If the checking passed, win\n if (check == 4)\n {\n return true;\n }\n }\n\n // diagonal line \"/\"\n // Start checking at a possible and valid leftmost and downmost point\n for (int start = Math.max(Math.max(col - 3, 0),\n col - ROWS + row + 1); start <= Math.min(Math.min(col, COLUMNS - 4),\n col + row - 3); start++ )\n {\n // Check 4 chess diagonally from left and bottom to right and up\n for (check = 0; check < 4; check++ )\n {\n // The coordinate of row decreases 1 every time\n // The coordinate of column increases 1 every time\n // Check if the chess all belong to the player\n if (chessBoard[row + col - start - check][start + check] != player)\n {\n break;\n }\n }\n // If the checking passed, win\n if (check == 4)\n {\n return true;\n }\n }\n // no checking passed, not win\n return false;\n }",
"private boolean winCheck(int x, int y, char symbol){\n\t\t/* Horizontal */\n\t\tif(y>=2 && board[x][y-2]==symbol && board[x][y-1]==symbol && board[x][y]==symbol)\n\t\t\treturn true;\n\t\tif(y>=1 && y+1<size && board[x][y-1]==symbol && board[x][y]==symbol && board[x][y+1]==symbol)\n\t\t\treturn true;\n\t\tif(y+2<size && board[x][y]==symbol && board[x][y+1]==symbol && board[x][y+2]==symbol)\n\t\t\treturn true;\n\t\t\n\t\t/* Vertical */\n\t\tif(x>=2 && board[x-2][y]==symbol && board[x-1][y]==symbol && board[x][y]==symbol)\n\t\t\treturn true;\n\t\tif(x>=1 && x+1<size && board[x-1][y]==symbol && board[x][y]==symbol && board[x+1][y]==symbol)\n\t\t\treturn true;\n\t\tif(x+2<size && board[x][y]==symbol && board[x+1][y]==symbol && board[x+2][y]==symbol)\n\t\t\treturn true;\n\t\t\n\t\t/* Main Diagonal */\n\t\tif(x>=2 && y>=2 && board[x-2][y-2]==symbol && board[x-1][y-1]==symbol && board[x][y]==symbol)\n\t\t\treturn true;\n\t\tif(x>=1 && x+1<size && y>=1 && y+1<size && board[x-1][y-1]==symbol && board[x][y]==symbol && board[x+1][y+1]==symbol)\n\t\t\treturn true;\n\t\tif(x+2<size && y+2<size && board[x][y]==symbol && board[x+1][y+1]==symbol && board[x+2][y+2]==symbol)\n\t\t\treturn true;\n\t\t\n\t\t/* Anti Diagonal */\n\t\tif(x>=2 && y+2<size && board[x-2][y+2]==symbol && board[x-1][y+1]==symbol && board[x][y]==symbol)\n\t\t\treturn true;\n\t\tif(x>=1 && x+1<size && y>=1 && y+1<size && board[x+1][y-1]==symbol && board[x][y]==symbol && board[x-1][y+1]==symbol)\n\t\t\treturn true;\n\t\tif(x+2<size && y>=2 && board[x][y]==symbol && board[x+1][y-1]==symbol && board[x+2][y-2]==symbol)\n\t\t\treturn true;\n\t\t\n\t\treturn false;\n\t}",
"public boolean execute(int action, Point nextposition, double x, double y, int direction) {\n Player currentPlayer = getTurn();\n boolean success = false;\n if (action == 0) {\n success = currentPlayer.walk(board, nextposition);\n }\n if (action == 1) {\n success = currentPlayer.putPlank(board, x, y, direction);\n }\n if (action == 2) {\n winner = getPlayer(1-currentPlayer.getLabel());\n return true;\n }\n// if (isWin(getTurn(), getTurn().getPosition())) {\n// return true;\n// }\n // move is valid, finish and switch turns.\n isWin(currentPlayer, currentPlayer.getPosition());\n if (success) {\n finish();\n return true;\n }\n return false;\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 boolean validMove(GameWorld world, Character nextKey) {\n if (nextKey.equals('Q') || nextKey.equals('q') || nextKey.equals(':')) {\n return true;\n } else if (nextKey.equals('W') || nextKey.equals('w')) {\n if (world.world[world.avatarPosition.x]\n [world.avatarPosition.y + 1].equals(Tileset.WALL)) {\n return false;\n }\n } else if (nextKey.equals('S') || nextKey.equals('s')) {\n if (world.world[world.avatarPosition.x]\n [world.avatarPosition.y - 1].equals(Tileset.WALL)) {\n return false;\n }\n } else if (nextKey.equals('D') || nextKey.equals('d')) {\n if (world.world[world.avatarPosition.x + 1]\n [world.avatarPosition.y].equals(Tileset.WALL)) {\n return false;\n }\n } else if (nextKey.equals('A') || nextKey.equals('a')) {\n if (world.world[world.avatarPosition.x - 1]\n [world.avatarPosition.y].equals(Tileset.WALL)) {\n return false;\n }\n } else {\n return true;\n }\n return true;\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 }",
"public void playMove(int turn)\t{\n\t\tString command;\n\t\tint index = -1;\n\t\tCard dealt;\n\t\tCard drawn;\n\t\tboolean illegal = false;\n\t\tSystem.out.println(\"\\n\" + hand[turn].toString() + \"\\n\");\n\t\tSystem.out.println(\"Choose a number, or 'd' for draw, or 'p' for pass.\");\n\t\tcommand = input.nextLine();\n\t\trecord[turn] = command;\n\t\tif(command.equalsIgnoreCase(\"d\"))\t{\n\t\t\tdrawn = deck1.deal();\n\t\t\tif(drawn!=null)\t{\n\t\t\t\thand[turn].addCard(drawn);\n\t\t\t}\n\t\t\telse\t{\n\t\t\t\tSystem.out.print(\"\\n+++++No cards in deck!\");\n\t\t\t}\n\t\t\tplayMove(turn);\n\t\t}\n\t\telse if(command.equalsIgnoreCase(\"p\"))\t{\n\t\t\tif(deck1.isEmpty() || !hand[turn].playable(top))\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse\t{\n\t\t\t\tSystem.out.print(\"\\n+++++Cannot pass!+++++\\n\");\n\t\t\t\tplayMove(turn);\n\t\t\t}\n\t\t}\n\t\telse\t{\n\t\t\tif(isNumber(command))\t{\n\t\t\t\tindex = Integer.parseInt(command);\n\t\t\t}\n\t\t\telse\t{\n\t\t\t\tSystem.out.println(\"Invalid Command!\");\n\t\t\t\tplayMove(turn);\n\t\t\t}\n\t\t\tif(index>=0 && index<hand[turn].countCards())\t{\n\t\t\t\tdealt = hand[turn].seekCard(index);\n\t\t\t\tif(top.getValue()!=8)\t{\n\t\t\t\t\tif(top.getSuit().equals(dealt.getSuit()) || \n\t\t\t\t\t\t\ttop.getValue()==dealt.getValue() || \n\t\t\t\t\t\t\tdealt.getValue()==8)\t{\n\t\t\t\t\t\tif(dealt.getValue()==8)\t{\n\t\t\t\t\t\t\tdealt.setSuit(chooseSuit());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\t{\n\t\t\t\t\t\tillegal = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\t{\n\t\t\t\t\tif(dealt.getValue()==8 || \n\t\t\t\t\t\t\ttop.getChosenSuit().equalsIgnoreCase(dealt.getSuit()))\t{\n\t\t\t\t\t\tillegal = false;\n\t\t\t\t\t}\n\t\t\t\t\telse\t{\n\t\t\t\t\t\tillegal = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(illegal)\t{\n\t\t\t\t\tSystem.out.println(\"Illegal Move!\");\n\t\t\t\t\tplayMove(turn);\n\t\t\t\t}\n\t\t\t\telse\t{\n\t\t\t\t\ttop = dealt;\n\t\t\t\t\thand[turn].removeCard(index);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\t{\n\t\t\t\tSystem.out.println(\"Card does not exist!\");\n\t\t\t\tplayMove(turn);\n\t\t\t}\n\t\t}\n\t\treturn;\n\t}",
"public boolean isValidMove(Point orig, Point dest){ \r\n Color playerColor = model.getCurrentPlayer().getColor();\r\n // Validate all point between board limits\r\n if(!isValidPosition(orig) || !isValidPosition(dest)) return false;\r\n // Check for continue move starting piece\r\n if(model.getCheckPiece() != null && !model.getCheckPiece().equals(orig)) return false;\r\n // Validate origin piece to player color\r\n if((isRed(playerColor) && !isRed(orig)) || (isBlack(playerColor) && !isBlack(orig))) return false;\r\n // Only can move to empty Black space\r\n if(!isEmpty(dest)) return false;\r\n // If current player have obligatory eats, then need to eat\r\n if(obligatoryEats(playerColor) && !moveEats(orig,dest)) return false;\r\n // Check move direction and length\r\n int moveDirection = orig.getFirst() - dest.getFirst(); // Direction in Rows\r\n int rLength = Math.abs(moveDirection); // Length in Rows\r\n int cLength = Math.abs(orig.getSecond() - dest.getSecond()); // Length in Columns\r\n int mLength;\r\n // Only acepts diagonal movements in 1 or 2 places (1 normal move, 2 eats move)\r\n if ((rLength == 1 && cLength == 1) || (rLength == 2 && cLength == 2)){\r\n mLength = rLength;\r\n } else {\r\n return false;\r\n }\r\n // 1 Place movement\r\n if (mLength == 1){ \r\n if (isRed(orig) && !isQueen(orig) && moveDirection > 0) return true;\r\n if (isBlack(orig) && !isQueen(orig) && moveDirection < 0) return true;\r\n if ((isRed(orig) && isQueen(orig)) || (isBlack(orig) && isQueen(orig))) return true;\r\n }\r\n // 2 Places movement need checks if eats rivals\r\n if (mLength == 2){\r\n // Compute mid point\r\n Point midPoint = getMidPoint(orig, dest);\r\n // Check move\r\n if ((isRed(orig) && isBlack(midPoint)) || (isBlack(orig) && isRed(midPoint))){\r\n if (isRed(orig) && !isQueen(orig) && moveDirection > 0) return true;\r\n if (isBlack(orig) && !isQueen(orig) && moveDirection < 0) return true;\r\n if ((isRed(orig) && isQueen(orig)) || (isBlack(orig) && isQueen(orig))) return true;\r\n }\r\n }\r\n return false;\r\n }",
"@Override\r\n\tpublic boolean makeMove(String notation) {\n\t\tif(Castle.isCastlingMove(new ChessCoordinate(notation))) {\r\n\t\t\tKing playerKing = (King) getPlayerTurn().getPieces(\"King\", true).get(0);\r\n\t\t\t//return the result of trying to castle\r\n\t\t\treturn playerKing.move(new ChessCoordinate(notation));\r\n\t\t\t\r\n\t\t}else {\r\n\t\t\t//not a castling move, standard move\r\n\t\t\t\t\r\n\t\t\tString[] notationList = notation.split(\"\");\r\n\t\t\t//find the piece name\r\n\t\t\tString pieceName = ChessPieceNames.getPieceName(notationList[0]);\t\t\r\n\t\t\t\r\n\t\t\tif(pieceName == null && getColumnNames().contains(notationList[0].toLowerCase())) {\r\n\t\t\t\t//if first character is a column and returned null from above\r\n\t\t\t\t//must be a pawn move like e4 or axb2\r\n\t\t\t\tpieceName = ChessPieceNames.PAWN.toString();\r\n\t\t\t}else if(pieceName == null){\r\n\t\t\t\t//not a column and null so invalid move\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\r\n//\t\t\t//capturing move if there is a capture (x)\r\n\t\t\tboolean isCaptureMove = Arrays.asList(notationList).contains(\"x\");\r\n\t\t\t\r\n\t\t\t//final coordinate\r\n\t\t\tString coordinateString = notationList[notationList.length-2] + notationList[notationList.length-1];\r\n\t\t\tChessCoordinate coordinate = new ChessCoordinate(coordinateString);\r\n\t\t\tif(coordinate.isValid()) {\r\n\t\t\t\t//extract players alive pieces of piece name\r\n\t\t\t\tList<Piece> piecesOfType = getPlayerTurn().getPieces(pieceName, true);\r\n\t\t\t\t//list of pieces that can move to the same square\r\n\t\t\t\tList<Piece> piecesCanMoveToSquare = new ArrayList<Piece>();\r\n\t\t\t\tfor (Piece piece : piecesOfType) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t//use valid moves of attacking if capturing move, else use move to\r\n\t\t\t\t\tSet<Coordinate> pieceMoves = isCaptureMove \r\n\t\t\t\t\t\t\t? piece.getValidMoves(Action.ATTACK) : piece.getValidMoves(Action.MOVE_TO);\r\n\t\t\t\t\tif(pieceMoves.contains(coordinate))piecesCanMoveToSquare.add(piece);\r\n\t\t\t\t}\t\r\n\t\t\t\t\r\n\t\t\t\tif (piecesCanMoveToSquare.size() == 1) {\r\n\t\t\t\t\t//only one piece can go to that square, so take piece at 0th index as the list only has one element\r\n\t\t\t\t\tpiecesCanMoveToSquare.get(0).move(coordinate);\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\telse if (piecesCanMoveToSquare.size() > 1) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(notation.length() <= 3) {\r\n\t\t\t\t\t\tSystem.out.println(\"Invalid move, specify which piece to move to \" + coordinateString);\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//multiple pieces of the same type can move to that square, check which one to use\r\n\t\t\t\t\t//if pawn, the identifier to use is the 0th index of notationList, eg axb4. use pawn in column a.\r\n\t\t\t\t\t//for other pieces, column to use is the 1st index of notationList. eg Nab4.\r\n\t\t\t\t\t\r\n\t\t\t\t\t//variable called identifier as it can be a row or column value.\r\n\t\t\t\t\tString identifier = (pieceName.equalsIgnoreCase(ChessPieceNames.PAWN.toString()) ?\r\n\t\t\t\t\t\t\tnotationList[0] : notationList[1]).toLowerCase();\r\n\t\t\t\t\t//identifier should be a row value if pieces share the same column\r\n\t\t\t\t\tboolean isRowIdentifier = shareColumn(piecesOfType);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(isRowIdentifier && getRowNames().contains(identifier)) {\r\n\t\t\t\t\t\t//locate piece by row and move that piece to coordinate\r\n\t\t\t\t\t\tfor (Piece piece : piecesCanMoveToSquare) {\r\n\t\t\t\t\t\t\t//look at the row number of piece coordinate, see if it matches the identifier \r\n\t\t\t\t\t\t\tif(Character.toString(piece.getPosition().toString().charAt(1)).equalsIgnoreCase(identifier)) {\r\n\t\t\t\t\t\t\t\tpiece.move(coordinate);\r\n\t\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tSystem.out.println(\"There is no \" + pieceName + \" on row \" + identifier);\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}else if(getColumnNames().contains(identifier)) {\r\n\t\t\t\t\t\tfor (Piece piece : piecesCanMoveToSquare) {\r\n\t\t\t\t\t\t\t//look at the column letter of piece coordinate, see if it matches the identifier \r\n\t\t\t\t\t\t\tif(Character.toString(piece.getPosition().toString().charAt(0)).equalsIgnoreCase(identifier)) {\r\n\t\t\t\t\t\t\t\tpiece.move(coordinate);\r\n\t\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tSystem.out.println(\"There is no \" + pieceName + \" on column \" + identifier);\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//invalid identifier\r\n\t\t\t\t\telse return false;\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\telse {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//invalid coordinate, move can not be played\r\n\t\t\telse return false;\r\n\t\t}\r\n\t\t\r\n\t}",
"public boolean move(ChessBoard n, int a, int b, int c, int d) throws OutOfBoardException, PathwayException {\n if(!n.getPiece(c,d).getSymbol().equals(\"--- \")){\n System.out.println(\"KING: (\" + a + \",\" + b + \") (\" + c + \",\" + d + \")\");\n System.out.println(\"Invalid Move.(\" + a + \",\" + b + \") (\" + c + \",\" + d + \") Another Piece is in the way.\");\n System.out.println(\"=======================================\");\n System.out.println(n);\n throw new PathwayException();\n }\n //CHECKS TO SEE IF IT IS OUT OF BOARD\n if (c >= 8 || d >= 8) {\n tof = false;\n System.out.println(\"King: (\" + a + \",\" + b + \") (\" + c + \",\" + d + \")\");\n System.out.println(\"Invalid Move.(\" + a + \",\" + b + \") (\" + c + \",\" + d + \") Out of Board. \");\n System.out.println(\"=======================================\");\n System.out.println(n);\n throw new OutOfBoardException();\n } else if (c == a + 1 || c == a - 1 && d == b + 1 || d == b - 1) {\n tof = true;\n } else {\n tof = false;\n }\n return tof;\n }",
"private boolean anyMove (int x,int y, OthelloPiece colour){\n boolean valid = false;\n if(move(x,y,VALID_MOVE_3,VALID_MOVE_2,colour)) valid=true;\n if(move(x,y,VALID_MOVE_3,VALID_MOVE_3,colour)) valid=true;\n if(move(x,y,VALID_MOVE_3,VALID_MOVE_1,colour)) valid=true;\n if(move(x,y,VALID_MOVE_2,VALID_MOVE_3,colour)) valid=true;\n if(move(x,y,VALID_MOVE_2,VALID_MOVE_1,colour)) valid=true;\n if(move(x,y,VALID_MOVE_1,VALID_MOVE_2,colour)) valid=true;\n if(move(x,y,VALID_MOVE_1,VALID_MOVE_3,colour)) valid=true;\n if(move(x,y,VALID_MOVE_1,VALID_MOVE_1,colour)) valid=true;\n return (valid);\n }",
"private boolean isThereValidMove() {\n\t\treturn true;\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 abstract boolean doComputerMove(Player player);",
"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 }",
"public static boolean isMoveValid(int[][] board, int player, int fromRow, int fromCol, int toRow, int toCol) {\r\n\t\t\r\n\t\tboolean ans = false;\r\n\t\t\r\n\t\tif (board[toRow][toCol]==0){/*is the target slot ia emtey*/\r\n\t\t\tif (player==1){\r\n\t\t\t\tif (board[fromRow][fromCol]==1||board[fromRow][fromCol]==2){ /*is the starting slot is red player queen olayer solduer*/\r\n\t\t\t\t\tif (isBasicJumpValid(board,player,fromRow,fromCol,toRow,toCol)){/*is the eating is legal*/\r\n\t\t\t\t\t\tans = true;\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tif (canJump(board,player)==false){/*is ther no eating jump?*/\r\n\t\t\t\t\t\t\tif (isBasicMoveValid(board,player,fromRow,fromCol,toRow,toCol)){/*is this is legal move*/\r\n\t\t\t\t\t\t\t\tans = true;\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\t\t\t\t}\r\n\t\t\t}\t\t\r\n\t\t\tif (player==-1){\r\n\t\t\t\tif (board[fromRow][fromCol]==-1||board[fromRow][fromCol]==-2){/*is the starting slot is blue player queen olayer solduer*/\r\n\t\t\t\t\tif (isBasicJumpValid(board,player,fromRow,fromCol,toRow,toCol)){/*is the eating is legal*/\r\n\t\t\t\t\t\tans = true;\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tif (canJump(board,player)==false){/*is ther are no eating move*/\r\n\t\t\t\t\t\t\tif (isBasicMoveValid(board,player,fromRow,fromCol,toRow,toCol)){/*is the move is legal*/\r\n\t\t\t\t\t\t\t\tans = true;\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\t\t\t\t}\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn ans;\r\n\t}",
"@Override\r\n\tboolean isFinished() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tif(checkForWin() != -1)\r\n\t\t\treturn true;\r\n\t\telse if(!(hasValidMove(0) || hasValidMove(1)))\r\n\t\t\treturn true; //game draw both are stuck\r\n\t\telse return false;\r\n\t}",
"public boolean playerOneWin()\n\t{\n\t\tif( (board[ 1 ] == \"X\") && (board[ 2 ] == \"X\") && (board[ 3 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t} // end of if( (board[ 1 ] == \"X\") && (board[ 2 ] == \"X\") && (board[ 3 ] == \"X\") )\n\t\t\n\t\telse if( (board[ 4 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 6 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t} // end of if( (board[ 4 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 6 ] == \"X\") ) \n\t\t\n\t\telse if( (board[ 7 ] == \"X\") && (board[ 8 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t} // end of if( (board[ 7 ] == \"X\") && (board[ 8 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t\n\t\telse if( (board[ 1 ] == \"X\") && (board[ 4 ] == \"X\") && (board[ 7 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t} // end of if( (board[ 1 ] == \"X\") && (board[ 4 ] == \"X\") && (board[ 7 ] == \"X\") )\n\t\t\n\t\telse if( (board[ 2 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 8 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t} // end of if( (board[ 2 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 8 ] == \"X\") )\n\t\t\n\t\telse if( (board[ 3 ] == \"X\") && (board[ 6 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t} // end of if( (board[ 3 ] == \"X\") && (board[ 6 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t\n\t\telse if( (board[ 1 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t}// end of if( (board[ 1 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t\n\t\telse if( (board[ 7 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t} // end of if( (board[ 7 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t\n\t\treturn false;\n\t}",
"public Move move() {\n\n byte[] piece;\n int pieceIndex;\n Move.Direction direction = null;\n int counter = 0;\n\n Scanner s = new Scanner(System.in);\n\n\n System.out.println(\"Please select piece to move: \");\n\n\n while (true) {\n try {\n pieceIndex = s.nextInt();\n\n if ((piece = getPiece(pieceIndex)) == null) {\n System.out.println(\"invalid index, try again!\");\n// check if selected piece is stuck\n } else if (\n (((player == Board.V) && (piece[1]+1 == Board.getSize()))) || (board.layout[piece[0]][piece[1]+1] == O ) || // UP\n ((player == Board.H) && (piece[1]-1 >=0) && (board.layout[piece[0]][piece[1]-1] == O)) || // DOWN\n ((player == Board.V) && (piece[0]-1 >=0) && (board.layout[piece[0]-1][piece[1]] == O)) || // LEFT\n (((player == Board.H) && (piece[0]+1 == Board.getSize()))) || (board.layout[piece[0]][piece[1]+1] == O )) // RIGHT\n {\n break;\n// if all are stuck pass turn\n } else if (counter + 1 < Board.getSize()) {\n counter++;\n System.out.println(\"Piece is stuck, pick another, \" + counter + \" pieces stuck.\");\n } else {\n System.out.println(\"Passing\");\n return null;\n }\n } catch (Exception e){\n System.out.println(\"Piece index expects int, try again\");\n s = new Scanner(System.in);\n }\n }\n System.out.println(\"Please select direction ('w' // 'a' // 's' // 'd'): \");\n\n boolean valid = false;\n while (!valid) {\n\n switch (s.next().charAt(0)) {\n // if the move requested is valid, break the loop, make the move on our record of layout and return the\n // move made\n case 'w':\n direction = Move.Direction.UP;\n valid = (((player == Board.V) && (piece[1]+1 == Board.getSize()))) || (board.layout[piece[0]][piece[1]+1] == O );\n break;\n\n case 'a':\n direction = Move.Direction.LEFT;\n valid = ((player == Board.V) && (piece[0]-1 >=0) && (board.layout[piece[0]-1][piece[1]] == O));\n break;\n\n case 's':\n direction = Move.Direction.DOWN;\n valid = ((player == Board.H) && (piece[1]-1 >=0) && (board.layout[piece[0]][piece[1]-1] == O));\n break;\n\n case 'd':\n direction = Move.Direction.RIGHT;\n valid = (((player == Board.H) && (piece[0]+1 == Board.getSize()))) || (board.layout[piece[0]][piece[1]+1] == O );\n break;\n default:\n System.out.println(\"Invalid key press, controls are wasd\");\n valid = false;\n }\n }\n Move move = makeMove(direction, pieceIndex);\n board.update(move, player);\n\n return move;\n }",
"@Override\n public boolean isValidMove(Move move) {\n if (board[move.oldRow][move.oldColumn].isValidMove(move, board))\n return true;\n //player will not be in check\n //move will get player out of check if they are in check\n return false;\n }",
"boolean isMoveFinished(int tick);",
"private boolean winningBoard(char[][] board){\n for(int i = 0; i < boardHeight; i++ ){\n for(int j = 0; j < boardWidth; j++) {\n\n //if white was made it to the other side\n if(board[i][j] == 'P' && i == 0){\n return true;\n }\n\n //if black has made it to the other side\n if(board[i][j] == 'p' && i == boardHeight -1){\n return true;\n }\n }\n }\n //no winners\n return false;\n }",
"public static boolean isBasicMoveValid(int[][] board, int player, int fromRow, int fromCol, int toRow, int toCol) {\r\n\t\t\t\r\n\t\tboolean ans = false;\r\n\t\t\r\n\t\t/*Checking if coordinates are OK*/\r\n\t\tif(fromRow<8&fromCol<8&toRow<8&toCol<8&fromRow>-1&fromCol>-1&toRow>-1&toCol>-1&player>-2&player<2&player!=0){\r\n\t\t\tif (board [toRow][toCol]==0){/*Checks if the tile is empty*/\r\n\t\t\t\tif (player==1){/*Checks if player is red*/\r\n\t\t\t\t\tif (board[fromRow][fromCol]==1){/*Checks if in tile there is soldier red */\r\n\t\t\t\t\t\tif(fromRow==toRow-1&&(fromCol==toCol+1||fromCol==toCol-1)){/*Did he move diagonally upward*/\r\n\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\t\r\n\t\t\t\t\tif (board[fromRow][fromCol]==2){/*Checks if in tile there is queen red*/\r\n\t\t\t\t\t\tif(((fromRow==toRow+1)||(fromRow==toRow-1))&&((fromCol==toCol+1)||(fromCol==toCol-1))){/*Did he move diagonally */\r\n\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\r\n\t\t\t\tif (player==-1){/*Checks if player is blue*/\r\n\t\t\t\t\tif (board[fromRow][fromCol]==-1){/*Checks if in tile there is soldier blue */\r\n\t\t\t\t\t\tif(fromRow==toRow+1&(fromCol==toCol+1||fromCol==toCol-1)){/*Did he move diagonally down*/\r\n\t\t\t\t\t\t\tans = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (board[fromRow][fromCol]==-2){/*Checks if in tile there is queen blue*/\r\n\t\t\t\t\t\tif(((fromRow==toRow+1)||(fromRow==toRow-1))&&((fromCol==toCol+1)||(fromCol==toCol-1))){/*Did he move diagonally */\r\n\t\t\t\t\t\t\tans = true;\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\treturn ans;\r\n\t}",
"public void checkWinner(){\n \n if ((board[0][0] == 'X' && board[0][1] == 'X' && board[0][2] == 'X')||(board[1][0] == 'X' && board[1][1] == 'X' && board[1][2] == 'X')||(board[2][0] == 'X' && board[2][1] == 'X' && board[2][2] == 'X')){\n winner();\n }\n else if ((board[0][0] == 'X' && board[1][0] == 'X' && board[2][0] == 'X')||(board[0][1] == 'X' && board[1][1] == 'X' && board[2][1] == 'X')||(board[0][2] == 'X' && board[1][2] == 'X' && board[2][2] == 'X')){\n winner();\n }\n else if ((board[0][0] == 'X' && board[1][1] == 'X' && board[2][2] == 'X')||(board[0][2] == 'X' && board[1][1] == 'X' && board[2][0] == 'X')){\n winner();\n }\n else if ((board[0][0] == 'O' && board[0][1] == 'O' && board[0][2] == 'O')||(board[1][0] == 'O' && board[1][1] == 'O' && board[1][2] == 'O')||(board[2][0] == 'O' && board[2][1] == 'O' && board[2][2] == 'O')){\n winner();\n }\n else if ((board[0][0] == 'O' && board[1][0] == 'O' && board[2][0] == 'O')||(board[0][1] == 'O' && board[1][1] == 'O' && board[2][1] == 'O')||(board[0][2] == 'O' && board[1][2] == 'O' && board[2][2] == 'O')){\n winner();\n }\n else if ((board[0][0] == 'O' && board[1][1] == 'O' && board[2][2] == 'O')||(board[0][2] == 'O' && board[1][1] == 'O' && board[2][0] == 'O')){\n winner();\n }\n \n }",
"public boolean DecideMove(Crazy8sBoard board){\n boolean haveAnEight = false;\n int locationOf8Card = 0;\n\n String topCard = board.GetTopTrashCard();\n String topFirstLetter = Character.toString(topCard.charAt(0));\n\n for(int i = 0; i < board.GetSizeOfComputerHand(); i++){\n\n String card = board.GetComputerCard(i);\n String firstLetter = Character.toString(card.charAt(0));\n\n if(topCard.contains(\"8\")){\n //Play whatever card, get to choose suite\n board.ComputerUpdateTopCard(i);\n board.RemoveCardFromComputer(i);\n return true;\n }\n\n if(card.contains(\"8\")){\n haveAnEight = true;\n locationOf8Card = i;\n }\n\n else {\n //the cards match in suite, doesn't matter what it is\n if (firstLetter.equals(topFirstLetter)) {\n board.ComputerUpdateTopCard(i);\n board.RemoveCardFromComputer(i);\n return true;\n }\n\n else {\n if (topFirstLetter.equals(\"c\")) {\n String temp = topCard.substring(5, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if (card.contains(temp)) {\n board.ComputerUpdateTopCard(i);\n board.RemoveCardFromComputer(i);\n return true;\n }\n\n } else if (topFirstLetter.equals(\"h\")) {\n String temp = topCard.substring(6, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if (card.contains(temp)) {\n board.ComputerUpdateTopCard(i);\n board.RemoveCardFromComputer(i);\n return true;\n }\n\n } else if (topFirstLetter.equals(\"d\")) {\n String temp = topCard.substring(8, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if (card.contains(temp)) {\n board.ComputerUpdateTopCard(i);\n board.RemoveCardFromComputer(i);\n return true;\n }\n\n } else if (topFirstLetter.equals(\"s\")) {\n String temp = topCard.substring(6, topCard.length());\n System.out.println(\"TEMP \" + temp);\n\n if (card.contains(temp)) {\n board.ComputerUpdateTopCard(i);\n board.RemoveCardFromComputer(i);\n return true;\n }\n }\n }\n }\n }\n\n //Only play an 8 if all other cards are exhausted\n if(haveAnEight){\n //valid because 8s are wild cards, can place it\n board.ComputerUpdateTopCard(locationOf8Card);\n board.RemoveCardFromComputer(locationOf8Card);\n return true;\n }\n\n //couldn't play any card\n return false;\n }",
"public static void move(TTTBoard board, char piece) {\n if (board.winner() != ' ') {\n throw new IllegalArgumentException(\"Game Over\");\n }\n if (board.size() == 1) {\n board.set(0, 0, piece);\n return;\n }\n if (board.size() == 3) {\n int turnNumber = getBoardTurnNumber(board);\n if (turnNumber == 1) {\n board.set(0, 0, piece);\n return;\n } else if (turnNumber == 2) {\n if (board.get(1, 1) == ' ') {\n board.set(1, 1, piece);\n return;\n } else if (board.get(0, 0) == ' ') {\n board.set(0, 0, piece);\n return;\n }\n } else if (turnNumber == 3) {\n try {\n int[] opp = getFirstOpp(board, piece);\n int oppRow = opp[0];\n if (oppRow == 0) {\n board.set(2, 0, piece);\n return;\n } else if (oppRow == 1) {\n board.set(0, 2, piece);\n return;\n } else {\n board.set(0, 2, piece);\n return;\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }\n\n // check if win diagonal\n int selfC = 0;\n int oppC = 0;\n int spaceC = 0;\n for (int i = 0; i < board.size(); ++i) {\n int j = i;\n char p = board.get(i, j);\n if (p == ' ') spaceC++;\n else if (p == piece) selfC++;\n else oppC++;\n }\n\n if (spaceC == 1 && (selfC == 0 || oppC == 0)) {\n // fill in that space\n for (int i = 0; i < board.size(); ++i) {\n int j = i;\n char p = board.get(i, j);\n if (p == ' ') {\n board.set(i, j, piece);\n return;\n }\n }\n }\n\n selfC = 0;\n oppC = 0;\n spaceC = 0;\n for (int i = 0; i < board.size(); ++i) {\n int j = board.size() - i - 1;\n char p = board.get(i, j);\n if (p == ' ') spaceC++;\n else if (p == piece) selfC++;\n else oppC++;\n\n }\n\n if (spaceC == 1 && (selfC == 0 || oppC == 0)) {\n // fill in that space\n for (int i = 0; i < board.size(); ++i) {\n int j = board.size() - i - 1;\n char p = board.get(i, j);\n if (p == ' ') {\n board.set(i, j, piece);\n return;\n }\n }\n }\n\n // check if win row col\n\n boolean[] selfWinnableRows = new boolean[board.size()];\n boolean[] oppWinnableRows = new boolean[board.size()];\n boolean[] selfWinnableCols = new boolean[board.size()];\n boolean[] oppWinnableCols = new boolean[board.size()];\n int[] selfCountRows = new int[board.size()];\n int[] selfCountCols = new int[board.size()];\n int[] oppCountRows = new int[board.size()];\n int[] oppCountCols = new int[board.size()];\n\n // checks if any rows can be won\n for (int i = 0; i < board.size(); ++i) {\n boolean containsSelf = false;\n boolean containsOpp = false;\n boolean hasEmpty = false;\n int selfCount = 0;\n int oppCount = 0;\n\n for (int j = 0; j < board.size(); ++j) {\n char p = board.get(i, j);\n\n if (p == ' ') {\n hasEmpty = true;\n } else if (p == piece) {\n containsSelf = true;\n selfCount++;\n } else {\n containsOpp = true;\n oppCount++;\n }\n }\n\n selfCountRows[i] = selfCount;\n oppCountRows[i] = oppCount;\n\n if (!hasEmpty) continue;\n\n if (!containsSelf && !containsOpp) {\n selfWinnableRows[i] = true;\n oppWinnableRows[i] = true;\n }\n\n if (containsSelf && !containsOpp) {\n selfWinnableRows[i] = true;\n }\n if (containsOpp && !containsSelf) {\n oppWinnableRows[i] = true;\n }\n }\n\n // checks if any cols can be won\n for (int i = 0; i < board.size(); ++i) {\n boolean containsSelf = false;\n boolean containsOpp = false;\n boolean hasEmpty = false;\n int selfCount = 0;\n int oppCount = 0;\n for (int j = 0; j < board.size(); ++j) {\n char p = board.get(j, i);\n\n if (p == ' ') {\n hasEmpty = true;\n } else if (p == piece) {\n containsSelf = true;\n selfCount++;\n } else {\n containsOpp = true;\n oppCount++;\n }\n }\n\n selfCountCols[i] = selfCount;\n oppCountCols[i] = oppCount;\n\n if (!hasEmpty) continue;\n\n if (!containsSelf && !containsOpp) {\n selfWinnableCols[i] = true;\n oppWinnableCols[i] = true;\n }\n\n if (containsSelf && !containsOpp) {\n selfWinnableCols[i] = true;\n }\n\n if (containsOpp && !containsSelf) {\n oppWinnableCols[i] = true;\n }\n }\n\n int[] selfInRowRows = new int[board.size()];\n int[] selfInRowCols = new int[board.size()];\n int[] oppInRowRows = new int[board.size()];\n int[] oppInRowCols = new int[board.size()];\n\n for (int i = 0; i < selfWinnableRows.length; ++i) {\n if (selfWinnableRows[i]) {\n int count = selfCountRows[i];\n selfInRowRows[count]++;\n }\n }\n for (int i = 0; i < selfWinnableCols.length; ++i) {\n if (selfWinnableCols[i]) {\n int count = selfCountCols[i];\n selfInRowCols[count]++;\n }\n }\n for (int i = 0; i < oppWinnableRows.length; ++i) {\n if (oppWinnableRows[i]) {\n int count = oppCountRows[i];\n oppInRowRows[count]++;\n }\n }\n for (int i = 0; i < oppWinnableCols.length; ++i) {\n if (oppWinnableCols[i]) {\n int count = oppCountCols[i];\n oppInRowCols[count]++;\n }\n }\n\n if (board.size() == 3) {\n int turnNumber = getBoardTurnNumber(board);\n if (selfInRowRows[board.size() - 1] == 0 &&\n selfInRowCols[board.size() - 1] == 0 &&\n oppInRowRows[board.size() - 1] == 0 &&\n oppInRowCols[board.size() - 1] == 0) {\n if (turnNumber == 4) {\n if ((board.get(1, 1) != ' ' && board.get(1, 1) != piece)\n && (board.get(2, 2) != ' ' && board.get(2, 2) != piece)) {\n board.set(2, 0, piece);\n return;\n }\n } else if (turnNumber == 5) {\n if (selfCountCols[0] == 2) {\n board.set(2, 2, piece);\n return;\n } else if (selfCountRows[0] == 2) {\n if (board.get(1, 0) != piece && board.get(1, 0) != ' ') {\n board.set(2, 2, piece);\n return;\n }\n if (board.get(2, 0) != piece && board.get(2, 0) != ' ') {\n board.set(2, 2, piece);\n return;\n }\n board.set(2, 0, piece);\n return;\n }\n }\n }\n }\n\n for (int i = board.size() - 1; i >= 0; i--) {\n int selfRowsCount = selfInRowRows[i];\n //System.out.println(i + \" self rows count: \" + selfRowsCount);\n if (selfRowsCount > 0) {\n // get a row index that contains this self in row rows\n try {\n int rowIndex = getRowIndexForInRowRows(board, i, selfWinnableRows, selfCountRows);\n int colIndex = getNextInRow(board, rowIndex);\n board.set(rowIndex, colIndex, piece);\n return;\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }\n int selfColsCount = selfInRowCols[i];\n if (selfColsCount > 0) {\n try {\n int colIndex = getRowIndexForInRowRows(board, i, selfWinnableCols, selfCountCols);\n int rowIndex = getNextInCol(board, colIndex);\n board.set(rowIndex, colIndex, piece);\n return;\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n int oppRowsCount = oppInRowRows[i];\n // System.out.println(i + \" opp rows count: \" + oppRowsCount);\n if (oppRowsCount > 0) {\n\n try {\n int rowIndex = getRowIndexForInRowRows(board, i, oppWinnableRows, oppCountRows);\n int colIndex = getNextInRow(board, rowIndex);\n board.set(rowIndex, colIndex, piece);\n return;\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }\n int oppColsCount = oppInRowCols[i];\n if (oppColsCount > 0) {\n try {\n int colIndex = getRowIndexForInRowRows(board, i, oppWinnableCols, oppCountCols);\n int rowIndex = getNextInCol(board, colIndex);\n board.set(rowIndex, colIndex, piece);\n return;\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }\n\n try {\n int[] nextEmpty = getNextEmpty(board);\n board.set(nextEmpty[0], nextEmpty[1], piece);\n } catch (Exception e) {\n throw new IllegalArgumentException(\"DRAW / SOMEONE WON\");\n }\n }",
"private boolean movePlayer(String placeToMoveTo) {\n if (placeToMoveTo.equalsIgnoreCase(\"go\") || placeToMoveTo.equals(\"\")) {\n System.out.println(\"Go where?\");\n return false;\n }\n\n // Check to see if the player is trying to move through a valid Exit\n if (currentRoom.getExit1() != null && placeToMoveTo.equalsIgnoreCase(currentRoom.getExit1().getName())) {\n if (this.checkExit(currentRoom.getExit1())) {\n // Move the player and set the current room to the room that they have moved to\n currentRoom = currentRoom.getExit1().getDestination();\n return true;\n }\n } else if (currentRoom.getExit2() != null && placeToMoveTo.equalsIgnoreCase(currentRoom.getExit2().getName())) {\n if (this.checkExit(currentRoom.getExit2())) {\n // Move the player and set the current room to the room that they have moved to\n currentRoom = currentRoom.getExit2().getDestination();\n return true;\n }\n } else if (currentRoom.getExit3() != null && placeToMoveTo.equalsIgnoreCase(currentRoom.getExit3().getName())) {\n if (this.checkExit(currentRoom.getExit3())) {\n // Move the player and set the current room to the room that they have moved to\n currentRoom = currentRoom.getExit3().getDestination();\n return true;\n }\n } else if (currentRoom.getExit4() != null && placeToMoveTo.equalsIgnoreCase(currentRoom.getExit4().getName())) {\n if (this.checkExit(currentRoom.getExit4())) {\n // Move the player and set the current room to the room that they have moved to\n currentRoom = currentRoom.getExit4().getDestination();\n return true;\n }\n } else if (currentRoom.getSecretExit() != null && placeToMoveTo.equalsIgnoreCase(currentRoom.getSecretExit().getName())) {\n if (this.checkExit(currentRoom.getSecretExit())) {\n // Move the player and set the current room to the room that they have moved to\n currentRoom = currentRoom.getSecretExit().getDestination();\n return true;\n }\n } // They have not specified a valid exit\n else {\n System.out.println(\"It doesn't appear as though I can go there.\");\n return false;\n }\n\n return false;\n }",
"@Override\n\tpublic boolean move(int col, int row, piece[][] board) {\n\t\treturn false;\n\t}",
"private boolean processCommand(Command command) \n {\n boolean wantToQuit = false;\n\n CommandWord commandWord = command.getCommandWord();\n\n if(commandWord == CommandWord.UNKNOWN) {\n Logger.Log(\"I don't know what you mean...\");\n return false;\n }\n \n if (commandWord == CommandWord.HELP) {\n printHelp();\n }\n else if (commandWord == CommandWord.GO) {\n goRoom(command);\n }\n \n else if (commandWord == CommandWord.TAKE) {\n takeItem(command);\n }\n \n else if (commandWord == CommandWord.USE) {\n useItem(command);\n }\n \n else if (commandWord == CommandWord.LOOK) {\n Logger.Log(currentRoom.getLongDescription());\n }\n \n else if (commandWord == CommandWord.VIEW) {\n viewPlayer(command);\n }\n \n else if (commandWord == CommandWord.QUIT) {\n wantToQuit = quit(command);\n }\n // else command not recognised.\n return wantToQuit;\n }",
"private int Win_Move() {\n\t\tfinal int POSSIBLE_WIN = 8;\n\t\tint move = NO_MOVE;\n\t\tif(( gameBoard[TOP_LEFT] + gameBoard[TOP_CENTER] + gameBoard[TOP_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_LEFT] == EMPTY){\n\t\t\t\tmove = TOP_LEFT;\n\t\t\t}else if (gameBoard[TOP_CENTER] == EMPTY){\n\t\t\t\tmove = TOP_CENTER;\n\t\t\t}else if (gameBoard[TOP_RIGHT] == EMPTY){\n\t\t\t\tmove = TOP_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[CTR_LEFT] + gameBoard[CTR_CENTER] + gameBoard[CTR_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[CTR_LEFT] == EMPTY){\n\t\t\t\tmove = CTR_LEFT;\n\t\t\t}else if (gameBoard[CTR_CENTER] == EMPTY){\n\t\t\t\tmove = CTR_CENTER;\n\t\t\t}else if (gameBoard[CTR_RIGHT] == EMPTY){\n\t\t\t\tmove = CTR_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[BTM_LEFT] + gameBoard[BTM_CENTER] + gameBoard[BTM_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[BTM_LEFT] == EMPTY){\n\t\t\t\tmove = BTM_LEFT;\n\t\t\t}else if (gameBoard[BTM_CENTER] == EMPTY){\n\t\t\t\tmove = BTM_CENTER;\n\t\t\t}else if (gameBoard[BTM_RIGHT] == EMPTY){\n\t\t\t\tmove = BTM_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_LEFT] + gameBoard[CTR_LEFT] + gameBoard[BTM_LEFT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_LEFT] == EMPTY){\n\t\t\t\tmove = TOP_LEFT;\n\t\t\t}else if (gameBoard[CTR_LEFT] == EMPTY){\n\t\t\t\tmove = CTR_LEFT;\n\t\t\t}else if (gameBoard[BTM_LEFT] == EMPTY){\n\t\t\t\tmove = BTM_LEFT;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_CENTER] + gameBoard[CTR_CENTER] + gameBoard[BTM_CENTER]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_CENTER] == EMPTY){\n\t\t\t\tmove = TOP_CENTER;\n\t\t\t}else if (gameBoard[CTR_CENTER] == EMPTY){\n\t\t\t\tmove = CTR_CENTER;\n\t\t\t}else if (gameBoard[BTM_CENTER] == EMPTY){\n\t\t\t\tmove = BTM_CENTER;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_RIGHT] + gameBoard[CTR_RIGHT] + gameBoard[BTM_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_RIGHT] == EMPTY){\n\t\t\t\tmove = TOP_RIGHT;\n\t\t\t}else if (gameBoard[CTR_RIGHT] == EMPTY){\n\t\t\t\tmove = CTR_RIGHT;\n\t\t\t}else if (gameBoard[BTM_RIGHT] == EMPTY){\n\t\t\t\tmove = BTM_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_LEFT] + gameBoard[CTR_CENTER] + gameBoard[BTM_RIGHT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_LEFT] == EMPTY){\n\t\t\t\tmove = TOP_LEFT;\n\t\t\t}else if (gameBoard[CTR_CENTER] == EMPTY){\n\t\t\t\tmove = CTR_CENTER;\n\t\t\t}else if (gameBoard[BTM_RIGHT] == EMPTY){\n\t\t\t\tmove = BTM_RIGHT;\n\t\t\t}\n\t\t}else if((gameBoard[TOP_RIGHT] + gameBoard[CTR_CENTER] + gameBoard[BTM_LEFT]) == POSSIBLE_WIN){\n\t\t\tif(gameBoard[TOP_RIGHT] == EMPTY){\n\t\t\t\tmove = TOP_RIGHT;\n\t\t\t}else if (gameBoard[CTR_CENTER] == EMPTY){\n\t\t\t\tmove = CTR_CENTER;\n\t\t\t}else if (gameBoard[BTM_LEFT] == EMPTY){\n\t\t\t\tmove = BTM_LEFT;\n\t\t\t}\n\t\t}\n\t\treturn move;\n\t}",
"public boolean checkForWinner(String player) {\r\n\t\t\r\n\t\t// check rows\r\n\t\tfor (int row = 0; row < board.length; row++) {\r\n\t\t\tint markCounter = 0;\r\n\t\t\tfor (int col = 0; col < board[row].length; col++) {\r\n\t\t\t\tif (board[row][col].getText().contains(player)) {\r\n\t\t\t\t\tmarkCounter++;\r\n\t\t\t\t}\r\n\t\t\t\telse if(! (board[row][col].getText().contains(player)) ) {\r\n\t\t\t\t\tmarkCounter = 0;\r\n\t\t\t\t}\r\n\t\t\t\tif (markCounter == connectX) {\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\t\r\n\t\t\r\n\t\t// check columns\r\n\t\tfor (int col = 0; col < 7; col++) {\r\n\t\t\tint markCounter = 0;\r\n\t\t\tfor (int row = board.length - 1; row >= 0; row--) {\r\n\t\t\t\tif(board[row][col].getText().contains(player)) {\r\n\t\t\t\t\tmarkCounter++;\r\n\t\t\t\t}\r\n\t\t\t\telse if(! (board[row][col].getText().contains(player)) ) {\r\n\t\t\t\t\tmarkCounter = 0;\r\n\t\t\t\t}\r\n\t\t\t\tif (markCounter == connectX) {\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\t\r\n\t\t/*\r\n\t\t * This algorithm checks the right side of the second diagonal on the board. The while loop iterates four times from bottom \r\n\t\t * to top, right to left. \r\n\t\t * The reason it only iterates four times is because after a certain point, it is impossible for a player to connect four\r\n\t\t * so the code does'nt have to check the corners.\r\n\t\t * \t\tO X X X O O O\r\n\t\t * \t\tO O X X X O O\r\n\t\t * \t\tO O O X X X O\r\n\t\t *\t\tO O O O X X X\r\n\t\t * \t\tO O O O O X X\r\n\t\t * \t\tO O O O O O X\r\n\t\t * \r\n\t\t */\r\n\t\tint diag2Count = 0;\r\n\t\tint row = board.length - 1;\r\n\t\tint col = 6;\r\n\t\tint iteration = 0;\r\n\t\tint rowPlace = row;\r\n\t\twhile (iteration < 4) {\r\n\t\t\trow = rowPlace;\r\n\t\t\tcol = 6;\r\n\t\t\twhile (row >= 0 && col >= 1) {\r\n\t\t\t\tif (board[row][col].getText().contains(currPlayer)) {\r\n\t\t\t\t\tdiag2Count++;\r\n\t\t\t\t}\r\n\t\t\t\tif (!(board[row][col].getText().contains(player))) {\r\n\t\t\t\t\tdiag2Count = 0; //If there is a chip which does not belong to a player in the sequence, the counter is reset.\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (diag2Count == connectX) {\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\trow--;\r\n\t\t\t\tcol--;\r\n\t\t\t}\r\n\t\t\titeration++;\r\n\t\t\trowPlace--;\r\n\t\t}\r\n\r\n\t\t/*\r\n\t\t * Checks the left hand side of the secondary diagonal. Iterates only 3 times.\r\n\t\t * of the board.\r\n\t\t * \t\t\tX O O O O O O\r\n\t\t * \t\t\tX X O O O O O\r\n\t\t * \t\t\tX X X O O O O\r\n\t\t * \t\t\tO X X X O O O\r\n\t\t * \t\t\tO O X X X O O\r\n\t\t * \t\t\tO O O X X X O\r\n\t\t */\r\n\t\trow = board.length - 1;\r\n\t\tcol = 3;\r\n\t\titeration = 0;\r\n\t\tint colPlace = col;\r\n\t\twhile (iteration < 4) {\r\n\t\t\tcol = colPlace;\r\n\t\t\trow = board.length -1;\r\n\t\t\twhile (row >= 0 && col >= 0) {\r\n\t\t\t\tif (board[row][col].getText().contains(currPlayer)) {\r\n\t\t\t\t\tdiag2Count++;\r\n\t\t\t\t}\r\n\t\t\t\tif (!(board[row][col].getText().contains(player))) {\r\n\t\t\t\t\tdiag2Count = 0; //If there is a chip which does not belong to a player in the sequence, the counter is reset.\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (diag2Count == connectX) {\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\trow--;\r\n\t\t\t\tcol--;\r\n\t\t\t}\r\n\t\t\titeration++;\r\n\t\t\tcolPlace++;\r\n\t\t}\r\n\t\t\r\n\t\t/*\r\n\t\t * Checks the left hand main Diagonals and iterates 3 times.\r\n\t\t * \t\t\tO O O X X X O\r\n\t\t * \t\t\tO O X X X O O\r\n\t\t * \t\t\tO X X X O O O \r\n\t\t * \t\t\tX X X O O O O\r\n\t\t * \t\t\tX X O O O O O\r\n\t\t * \t\t\tX O O O O O O\r\n\t\t * \r\n\t\t */\r\n\t\trow = 3;\r\n\t\tcol = 0;\r\n\t\trowPlace = row;\r\n\t\titeration = 0;\r\n\t\tint diagMainCounter = 0;\r\n\t\twhile (iteration < 3) {\r\n\t\t\trow = rowPlace;\r\n\t\t\tcol = 0;\r\n\t\t\twhile (row >= 0 && col <= 6) {\r\n\t\t\t\tif (board[row][col].getText().contains(currPlayer)) {\r\n\t\t\t\t\tdiagMainCounter++;\r\n\t\t\t\t}\r\n\t\t\t\tif (!(board[row][col].getText().contains(player))) {\r\n\t\t\t\t\tdiagMainCounter = 0; //If there is a chip which does not belong to a player in the sequence, the counter is reset.\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (diagMainCounter == connectX) {\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\trow--;\r\n\t\t\t\tcol++;\r\n\t\t\t}\r\n\t\t\titeration++;\r\n\t\t\trowPlace++;\r\n\t\t}\r\n\t\t\r\n\t\t/*\r\n\t\t * Checks the right hand side of the main diagonal and iterates 4 times.\r\n\t\t * \r\n\t\t *\t\t\tO O O O O O X\r\n\t\t *\t\t\tO O O O O X X\r\n\t\t *\t\t\tO O O O X X X\r\n\t\t *\t\t\tO O O X X X O\r\n\t\t *\t\t\tO O X X X O O\r\n\t\t *\t\t\tO X X X O O O\r\n\t\t */\r\n\t\trow = board.length -1;\r\n\t\tcol = 0;\r\n\t\tcolPlace = col;\r\n\t\titeration = 0;\r\n\t\tdiagMainCounter = 0;\r\n\t\twhile (iteration < 4) {\r\n\t\t\tcol = colPlace;\r\n\t\t\trow = board.length -1;\r\n\t\t\twhile (row >= 0 && col <= 6) {\r\n\t\t\t\tif (board[row][col].getText().contains(currPlayer)) {\r\n\t\t\t\t\tdiagMainCounter++;\r\n\t\t\t\t}\r\n\t\t\t\tif (!(board[row][col].getText().contains(player))) {\r\n\t\t\t\t\tdiagMainCounter = 0; //If there is a chip which does not belong to a player in the sequence, the counter is reset.\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (diagMainCounter == connectX) {\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\trow--;\r\n\t\t\t\tcol++;\r\n\t\t\t}\r\n\t\t\titeration++;\r\n\t\t\tcolPlace++;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"boolean doMove();",
"public boolean isLegalStep(MoveDirection dir){\r\n GamePosition curPos = currentGame.getCurrentPosition();\n\t\tPlayer white = currentGame.getWhitePlayer();\n\t\tint[] toCheckPos = new int[2];\n\t\tint[] existingPos = new int[2];\n\t\tif(curPos.getPlayerToMove().equals(white)) {\n\t\t\ttoCheckPos[0] = curPos.getWhitePosition().getTile().getColumn();\n\t\t\ttoCheckPos[1] = curPos.getWhitePosition().getTile().getRow();\n\t\t\t\n\t\t\texistingPos[0] = curPos.getBlackPosition().getTile().getColumn();\n\t\t\texistingPos[1] = curPos.getBlackPosition().getTile().getRow();\n\t\t\t\n\t\t} else {\n\t\t\ttoCheckPos[0] = curPos.getBlackPosition().getTile().getColumn();\n\t\t\ttoCheckPos[1] = curPos.getBlackPosition().getTile().getRow();\n\t\t\t\n\t\t\texistingPos[0] = curPos.getWhitePosition().getTile().getColumn();\n\t\t\texistingPos[1] = curPos.getWhitePosition().getTile().getRow();\n\t\t}\n\t\t//0 = column, 1 = row\n\t\tif(dir == MoveDirection.North) {\n\t\t\tif(toCheckPos[1] == 1) return false;\n\t\t\tif(toCheckPos[1] - 1 == existingPos[1] && toCheckPos[0] == existingPos[0]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), -1, 0);\n\t\t} else if(dir == MoveDirection.South) {\n\t\t\tif(toCheckPos[1] == 9) return false;\n\t\t\tif(toCheckPos[1] + 1 == existingPos[1] && toCheckPos[0] == existingPos[0]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), 1, 0);\n\t\t} else if(dir == MoveDirection.East) {\n\t\t\tif(toCheckPos[0] == 9) return false;\n\t\t\tif(toCheckPos[0] + 1 == existingPos[0] && toCheckPos[1] == existingPos[1]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), 0, 1);\n\t\t} else if(dir == MoveDirection.West) {\n\t\t\tif(toCheckPos[0] == 1) return false;\n\t\t\tif(toCheckPos[0] - 1 == existingPos[0] && toCheckPos[1] == existingPos[1]) return false;\n\t\t\treturn QuoridorController.noWallBlock(curPos.getPlayerToMove(), 0, -1);\n\t\t}\n\t\t\n\t\treturn false;\r\n }",
"public boolean playerMove(Character token, int dice){\n\n\t\tPlayers player = searchBox(token, 0, 0, 0).getPlayers().get(0);\n\t\tplayer.setCurrentBox(player.getCurrentBox() + dice);\n\t\t\n\t\tif(player.getCurrentBox() == colums*rows){\n\t\t\tplayer.setMovement(player.getMovement() + 1);\n\t\t\treturn true;\n\n\t\t}else if(player.getCurrentBox() > colums*rows){\n\t\t\tint difference = colums*rows - (player.getCurrentBox() - dice);\n\t\t\tgetBoxs().get(searchPosition(player.getCurrentBox() - dice, 0)).getPlayers().remove(0);\n\t\t\tplayer.setCurrentBox(colums*rows);\n\t\t\tgetBoxs().get(colums*rows - colums).getPlayers().add(player);\n\n\t\t\tif(dice - difference == colums*rows){\n\t\t\t\treturn playerMove(token, (colums*rows - 1) * (-1));\n\n\t\t\t}else{\n\t\t\t\treturn playerMove(token, (dice - difference) * (-1));\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}else{\n\n\t\t\tint index = searchPosition(player.getCurrentBox(), 0);\n\t\t\tsearchBox(token, 0, 0, 0).getPlayers().remove(0);\n\t\t\tplayer.setMovement(player.getMovement() + 1);\n\n\t\t\tif(getBoxs().get(index).getTypeAction()){\n\t\t\t\tplayer.setCurrentBox(getBoxs().get(getBoxs().get(index).getSendTo()).getNumBoxInt());\n\t\t\t\tgetBoxs().get(getBoxs().get(index).getSendTo()).getPlayers().add(player);\n\t\t\t\tSystem.out.println(\"*. El jugador cayo en una casilla especial por ende su ficha queda en: \" + player.getCurrentBox());\n\t\t\t}else{\n\t\t\t\tgetBoxs().get(index).getPlayers().add(player);\n\t\t\t\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\t\t\n\n\t}",
"public void game(){\r\n char activePlayer='X';\r\n printBoard();\r\n System.out.println();\r\n while(checkWinner()=='N'){\r\n Scanner scan=new Scanner(System.in);\r\n System.out.println(activePlayer+\": What X Coordinate would you like to go at?\");\r\n int x=scan.nextInt();\r\n System.out.println(activePlayer+\": What Y Coordinate would you like to go at?\");\r\n int y=scan.nextInt();\r\n System.out.println();\r\n if(makeMove(x, y, activePlayer)){\r\n if(activePlayer=='X'){\r\n activePlayer='O';\r\n }\r\n else{\r\n activePlayer='X';\r\n }\r\n }\r\n else{\r\n System.out.println(\"Sorry \"+activePlayer+\" your move was invalid. Try again!\");\r\n }\r\n printBoard();\r\n System.out.println();\r\n }\r\n if(checkWinner()=='T'){\r\n System.out.println(\"It's a Tie!\");\r\n }\r\n else{\r\n System.out.println(checkWinner()+\" Wins!\");\r\n }\r\n \r\n }",
"public boolean move (int x,int y, OthelloPiece colour){\n boolean valid = false;\n if(move(x,y,VALID_MOVE_3,VALID_MOVE_2,colour)) valid=true;\n if(move(x,y,VALID_MOVE_3,VALID_MOVE_3,colour)) valid=true;\n if(move(x,y,VALID_MOVE_3,VALID_MOVE_1,colour)) valid=true;\n if(move(x,y,VALID_MOVE_2,VALID_MOVE_3,colour)) valid=true;\n if(move(x,y,VALID_MOVE_2,VALID_MOVE_1,colour)) valid=true;\n if(move(x,y,VALID_MOVE_1,VALID_MOVE_2,colour)) valid=true;\n if(move(x,y,VALID_MOVE_1,VALID_MOVE_3,colour)) valid=true;\n if(move(x,y,VALID_MOVE_1,VALID_MOVE_1,colour)) valid=true;\n setThePieces();\n if(valid){\n m_PieceCount++;\n }\n return (valid);\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 }",
"private boolean moveIsValid(Move move){\n BoardSpace[][] boardCopy = new BoardSpace[Constants.BOARD_DIMENSIONS][Constants.BOARD_DIMENSIONS];\n for(int i = 0; i < Constants.BOARD_DIMENSIONS; i++){\n for(int j = 0; j < Constants.BOARD_DIMENSIONS; j++){\n boardCopy[i][j] = new BoardSpace(boardSpaces[i][j]);\n }\n }\n int row = move.getStartRow();\n int col = move.getStartCol();\n String ourWord = \"\";\n String currentWord = \"\";\n for (Tile tile: move.getTiles()){\n ourWord += tile.getLetter();\n if (move.isAcross()){\n col++;\n } else {\n row++;\n }\n }\n currentWord = ourWord;\n if(move.isAcross()){\n //check if we keep going right we invalidate the word\n while(col+1 < boardCopy.length && !boardCopy[row][++col].isEmpty() ){\n if( isValidWord(currentWord += boardCopy[row][col].getTile().getLetter()) == false ) return false;\n }\n //check if we keep going left we invalidate the word\n col = move.getStartCol();\n currentWord = ourWord;\n while(col-1 >= 0 && !boardCopy[row][--col].isEmpty() ){\n if(!isValidWord( currentWord = boardCopy[row][col].getTile().getLetter() + currentWord ) ) return false;\n }\n } else if(!move.isAcross()){\n row = move.getStartRow(); col = move.getStartCol();\n currentWord = ourWord;\n //check if we keep going down we invalidate the word;\n while(row+1 < boardCopy.length && !boardCopy[++row][col].isEmpty()){\n if( !isValidWord(currentWord += boardCopy[row][col].getTile().getLetter() )) return false;\n }\n row = move.getStartRow();\n currentWord = ourWord;\n while(row-1 >= 0 && !boardCopy[--row][col].isEmpty()){\n if( !isValidWord( currentWord = boardCopy[row][col].getTile().getLetter() + currentWord )) return false;\n }\n }\n return true;\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 }",
"public boolean send(String command, Component owner, boolean askContinue)\n {\n assert(SwingUtilities.isEventDispatchThread());\n String c = command.trim();\n if (c.equals(\"\"))\n return true;\n if (c.startsWith(\"#\"))\n {\n m_gtpShellText.appendComment(command + \"\\n\");\n }\n else\n {\n if (c.startsWith(\"boardsize \")\n || c.startsWith(\"black \")\n || c.equals(\"clear_board\")\n || c.startsWith(\"genmove \")\n || c.startsWith(\"genmove_black \")\n || c.startsWith(\"genmove_cleanup \")\n || c.startsWith(\"genmove_white \")\n || c.startsWith(\"kgs-genmove_cleanup \")\n || c.startsWith(\"loadsgf \")\n || c.startsWith(\"play \")\n || c.startsWith(\"play_sequence \")\n || c.startsWith(\"white \")\n || c.startsWith(\"quit\"))\n {\n if (m_modifyWarning == null)\n m_modifyWarning = new OptionalMessage(this);\n String message = \n \"The command '\" + command + \"' \" +\n \"will modify the board state \" +\n \"and cause the graphical board to be out of sync. \" +\n \"You should start a new game before using \" +\n \"the graphical board again.\";\n if (! m_modifyWarning.showWarning(message))\n return true;\n }\n try\n {\n m_callback.sendGtpCommand(command, owner != null);\n }\n catch (GtpError e)\n {\n Util.showError(owner, m_programName, e);\n if (askContinue)\n return ! SimpleDialogs.showQuestion(owner, \"Abort?\");\n }\n }\n return true;\n }",
"public boolean validateMoveAndPlay(String input){\n // This function validates the move. such as whether coins are present or not.\n try{\n InvalidMoveException.validateMove(input, this.gameController);\n if(playMove(input) == false){\n return false;\n }\n }catch(InvalidMoveException e){\n System.out.println(\"\\nDiscarding \"+input+ \" move because of following exception\");\n System.out.println(e.getMessage()+\"\\n\");\n }\n return true;\n }",
"public boolean move(int oldCol, int oldRow, int newCol, int newRow , char promo) {\r\n\r\n\r\n if(isValidMove(oldCol, oldRow, newCol, newRow)) {\r\n\r\n\r\n // not a valid move for current player for ANY piece\r\n // if current players king will be in check as a result\r\n // move is disallowed\r\n if (King.isPlayerKingInCheck(oldRow, oldCol, newRow, newCol)) {\r\n return false;\r\n }\r\n else {\r\n\r\n if (Chessboard.whitesTurn==true) {\r\n Chessboard.whiteincheck=false;\r\n }\r\n if (Chessboard.blacksTurn==true) {\r\n Chessboard.blackincheck=false;\r\n }\r\n }\r\n\r\n\r\n\r\n Chessboard.chessBoard[newRow][newCol].setPiece(Chessboard.chessBoard[oldRow][oldCol].getPiece());\r\n Chessboard.chessBoard[oldRow][oldCol].setPiece(null);\r\n Chessboard.chessBoard[newRow][newCol].getPiece().moved();\r\n\r\n if (King.isOpponentKingInCheck(newRow, newCol)){\r\n if (Chessboard.whitesTurn==true) {\r\n Chessboard.blackincheck=true;\r\n }\r\n if (Chessboard.blacksTurn==true) {\r\n Chessboard.whiteincheck=true;\r\n }\r\n }\r\n else {\r\n if (Chessboard.whitesTurn==true) {\r\n Chessboard.blackincheck=false;\r\n }\r\n if (Chessboard.blacksTurn==true) {\r\n Chessboard.whiteincheck=false;\r\n }\r\n }\r\n if(King.isOpponentKinginCheckmate(newRow, newCol)) {\r\n Chessboard.checkMate=true;\r\n }\r\n\r\n\r\n Pawn.r = -1;\r\n Pawn.c = -1;\r\n return true;\r\n }\r\n return false;\r\n }",
"public boolean isCommandValid(Character character, String command)\n\n {\n\n \n\n if(command.length() > 4 && isKill(command))\n { \n HandleKill(character, command);\n return true;\n }\n if(isPossess(command))\n {\n HandlePossess(character);\n return true;\n }\n if(isDontPossess(command))\n {\n HandleDontPossess(character);\n return true;\n }\n if(isJump(command))\n\n {\n\n HandleJump();\n\n return true;\n\n }\n\n if(isSit(command))\n\n {\n\n HandleSit();\n\n return true;\n\n }\n\n if(isSing(command))\n\n {\n\n HandleSing();\n\n return true;\n\n }\n\n if(isDance(command))\n\n {\n\n HandleDance();\n\n return true;\n\n }\n\n if(isDirections(command))\n\n {\n\n HandleDirections(character.currentArea);\n\n return true;\n\n }\n\n if(isExit(command))\n\n {\n\n HandleExit();\n\n return true;\n\n }\n \n if(isHeal(command))\n\n {\n\n HandleHeal(character);\n\n return true;\n\n }\n\n if(isStats(command))\n\n {\n\n HandleStats(character);\n\n return true;\n\n }\n\n \n\n switch(character.currentArea.paths)\n\n {\n\n case Constants.North:\n\n if(isNorth(command))\n\n return true;\n\n else\n\n return false;\n\n case Constants.South:\n\n if(isSouth(command))\n\n return true;\n\n else\n\n return false;\n\n case Constants.East:\n\n if(isEast(command))\n\n return true;\n\n else\n\n return false;\n\n case Constants.West:\n\n if(isWest(command))\n\n return true;\n\n else\n\n return false;\n\n \n\n case Constants.NorthAndSouth:\n\n if(isNorth(command) || isSouth(command))\n\n return true;\n\n else\n\n return false;\n\n case Constants.NorthAndEast:\n\n if(isNorth(command) || isEast(command))\n\n return true;\n\n else\n\n return false;\n\n case Constants.NorthAndWest:\n\n if(isNorth(command) || isWest(command))\n\n return true;\n\n else\n\n return false;\n\n case Constants.SouthAndEast:\n\n if(isSouth(command) || isEast(command))\n\n return true;\n\n else\n\n return false;\n\n case Constants.SouthAndWest:\n\n if(isSouth(command) || isWest(command))\n\n return true;\n\n else\n\n return false;\n\n case Constants.EastAndWest:\n\n if(isEast(command) || isWest(command))\n\n return true;\n\n else\n\n return false;\n\n \n\n case Constants.NorthSouthAndEast:\n\n if(isNorth(command) || isSouth(command) || isEast(command))\n\n return true;\n\n else\n\n return false;\n\n case Constants.NorthSouthAndWest:\n\n if(isNorth(command) || isSouth(command) || isWest(command))\n\n return true;\n\n else\n\n return false;\n\n case Constants.NorthEastAndWest:\n\n if(isNorth(command) || isEast(command) || isWest(command))\n\n return true;\n\n else\n\n return false;\n\n case Constants.SouthEastAndWest:\n\n if(isSouth(command) || isEast(command) || isWest(command))\n\n return true;\n\n else\n\n return false;\n\n \n\n case Constants.NorthSouthEastAndWest:\n\n if(isNorth(command) || isSouth(command) || isWest(command) || isEast(command))\n\n return true;\n\n else\n\n return false;\n\n default:\n\n break;\n\n \n\n }\n\n \n character.canPossess = false;\n return false;\n\n \n\n }",
"public boolean meWin(){\n return whitePieces.size() > blackPieces.size() && isWhitePlayer;\n }",
"public static boolean canPlayerMove(Player player){\r\n int playerX = 0;\r\n int playerY = 0;\r\n int nX;\r\n int nY;\r\n //finding the player on the board\r\n for(int i = 0; i < board.length; i++) {\r\n for (int j = 0; j < board[i].length; j++) {\r\n if(player.getPosition() == board[i][j]) {\r\n playerX = i;\r\n playerY = j;\r\n }\r\n }\r\n }\r\n //making sure that the player stays on the board\r\n\r\n if(playerY != board[0].length-1) {\r\n nX = playerX;\r\n nY = playerY + 1;\r\n if (board[nX][nY].west && board[playerX][playerY].east && !board[nX][nY].isOnFire) {//if the tile will accept the player\r\n return true;\r\n }\r\n }\r\n\r\n if(playerY != 0) {\r\n nX = playerX;\r\n nY = playerY - 1;\r\n if (board[nX][nY].east && board[playerX][playerY].west && !board[nX][nY].isOnFire) {\r\n return true;\r\n }\r\n }\r\n\r\n if(playerX != 0) {\r\n nX = playerX - 1;\r\n nY = playerY;\r\n if (board[nX][nY].south && board[playerX][playerY].north && !board[nX][nY].isOnFire) {\r\n return true;\r\n }\r\n }\r\n\r\n if(playerX != board.length-1) {\r\n nX = playerX + 1;\r\n nY = playerY;\r\n if (board[nX][nY].north && board[playerX][playerY].south && !board[nX][nY].isOnFire) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }",
"public abstract boolean attemptMove(Player currentPlayerObj, Coordinate move);",
"boolean isWinner() {\n boolean win = true;\n // first method to win\n for (int i = 0; i < 9; i++) {\n for (int j = 0; j < 9; j++) {\n if ((state[i][j] == 'X' && stateGame[i][j] != '*') || (state[i][j] != 'X' && stateGame[i][j] == '*'))\n win = false;\n }\n }\n if (win)\n return true;\n\n win = true;\n // second method to win\n for (int i = 0; i < 9; i++) {\n for (int j = 0; j < 9; j++) {\n if (state[i][j] == '.' && stateGame[i][j] == '.')\n win = false;\n }\n }\n return win;\n }",
"private boolean playerWin(Board board)\n {\n return check(board, PLAYER);\n }",
"public void run() {\n Scanner cin = new Scanner(System.in, \"UTF-8\");\n boolean quit = false;\n chess = new Chess();\n Player temp;\n boolean check = false;\n Pawnposition p = null;\n int checknew = 0;\n\n while (!quit) {\n System.out.print(\"Chess> \");\n String str = cin.nextLine();\n if (str.length() <= 0) {\n System.out.println(\"Error! Not support this command1!\\n\");\n }\n else {\n String[] cmd = str.split(\" \");\n if (\"new\".startsWith(cmd[0]) && cmd.length == 2) {\n if(cmd[1].equals(\"SINGLE\")||(cmd[1].equals(\"single\"))){\n chess = new Chess();\n checknew = 1;\n }\n if(cmd[1].equals(\"HOTSEAT\")){\n chess = new Chess();\n }\n }\n else if (\"help\".startsWith(cmd[0]) && cmd.length == 1) {\n this.showHelp();\n }\n else if (\"quit\".startsWith(cmd[0]) && cmd.length == 1) {\n return;\n }\n else if (\"move\".startsWith(cmd[0]) && cmd.length == 3) {\n Cell f = new Cell(this.inputChange(cmd[1].charAt(0)), this.inputChange(cmd[1].charAt(1)));\n Cell t = new Cell(this.inputChange(cmd[2].charAt(0)), this.inputChange(cmd[2].charAt(1)));\n\n check = chess.move(f, t);\n if (check == true) {\n if ((chess.getState().getWinner() == Player.BLACK) || (chess.getState().getWinner() == Player.WHITE)) {\n Player tempforwin = this.chess.getState().getCurrentPlayer();\n System.out.println(tempforwin + \" moved \" + cmd[1] + \" to \" + cmd[2]);\n System.out.println(\"Game over. \" + tempforwin + \" has won\");\n continue;\n }\n if (this.chess.getState().getCurrentPlayer() == Player.WHITE) {\n temp = Player.BLACK;\n System.out.println(temp + \" moved \" + cmd[1] + \" to \" + cmd[2]);\n }\n if (this.chess.getState().getCurrentPlayer() == Player.BLACK) {\n temp = Player.WHITE;\n System.out.println(temp + \" moved \" + cmd[1] + \" to \" + cmd[2]);\n if(checknew == 1) {\n p = this.chess.minmax(0, Player.BLACK);\n if (p == null) {\n System.out.println(\"Fehler bei p\");\n } else if (p.getresult() == 0) {\n System.out.println(\"Fehler bei p.r\");\n } else if (p.getcellt() == null) {\n System.out.println(\"Fehler bei p.getcellt\");\n } else if (p.getcellf() == null) {\n System.out.println(\"Fehler bei p.getcellf\");\n } else {\n this.chess.move(p.getcellf(), p.getcellt());\n }\n }\n }\n }\n if (this.chess.ifmiss() == false && chess.getState().getWinner() == null) {\n System.out.println(this.chess.getState().getCurrentPlayer() + \" must miss a turn\");\n this.chess.getState().setCurrentPlayer(this.chess.getState().getCurrentPlayer());\n }\n\n\n }\n else if (\"print\".startsWith(cmd[0]) && cmd.length == 1) {\n if (chess == null) {\n System.out.println(\"Error! Fehler chess\");\n }\n else {\n chess.print();\n }\n }\n else {\n System.out.println(\"Error! Not support this command!\");\n }\n }\n }\n }",
"public boolean attemptMove(Move move, int color) {\n //ArrayList<Move> jumps = canJump(color);\n //make sure the to and from values don't go out of bounds\n if (move.xFrom > 7 || move.yFrom > 7 || move.xTo > 7 || move.yTo > 7 ||\n \tmove.xFrom < 0 || move.yFrom < 0 || move.xTo < 0 || move.yTo < 0 ){\n// System.out.println(\"out of bounds\");\n return false;\n }\n int stateOfFrom = gameState.getStateOfSquare(move.xFrom, move.yFrom);\n int stateOfTo = gameState.getStateOfSquare(move.xTo, move.yTo);\n \n\n //if there in no piece in the \"from\" location return false\n if (stateOfFrom == 0){\n// System.out.println(\"no piece at 'from'\");\n return false;\n }\n \n //if there is a piece in the \"to\" location return false\n if (!(stateOfTo == 0)){\n// System.out.println(\"'to' is not empty\");\n return false;\n }\n \n //if the \"from\" piece is not the correct color return false\n if (!(gameState.getStateOfSquare(move.xFrom, move.yFrom)%2 == color))\n {\n// System.out.println(\"that is not your piece\");\n return false;\n }\n \n //check if the \"from\" piece is moving in the right direction\n \n /*if (jumps.isEmpty() == false) //if there are jumps.\n {\n System.out.println(\"there are jumps\");\n //for every possible jump\n for (int i=0; i<jumps.size(); i++){\n \t//if this move matches a possible jump then it is valid\n \tSystem.out.println(\"is this jump \"+ i + \"?\");\n \tif ((move.xFrom == jumps.get(i).xFrom)&&\n \t\t\t(move.yFrom == jumps.get(i).yFrom)&&\n \t\t\t(move.xTo == jumps.get(i).xTo)&&\n \t\t\t(move.yTo == jumps.get(i).yTo)){\n \t\tSystem.out.println(\"yes\");\n \t\treturn true;\n \t}\n \telse{\n \t\tSystem.out.println(\"there are possible jumps\");\n \t}\n \t\t\n \t\n }\n //return false;\n \n //handle jumps\n }\n */\n //moving diagonally\n else{\n if (move.xTo == move.xFrom + 1 || move.xTo == move.xFrom - 1){\n //if (stateOfFrom >= 3) \n //if piece is king it can move both forward and back\n if (stateOfFrom >= 3 && (move.yTo == move.yFrom + 1 || move.yTo == move.yFrom - 1)){\n \treturn true;\n }\n //red can only move up\n else if(color == 0 && (move.yTo == move.yFrom + 1)){\n \treturn true;\n }\n //black can only move down\n else if(color == 1 && (move.yTo == move.yFrom - 1)){\n \treturn true;\n }\n else{\n// System.out.println(\"wrong way\");\n return false;\n }\n }\n else{\n// System.out.println(\"too far away\");\n return false;\n }\n }\n //return true;\n \n \n }",
"public static boolean validMove(String move, Person p, Board building )\n {\n Room[][] map = building.getMap();\n move = move.toLowerCase().trim();\n switch (move) {\n case \"n\":\n if (p.getxLoc() > 0)\n {\n map[p.getxLoc()][p.getyLoc()].leaveRoom(p);\n System.out.println(\"You are in the \"+map[p.getxLoc()-1][p.getyLoc()].getName());\n map[p.getxLoc()-1][p.getyLoc()].enterRoom(p,building);\n return true;\n }\n else\n {\n return false;\n }\n case \"e\":\n if (p.getyLoc()< map[p.getyLoc()].length -1)\n {\n map[p.getxLoc()][p.getyLoc()].leaveRoom(p);\n System.out.println(\"You are in the \"+map[p.getxLoc()][p.getyLoc() + 1].getName());\n map[p.getxLoc()][p.getyLoc() + 1].enterRoom(p, building);\n return true;\n }\n else\n {\n return false;\n }\n\n case \"s\":\n if (p.getxLoc() < map.length - 1)\n {\n map[p.getxLoc()][p.getyLoc()].leaveRoom(p);\n System.out.println(\"You are in the \"+map[p.getxLoc()+1][p.getyLoc()].getName());\n map[p.getxLoc()+1][p.getyLoc()].enterRoom(p, building);\n return true;\n }\n else\n {\n return false;\n }\n\n case \"w\":\n if (p.getyLoc() > 0)\n {\n map[p.getxLoc()][p.getyLoc()].leaveRoom(p);\n System.out.println(\"You are in the \"+map[p.getxLoc()][p.getyLoc()-1].getName());\n map[p.getxLoc()][p.getyLoc()-1].enterRoom(p, building);\n return true;\n }\n else\n {\n return false;\n }\n default:\n break;\n\n }\n return true;\n }",
"public boolean isValidMove(Move move) {\n if (this.gameStarted && isSpaceFree(move) && isPlayerTurn(move)) {\n return true; \n }\n return false; \n }",
"public boolean validMove(ChessBoard board, Square from, Square to) {\r\n // check if piece killing his ally\r\n if(to.getPiece() != null){\r\n if (to.getPiece().isBlue() == this.isBlue()) {\r\n return false;\r\n }\r\n } \r\n\r\n int x = from.getX() - to.getX();\r\n int y = from.getY() - to.getY();\r\n \r\n if (x < 0 && Math.abs(x) == Math.abs(y) && y > 0){\r\n int j = from.getY()-1;\r\n for( int i = from.getX()+1 ; i < to.getX() ; i++){\r\n if (board.getBox(i,j).getPiece()!=null){\r\n return false;}\r\n j--;\r\n } \r\n return true;\r\n }\r\n else if(x > 0 && Math.abs(x) == Math.abs(y) && y > 0){\r\n int j = from.getY()-1;\r\n for( int i = from.getX()-1 ; i > to.getX() ; i--){\r\n if (board.getBox(i,j).getPiece()!=null){\r\n return false;}\r\n j--;\r\n }\r\n return true;\r\n }\r\n else if( x > 0 && Math.abs(x) == Math.abs(y) && y < 0){\r\n int j = from.getY()+1;\r\n for( int i = from.getX()-1 ; i > to.getX() ; i--){\r\n if (board.getBox(i,j).getPiece()!=null){\r\n return false;}\r\n j++;\r\n }\r\n return true; \r\n }\r\n else if (x < 0 && Math.abs(x) == Math.abs(y) && y < 0){\r\n int j = from.getY()+1;\r\n for( int i = from.getX()+1 ; i < to.getX() ; i++){\r\n if (board.getBox(i,j).getPiece()!=null){\r\n return false;}\r\n j++;\r\n } \r\n return true;\r\n }\r\n\r\n return false;\r\n }",
"public boolean isWinner() {\n\t\t//initialize row, column, and depth\n\t\tint row = 0;\n\t\tint col = 0;\n\t\tint dep = 0;\n\t\t\n\t\t//Checks for a vertical four in a row\n\t\t//row is restriced from the full size to >=3 to avoid\n\t\t//an out of bounds exception\n\t\tfor(row = size - 1; row >= 3; row --)\n\t\t\tfor(col = 0; col < size; col ++)\n\t\t\t\tfor(dep = 0; dep < size; dep ++) {\n\t\t\t\t\t//a variable check is made to save lines\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\t//checks if the value is a player, and it\n\t\t\t\t\t//qualifies as a vertical win. If it does,\n\t\t\t\t\t//the for loop returns true.\n\t\t\t\t\tif (check != -1\n\t\t\t\t\t\t && check == board[row - 1][col][dep] &&\n\t\t\t\t\t\t\tcheck == board[row - 2][col][dep] &&\n\t\t\t\t\t\t\tcheck == board[row - 3][col][dep] )\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t//check for horizontal four in a row\n\t\t//col is restriced and increasing (+)\n\t\tfor (dep = 0; dep < size; dep ++)\n\t\t\tfor(row = size - 1; row >= 0; row --)\n\t\t\t\tfor(col = 0; col < size - 3; col ++) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t\t&& check == board[row][col + 1][dep]\n\t\t\t\t\t\t\t&& check == board[row][col + 2][dep] \n\t\t\t\t\t\t\t&& check == board[row][col + 3][dep])\n\t\t\t\t\t\treturn true;\n\n\t\t\t\t}\n\t\t//check for x,y upDiagnol four in a row on each depth\n\t\t//row is restricted and decreasing (-)\n\t\t//col is restricted and increasing (+)\n\t\tfor (dep = 0; dep < size; dep ++)\n\t\t\tfor(row = size - 1; row >= 3; row --)\n\t\t\t\tfor(col = 0; col < size - 3; col ++) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t\t&& check == board[row - 1][col + 1][dep]\n\t\t\t\t\t\t\t&& check == board[row - 2][col + 2][dep]\n\t\t\t\t\t\t\t&& check == board[row - 3][col + 3][dep])\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t//check for x,y downDiagnol four in a row on each depth\n\t\t//row is restricted and increasing (+)\n\t\t//col is restricted and increasing (+)\n\t\tfor (dep = 0; dep < size; dep ++)\n\t\t\tfor(row = 0; row < size - 3; row ++)\n\t\t\t\tfor(col = 0; col < size - 3; col ++) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t\t&& check == board[row + 1][col + 1][dep]\n\t\t\t\t\t\t\t&& check == board[row + 2][col + 2][dep]\n\t\t\t\t\t\t\t&& check == board[row + 3][col + 3][dep])\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t//check for x,z horizontal four in a row on each column\n\t\t//dep is restricted and increasing (+)\n\t\tfor(col = 0; col < size; col ++)\n\t\t\tfor(row = size - 1; row >= 0; row --)\n\t\t\t\tfor(dep = 0; dep < size - 3; dep ++) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t\t&& check == board[row][col][dep + 1]\n\t\t\t\t\t\t\t&& check == board[row][col][dep + 2]\n\t\t\t\t\t\t\t&& check == board[row][col][dep + 3])\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t//check for x,z upDiagnol four in a row on ecah column\n\t\t//row is restricted and decreasing (-)\n\t\t//dep is restricted and increasing (+)\n\t\tfor(col = 0; col < size; col ++)\n\t\t\tfor(row = size - 1; row >= 3; row --)\n\t\t\t\tfor(dep = 0; dep < size - 3; dep ++) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t\t&& check == board[row - 1][col][dep + 1]\n\t\t\t\t\t\t\t&& check == board[row - 2][col][dep + 2]\n\t\t\t\t\t\t\t&& check == board[row - 3][col][dep + 3])\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t//check for x,z downDiagnol four in a row\n\t\t// dep +, row +\n\t\tfor(col = 0; col < size; col ++)\n\t\t\tfor(row = 0; row > size - 3; row ++)\n\t\t\t\tfor(dep = 0; dep < size - 3; dep ++) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t\t&& check == board[row + 1][col][dep + 1]\n\t\t\t\t\t\t\t&& check == board[row + 2][col][dep + 2]\n\t\t\t\t\t\t\t&& check == board[row + 3][col][dep + 3])\n\t\t\t\t\t\treturn true;\n\n\t\t\t\t}\n\t\t//check for x,y,z up diagnol to the top right\n\t\t//row -, col +, dep +\n\t\tfor(row = size - 1; row >= 3; row --)\n\t\t\tfor(col = 0; col < size - 3; col ++)\n\t\t\t\tfor(dep = 0; dep < size - 3; dep ++) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t&& check == board[row - 1][col + 1][dep + 1]\n\t\t\t\t\t\t&& check == board[row - 2][col + 2][dep + 2]\n\t\t\t\t\t\t&& check == board[row - 3][col + 3][dep + 3])\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t//check for x,y,z up diagnol to the top left\n\t\t//row -, col -, dep +\n\t\tfor(row = size - 1; row >= 3; row --)\n\t\t\tfor(col = size -1; col >= 3; col --)\n\t\t\t\tfor(dep = 0; dep < size - 3; dep ++) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t&& check == board[row - 1][col - 1][dep + 1]\n\t\t\t\t\t\t&& check == board[row - 2][col - 2][dep + 2]\n\t\t\t\t\t\t&& check == board[row - 3][col - 3][dep + 3])\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t//check for x,y,z up diagnol to the down left\n\t\t//row -, col -, dep -\n\t\tfor(row = size - 1; row >= 3; row --)\n\t\t\tfor(col = size -1; col >= 3; col --)\n\t\t\t\tfor(dep = size - 1; dep >= 3; dep --) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t&& check == board[row - 1][col - 1][dep - 1]\n\t\t\t\t\t\t&& check == board[row - 2][col - 2][dep - 2]\n\t\t\t\t\t\t&& check == board[row - 3][col - 3][dep - 3])\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t//check for x,y,z up diagnol to the down right\n\t\t//row -, col +, dep -\n\t\tfor(row = size - 1; row >= 3; row --)\n\t\t\tfor(col = 0; col < size - 3; col ++)\n\t\t\t\tfor(dep = size - 1; dep >= 3; dep --) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t&& check == board[row - 1][col + 1][dep - 1]\n\t\t\t\t\t\t&& check == board[row - 2][col + 2][dep - 2]\n\t\t\t\t\t\t&& check == board[row - 3][col + 3][dep - 3])\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t//Same as above, but now row increases rather than decreasing\n\t\t//check for down diagnol from top left to center\n\t\t//row +, col +, dep +\n\t\tfor(row = 0; row > size - 3; row ++)\n\t\t\tfor(col = 0; col < size - 3; col ++)\n\t\t\t\tfor(dep = 0; dep < size - 3; dep ++) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1\n\t\t\t\t\t\t&& check == board[row + 1][col + 1][dep + 1]\n\t\t\t\t\t\t&& check == board[row + 2][col + 2][dep + 2]\n\t\t\t\t\t\t&& check == board[row + 3][col + 3][dep + 3])\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t//check for down diagnol from top right to center\n\t\t//row + , col -, dep +\n\t\tfor(row = 0; row > size - 3; row ++)\n\t\t\tfor(col = size -1; col >= 3; col --)\n\t\t\t\tfor(dep = 0; dep < size - 3; dep ++) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t&& check == board[row + 1][col - 1][dep + 1]\n\t\t\t\t\t\t&& check == board[row + 2][col - 2][dep + 2]\n\t\t\t\t\t\t&& check == board[row + 3][col - 3][dep + 3])\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t//check for down diagnol from bottom left to center\n\t\t//row +, col -, dep -\n\t\tfor(row = 0; row > size - 3; row ++)\n\t\t\tfor(col = size -1; col >= 3; col --)\n\t\t\t\tfor(dep = size - 1; dep >= 3; dep --) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t&& check == board[row + 1][col - 1][dep - 1]\n\t\t\t\t\t\t&& check == board[row + 2][col - 2][dep - 2]\n\t\t\t\t\t\t&& check == board[row + 3][col - 3][dep - 3])\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t//check for down diagnol from bottom right to center\n\t\t//row +, col +, dep -\n\t\tfor(row = 0; row > size - 3; row ++)\n\t\t\tfor(col = 0; col < size - 3; col ++)\n\t\t\t\tfor(dep = size - 1; dep >= 3; dep --) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t&& check == board[row + 1][col + 1][dep - 1]\n\t\t\t\t\t\t&& check == board[row + 2][col + 2][dep - 2]\n\t\t\t\t\t\t&& check == board[row + 3][col + 3][dep - 3])\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\n\t\t//check for diagonals where row stays the same, but x,z change\n\t\t//depth up diagnol, col +, dep +\n\t\tfor(row = size - 1; row >= 0 ; row --)\n\t\t\tfor(col = 0; col < size - 3; col ++)\n\t\t\t\tfor(dep = 0; dep < size - 3; dep ++) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t&& check == board[row][col + 1][dep + 1]\n\t\t\t\t\t\t&& check == board[row][col + 2][dep + 2]\n\t\t\t\t\t\t&& check == board[row][col + 3][dep + 3])\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\n\t\t//depth down diagnol, col +, dep -\n\t\tfor(row = size - 1; row >= 0 ; row --)\n\t\t\tfor(col = 0; col < size - 3; col ++)\n\t\t\t\tfor(dep = size - 1; dep >= 3; dep --) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t&& check == board[row][col + 1][dep - 1]\n\t\t\t\t\t\t&& check == board[row][col + 2][dep - 2]\n\t\t\t\t\t\t&& check == board[row][col + 3][dep - 3])\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\n\t\t// depth down left diagnol, col -, dep +\n\t\tfor(row = size - 1; row >= 0 ; row --)\n\t\t\tfor(col = size - 1; col >= 3; col --)\n\t\t\t\tfor(dep = 0; dep < size - 3; dep ++) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t&& check == board[row][col - 1][dep + 1]\n\t\t\t\t\t\t&& check == board[row][col - 2][dep + 2]\n\t\t\t\t\t\t&& check == board[row][col - 3][dep + 3])\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\n\t\t//depth down right diagnol, col -, dep -\n\t\tfor(row = size - 1; row >= 0 ; row --)\n\t\t\tfor(col = size - 1; col >= 3; col --)\n\t\t\t\tfor(dep = size - 1; dep >= 3; dep --) {\n\t\t\t\t\tint check = board[row][col][dep];\n\t\t\t\t\tif(check != -1 \n\t\t\t\t\t\t&& check == board[row][col - 1][dep - 1]\n\t\t\t\t\t\t&& check == board[row][col - 2][dep - 2]\n\t\t\t\t\t\t&& check == board[row][col - 3][dep - 3])\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t//returns false if none of the above return true\n\t\treturn false;\n\t}",
"public boolean playerTwoWin()\n\t{\n\t\tif( (board[ 1 ] == \"X\") && (board[ 2 ] == \"X\") && (board[ 3 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t} // end of if( (board[ 1 ] == \"X\") && (board[ 2 ] == \"X\") && (board[ 3 ] == \"X\") )\n\t\t\n\t\telse if( (board[ 4 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 6 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t} // end of if( (board[ 4 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 6 ] == \"X\") ) \n\t\t\n\t\telse if( (board[ 7 ] == \"X\") && (board[ 8 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t} // end of if( (board[ 7 ] == \"X\") && (board[ 8 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t\n\t\telse if( (board[ 1 ] == \"X\") && (board[ 4 ] == \"X\") && (board[ 7 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t} // end of if( (board[ 1 ] == \"X\") && (board[ 4 ] == \"X\") && (board[ 7 ] == \"X\") )\n\t\t\n\t\telse if( (board[ 2 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 8 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t} // end of if( (board[ 2 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 8 ] == \"X\") )\n\t\t\n\t\telse if( (board[ 3 ] == \"X\") && (board[ 6 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t} // end of if( (board[ 3 ] == \"X\") && (board[ 6 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t\n\t\telse if( (board[ 1 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t}// end of if( (board[ 1 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t\n\t\telse if( (board[ 7 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t{\n\t\t\treturn true;\n\t\t} // end of if( (board[ 7 ] == \"X\") && (board[ 5 ] == \"X\") && (board[ 9 ] == \"X\") )\n\t\t\n\t\treturn false;\n\t}",
"boolean canMove(Color player) {\n int[][] myStatusBoard;\n if (_playerOnMove == ORANGE) {\n myStatusBoard = _orangeStatusBoard;\n } else {\n myStatusBoard = _violetStatusBoard;\n }\n if (Game._totalMoves < 2) {\n return true;\n }\n int i, j;\n for (i = 0; i < 16; i++) {\n for (j = 0; j < 16; j++) {\n if (myStatusBoard[i][j] == 1) {\n if (findMove(i, j, myStatusBoard)) {\n return true;\n }\n }\n }\n }\n return false;\n }",
"private boolean processCommand(String line) {\n if (line.length() == 0) {\n return true;\n }\n Matcher command = COMMAND_PATN.matcher(line);\n if (command.matches()) {\n switch (command.group(1).toLowerCase()) {\n case \"#\":\n return true;\n case \"manual\":\n manualCommand(command.group(2).toLowerCase());\n return true;\n case \"auto\":\n autoCommand(command.group(2).toLowerCase());\n return true;\n case \"seed\":\n seedCommand(command.group(2));\n return true;\n case \"board\": case \"b\":\n System.out.println(_board.toString2());\n return true;\n case \"autoprint\":\n autoPrintCommand();\n return true;\n case \"set\":\n setCommand(command.group(2), command.group(3));\n return true;\n case \"dump\":\n System.out.println(_board.toString());\n return true;\n case \"start\":\n _playing = true;\n return true;\n case \"clear\":\n _playing = false;\n _board.clear();\n return true;\n case \"quit\":\n quit();\n return true;\n case \"help\": case \"?\":\n help();\n return true;\n default:\n return false;\n }\n }\n return false;\n }",
"@Override\n public void drawValidMove() {\n if(this.getPlayer().getPlayerID() % 2 != 0) {\n //Pawn can move one space forwards if no piece is in front\n if (board.getSquare(x-1, y).getPiece()== null) {\n board.getSquare(x-1, y).drawOutline();\n }\n \n //if first move, pawn can move 2 spaces forward\n if (!hasMoved && board.getSquare(x-2, y).getPiece() == null && board.getSquare(x-1, y).getPiece() == null) {\n board.getSquare(x-2, y).drawOutline();\n }\n \n //If there is an enemy piece in the diagonal forward square of the pawn, the pawn can move (capture the piece)\n if (y-1 > 0) { //ensures no arrayoutofbounds error\n if (board.getSquare(x-1, y-1) != null && board.getSquare(x-1, y-1).getPiece() != null &&\n board.getSquare(x-1, y-1).getPiece().getPlayer() != this.getPlayer()) {\n board.getSquare(x-1, y-1).drawOutline();\n }\n }\n \n if(y+1<SIZE) { //ensures no arrayoutofbounds error\n if (board.getSquare(x-1, y+1) != null && board.getSquare(x-1, y+1).getPiece() != null &&\n board.getSquare(x-1, y+1).getPiece().getPlayer() != this.getPlayer() ) {\n board.getSquare(x-1, y+1).drawOutline();\n }\n }\n \n System.out.println(\"\");\n //En passant\n if (y - 1 > 0) {\n \n System.out.println();\n if (board.getSquare(x, y-1).getPiece() != null) { \n System.out.println(\"the piece's enPassant is: \" + board.getSquare(x, y-1).getPiece().getEnPassant());\n System.out.println(\"The game's turn counter is: \" + board.getTurnCounter());\n }\n else {\n System.out.println(\"Null piece when checking for en passent.\");\n }\n \n if (board.getSquare(x, y-1).getPiece() != null && board.getSquare(x, y-1).getPiece().getPlayer() != this.player &&\n board.getSquare(x, y-1).getPiece().getEnPassant() == board.getTurnCounter() - 1) {\n board.getSquare(x-1, y-1).drawOutline();\n board.getSquare(x-1, y-1).setEnPassent(true);\n }\n }\n \n if (y + 1 < SIZE) {\n if (board.getSquare(x, y+1).getPiece() != null && board.getSquare(x, y+1).getPiece().getPlayer() != this.player &&\n board.getSquare(x, y+1).getPiece().getEnPassant() == board.getTurnCounter() - 1) {\n board.getSquare(x-1, y+1).drawOutline();\n board.getSquare(x-1, y+1).setEnPassent(true);\n }\n }\n }\n \n //If this pawn belongs to player 2:\n else {\n \n if (board.getSquare(x+1, y).getPiece() == null) {\n board.getSquare(x+1, y).drawOutline();\n }\n \n //if first move, pawn can move 2 spaces forward\n if (!hasMoved && board.getSquare(x+2, y).getPiece() == null && board.getSquare(x+1, y).getPiece() == null) {\n board.getSquare(x+2, y).drawOutline();\n \n }\n \n if(y-1 > 0) {\n if (board.getSquare(x+1, y-1) != null && board.getSquare(x+1, y-1).getPiece() != null &&\n board.getSquare(x+1, y-1).getPiece().getPlayer() != this.getPlayer() ) {\n board.getSquare(x+1, y-1).drawOutline();\n }\n }\n \n if(y+1 < SIZE) {\n if (board.getSquare(x+1, y+1) != null && board.getSquare(x+1, y+1).getPiece() != null &&\n board.getSquare(x+1, y+1).getPiece().getPlayer() != this.getPlayer()) {\n board.getSquare(x+1, y+1).drawOutline();\n }\n }\n \n //En passant\n if (y - 1 > 0) {\n if (board.getSquare(x, y-1).getPiece() != null &&board.getSquare(x, y-1).getPiece().getPlayer() != this.player &&\n board.getSquare(x, y-1).getPiece().getEnPassant() == board.getTurnCounter() - 1) {\n board.getSquare(x+1, y-1).drawOutline();\n board.getSquare(x+1, y-1).setEnPassent(true);\n }\n }\n \n if (y + 1 < SIZE) {\n if (board.getSquare(x, y+1).getPiece() != null && board.getSquare(x, y+1).getPiece().getPlayer() != this.player &&\n board.getSquare(x, y+1).getPiece().getEnPassant() == board.getTurnCounter() - 1) {\n board.getSquare(x+1, y+1).drawOutline();\n board.getSquare(x+1, y+1).setEnPassent(true);\n }\n }\n }\n }",
"public boolean makeMove(int row, int col, PlayerController player)\n {\n if(checkDraw(turn)){\n winSend.sendDraw(opponent);\n player1.gameOver(RESULT_DRAW);\n player2.gameOver(RESULT_DRAW);\n }\n if (turn % 2 + 1 != playerFlagFor(player)) {\n return false;\n }\n if (validateMove(row, col)) {\n turn++;\n int pFlag = playerFlagFor(player);\n \n board[row][col] = pFlag;\n player1.moveMade(row, col, pFlag);\n player2.moveMade(row, col, pFlag);\n if (checkWin(row, col, pFlag)) {\n \n if(!winSent && player1 instanceof GameController){\n win(pFlag);\n winSend.sendWin(opponent);\n } \n else if( !winSent && player1 instanceof NetworkPlayer){\n win(pFlag);\n }\n \n player1.model.setWinSent(true);\n player2.model.setWinSent(true);\n \n \n \n } \n return true;\n } else {\n return false;\n }\n }",
"public String computerMove() {\n\t\t// Look to win in a row\n\t\tfor (int r = 0; r < 3; r++) {\n\t\t\tif (rowSum[r] == -2) {\n\t\t\t\t// Find the empty space\n\t\t\t\tfor (int c = 0; c < 3; c++) {\n\t\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\t\treturn done(r, c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Look to win in a col\n\t\tfor (int c = 0; c < 3; c++) {\n\t\t\tif (colSum[c] == -2) {\n\t\t\t\t// Find the empty space\n\t\t\t\tfor (int r = 0; r < 3; r++) {\n\t\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\t\treturn done(r, c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Look to win a diag\n\t\tfor (int d = 0; d < 2; d++) {\n\t\t\tif (diagSum[d] == -2) {\n\t\t\t\t// Find the empty space\n\t\t\t\tfor (int r = 0; r < 3; r++) {\n\t\t\t\t\tint c = d == 0 ? r : 2 - r;\n\t\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\t\treturn done(r, c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Look to block a row\n\t\tfor (int r = 0; r < 3; r++) {\n\t\t\tif (rowSum[r] == 2) {\n\t\t\t\t// Find the empty space\n\t\t\t\tfor (int c = 0; c < 3; c++) {\n\t\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\t\treturn done(r, c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Look to block a col\n\t\tfor (int c = 0; c < 3; c++) {\n\t\t\tif (colSum[c] == 2) {\n\t\t\t\t// Find the empty space\n\t\t\t\tfor (int r = 0; r < 3; r++) {\n\t\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\t\treturn done(r, c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Look to block a diag\n\t\tfor (int d = 0; d < 2; d++) {\n\t\t\tif (diagSum[d] == 2) {\n\t\t\t\t// Find the empty space\n\t\t\t\tfor (int r = 0; r < 3; r++) {\n\t\t\t\t\tint c = d == 0 ? r : 2 - r;\n\t\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\t\treturn done(r, c);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Find the non-full row and col w/ least val\n\t\tint bestR = -1;\n\t\tint bestC = -1;\n\t\tint minSum = 10;\n\t\tfor (int r = 0; r < 3; r++) {\n\t\t\tfor (int c = 0; c < 3; c++) {\n\t\t\t\tif (board[r][c] == 0) {\n\t\t\t\t\tint sum = rowSum[r] + colSum[c];\n\t\t\t\t\tif (sum < minSum) {\n\t\t\t\t\t\tminSum = sum;\n\t\t\t\t\t\tbestR = r;\n\t\t\t\t\t\tbestC = c;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn done(bestR, bestC);\n\t}",
"private boolean checkWinner() {\n\t\tboolean frontDiagWin = !myBoard.isEmpty(0, 0);\n\t\tchar frontDiagToken = myBoard.getCell(0, 0);\n\t\tboolean backDiagWin = !myBoard.isEmpty(0, Board.BOARD_SIZE - 1);\n\t\tchar backDiagToken = myBoard.getCell(0, Board.BOARD_SIZE - 1);\n\t\tfor (int i = 0; i < Board.BOARD_SIZE; i++) {\n\t\t\t// check Diagonals\n\t\t\tfrontDiagWin = myBoard.getCell(i, i) == frontDiagToken ? frontDiagWin\n\t\t\t\t\t: false;\n\t\t\tbackDiagWin = myBoard.getCell(i, (Board.BOARD_SIZE - 1) - i) == backDiagToken ? backDiagWin\n\t\t\t\t\t: false;\n\t\t\t// check Rows and Columns\n\t\t\tboolean rowWin = !myBoard.isEmpty(i, 0);\n\t\t\tchar startRowToken = myBoard.getCell(i, 0);\n\t\t\tboolean colWin = !myBoard.isEmpty(0, i);\n\t\t\tchar startColToken = myBoard.getCell(0, i);\n\t\t\tfor (int j = 0; j < Board.BOARD_SIZE; j++) {\n\t\t\t\trowWin = myBoard.getCell(i, j) == startRowToken ? rowWin\n\t\t\t\t\t\t: false;\n\t\t\t\tcolWin = myBoard.getCell(j, i) == startColToken ? colWin\n\t\t\t\t\t\t: false;\n\t\t\t}\n\t\t\tif (rowWin || colWin) {\n\t\t\t\tSystem.out.println(\"\\\"\"\n\t\t\t\t\t\t+ (rowWin ? startRowToken : startColToken)\n\t\t\t\t\t\t+ \"\\\" wins the game!\");\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tif (frontDiagWin || backDiagWin) {\n\t\t\tSystem.out.println(\"\\\"\"\n\t\t\t\t\t+ (frontDiagWin ? frontDiagToken : backDiagToken)\n\t\t\t\t\t+ \"\\\" wins the game!\");\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public boolean isWinningMove(Move move, Player player) {\n int adiagonal = 0, diagonal = 0, horizontal = 0, vertical = 0;\n\n for (int i = 0; i < LENGTH; i++) {\n if (getPlayerFromBoard(i, i) == player) {\n diagonal++;\n }\n if (getPlayerFromBoard(move.x, i) == player) {\n horizontal++;\n }\n if (getPlayerFromBoard(i, move.y) == player) {\n vertical++;\n }\n if (getPlayerFromBoard(i, LENGTH - i - 1) == player) {\n adiagonal++;\n }\n }\n\n return diagonal == LENGTH || horizontal == LENGTH\n || vertical == LENGTH || adiagonal == LENGTH;\n }",
"public Move movePiece(int turn) {\n\t\tboolean error = false;\n\t\tString moveInput = null;\n\t\tString origin = null;\n\t\tboolean isCorrectTurn = false;\n\t\t@SuppressWarnings(\"resource\")\n\t\tScanner keyboard = new Scanner(System.in);\n\n\t\tdo {\n\t\t\t\n\t\t\ttry {\n\t\t\t\tdo {\n\t\t\t\t\tSystem.out.println(\"Which piece would you like to move?\");\n\t\t\t\t\torigin = keyboard.next();\n\n\t\t\t\t\tif(validateInput(origin)) {\n\t\t\t\t\t\tSystem.out.println(\"Error in input, please try again\");\n\t\t\t\t\t\terror = true; \n\t\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\t\terror = false;\n\t\t\t\t\t}\n\n\t\t\t\t}while(error);\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tString xOrigin = origin.substring(0, 1);\n\t\t\t\tint yOrigin = Integer.parseInt(origin.substring(1,2));\n\t\t\t\tint convertedXOrigin = convertXPosition(xOrigin);\n\t\t\t\tyOrigin -= 1;\n\t\t\t\t\nif((board.getBoard()[yOrigin][convertedXOrigin] == turn) || (board.getBoard()[yOrigin][convertedXOrigin] == (turn + 2))) {\n\t\t\t\tisCorrectTurn = true;\n\t\t\t\tChecker checker = validatePiece(convertedXOrigin, yOrigin);\t\n\t\t\t\tdo {\n\t\t\t\t\t\n\t\t\t\t\t\tSystem.out.println(\"Where would you like to move\");\n\t\t\t\t\t\t moveInput = keyboard.next();\n\t\t\t\t\t\tif(validateInput(moveInput)) {\n\t\t\t\t\t\t\tSystem.out.println(\"Error in Input, please try again\");\n\t\t\t\t\t\t\terror = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\terror = false;\n\t\t\t\t\t\t//\tSystem.out.println(\"No errors found with input move\");\n\t\t\t\t\t\t}\n\n\t\t\t\t} while(error);\n\t\t\t\t\n\t\t\t\tString xMove = moveInput.substring(0, 1);\n\t\t\t\tint yMove = Integer.parseInt(moveInput.substring(1,2));\n\t\t\t\tint convertedXMove = convertXPosition(xMove);\n\t\t\t\tyMove -= 1;\n\t\t\t\tboolean isMovingRight = isMovingRight(convertedXOrigin, yOrigin, convertedXMove, yMove);\n\t\t\t\tboolean isMovingDown = isMovingDown(convertedXOrigin, yOrigin, convertedXMove, yMove);\n\t\t\t\tMove move = null;\n\t\t\t\t\n\t\t\t\t//checks to see if the move itself is valid\n\t\t\t\ttry {\nif(isMoveValid(convertedXOrigin, yOrigin, convertedXMove, yMove, isMovingRight, isMovingDown)) {\n\t\t\t\tif(isSpaceTaken(convertedXMove, yMove)) {\n\t\t\t\t\t//System.out.println(\"Space is taken\");\n\t\t\t\t\tif(isPieceEnemy(convertedXMove, yMove, checker, turn)) {\n\t\t\t\t\t\tif(isJumpValid(convertedXOrigin, yOrigin, convertedXMove, yMove, isMovingRight, isMovingDown)) {\n\t\t\t\t\t\t\tif(isMovingRight) {\n\t\t\t\t\t\t\t\t//checks to see if the piece is moving up or down\n\t\t\t\t\t\t\t\tif(isMovingDown) {\n\t\t\t\t\t\t\t\t\t//means the piece is moving right and down\n\t\t\t\t\t\t\t\t\t move = new Move(convertedXOrigin, yOrigin, convertedXMove + 1, yMove + 1);\n\t\t\t\t\t\t\t\t\tmodel.moves.add(move);\t\n\t\t\t\t\t\t\t\t\tremoveTakenPiece(convertedXMove, yMove);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t//means the piece is moving right, but up\n\t\t\t\t\t\t\t\t\t move = new Move(convertedXOrigin, yOrigin, convertedXMove + 1, yMove - 1);\n\t\t\t\t\t\t\t\t\tmodel.moves.add(move);\n\t\t\t\t\t\t\t\t\tremoveTakenPiece(convertedXMove, yMove);\n\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\tif(isMovingDown) {\n\t\t\t\t\t\t\t\t\t//means its moving left and down\n\t\t\t\t\t\t\t\t\tmove = new Move(convertedXOrigin, yOrigin, convertedXMove - 1, yMove + 1);\n\t\t\t\t\t\t\t\t\tmodel.moves.add(move);\n\t\t\t\t\t\t\t\t\tremoveTakenPiece(convertedXMove, yMove);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t//means it's moving left and up\n\t\t\t\t\t\t\t\t\tmove = new Move(convertedXOrigin, yOrigin, convertedXMove - 1, yMove - 1);\n\t\t\t\t\t\t\t\t\tmodel.moves.add(move);\t\n\t\t\t\t\t\t\t\t\tremoveTakenPiece(convertedXMove, yMove);\n\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\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t//System.out.println(\"Space isn't taken\");\n\t\t\t\t\tmove = new Move(convertedXOrigin, yOrigin, convertedXMove, yMove);\n\t\t\t\t\tmodel.moves.add(move);\n\t\t\t\t\tif(canBeKing(checker, move)) {\n\t\t\t\t\t\tchecker = convertToKing(checker, move);\n\t\t\t\t\t\tmodel.updateChecker(move, checker, turn);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tprintBoard();\n\t\t\t\t\t\treturn move;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tmodel.updateChecker(move, checker, turn);\n\t\t\t\t\tupdateBoard(move);\n\t\t\t\t\t\n\t\t\t\t\tprintBoard();\n\t\t\t\t\treturn move;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Error in move\");\n\t\t\t\t//System.out.println(\"It's not your turn\");\n\t\t\t\tisCorrectTurn = false;\n\t\t\t\t}\n\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\tSystem.out.println(\"NullPointerException - Error\");\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tif(canBeKing(checker, move)) {\n\t\t\t\tchecker = convertToKing(checker, move);\n\t\t\t\tmodel.updateChecker(move, checker, turn);\n\t\t\t\t\n\t\t\t\tprintBoard();\n\t\t\t\treturn move;\n}\n\n\n\n\t\t\t\t\n\t\t\t\tmodel.updateChecker(move, checker, turn);\n\t\t\t\tupdateBoard(move);\n\t\t\t\t\n\t\t\t\tprintBoard();\n\t\t\t\treturn move;\n\t\t\t\t}\n\t\t\t} catch (NumberFormatException e) {\n\t\t\t\tSystem.out.println(\"Error in Input. Please try again\");\n\t\t\t}\n\t\t\n\t\t}while(!isCorrectTurn);\n\n\t\tprintBoard();\n\t\treturn null;\n\t\t\n\t}",
"boolean makeMove();",
"private boolean canMove() {\n return !(bestMove[0].getX() == bestMove[1].getX() && bestMove[0].getY() == bestMove[1].getY());\n }",
"private boolean selectedPieceHasNextMove(Position startingPosition) {\n\t\treturn false;\n\t}",
"public void checkMoveOrPass(){\n if (this.xTokens.size() > 0) {\n this.diceRoller = false;} \n else { //if no tokens to move, pass and let player roll dice\n this.turn++;\n //System.out.println(\"next turn player \" + this.players[currentPlayer].getColor());\n }\n this.currentPlayer = this.xPlayers.get(this.turn % this.xPlayers.size());\n }",
"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 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 win() {\r\n\t\tfor (int n = 0; n < 3; n++) {\r\n\t\t\tfor (int m = 0; m < 7; m++) {\r\n\t\t\t\tif (board[n][m] != 'X') {\r\n\t\t\t\t\tif (board[n + 1][m] == board[n][m] && board[n + 2][m] == board[n][m]\r\n\t\t\t\t\t\t\t&& board[n + 3][m] == board[n][m]) {\r\n\t\t\t\t\t\tsquares[n][m].setText(\"X\");\r\n\t\t\t\t\t\tsquares[n + 1][m].setText(\"X\");\r\n\t\t\t\t\t\tsquares[n + 2][m].setText(\"X\");\r\n\t\t\t\t\t\tsquares[n + 3][m].setText(\"X\");\r\n\r\n\t\t\t\t\t\twinnerChip = board[n][m];\r\n\r\n\t\t\t\t\t\treturn true;\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\tfor (int n = 0; n < 6; n++) {\r\n\t\t\tfor (int m = 0; m < 4; m++) {\r\n\t\t\t\tif (board[n][m] != 'X') {\r\n\t\t\t\t\tif (board[n][m + 1] == board[n][m] && board[n][m + 2] == board[n][m]\r\n\t\t\t\t\t\t\t&& board[n][m + 3] == board[n][m]) {\r\n\t\t\t\t\t\tsquares[n][m].setText(\"X\");\r\n\t\t\t\t\t\tsquares[n][m + 1].setText(\"X\");\r\n\t\t\t\t\t\tsquares[n][m + 2].setText(\"X\");\r\n\t\t\t\t\t\tsquares[n][m + 3].setText(\"X\");\r\n\t\t\t\t\t\twinnerChip = board[n][m];\r\n\r\n\t\t\t\t\t\treturn true;\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\tfor (int n = 0; n < 3; n++) {\r\n\t\t\tfor (int m = 0; m < 4; m++) {\r\n\t\t\t\tif (board[n][m] != 'X') {\r\n\t\t\t\t\tif (board[n + 1][m + 1] == board[n][m] && board[n + 2][m + 2] == board[n][m]\r\n\t\t\t\t\t\t\t&& board[n + 3][m + 3] == board[n][m]) {\r\n\t\t\t\t\t\tsquares[n][m].setText(\"X\");\r\n\t\t\t\t\t\tsquares[n + 1][m + 1].setText(\"X\");\r\n\t\t\t\t\t\tsquares[n + 2][m + 2].setText(\"X\");\r\n\t\t\t\t\t\tsquares[n + 3][m + 3].setText(\"X\");\r\n\r\n\t\t\t\t\t\twinnerChip = board[n][m];\r\n\t\t\t\t\t\treturn true;\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\tfor (int n = 3; n < 6; n++) {\r\n\t\t\tfor (int m = 0; m < 4; m++) {\r\n\t\t\t\tif (board[n][m] != 'X') {\r\n\t\t\t\t\tif (board[n - 1][m + 1] == board[n][m] && board[n - 2][m + 2] == board[n][m]\r\n\t\t\t\t\t\t\t&& board[n - 3][m + 3] == board[n][m]) {\r\n\t\t\t\t\t\tsquares[n][m].setText(\"X\");\r\n\t\t\t\t\t\tsquares[n - 1][m + 1].setText(\"X\");\r\n\t\t\t\t\t\tsquares[n - 2][m + 2].setText(\"X\");\r\n\t\t\t\t\t\tsquares[n - 3][m + 3].setText(\"X\");\r\n\r\n\t\t\t\t\t\twinnerChip = board[n][m];\r\n\t\t\t\t\t\treturn true;\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\treturn false;\r\n\r\n\t}",
"public boolean move(int x, int y, CheckersBoard board) {\n if (whiteTurn == true && team == Constants.TeamId.team1Id) {\n return false;\n }\n if (whiteTurn == false && team == Constants.TeamId.team2Id) {\n return false;\n }\n /**\n * then change the x - y coords of the piece\n * update the UI to remove the highlighted squares then move the piece\n * if chess and shared square you take a piece\n * if checkers you jumped them you take the piece\n * return new x - y components\n *\n * if this is too high up in the tree you can override this implementation or update it\n * to fit specific pieces if its not working for some reason\n */\n if (possible(x, y, gameBoard)) {\n int changex = this.getX()-x;\n int changey = this.getY()-y;\n CheckersPiece temp = gameBoard.boardPositions[getX()][getY()];\n gameBoard.boardPositions[getX()][getY()] = null;\n gameBoard.boardPositions[x][y] = temp;\n if (gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2] != null) {\n System.out.println(\"Here\");\n if (gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2].team != this.team) {\n gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2].imageView.setVisibility(View.GONE);\n gameBoard.boardPositions[(this.getX() + x)/2][(this.getY() + y)/2] = null;\n }\n }\n this.setX(x);\n this.setY(y);/*\n if (Math.abs(changex) == 2) {\n gameBoard.boardPositions[x + (changex/2)][y + (changey/2)] = null;\n if (team == Constants.TeamId.team1Id) {\n board.numPieces1--;\n } else if (team == Constants.TeamId.team2Id) {\n board.numPieces0--;\n }\n }*/\n\n gameBoard.boardPositions[x][y].imageView.setX(142*x);\n gameBoard.boardPositions[x][y].imageView.setY(142*y);\n // flips after move is\n whiteTurn = !whiteTurn;\n gameBoard.startTimer();\n }\n //setUpUI(gameBoard);\n if (getY() == 7 && team == Constants.TeamId.team2Id) {\n board.crown(this);\n }\n if (getY() == 0 && team == Constants.TeamId.team1Id) {\n board.crown(this);\n }\n return possible(x, y, gameBoard);\n }",
"public static boolean hasWinningMove(int[][] gamePlay){\n\t\tfor(int i=0;i<4;i++){\n\t\t\tfor(int j=0;j<4;j++){\n\t\t\t\tif(gamePlay[i][j]==1){\n\t\t\t\t\tfor(int k=1;k<9;k++){\n\t\t\t\t\t\tint[] root={i,j};\n\t\t\t\t\t\tint[] root1={i,j};\n\t\t\t\t\t\tint[] source=root;\n\t\t\t\t\t\tsource=calculatePosition(root,k);\n\t\t\t\t\t\t//System.out.println(\"Looking in direction \"+k+\" For root\"+i+\",\"+j);\n\t\t\t\t\t\tif(isValidLocation(source)){ \n\t\t\t\t\t\t\tif(gamePlay[source[0]][source[1]]==1){\n\t\t\t\t\t\t\t\tint[] newSource=calculatePosition(source,k);\n\t//System.out.println(\"Two contigous isValid:\"+isValidLocation(newSource)+\"newSource(\"+newSource[0]+\",\"+newSource[1]+\")\"+\" gamePlay:\"+(isValidLocation(newSource)?gamePlay[newSource[0]][newSource[1]]:-1));\n\t\t\t\t\t\t\t\tif(isValidLocation(newSource)){ \n\t\t\t\t\t\t\t\t\tif(gamePlay[newSource[0]][newSource[1]]==0){\n\t\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t//System.out.println(\"Looking in opposite direction\");\n\t\t\t\t\t\t\t\t\t//Lookup in opposite direction\n\t\t\t\t\t\t\t\t\tnewSource=calculatePosition(root1,9-k);\n\t\t\t\t\t\t\t\t\tif(isValidLocation(newSource) && gamePlay[newSource[0]][newSource[1]]==1){\n\t\t\t\t\t\t\t\t\t\t//System.out.println(\"Valid Location:\"+newSource[0]+\" \"+newSource[1]+\" gamePlay\"+gamePlay[newSource[0]][newSource[1]]);\n\t\t\t\t\t\t\t\t\t\treturn true;\n\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}else if(gamePlay[source[0]][source[1]]==0){\n\t\t\t\t\t\t\t\t\t//System.out.println(\"Looking for alternate\");\n\t\t\t\t\t\t\t\t\tsource=calculatePosition(source,k);\n\t\t\t\t\t\t\t\t\tif(isValidLocation(source) && gamePlay[source[0]][source[1]]==1){\n\t\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t//System.out.println(\"Invalid direction or no move here isValid:\"+isValidLocation(source)+\"Source(\"+source[0]+\",\"+source[1]+\")\"+\" gamePlay:\"+(isValidLocation(source)?gamePlay[source[0]][source[1]]:-1));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\n\t\t\t\t}\t\t\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"@Override\n public boolean isValidMove(Tile target, Board board) {\n if (target == null || board == null) {\n throw new NullPointerException(\"Arguments for the isValidMove method can not be null.\");\n }\n // current and target tiles have to be on a diagonal (delta between row and col index have to be identical)\n int currentCol = this.getTile().getCol();\n int currentRow = this.getTile().getRow();\n int targetCol = target.getCol();\n int targetRow = target.getRow();\n\n int deltaRow = Math.abs(currentRow - targetRow);\n int deltaCol = Math.abs(currentCol - targetCol);\n int minDelta = Math.min(deltaCol, deltaRow);\n\n boolean sameDiagonal = deltaCol == deltaRow;\n\n // check if there are pieces between the tiles\n boolean noPiecesBetween = true;\n // Directions -- (Up and to the left) , -+ (Up and to the right), ++, +-\n if (targetRow < currentRow && targetCol < currentCol) { // --\n for (int delta = 1; delta < minDelta; delta++) {\n Tile tileInBetween = board.getTile(currentRow - delta, currentCol - delta);\n if (tileInBetween.hasChessPiece()) {\n noPiecesBetween = false;\n }\n }\n\n } else if (targetRow > currentRow && targetCol < currentCol) { // +-\n for (int delta = 1; delta < minDelta; delta++) {\n Tile tileInBetween = board.getTile(currentRow + delta, currentCol - delta);\n if (tileInBetween.hasChessPiece()) {\n noPiecesBetween = false;\n }\n }\n } else if (targetRow > currentRow && targetCol > currentCol) { // ++\n for (int delta = 1; delta < minDelta; delta++) {\n Tile tileInBetween = board.getTile(currentRow + delta, currentCol + delta);\n if (tileInBetween.hasChessPiece()) {\n noPiecesBetween = false;\n }\n }\n } else if (targetRow < currentRow && targetCol > currentCol) { // -+\n for (int delta = 1; delta < minDelta; delta++) {\n Tile tileInBetween = board.getTile(currentRow - delta, currentCol + delta);\n if (tileInBetween.hasChessPiece()) {\n noPiecesBetween = false;\n }\n }\n }\n\n return sameDiagonal && noPiecesBetween;\n }",
"public boolean isValidMove(Location from, Location to, Piece[][]b) {\n\t\t// Bishop\n\t\tboolean pieceInWay = true;\n\t\tint direction =0; \n\t\tboolean finalLocation = false;\n\t\tboolean verticalUp = false, verticalDown = false, horizontalLeft = false, horizontalRight = false;\n\t\t\n\t\tif(to.getColumn()>from.getColumn() && to.getRow()<from.getRow()){\n\t\t\tdirection = 1;\n\t\t}\n\t\telse if (to.getColumn()<from.getColumn() && to.getRow()>from.getRow()){\n\t\t\tdirection = 2;\n\t\t}\n\t\telse if (to.getColumn()<from.getColumn() && to.getRow()<from.getRow()){\n\t\t\tdirection = 4;\n\t\t}\n\t\telse\n\t\t\tdirection = 3;\t\n\t\t\n\t\t\n\t\tif (Math.abs(from.getColumn() - to.getColumn()) == Math.abs(from.getRow() - to.getRow())\n\t\t\t\t&& b[to.getRow()][to.getColumn()].getPlayer() != getPlayer()\n\t\t\t\t&& !pieceInWay/*b[to.getRow()][to.getColumn()].getPlayer() == 0 b[from.getRow()+1][from.getColumn()+1]*/) {\n\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// Rook\n\n\t\t//This line checks to see if the final destination of the piece contains anything but a friendly piece. This is here, because\n\t\t//anything other than a friendly piece would make the move valid, given that every space in between is blank.\n\t\tif(b[to.getRow()][to.getColumn()].getPlayer() != b[from.getRow()][from.getColumn()].getPlayer())\n\t\t\tfinalLocation = true;\n\t\telse\n\t\t\tfinalLocation = false;\n\t\t\n\t\t//verticalUp\n\t\tif(from.getRow() == to.getRow() && from.getColumn() > to.getColumn()){\n\t\t\tverticalUp = true;\n\t\t\tfor(int i = to.getColumn(); i < from.getColumn() && verticalUp; i++){\n\t\t\t\tif(b[to.getRow()][i].getPlayer() == 0 && verticalUp){\n\t\t\t\t\tverticalUp = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tverticalUp = false;\n\t\t\t}\n\t\t}\n\t\t//verticalDown\n\t\telse if(from.getRow() == to.getRow() && from.getColumn() < to.getColumn()){\n\t\t\tverticalDown = true;\n\t\t\tfor(int i = from.getColumn(); i < to.getColumn() && verticalDown; i++){\n\t\t\t\tif(b[from.getRow()][i].getPlayer() == 0 && verticalDown){\n\t\t\t\t\tverticalDown = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tverticalDown = false;\n\t\t\t}\n\t\t}\n\t\t//horizontalLeft\n\t\telse if(from.getColumn() == to.getColumn() && from.getRow() > to.getRow()){\n\t\t\thorizontalLeft = true;\n\t\t\tfor(int i = to.getRow(); i < from.getRow() && horizontalLeft; i++){\n\t\t\t\tif(b[i][to.getColumn()].getPlayer() == 0 && horizontalLeft){\n\t\t\t\t\thorizontalLeft = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\thorizontalLeft = false;\n\t\t\t}\n\t\t}\n\t\t//horizontalRight\n\t\telse if(from.getColumn() == to.getColumn() && from.getRow() < to.getRow()){\n\t\t\thorizontalRight = true;\n\t\t\tfor(int i = from.getRow(); i < to.getRow() && horizontalRight; i++){\n\t\t\t\tif(b[i][from.getColumn()].getPlayer() == 0 && horizontalRight){\n\t\t\t\t\thorizontalRight = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\thorizontalRight = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(verticalUp || verticalDown || horizontalLeft || horizontalRight && finalLocation){\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}",
"private static String gameStatus(char[][] board){\n\t\t\n\t\tfor (int i = 0; i < 3; i++){\n\t\t\t// check horizontal lines && vertical lines for player x\n\t\t\tif ((board[i][0] == 'X' && board[i][1] == 'X' && board[i][2] == 'X') || \n\t\t\t\t\t(board[0][i] == 'X' && board[1][i] == 'X' && board[2][i] == 'X')){\n\t\t\t\twinner = 'X';\n\t\t\t\treturn \"true\";\n\t\t\t}\n\t\t}\n\t\t//check diags for x\n\t\tif ((board[0][0] == 'X' && board[1][1] == 'X' && board[2][2] == 'X') || \n\t\t\t\t(board[0][2] == 'X' && board[1][1] == 'X' && board[2][0] == 'X')){\n\t\t\twinner = 'X';\n\t\t\treturn \"true\";\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < 3 ; i++) {\n\t\t\t// check horizontal and vertical lines for player o\n\t\t\tif ((board[i][0] == 'O' && board[i][1] == 'O' && board[i][2] == 'O') || \n\t\t\t\t\t(board[0][i] == 'O' && board[1][i] == 'O' && board[2][i] == 'O')){\n\t\t\t\twinner = 'O';\n\t\t\t\treturn \"true\";\n\t\t\t}\n\t\t}\n\t\t//check diags for o\n\t\tif ((board[0][0] == 'O' && board[1][1] == 'O' && board[2][2] == 'O') || \n\t\t\t\t(board[0][2] == 'O' && board[1][1] == 'O' && board[2][0] == 'O')){\n\t\t\twinner = 'O';\n\t\t\treturn \"true\";\n\t\t}\n\n\t\t// check for tie\n\t\tint emptyCells = 9;\n\t\tfor (int i = 0; i < 3; i++){\n\t\t\tfor (int j = 0; j < 3; j++){\n\t\t\t\tif (board[i][j]!='\\0') emptyCells -= 1;\t\t\n\t\t\t}\n\t\t}\n\t\t// if all cells are filled, game is over with a tie\n\t\tif (emptyCells == 0) return \"tie\";\n\n\t\t// otherwise game is not over and return false\n\t\t//printBoard(board);\n\n\t\treturn \"false\";\n\t}",
"private boolean isWinner(byte player) {\n for (int row = 0; row <= 2; row++) {\n if (board[row][0] == player && board[row][1] == player && board[row][2] == player) {\n return true;\n }\n }\n for (int column = 0; column <= 2; column++) {\n if (board[0][column] == player && board[1][column] == player && board[2][column] == player) {\n return true;\n }\n }\n if (board[0][0] == player && board[1][1] == player && board[2][2] == player) {\n return true;\n } else if (board[0][2] == player && board[1][1] == player && board[2][0] == player) {\n return true;\n } else {\n return false;\n }\n }",
"private boolean canEats(Point piece){\r\n\t// direction -1: red pieces +1: black pieces\r\n int dir = isRed(piece)? -1:+1;\r\n int dest = dir * 2; // eat move destination\r\n // compute movement points\r\n Point left = new Point(piece.getFirst() + dir, piece.getSecond() - 1);\r\n Point left2 = new Point(piece.getFirst()+ dest, piece.getSecond() - 2);\r\n Point right = new Point(piece.getFirst() + dir, piece.getSecond() + 1);\r\n Point right2 = new Point(piece.getFirst() + dest, piece.getSecond() + 2);\r\n // check left eat\r\n if(isValidPosition(left) && isValidPosition(left2)){\r\n if(isRed(piece) && isBlack(left) && isEmpty(left2)) return true;\r\n if(isBlack(piece) && isRed(left) && isEmpty(left2)) return true;\r\n }\r\n // check right eat\r\n if(isValidPosition(right) && isValidPosition(right2)){\r\n if(isRed(piece) && isBlack(right) && isEmpty(right2)) return true;\r\n if(isBlack(piece) && isRed(right) && isEmpty(right2)) return true;\r\n }\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 leftQ2 = new Point(piece.getFirst() - dest, piece.getSecond() - 2);\r\n Point rightQ = new Point(piece.getFirst() - dir, piece.getSecond() + 1);\r\n Point rightQ2 = new Point(piece.getFirst() - dest, piece.getSecond() + 2);\r\n // check left eat\r\n if(isValidPosition(leftQ) && isValidPosition(leftQ2)){\r\n if(isRed(piece) && isBlack(leftQ) && isEmpty(leftQ2)) return true;\r\n if(isBlack(piece) && isRed(leftQ) && isEmpty(leftQ2)) return true;\r\n }\r\n // check right eat\r\n if(isValidPosition(rightQ) && isValidPosition(rightQ2)){\r\n if(isRed(piece) && isBlack(rightQ) && isEmpty(rightQ2)) return true;\r\n if(isBlack(piece) && isRed(rightQ) && isEmpty(rightQ2)) return true;\r\n }\r\n }\r\n return false;\r\n }",
"private boolean checkPlayerOneWin()\n {\n boolean playerOneWin = false;\n \n if( board[0][0] == \"X\" && board[0][1] == \"X\" && board[0][2] == \"X\" )\n {\n playerOneWin = true;\n }\n else if( board[1][0] == \"X\" && board[1][1] == \"X\" && board[1][2] == \"X\" )\n {\n playerOneWin = true;\n }\n else if( board[2][0] == \"X\" && board[2][1] == \"X\" && board[2][2] == \"X\" )\n {\n playerOneWin = true;\n }\n else if( board[0][0] == \"X\" && board[1][0] == \"X\" && board[2][0] == \"X\" )\n {\n playerOneWin = true;\n }\n else if( board[0][1] == \"X\" && board[1][1] == \"X\" && board[2][1] == \"X\" )\n {\n playerOneWin = true;\n }\n else if( board[2][0] == \"X\" && board[2][1] == \"X\" && board[2][2] == \"X\" )\n {\n playerOneWin = true;\n }\n else if( board[0][0] == \"X\" && board[1][1] == \"X\" && board[2][2] == \"X\" )\n {\n playerOneWin = true;\n }\n else if( board[0][2] == \"X\" && board[1][1] == \"X\" && board[2][0] == \"X\" )\n {\n playerOneWin = true;\n }\n \n return playerOneWin;\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 }",
"private boolean isLegalMove(Move move, String dir, ArrayList<Tile> rack) {\n\t\t// one of the possibly many words created by the move, to be checked\n\t\t// with the supplied dictionary\n\t\tString word = \"\";\n\t\tint r = 0;\n\t\tint c = 0;\n\t\t// check the word created in the vertical direction only once, then for\n\t\t// every letter in the move, check the word created in the horizontal\n\t\t// direction\n\t\tif (dir.equals(\"vertical\")) {\n\t\t\t// add the letters in the move to the word created\n\t\t\tfor (int i = 0; i < move.size(); i++)\n\t\t\t\tword += move.get(i).getChar();\n\t\t\t// add any adjacent letters on the board above the first letter in\n\t\t\t// move, adds the letters to the beginning of the word created\n\t\t\tr = move.get(0).getLoc().getRow() - 1;\n\t\t\tc = move.get(0).getLoc().getCol();\n\t\t\twhile (r >= 0 && board[r][c].getLetter() != null) {\n\t\t\t\tword = board[r][c].getLetter().getChar() + word;\n\t\t\t\tr--;\n\t\t\t}\n\t\t\t// add any adjacent letters on the board below the last letter in\n\t\t\t// move, adds the letters to the end of the word created\n\t\t\tr = move.get(move.size() - 1).getLoc().getRow() + 1;\n\t\t\twhile (r < len && board[r][c].getLetter() != null) {\n\t\t\t\tword += board[r][c].getLetter().getChar();\n\t\t\t\tr++;\n\t\t\t}\n\t\t\t// check if the created word is in the dictionary provided if\n\t\t\t// the word created is longer than one letter\n\t\t\tif (word.length() > 1 && !isWord(word))\n\t\t\t\treturn false;\n\n\t\t\t// add any adjacent letters on the board that are left and right of\n\t\t\t// the current letter of move at the given coordinate, adds the\n\t\t\t// letters to the beginning and end of the word created,\n\t\t\t// respectively\n\t\t\tfor (int i = 0; i < move.size(); i++) {\n\t\t\t\t// clear the word to be checked\n\t\t\t\tword = \"\";\n\t\t\t\t// add the current letter to the word to be checked\n\t\t\t\tword += move.get(i).getChar();\n\t\t\t\tr = move.get(i).getLoc().getRow();\n\t\t\t\tc = move.get(i).getLoc().getCol() - 1;\n\t\t\t\t// add letters left of the current letter\n\t\t\t\twhile (c >= 0 && board[r][c].getLetter() != null) {\n\t\t\t\t\tword = board[r][c].getLetter().getChar() + word;\n\t\t\t\t\tc--;\n\t\t\t\t}\n\t\t\t\t// add letters right of the current letter\n\t\t\t\tc = move.get(move.size() - 1).getLoc().getCol() + 1;\n\t\t\t\twhile (c < len && board[r][c].getLetter() != null) {\n\t\t\t\t\tword += board[r][c].getLetter().getChar();\n\t\t\t\t\tc++;\n\t\t\t\t}\n\t\t\t\t// check if the created word is in the dictionary provided if\n\t\t\t\t// the word created is longer than one letter\n\t\t\t\tif (word.length() > 1 && !isWord(word))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tif (dir.equals(\"horizontal\")) {\n\t\t\t// add the letters in the move to the word created\n\t\t\tfor (int i = 0; i < move.size(); i++) {\n\t\t\t\tword += move.get(i).getChar();\n\t\t\t}\n\t\t\t// add any adjacent letters on the board left of the first letter in\n\t\t\t// move, adds the letters to the beginning of the word created\n\t\t\tr = move.get(0).getLoc().getRow();\n\t\t\tc = move.get(0).getLoc().getCol() - 1;\n\t\t\twhile (c >= 0 && board[r][c].getLetter() != null) {\n\t\t\t\tword = board[r][c].getLetter().getChar() + word;\n\t\t\t\tc--;\n\t\t\t}\n\t\t\t// add any adjacent letters on the board right of the last letter in\n\t\t\t// move, adds the letters to the end of the word created\n\t\t\tc = move.get(move.size() - 1).getLoc().getCol() + 1;\n\t\t\twhile (c < len && board[r][c].getLetter() != null) {\n\t\t\t\tword += board[r][c].getLetter().getChar();\n\t\t\t\tc++;\n\t\t\t}\n\t\t\t// check if the created word is in the dictionary provided if\n\t\t\t// the word created is longer than one letter\n\t\t\tif (word.length() > 1 && !isWord(word))\n\t\t\t\treturn false;\n\n\t\t\t// add any adjacent letters on the board that are above and below\n\t\t\t// the current letter of move at the given coordinate, adds the\n\t\t\t// letters to the beginning and end of the word created,\n\t\t\t// respectively\n\t\t\tfor (int i = 0; i < move.size(); i++) {\n\t\t\t\t// clear the word to be checked\n\t\t\t\tword = \"\";\n\t\t\t\t// add the current letter to the word to be checked\n\t\t\t\tword += move.get(i).getChar();\n\t\t\t\tr = move.get(i).getLoc().getRow() - 1;\n\t\t\t\tc = move.get(i).getLoc().getCol();\n\t\t\t\t// add letters above the current letter\n\t\t\t\twhile (r >= 0 && board[r][c].getLetter() != null) {\n\t\t\t\t\tword = board[r][c].getLetter().getChar() + word;\n\t\t\t\t\tr--;\n\t\t\t\t}\n\t\t\t\t// add letters below the current letter\n\t\t\t\tr = move.get(move.size() - 1).getLoc().getRow() + 1;\n\t\t\t\twhile (r < len && board[r][c].getLetter() != null) {\n\t\t\t\t\tword += board[r][c].getLetter().getChar();\n\t\t\t\t\tr++;\n\t\t\t\t}\n\t\t\t\t// check if the created word is in the dictionary provided if\n\t\t\t\t// the word created is longer than one letter\n\t\t\t\tif (word.length() > 1 && !isWord(word))\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tif (isReplacing(move) || hasMissingLetters(move, rack))\n\t\t\treturn false;\n\t\treturn true;\n\t}",
"public boolean canMove(int nrow, int ncol){\n\t//# means hasn't been visited; o means has been visited\n\tif(board[nrow][ncol] == ' ' ||\n\t board[nrow][ncol] == 'E'){\n\t return true;\n\t}else{\n\t return false;\n\t}\n\t/* \n\t if(board[nrow][ncol] != ' '){\n\t return false;\n\t }else{\n\t return true;\n\t }\n\t*/\n }",
"public static boolean isValidMove(Player curr, int r, int c) {\n if (r < 0 || c < 0 || r >= board.length || c >= board[0].length)\n return false; //nobody can escape the dimensions of the board\n if (curr == null)\n return false;\n if (curr.isFlying()) //aircraft can fly over anything\n return true;\n if (curr.getName().startsWith(\"TRAIN\")) //trains can only run on tracks\n {\n if (board[r][c][panel].startsWith(\"T\")) //train tracks\n return true;\n return false;\n }\n\n if (board[r][c][panel].startsWith(\"#\")) //nobody can cross electric lines\n return false;\n if (Utilities.streetTraveler(curr)) //curr can only travel on streets\n { //street or crossroad\tor empty lot or bridge or rr x-ing AND\tno structure\n if (MapBuilder.isStreet(r, c, panel)) { //don't try to move into the monster\n if (r == players[PLAYER1].getRow() && c == players[PLAYER1].getCol())\n return false;\n return true;\n }\n return false;\n } else if (curr.getName().startsWith(\"CROWD\")) { //street, crossroad, empty lot, bridge, mud, sand or park or rr x-ing AND\tno structure\n if (MapBuilder.passableByCrowd(r, c, panel)) { //don't try to move into the monster\n if (r == players[PLAYER1].getRow() && c == players[PLAYER1].getCol())\n return false;\n return true;\n }\n return false;\n } else if (curr.getName().endsWith(\"tank\") || curr.getName().endsWith(\"flame\")) { //park, street, rubble or mud or rr x-ing\n if (MapBuilder.passableByTank(r, c, panel)) { //don't try to move into the monster\n if (r == players[PLAYER1].getRow() && c == players[PLAYER1].getCol())\n return false;\n return true;\n }\n return false;\n } else if (curr.getName().startsWith(\"BOAT\")) {\n if (board[r][c][panel].startsWith(\"~\"))\n return true;\n return false;\n }\n return true;\n }",
"public boolean validMove(int playerID, Card selectedCard){\n // turn == playerID\n if(gameStage == 3){\n if(numPlays == 0){\n if(playerID == 0){\n player1Play = selectedCard;\n // card goes to middle\n //checks suit of the jack if played first and sets first played suit to the correct suit\n //according to which suit is trump\n if(selectedCard.getValue() == Card.NUMBER.JACK){\n if(currentTrumpSuit == Card.SUIT.DIAMONDS && selectedCard.getSuit() == Card.SUIT.HEARTS){\n firstPlayedSuit = Card.SUIT.DIAMONDS;\n }\n if(currentTrumpSuit == Card.SUIT.HEARTS && selectedCard.getSuit() == Card.SUIT.DIAMONDS){\n firstPlayedSuit = Card.SUIT.HEARTS;\n }\n if(currentTrumpSuit == Card.SUIT.CLUBS && selectedCard.getSuit() == Card.SUIT.SPADES){\n firstPlayedSuit = Card.SUIT.CLUBS;\n }\n if(currentTrumpSuit == Card.SUIT.SPADES && selectedCard.getSuit() == Card.SUIT.CLUBS){\n firstPlayedSuit = Card.SUIT.SPADES;\n }\n }\n else{\n firstPlayedSuit = player1Play.getSuit();\n }\n numPlays++;\n turn++;\n return true;\n }\n else if(playerID == 1){\n player2Play = selectedCard;\n // card goes to middle\n //checks suit of the jack if played first and sets first played suit to the correct suit\n //according to which suit is trump\n if(selectedCard.getValue() == Card.NUMBER.JACK){\n if(currentTrumpSuit == Card.SUIT.DIAMONDS && selectedCard.getSuit() == Card.SUIT.HEARTS){\n firstPlayedSuit = Card.SUIT.DIAMONDS;\n }\n if(currentTrumpSuit == Card.SUIT.HEARTS && selectedCard.getSuit() == Card.SUIT.DIAMONDS){\n firstPlayedSuit = Card.SUIT.HEARTS;\n }\n if(currentTrumpSuit == Card.SUIT.CLUBS && selectedCard.getSuit() == Card.SUIT.SPADES){\n firstPlayedSuit = Card.SUIT.CLUBS;\n }\n if(currentTrumpSuit == Card.SUIT.SPADES && selectedCard.getSuit() == Card.SUIT.CLUBS){\n firstPlayedSuit = Card.SUIT.SPADES;\n }\n }\n else{\n firstPlayedSuit = player2Play.getSuit();\n }\n numPlays++;\n turn++;\n return true;\n }\n else if(playerID == 2){\n player3Play = selectedCard;\n // card goes to middle\n //checks suit of the jack if played first and sets first played suit to the correct suit\n //according to which suit is trump\n if(selectedCard.getValue() == Card.NUMBER.JACK){\n if(currentTrumpSuit == Card.SUIT.DIAMONDS && selectedCard.getSuit() == Card.SUIT.HEARTS){\n firstPlayedSuit = Card.SUIT.DIAMONDS;\n }\n if(currentTrumpSuit == Card.SUIT.HEARTS && selectedCard.getSuit() == Card.SUIT.DIAMONDS){\n firstPlayedSuit = Card.SUIT.HEARTS;\n }\n if(currentTrumpSuit == Card.SUIT.CLUBS && selectedCard.getSuit() == Card.SUIT.SPADES){\n firstPlayedSuit = Card.SUIT.CLUBS;\n }\n if(currentTrumpSuit == Card.SUIT.SPADES && selectedCard.getSuit() == Card.SUIT.CLUBS){\n firstPlayedSuit = Card.SUIT.SPADES;\n }\n }\n else{\n firstPlayedSuit = player3Play.getSuit();\n }\n numPlays++;\n turn++;\n return true;\n }\n else if(playerID == 3){\n player4Play = selectedCard;\n // card goes to middle\n //checks suit of the jack if played first and sets first played suit to the correct suit\n //according to which suit is trump\n if(selectedCard.getValue() == Card.NUMBER.JACK){\n if(currentTrumpSuit == Card.SUIT.DIAMONDS && selectedCard.getSuit() == Card.SUIT.HEARTS){\n firstPlayedSuit = Card.SUIT.DIAMONDS;\n }\n if(currentTrumpSuit == Card.SUIT.HEARTS && selectedCard.getSuit() == Card.SUIT.DIAMONDS){\n firstPlayedSuit = Card.SUIT.HEARTS;\n }\n if(currentTrumpSuit == Card.SUIT.CLUBS && selectedCard.getSuit() == Card.SUIT.SPADES){\n firstPlayedSuit = Card.SUIT.CLUBS;\n }\n if(currentTrumpSuit == Card.SUIT.SPADES && selectedCard.getSuit() == Card.SUIT.CLUBS){\n firstPlayedSuit = Card.SUIT.SPADES;\n }\n }\n else{\n firstPlayedSuit = player4Play.getSuit();\n }\n numPlays++;\n turn = 0;\n return true;\n }\n }\n else if(numPlays < 3){\n if(playerID == 0){\n player1Play = selectedCard;\n numPlays++;\n turn++;\n return true;\n }\n else if(playerID == 1){\n player2Play = selectedCard;\n numPlays++;\n turn++;\n return true;\n }\n else if(playerID == 2){\n player3Play = selectedCard;\n numPlays++;\n turn++;\n return true;\n }\n else if(playerID == 3){\n player4Play = selectedCard;\n numPlays++;\n turn = 0;\n return true;\n }\n }\n // if three cards have been played this is the last card\n else if(numPlays == 3){\n if(playerID == 0){\n player1Play = selectedCard;\n numPlays++;\n firstPlayedSuit = null;\n return true;\n }\n else if(playerID == 1){\n player2Play = selectedCard;\n numPlays++;\n firstPlayedSuit = null;\n return true;\n }\n else if(playerID == 2){\n player3Play = selectedCard;\n numPlays++;\n firstPlayedSuit = null;\n return true;\n }\n else if(playerID == 3){\n player4Play = selectedCard;\n numPlays++;\n firstPlayedSuit = null;\n return true;\n }\n }\n }\n return false;\n }",
"public boolean checkForWin()\n {\n //Horizontal win\n for (int r = 0; r <= 5; r++)\n {\n for (int c = 0; c <= 3; c++)\n {\n if (current_board[c][r] == player_turn &&\n current_board[c+1][r] == player_turn &&\n current_board[c+2][r] == player_turn &&\n current_board[c+3][r] == player_turn)\n return true;\n }\n }\n //Vertical win\n for (int c = 0; c <= 6; c++)\n {\n for (int r = 0; r <= 2; r++)\n {\n if (current_board[c][r] == player_turn &&\n current_board[c][r+1] == player_turn &&\n current_board[c][r+2] == player_turn &&\n current_board[c][r+3] == player_turn)\n return true;\n }\n }\n //Shortest diagonals/anti diagonals (cell length == 4)\n //postive slope\n if (current_board[0][2] == player_turn && current_board[1][3] == player_turn && current_board[2][4] == player_turn && current_board[3][5] == player_turn)\n return true;\n if (current_board[3][0] == player_turn && current_board[4][1] == player_turn && current_board[5][2] == player_turn && current_board[6][3] == player_turn)\n return true;\n //negative slope\n if (current_board[0][3] == player_turn && current_board[1][2] == player_turn && current_board[2][1] == player_turn && current_board[3][0] == player_turn)\n return true;\n if (current_board[3][5] == player_turn && current_board[4][4] == player_turn && current_board[5][3] == player_turn && current_board[6][2] == player_turn)\n return true;\n\n //Medium-length diagonals/anti diagonals (cell length == 5)\n //positive slope\n if (current_board[0][1] == player_turn && current_board[1][2] == player_turn && current_board[2][3] == player_turn && current_board[3][4] == player_turn)\n return true;\n if (current_board[1][2] == player_turn && current_board[2][3] == player_turn && current_board[3][4] == player_turn && current_board[4][5] == player_turn)\n return true;\n if (current_board[2][0] == player_turn && current_board[3][1] == player_turn && current_board[4][2] == player_turn && current_board[5][3] == player_turn)\n return true;\n if (current_board[3][1] == player_turn && current_board[4][2] == player_turn && current_board[5][3] == player_turn && current_board[6][4] == player_turn)\n return true;\n //negative slope\n if (current_board[0][4] == player_turn && current_board[1][3] == player_turn && current_board[2][2] == player_turn && current_board[3][1] == player_turn)\n return true;\n if (current_board[1][3] == player_turn && current_board[2][2] == player_turn && current_board[3][1] == player_turn && current_board[4][0] == player_turn)\n return true;\n if (current_board[2][5] == player_turn && current_board[3][4] == player_turn && current_board[4][3] == player_turn && current_board[5][2] == player_turn)\n return true;\n if (current_board[3][4] == player_turn && current_board[4][3] == player_turn && current_board[5][2] == player_turn && current_board[6][1] == player_turn)\n return true;\n\n //Longest diagonals/anti diagonals (cell length == 6)\n //positive slope\n for (int c=0, r=0; c <= 2 && r <= 2; c++, r++)\n {\n if (current_board[c][r] == player_turn &&\n current_board[c+1][r+1] == player_turn &&\n current_board[c+2][r+2] == player_turn &&\n current_board[c+3][r+3] == player_turn)\n return true;\n }\n for (int c=1, r=0; c <= 3 && r <= 2; c++, r++)\n {\n if (current_board[c][r] == player_turn &&\n current_board[c+1][r+1] == player_turn &&\n current_board[c+2][r+2] == player_turn &&\n current_board[c+3][r+3] == player_turn)\n return true;\n }\n //negative slope\n for (int c=0, r=5; c <= 2 && r >= 3; c++, r--)\n {\n if (current_board[c][r] == player_turn &&\n current_board[c+1][r-1] == player_turn &&\n current_board[c+2][r-2] == player_turn &&\n current_board[c+3][r-3] == player_turn)\n return true;\n }\n for (int c=1, r=5; c <= 3 && r >= 3; c++, r--)\n {\n if (current_board[c][r] == player_turn &&\n current_board[c+1][r-1] == player_turn &&\n current_board[c+2][r-2] == player_turn &&\n current_board[c+3][r-3] == player_turn)\n return true;\n }\n\n return false;\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}",
"private boolean checkMoveOthers(Pieces piece, Coordinates from, Coordinates to) {\n\t\t\t\t\n\t\t/* \n\t\t *il pedone: \n\t\t * -può andare dritto sse davanti a se non ha pedine\n\t\t * -può andare obliquo sse in quelle posizioni ha una pedina avversaria da mangiare\n\t\t * \n\t\t */\n\t\tif (piece instanceof Pawn) {\n\t\t\tif (from.getY() == to.getY()) {\n\t\t\t\tif(chessboard.at(to) == null)\n\t\t\t\t\treturn true;\n\t\t\t\telse\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(chessboard.at(to) == null) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//il cavallo salta le pedine nel mezzo\n\t\tif (piece instanceof Knight)\n\t\t\treturn true;\n\t\t\n\t\t//Oltre non andranno il: cavallo, il re ed il pedone.\n\t\t/*\n\t\t *Calcolo le posizioni che intercorrono tra il from ed il to escluse \n\t\t *ed per ogni posizione verifico se è vuota\n\t\t *-se in almeno una posizione c'è una pedina(non importa il colore), la mossa non è valida\n\t\t *-altrimenti, la strada è spianata quindi posso effettuare lo spostamento \n\t\t */\n\t\tArrayList<Coordinates> path = piece.getPath(from, to);\n\t\tfor (Coordinates coordinate : path) {\n\t\t\tif ( chessboard.at(coordinate) != null ){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}",
"private boolean processCommand(Command command)//Method was given\n {\n if(command.isUnknown())\n {\n System.out.println(\"I don't know what you mean...\");\n return false;\n }\n\n String commandWord = command.getCommandWord();\n if (commandWord.equals(\"help\"))\n printHelp();\n else if (commandWord.equals(\"go\"))\n goRoom(command);\n else if (commandWord.equals(\"talk\"))\n talkToCharacter(currentRoom);\n else if (commandWord.equals(\"grab\"))\n {\n secondWord = command.getSecondWord();\n if (secondWord == null)\n {\n System.out.println(\"Grab what?\");\n }\n else\n {\n grabItem(secondWord);\n }\n }\n else if (commandWord.equals(\"eat\"))\n {\n secondWord = command.getSecondWord();\n if (secondWord == null)\n {\n System.out.println(\"Eat what?\");\n }\n else\n {\n eatItem(secondWord);\n }\n }\n else if (commandWord.equals(\"inventory\")) \n player.getInventory();\n else if (commandWord.equals(\"drop\"))\n {\n secondWord = command.getSecondWord();\n if (secondWord == null)\n {\n System.out.println(\"Drop what?\");\n }\n else\n {\n dropItem(secondWord);\n }\n }\n else if (commandWord.equals(\"inspect\"))\n {\n secondWord = command.getSecondWord();\n if (secondWord == null)\n {\n System.out.println(\"Inspect what?\");\n }\n else\n {\n inspectItem(secondWord);\n }\n }\n else if (commandWord.equals(\"quit\"))\n {\n if(command.hasSecondWord())\n System.out.println(\"Quit what?\");\n else\n return true; // signal that we want to quit\n }\n else if (commandWord.equals(\"look\"))\n {\n System.out.println(currentRoom.longDescription());\n }\n return false;\n }",
"public boolean isGameOver() {\n if (winner == null) {\n Piece[] diagOne = new Piece[this.size];\n Piece[] diagTwo = new Piece[this.size];\n for (int col = 0; col < _board.length; col += 1) {\n diagOne[col] = _board[col][col];\n diagTwo[col] = _board[col][this.size - 1 - col];\n if (isWinning(_board[col])) {\n alternatePlayer(currPlayer);\n winner = currPlayer;\n return true;\n }\n }\n this.transpose();\n for (int row = 0; row < _board[0].length; row += 1) {\n if (isWinning(this._board[row])) {\n this.transpose();\n alternatePlayer(currPlayer);\n winner = currPlayer;\n return true;\n }\n }\n\n this.transpose();\n\n if (isWinning(diagOne) || isWinning(diagTwo)) {\n alternatePlayer(currPlayer);\n winner = currPlayer;\n return true;\n }\n if (checkTie()) {\n return true;\n }\n }\n return false;\n }"
]
| [
"0.706877",
"0.68388844",
"0.6713701",
"0.6698731",
"0.66326374",
"0.661565",
"0.66031885",
"0.6602782",
"0.65861857",
"0.65465677",
"0.6538925",
"0.6536567",
"0.6515037",
"0.6508781",
"0.64874095",
"0.64851123",
"0.6478201",
"0.6467848",
"0.6439225",
"0.64383435",
"0.6437174",
"0.64303344",
"0.6429371",
"0.642927",
"0.6426614",
"0.6425486",
"0.641146",
"0.64075184",
"0.6405422",
"0.6403777",
"0.6401827",
"0.63738656",
"0.6371293",
"0.63712925",
"0.6370506",
"0.6365465",
"0.6362849",
"0.63623345",
"0.63613343",
"0.6356318",
"0.63504493",
"0.6348855",
"0.6343908",
"0.6341592",
"0.63375646",
"0.63339716",
"0.6332837",
"0.6332162",
"0.63316107",
"0.63150233",
"0.6312579",
"0.63108253",
"0.63018847",
"0.63011587",
"0.62959015",
"0.6292909",
"0.6292822",
"0.62927204",
"0.62885106",
"0.6284971",
"0.6274015",
"0.6258151",
"0.6254732",
"0.6253769",
"0.62489754",
"0.6248651",
"0.6244423",
"0.62393",
"0.62359715",
"0.6233777",
"0.62317556",
"0.6226281",
"0.62255293",
"0.62247455",
"0.62228286",
"0.6215498",
"0.62121093",
"0.62118596",
"0.6208853",
"0.620789",
"0.6206647",
"0.62040114",
"0.6201909",
"0.619965",
"0.61989665",
"0.61986935",
"0.6192388",
"0.6182199",
"0.61777186",
"0.61757505",
"0.6172693",
"0.61659205",
"0.615618",
"0.61539304",
"0.61527926",
"0.61461705",
"0.61449474",
"0.6144",
"0.6138811",
"0.6136161"
]
| 0.7796825 | 0 |
This function accepts the input and catches the InvalidMoveException if the move is not valid and in case of valid move it calls for playMove function. | public boolean validateMoveAndPlay(String input){
// This function validates the move. such as whether coins are present or not.
try{
InvalidMoveException.validateMove(input, this.gameController);
if(playMove(input) == false){
return false;
}
}catch(InvalidMoveException e){
System.out.println("\nDiscarding "+input+ " move because of following exception");
System.out.println(e.getMessage()+"\n");
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract boolean attemptMove(Player currentPlayerObj, Coordinate move);",
"public abstract void playMove(Move move, int indexOfMove);",
"public boolean playMove(String input_command) {\n // This function will take a command, validates input and calls for a move for a\n // player\n // whoes turn is there.\n String[] inputs = input_command.split(\" \");\n String move = inputs[0];\n PlayerController playerController = getNextPlayer();\n this.playerControllerList.remove(playerController);\n System.out.println(\"\\nPlayer\" + playerController.getPlayerId() + \" choosed:\" + input_command + \" move\");\n System.out.println(\"Before playing move=>\" + getStateOfPlayer(playerController));\n System.out.println(\"Before playing move=> Board State:\" + getStateOfBoard());\n switch (move) {\n case \"STRIKE\":\n this.gameController.strikeMove(playerController);\n break;\n case \"MULTI_STRIKE\":\n // We should take one more input that is count of striked coins\n this.gameController.multiStrikeMove(playerController, Integer.parseInt(inputs[1]));\n break;\n case \"RED_STRIKE\":\n this.gameController.redStrikeMove(playerController);\n break;\n case \"NONE\":\n this.gameController.noneMove(playerController);\n break;\n case \"DEFUNCT_COIN\":\n if(inputs[1].equals(\"BLACK\")){\n this.gameController.defunctCoinMove(playerController, CoinType.BLACK);\n }else if(inputs[1].equals(\"RED\")){\n this.gameController.defunctCoinMove(playerController, CoinType.RED);\n }\n break;\n case \"STRIKER_STRIKE\":\n this.gameController.strikerStrikeMove(playerController);\n break;\n }\n this.playerControllerList.add(playerController);\n System.out.println(\"After playing move=> Board State:\" + getStateOfBoard());\n System.out.println(\"After playing move=>\" + getStateOfPlayer(playerController) + \"\\n\");\n changeTurn();\n PlayerController winner = calculateWinner();\n if (winner != null) {\n System.out.println(\"Winner is:Player\" + winner.getPlayerId() + \" having points:\" + winner.getPoints());\n return false;\n } else {\n if (this.gameController.isBoardEmpty() == true) {\n System.out.println(\"Match is draw\");\n return false;\n }\n }\n return true;\n }",
"private void invalidMove(){\n setMsgText(\"That's a invalid move\");\n playSound(WRONG_SOUND);\n }",
"public Move movePiece(int turn) {\n\t\tboolean error = false;\n\t\tString moveInput = null;\n\t\tString origin = null;\n\t\tboolean isCorrectTurn = false;\n\t\t@SuppressWarnings(\"resource\")\n\t\tScanner keyboard = new Scanner(System.in);\n\n\t\tdo {\n\t\t\t\n\t\t\ttry {\n\t\t\t\tdo {\n\t\t\t\t\tSystem.out.println(\"Which piece would you like to move?\");\n\t\t\t\t\torigin = keyboard.next();\n\n\t\t\t\t\tif(validateInput(origin)) {\n\t\t\t\t\t\tSystem.out.println(\"Error in input, please try again\");\n\t\t\t\t\t\terror = true; \n\t\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\t\terror = false;\n\t\t\t\t\t}\n\n\t\t\t\t}while(error);\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tString xOrigin = origin.substring(0, 1);\n\t\t\t\tint yOrigin = Integer.parseInt(origin.substring(1,2));\n\t\t\t\tint convertedXOrigin = convertXPosition(xOrigin);\n\t\t\t\tyOrigin -= 1;\n\t\t\t\t\nif((board.getBoard()[yOrigin][convertedXOrigin] == turn) || (board.getBoard()[yOrigin][convertedXOrigin] == (turn + 2))) {\n\t\t\t\tisCorrectTurn = true;\n\t\t\t\tChecker checker = validatePiece(convertedXOrigin, yOrigin);\t\n\t\t\t\tdo {\n\t\t\t\t\t\n\t\t\t\t\t\tSystem.out.println(\"Where would you like to move\");\n\t\t\t\t\t\t moveInput = keyboard.next();\n\t\t\t\t\t\tif(validateInput(moveInput)) {\n\t\t\t\t\t\t\tSystem.out.println(\"Error in Input, please try again\");\n\t\t\t\t\t\t\terror = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\terror = false;\n\t\t\t\t\t\t//\tSystem.out.println(\"No errors found with input move\");\n\t\t\t\t\t\t}\n\n\t\t\t\t} while(error);\n\t\t\t\t\n\t\t\t\tString xMove = moveInput.substring(0, 1);\n\t\t\t\tint yMove = Integer.parseInt(moveInput.substring(1,2));\n\t\t\t\tint convertedXMove = convertXPosition(xMove);\n\t\t\t\tyMove -= 1;\n\t\t\t\tboolean isMovingRight = isMovingRight(convertedXOrigin, yOrigin, convertedXMove, yMove);\n\t\t\t\tboolean isMovingDown = isMovingDown(convertedXOrigin, yOrigin, convertedXMove, yMove);\n\t\t\t\tMove move = null;\n\t\t\t\t\n\t\t\t\t//checks to see if the move itself is valid\n\t\t\t\ttry {\nif(isMoveValid(convertedXOrigin, yOrigin, convertedXMove, yMove, isMovingRight, isMovingDown)) {\n\t\t\t\tif(isSpaceTaken(convertedXMove, yMove)) {\n\t\t\t\t\t//System.out.println(\"Space is taken\");\n\t\t\t\t\tif(isPieceEnemy(convertedXMove, yMove, checker, turn)) {\n\t\t\t\t\t\tif(isJumpValid(convertedXOrigin, yOrigin, convertedXMove, yMove, isMovingRight, isMovingDown)) {\n\t\t\t\t\t\t\tif(isMovingRight) {\n\t\t\t\t\t\t\t\t//checks to see if the piece is moving up or down\n\t\t\t\t\t\t\t\tif(isMovingDown) {\n\t\t\t\t\t\t\t\t\t//means the piece is moving right and down\n\t\t\t\t\t\t\t\t\t move = new Move(convertedXOrigin, yOrigin, convertedXMove + 1, yMove + 1);\n\t\t\t\t\t\t\t\t\tmodel.moves.add(move);\t\n\t\t\t\t\t\t\t\t\tremoveTakenPiece(convertedXMove, yMove);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t//means the piece is moving right, but up\n\t\t\t\t\t\t\t\t\t move = new Move(convertedXOrigin, yOrigin, convertedXMove + 1, yMove - 1);\n\t\t\t\t\t\t\t\t\tmodel.moves.add(move);\n\t\t\t\t\t\t\t\t\tremoveTakenPiece(convertedXMove, yMove);\n\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\tif(isMovingDown) {\n\t\t\t\t\t\t\t\t\t//means its moving left and down\n\t\t\t\t\t\t\t\t\tmove = new Move(convertedXOrigin, yOrigin, convertedXMove - 1, yMove + 1);\n\t\t\t\t\t\t\t\t\tmodel.moves.add(move);\n\t\t\t\t\t\t\t\t\tremoveTakenPiece(convertedXMove, yMove);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t//means it's moving left and up\n\t\t\t\t\t\t\t\t\tmove = new Move(convertedXOrigin, yOrigin, convertedXMove - 1, yMove - 1);\n\t\t\t\t\t\t\t\t\tmodel.moves.add(move);\t\n\t\t\t\t\t\t\t\t\tremoveTakenPiece(convertedXMove, yMove);\n\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\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t//System.out.println(\"Space isn't taken\");\n\t\t\t\t\tmove = new Move(convertedXOrigin, yOrigin, convertedXMove, yMove);\n\t\t\t\t\tmodel.moves.add(move);\n\t\t\t\t\tif(canBeKing(checker, move)) {\n\t\t\t\t\t\tchecker = convertToKing(checker, move);\n\t\t\t\t\t\tmodel.updateChecker(move, checker, turn);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tprintBoard();\n\t\t\t\t\t\treturn move;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tmodel.updateChecker(move, checker, turn);\n\t\t\t\t\tupdateBoard(move);\n\t\t\t\t\t\n\t\t\t\t\tprintBoard();\n\t\t\t\t\treturn move;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Error in move\");\n\t\t\t\t//System.out.println(\"It's not your turn\");\n\t\t\t\tisCorrectTurn = false;\n\t\t\t\t}\n\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\tSystem.out.println(\"NullPointerException - Error\");\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tif(canBeKing(checker, move)) {\n\t\t\t\tchecker = convertToKing(checker, move);\n\t\t\t\tmodel.updateChecker(move, checker, turn);\n\t\t\t\t\n\t\t\t\tprintBoard();\n\t\t\t\treturn move;\n}\n\n\n\n\t\t\t\t\n\t\t\t\tmodel.updateChecker(move, checker, turn);\n\t\t\t\tupdateBoard(move);\n\t\t\t\t\n\t\t\t\tprintBoard();\n\t\t\t\treturn move;\n\t\t\t\t}\n\t\t\t} catch (NumberFormatException e) {\n\t\t\t\tSystem.out.println(\"Error in Input. Please try again\");\n\t\t\t}\n\t\t\n\t\t}while(!isCorrectTurn);\n\n\t\tprintBoard();\n\t\treturn null;\n\t\t\n\t}",
"public Move move() {\n\n byte[] piece;\n int pieceIndex;\n Move.Direction direction = null;\n int counter = 0;\n\n Scanner s = new Scanner(System.in);\n\n\n System.out.println(\"Please select piece to move: \");\n\n\n while (true) {\n try {\n pieceIndex = s.nextInt();\n\n if ((piece = getPiece(pieceIndex)) == null) {\n System.out.println(\"invalid index, try again!\");\n// check if selected piece is stuck\n } else if (\n (((player == Board.V) && (piece[1]+1 == Board.getSize()))) || (board.layout[piece[0]][piece[1]+1] == O ) || // UP\n ((player == Board.H) && (piece[1]-1 >=0) && (board.layout[piece[0]][piece[1]-1] == O)) || // DOWN\n ((player == Board.V) && (piece[0]-1 >=0) && (board.layout[piece[0]-1][piece[1]] == O)) || // LEFT\n (((player == Board.H) && (piece[0]+1 == Board.getSize()))) || (board.layout[piece[0]][piece[1]+1] == O )) // RIGHT\n {\n break;\n// if all are stuck pass turn\n } else if (counter + 1 < Board.getSize()) {\n counter++;\n System.out.println(\"Piece is stuck, pick another, \" + counter + \" pieces stuck.\");\n } else {\n System.out.println(\"Passing\");\n return null;\n }\n } catch (Exception e){\n System.out.println(\"Piece index expects int, try again\");\n s = new Scanner(System.in);\n }\n }\n System.out.println(\"Please select direction ('w' // 'a' // 's' // 'd'): \");\n\n boolean valid = false;\n while (!valid) {\n\n switch (s.next().charAt(0)) {\n // if the move requested is valid, break the loop, make the move on our record of layout and return the\n // move made\n case 'w':\n direction = Move.Direction.UP;\n valid = (((player == Board.V) && (piece[1]+1 == Board.getSize()))) || (board.layout[piece[0]][piece[1]+1] == O );\n break;\n\n case 'a':\n direction = Move.Direction.LEFT;\n valid = ((player == Board.V) && (piece[0]-1 >=0) && (board.layout[piece[0]-1][piece[1]] == O));\n break;\n\n case 's':\n direction = Move.Direction.DOWN;\n valid = ((player == Board.H) && (piece[1]-1 >=0) && (board.layout[piece[0]][piece[1]-1] == O));\n break;\n\n case 'd':\n direction = Move.Direction.RIGHT;\n valid = (((player == Board.H) && (piece[0]+1 == Board.getSize()))) || (board.layout[piece[0]][piece[1]+1] == O );\n break;\n default:\n System.out.println(\"Invalid key press, controls are wasd\");\n valid = false;\n }\n }\n Move move = makeMove(direction, pieceIndex);\n board.update(move, player);\n\n return move;\n }",
"public void InvalidMove();",
"private void userMoveInput(Board board) {\n\n Scanner in = new Scanner(System.in);\n System.out.print(this.name + \"- Enter number to place \" + this.xOrO + \" :\");\n try {\n this.playerInput = in.nextInt() - 1;\n if (board.checkIfSpotTaken(playerInput)) {\n invalidInput(board);\n }\n }\n catch(Exception err){\n System.out.print(\"Enter a number from 1 - 9. \");\n invalidInput(board);\n }\n }",
"public void processTurn(Player player) {\n Move move;\n do {\n Scanner scan = new Scanner(System.in);\n\n System.out.println(\"Enter current position of Piece you want to move\");\n // Positions entered by player\n int startX = scan.nextInt();\n int startY = scan.nextInt();\n\n System.out.println(\"Enter position where you want to put Piece\");\n int endX = scan.nextInt();\n int endY = scan.nextInt();\n\n // Move created based on position entered by player 1\n move = new Move(player, board.getCellAtLocation(startX, startY), board.getCellAtLocation(endX, endY));\n } while (!makeMove(move));\n }",
"public void playerMove(SharedConstants.PlayableItem playitem){\n\t\tboolean isValidInput = false;\n\t\tint col;\n\t\tString AICoordinates;\n\t\tdo {\n\t\t\tif(currentPlayer == SharedConstants.PlayableItem.BLACK) {\n\t\t\t\tSystem.out.print(\"What column do you wish to put your piece in player Black?\\n\"); \n\t\t\t\tint[] parsed = consoleParser(playerMove,false);\n\t\t\t\tcol = parsed[0];\n\t\t\t\tif(col == -2){\n\t\t\t\t\tSystem.out.println(\"Redo\");\n\t\t\t\t\tredoBoard();\n\t\t\t\t}\n\t\t\t\telse if(col == -3){\n\t\t\t\t\tSystem.out.println(\"Undo\");\n\t\t\t\t\tundoBoard();\n\t\t\t\t}\n\t\t\t\telse if(col == -4){\n\t\t\t\t\tSystem.out.println(\"Save\");\n\t\t\t\t\tsaveMove();\n\t\t\t\t}\n\t\t\t\telse if(col == -5){\n\t\t\t\t\tSystem.out.println(\"Load\");\n\t\t\t\t\tloadMove();\n\t\t\t\t}\n\t\t\t\tif(validMove(col)){\n\t\t\t\t\tgameStateModel.getUndoBoard().add(board.makeDeepCopy());\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.print(\"AI \" + aiPlayer.getAIType() + \" move \\n\");\n\t\t\t\tAICoordinates = aiPlayer.makeMove(this);\n\t\t\t\tcol = Integer.parseInt(AICoordinates.split(\",\")[1]);\n\t\t\t}\n\t if(validMove(col)){\n\t \t\tint row = 5;\n\t \t\tint substituteLevel = (currentPlayer.equals(SharedConstants.PlayableItem.BLACK) ? -2:-1);\n\t \t\tmoveSet(row,col,substituteLevel);\n\t\t \tisValidInput = true;\n\t }\n\t else if(col < -1){\n\t \tSystem.out.println(\"Action\");\n\t }\n\t else\n\t\t\t\tSystem.out.println(\"Invalid move\"); \t\n\t\t} while(!isValidInput);\t\n\t\tif(isGameOver()){\n\t\t\tcurrentState = SharedConstants.GameStatus.GAME_END;\n\t\t}\n\t}",
"public void AskForMove();",
"public static void playerMove() \n\t{\n\t\tSystem.out.println(\"\\nPlayer: Enter a slot number :\\n\");\n\t\tint boardSlotNumber = scanner.nextInt();\n\n\t\tif (boardSlotNumber > 0 && boardSlotNumber <= 9 && tictactoeBoard[boardSlotNumber] != 'x' && tictactoeBoard[boardSlotNumber] != 'o')\n\t\t{\n\t\t\ttictactoeBoard[boardSlotNumber] = playerInput;\n\t\t\t//beforeMoveBoard();\n\t\t\tshowBoard();\n\t\t} \n\t\telse \n\t\t{\n\t\t\tSystem.out.println(\"Invalid input\");\n\t\t\tplayerMove();\n\t\t}\n\t}",
"protected boolean processIllegalMove(String moveString, String reason){return false;}",
"private void handleMovement() {\n if (movements.isEmpty()) return;\n try {\n switch (movements.peek()) {\n case MOVE_UP:\n game.movePlayer(Direction.N);\n break;\n case MOVE_LEFT:\n game.movePlayer(Direction.W);\n break;\n case MOVE_DOWN:\n game.movePlayer(Direction.S);\n break;\n case MOVE_RIGHT:\n game.movePlayer(Direction.E);\n break;\n }\n } catch (Exception ignored) { }\n }",
"public abstract boolean validMove(ChessBoard board, Square from, Square to);",
"@Test\n public void testMove() throws IOException, InvalidFormatException {\n GameController controller = new GameController(2,0);\n controller.move();\n Assert.assertTrue(controller.getActivePlayer().getLocation() > 0);\n }",
"public void receivedInvalidMoveMessage();",
"Move getMove() {\n try {\n boolean playing0 = _playing;\n while (_playing == playing0) {\n prompt();\n\n String line = _input.readLine();\n if (line == null) {\n quit();\n }\n line = line.trim();\n if (!processCommand(line)) {\n Move move = Move.create(line, _board);\n if (move == null) {\n error(\"invalid move: %s%n\", line);\n } else if (!_playing) {\n error(\"game not started\");\n } else if (!_board.isLegal(move)) {\n error(\"illegal move: %s%n\", line);\n } else {\n return move;\n }\n }\n }\n } catch (IOException excp) {\n error(1, \"unexpected I/O error on input\");\n }\n return null;\n }",
"public InvalidMoveException() {\n super(\"Invalid move!\");\n }",
"GameState performMove(String guid, String username, int x, int y) throws GameStateException, GamePlayException;",
"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 }",
"public void newGame()throws InputMismatchException{\r\n String token; \r\n token = \"X\";\r\n displayBoard();\r\n System.out.println(\"Begin Game. Enter 'P' if you want to play against another player; Enter 'C' if you want to play against computer.\"); \r\n String choice = in.nextLine();\r\n if (choice.equals(\"p\") || choice.equals(\"P\")){\r\n makeMove(token, false);\r\n } else if (choice.equals(\"c\") || choice.equals(\"C\")){\r\n System.out.println(\"Start game against computer.\");\r\n makeMove(token, true);\r\n } else {\r\n System.out.println(\"Invalid choice. Please try again!\");\r\n newGame();\r\n } \r\n }",
"private static void playersMove() {\r\n\t\tPrint print = new Print(); \r\n\t\tprint.board(game); \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Prints the entire gameBoard.\r\n\t\t\r\n\t\tboolean flag = false;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//true = Get Gideon's move | false = Get User's move\r\n\t\r\n\t\tArrayList<Integer> moves = MoveGenerator.Gen(flag, gamePieces);\t\t\t\t\t\t\t//returns all the legal moves possible to make by the player.\r\n\t\tPrint.moves(moves);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Prints all the moves returned by the Gen method.\r\n\t\t\r\n\t\tSystem.out.print(\"\\n\\n Enter your move: \");\r\n\t\t@SuppressWarnings(\"resource\")\r\n\t\tScanner kb = new Scanner(System.in);\r\n\t\tString userInput = kb.next();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Captures the players move\r\n\t\t\r\n\t\tboolean moveCheck = CheckUserInput.checkMove(userInput, moves);\t\t\t\t\t\t\t//Checks if the move entered by the player is in the legal move list\r\n\t\t\r\n\t\tString formattedUserInput = null;\r\n\t\t\r\n\t\tif(!moveCheck)\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Recall the playersMove() method if the move entered by the user is illegal\r\n\t\t\tplayersMove();\r\n\r\n\t\tformattedUserInput = FormatInput.formatUserMove(userInput);\t\t\t\t\t\t\t//Formatting the user's move to make it as an executable move on the board\r\n\t\t\r\n\t\t//System.out.println(formattedUserInput);\r\n\t\t\r\n\t\tUpdateBoard boardUpdater = new UpdateBoard();\r\n\t\tgame = boardUpdater.playMove(formattedUserInput,game, gamePieces, flag, false, true); //Executing the legal move on the gameBoard\r\n\t\tgamePieces = game.getGamePiecesArray();\t\t\t\t\t\t\t\t\t\t\t\t\t//Getting the updated copy of the Game Pieces Array\r\n\t\tgame.updateGameBoard();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Updating the String copy of the game board (required to print the updated gameBoard)\r\n\t\t\r\n\t\tSystem.out.println(\"\\n ========================\");\r\n\t\tGideonsMove();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Gideon's turn to make a move\r\n\t\r\n\t}",
"@Test\n\tpublic void invalidMove() throws Exception {\n\t\tgame.board.movePiece(knightCorner1Black, -1, 2);\n\t\tgame.board.movePiece(knightCorner2White, 4, 7);\n\t\tgame.board.movePiece(knightSide1Black, 1, -1);\n\t\tgame.board.movePiece(knightSide2White, 4, 6);\n\t\tgame.board.movePiece(knightMiddleWhite, 10, 4);\n\t\tassertEquals(knightCorner1Black, game.board.getPiece(0, 0));\n\t\tassertEquals(knightCorner2White, game.board.getPiece(7, 7));\n\t\tassertEquals(knightSide1Black, game.board.getPiece(0, 3));\n\t\tassertEquals(knightSide2White, game.board.getPiece(3, 7));\n\t\tassertEquals(knightMiddleWhite, game.board.getPiece(4, 4));\n\t}",
"public abstract void showBadMoveAlert(GameStateInterface state, Move mv);",
"public static int checkUserInput(int move, Scanner scanner){\n //Catch the exceptions that the user input is not integers\n boolean bError = true;\n while(bError){\n if (scanner.hasNextInt())\n move = scanner.nextInt();\n else {\n System.out.println(\"Wrong input! Please re-enter a correct position(1-9).\");\n scanner.next();\n continue;\n }\n bError = false;\n }\n //To catch the exceptions that user's input is not in [0,9].\n while(!correctPos.contains(move)){\n System.out.println(\"Oops! Your input is not from 1-9, please enter the correct move.\");\n move =scanner.nextInt();\n }\n //To catch the exceptions that user may place a move that has been taken. \n while(Player0Pos.contains(move)||Player1Pos.contains(move)){\n System.out.println(\"Error! Your move has been taken, please enter a correct position.\");\n move =scanner.nextInt();\n }\n return move;\n \n }",
"public void playPiece(Player player, Move move) {\n // if whos turn it is does not equal the player to make a move...\n if(!validMove(player, move)) {\n throw new IllegalArgumentException(\"DON'T CHEAT! That is an invalid move for this turn. \");\n }\n board.placePiece(turn.getPiece(), move.getRow(), move.getCol());\n lastMove = move;\n hasPlacedPiece = true;\n hasRotatedBoard = false;\n }",
"public void play(IMove move) {\n if (isGameOver || move.getPlayer() != currentTurn) {\n return;\n }\n\n move.accept(this);\n\n if (!isGameOver) {\n endTurn();\n }\n }",
"public void input() {\n \n \t\tboolean aPressed = Keyboard.isKeyDown(Keyboard.KEY_A);\n \t\tboolean dPressed = Keyboard.isKeyDown(Keyboard.KEY_D);\n \t\tboolean wPressed = Keyboard.isKeyDown(Keyboard.KEY_W);\n \t\tboolean sPressed = Keyboard.isKeyDown(Keyboard.KEY_S);\n \n \t\tif ((aPressed) && (!dPressed)) {\n \t\t\ttryToMove(Keyboard.KEY_A);\n \t\t} else if ((dPressed) && (!aPressed)) {\n \t\t\ttryToMove(Keyboard.KEY_D);\n \t\t} else if ((wPressed) && (!sPressed)) {\n \t\t\ttryToMove(Keyboard.KEY_W);\n \t\t} else if ((sPressed) && (!wPressed)) {\n \t\t\ttryToMove(Keyboard.KEY_S);\n \t\t}\n \t}",
"private boolean isThereValidMove() {\n\t\treturn true;\n\t}",
"@Test\n\tpublic void testMove() {\n\t\tSquare square = new Square();\n\t\tPlayer player = new Player(new Square(), 0);\n\t\t\n\t\tassertFalse(player.hasMoved());\n\t\t\n\t\tplayer.move(square);\n\t\tassertTrue(player.hasMoved());\n\t}",
"private void validPlayerMove(char moveType) {\n\n\t\t//Obtain X and Y of playerLocation\n\t\tint x = getPlayerLocation()[0];\n\t\tint y = getPlayerLocation()[1];\n\n\t\t//By default, set xOffset and yOffset to 0\n\t\tint xOffset = 0;\n\t\tint yOffset = 0;\n\n\t\t//Change xOffset and yOffset corresponding to each moveType\n\t\t//For example, RIGHT would set xOffset to +1\n\t\tswitch(moveType) {\n\t\tcase Legend.UP: \n\t\t\tyOffset = -1;\n\t\t\tbreak;\n\t\tcase Legend.UP_LEFT:\n\t\t\tyOffset = -1;\n\t\t\txOffset = -1;\n\t\t\tbreak;\n\t\tcase Legend.UP_RIGHT:\n\t\t\tyOffset = -1;\n\t\t\txOffset = 1;\n\t\t\tbreak;\n\t\tcase Legend.DOWN:\n\t\t\tyOffset = 1;\n\t\t\tbreak;\n\t\tcase Legend.DOWN_RIGHT:\n\t\t\tyOffset = 1;\n\t\t\txOffset = 1;\n\t\t\tbreak;\n\t\tcase Legend.DOWN_LEFT:\n\t\t\tyOffset = 1;\n\t\t\txOffset = -1;\n\t\t\tbreak;\n\t\tcase Legend.LEFT:\n\t\t\txOffset = -1;\n\t\t\tbreak;\n\t\tcase Legend.RIGHT:\n\t\t\txOffset = 1;\n\t\t\tbreak;\n\t\tcase Legend.JUMP:\n\n\t\t\t//Generate a random location of the jump\n\t\t\twhile (true) {\n\n\t\t\t\t//random x and y values (between 0-10)\n\t\t\t\tint randomX = 1+(int)(Math.random()*10);\n\t\t\t\tint randomY = 1+(int)(Math.random()*10);\n\n\t\t\t\t//If the new location is a BlankSpace, assign that as a Player, and assign a new move in moveList\n\t\t\t\tif(map[randomX][randomY] instanceof BlankSpace) {\n\t\t\t\t\tnewMap[randomX][randomY] = new Player(x, y, board);\n\t\t\t\t\tnewMap[x][y] = new BlankSpace(x, y, board);\n\t\t\t\t\tmoveList[x][y] = moveType;\n\t\t\t\t\tmap[x][y].setJumpLocation(randomX, randomY);\n\t\t\t\t\tsetNewPlayerLocation(new int[] {randomX, randomY});\n\t\t\t\t\tbreak;\n\t\t\t\t} \n\n\t\t\t\t//If the new location is a Mho, completely wipe the board of the player, and initiate a gameOver procedure\n\t\t\t\telse if(map[randomX][randomY] instanceof Mho) {\n\t\t\t\t\tnewMap[randomX][randomY] = new Mho(x, y, board);\n\t\t\t\t\tnewMap[x][y] = new BlankSpace(x, y, board);\n\t\t\t\t\tmoveList[x][y] = moveType;\n\t\t\t\t\tmap[x][y].setJumpLocation(randomX, randomY);\n\t\t\t\t\tsetNewPlayerLocation(new int[] {randomX, randomY});\n\t\t\t\t\tgameOver();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t//If the new location that the Player will move to will be a Player (in the case of Legend.SHRINK), or BlankSpace, change map and newMap, as well as moveList and the playerLocation \n\t\tif (map[x+xOffset][y+yOffset] instanceof BlankSpace || map[x+xOffset][y+yOffset] instanceof Player) {\n\t\t\tnewMap[x][y] = new BlankSpace(x, y, board);\n\t\t\tnewMap[x+xOffset][y+yOffset] = new Player(x+xOffset, y+yOffset, board);\n\t\t\tmoveList[x][y] = moveType;\n\t\t\tsetNewPlayerLocation(new int[] {x+xOffset, y+yOffset});\n\t\t\treturn;\n\t\t} \n\n\t\t//If the new location that the Player will move to will be a Fence, remove the player from the map and initiate the gameOver() process\n\t\telse {\n\t\t\tnewMap[x][y] = new BlankSpace(x, y, board);\n\t\t\tmoveList[x][y] = Legend.SHRINK;\n\t\t\tsetNewPlayerLocation(new int[] {x, y});\n\t\t\tgameOver();\n\t\t\treturn;\n\t\t}\n\n\t}",
"@Test\n void moveWithinPLAYING() {\n getGame().start();\n assertThat(getGame().isInProgress()).isTrue();\n getGame().move(getPlayer(), Direction.EAST);\n assertThat(getPlayer().isAlive()).isTrue();\n verifyZeroInteractions(observer);\n assertThat(getGame().isInProgress()).isTrue();\n }",
"public void move(){\n System.out.println(\"I can't move...\");\n }",
"public static void userMover(){\n System.out.println(\"Where would you like to move? Please choose (R)ight, (L)eft, (U)p, or (D)own \");\n String move = input.next();\n\n while (!\"RLUD\".contains(move)) {\n System.out.println(\"Where would you like to move? Please choose (R)ight, (L)eft, (U)p, or (D)own \");\n move = input.next();\n }\n\n if (move.equals(\"R\") && (myMap.canIMoveRight())) {\n myMap.moveRight();\n } else if (move.equals(\"L\") && myMap.canIMoveLeft()) {\n myMap.moveLeft();\n } else if (move.equals(\"U\") && myMap.canIMoveUp()) {\n myMap.moveUp();\n } else if (move.equals(\"D\") && myMap.canIMoveDown()) {\n myMap.moveDown();\n } else if (myMap.isThereAPit(move)) {\n navigatePit(move);\n } else {\n System.out.println(\"Sorry, you’ve hit a wall.\");\n }\n\n myMap.printMap();\n }",
"@Override\r\n\tpublic boolean makeMove(String notation) {\n\t\tif(Castle.isCastlingMove(new ChessCoordinate(notation))) {\r\n\t\t\tKing playerKing = (King) getPlayerTurn().getPieces(\"King\", true).get(0);\r\n\t\t\t//return the result of trying to castle\r\n\t\t\treturn playerKing.move(new ChessCoordinate(notation));\r\n\t\t\t\r\n\t\t}else {\r\n\t\t\t//not a castling move, standard move\r\n\t\t\t\t\r\n\t\t\tString[] notationList = notation.split(\"\");\r\n\t\t\t//find the piece name\r\n\t\t\tString pieceName = ChessPieceNames.getPieceName(notationList[0]);\t\t\r\n\t\t\t\r\n\t\t\tif(pieceName == null && getColumnNames().contains(notationList[0].toLowerCase())) {\r\n\t\t\t\t//if first character is a column and returned null from above\r\n\t\t\t\t//must be a pawn move like e4 or axb2\r\n\t\t\t\tpieceName = ChessPieceNames.PAWN.toString();\r\n\t\t\t}else if(pieceName == null){\r\n\t\t\t\t//not a column and null so invalid move\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\r\n//\t\t\t//capturing move if there is a capture (x)\r\n\t\t\tboolean isCaptureMove = Arrays.asList(notationList).contains(\"x\");\r\n\t\t\t\r\n\t\t\t//final coordinate\r\n\t\t\tString coordinateString = notationList[notationList.length-2] + notationList[notationList.length-1];\r\n\t\t\tChessCoordinate coordinate = new ChessCoordinate(coordinateString);\r\n\t\t\tif(coordinate.isValid()) {\r\n\t\t\t\t//extract players alive pieces of piece name\r\n\t\t\t\tList<Piece> piecesOfType = getPlayerTurn().getPieces(pieceName, true);\r\n\t\t\t\t//list of pieces that can move to the same square\r\n\t\t\t\tList<Piece> piecesCanMoveToSquare = new ArrayList<Piece>();\r\n\t\t\t\tfor (Piece piece : piecesOfType) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t//use valid moves of attacking if capturing move, else use move to\r\n\t\t\t\t\tSet<Coordinate> pieceMoves = isCaptureMove \r\n\t\t\t\t\t\t\t? piece.getValidMoves(Action.ATTACK) : piece.getValidMoves(Action.MOVE_TO);\r\n\t\t\t\t\tif(pieceMoves.contains(coordinate))piecesCanMoveToSquare.add(piece);\r\n\t\t\t\t}\t\r\n\t\t\t\t\r\n\t\t\t\tif (piecesCanMoveToSquare.size() == 1) {\r\n\t\t\t\t\t//only one piece can go to that square, so take piece at 0th index as the list only has one element\r\n\t\t\t\t\tpiecesCanMoveToSquare.get(0).move(coordinate);\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\telse if (piecesCanMoveToSquare.size() > 1) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(notation.length() <= 3) {\r\n\t\t\t\t\t\tSystem.out.println(\"Invalid move, specify which piece to move to \" + coordinateString);\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//multiple pieces of the same type can move to that square, check which one to use\r\n\t\t\t\t\t//if pawn, the identifier to use is the 0th index of notationList, eg axb4. use pawn in column a.\r\n\t\t\t\t\t//for other pieces, column to use is the 1st index of notationList. eg Nab4.\r\n\t\t\t\t\t\r\n\t\t\t\t\t//variable called identifier as it can be a row or column value.\r\n\t\t\t\t\tString identifier = (pieceName.equalsIgnoreCase(ChessPieceNames.PAWN.toString()) ?\r\n\t\t\t\t\t\t\tnotationList[0] : notationList[1]).toLowerCase();\r\n\t\t\t\t\t//identifier should be a row value if pieces share the same column\r\n\t\t\t\t\tboolean isRowIdentifier = shareColumn(piecesOfType);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(isRowIdentifier && getRowNames().contains(identifier)) {\r\n\t\t\t\t\t\t//locate piece by row and move that piece to coordinate\r\n\t\t\t\t\t\tfor (Piece piece : piecesCanMoveToSquare) {\r\n\t\t\t\t\t\t\t//look at the row number of piece coordinate, see if it matches the identifier \r\n\t\t\t\t\t\t\tif(Character.toString(piece.getPosition().toString().charAt(1)).equalsIgnoreCase(identifier)) {\r\n\t\t\t\t\t\t\t\tpiece.move(coordinate);\r\n\t\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tSystem.out.println(\"There is no \" + pieceName + \" on row \" + identifier);\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}else if(getColumnNames().contains(identifier)) {\r\n\t\t\t\t\t\tfor (Piece piece : piecesCanMoveToSquare) {\r\n\t\t\t\t\t\t\t//look at the column letter of piece coordinate, see if it matches the identifier \r\n\t\t\t\t\t\t\tif(Character.toString(piece.getPosition().toString().charAt(0)).equalsIgnoreCase(identifier)) {\r\n\t\t\t\t\t\t\t\tpiece.move(coordinate);\r\n\t\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tSystem.out.println(\"There is no \" + pieceName + \" on column \" + identifier);\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//invalid identifier\r\n\t\t\t\t\telse return false;\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\telse {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//invalid coordinate, move can not be played\r\n\t\t\telse return false;\r\n\t\t}\r\n\t\t\r\n\t}",
"@Override\n public boolean isValidMove(Move move) {\n if (board[move.oldRow][move.oldColumn].isValidMove(move, board))\n return true;\n //player will not be in check\n //move will get player out of check if they are in check\n return false;\n }",
"private void promptTurn()\n \t{\n \t\tUserInfo curr;\n\t\tString meow;\n \t\tcurr = players[turnIndex];\n \t\tString[] tokens;\n \t\tint x;\n \t\tint y;\n \t\n// PROTOCOL \t\n \t\tcurr.sendMessage(prtcl.makePacket(\"Please enter a move\", \"message\")); \n\t\tmeow = curr.getMessage();\n\t\ttokens = meow.split(\" \");\n// PROTOCOL\n \t\tx = Integer.parseInt(tokens[0]);\n \t\ty = Integer.parseInt(tokens[1]);\n \t\n \t\t// Should have a method to process the user's input, and provide an error message back to them if necessary. \n \t\tif(game.remove(x, y))\n \t\t{\n \t\t\tplayers[(turnIndex + 1) % 2].sendMessage(prtcl.makePacket(\"Other player took \" + tokens[0] + \" items from row \" + tokens[1] + \".\", \"message\"));\n \t\t\tbroadcast(prtcl.makePacket(game.toString(), \"message\"));\n \t\t\t// This is where the check to see if the game is won occurs. If so, a winner (the person who just moved) is \n \t\t\t// congratulated. \n \t\t\tif(!game.isDone())\n \t\t\t{\n \t\t\t\tturnIndex += 1;\n \t\t\t\tturnIndex %= 2;\n \t\t\t}\n \t\t} else\n \t\t{\n // PROTOCOL\n \t\t\tplayers[turnIndex].sendMessage(prtcl.makePacket(\"Something was wrong with that. Try again.\", \"ERROR\"));\n // PROTOCOL\n \t\t}\t\n \t}",
"public void invalidMove() {\n JOptionPane.showMessageDialog(frame, \"Invalid move\", \"Invalid move\", JOptionPane.ERROR_MESSAGE);\n }",
"private boolean handleIllegalMove(String line){\n if (!(line.startsWith(\"Illegal move \") ||\n line.equals(\"It is not your move.\") ||\n line.equals(\"The clock is paused, use \\\"unpause\\\" to resume.\")))\n return false;\n \n Matcher illegalMoveMatcher = ILLEGAL_MOVE_REGEX.matcher(line);\n Matcher notYourTurnMatcher = NOT_YOUR_TURN_REGEX.matcher(line);\n Matcher movedWhenGamePausedMatcher = MOVED_WHEN_GAME_PAUSED.matcher(line);\n\n if (illegalMoveMatcher.matches()){\n String moveString = illegalMoveMatcher.group(1);\n String reason = illegalMoveMatcher.group(2);\n\n if (!processIllegalMove(moveString, reason))\n processLine(line);\n\n return true;\n }\n else if (notYourTurnMatcher.matches()){\n String moveString = null; // sigh\n String reason = notYourTurnMatcher.group(1);\n\n if (!processIllegalMove(moveString, reason))\n processLine(line);\n\n return true;\n }\n else if (movedWhenGamePausedMatcher.matches()){\n String moveString = null;\n String reason = movedWhenGamePausedMatcher.group(1);\n \n if (!processIllegalMove(moveString, reason))\n processLine(line);\n \n return true;\n }\n\n return false;\n }",
"public void playMove(int turn)\t{\n\t\tString command;\n\t\tint index = -1;\n\t\tCard dealt;\n\t\tCard drawn;\n\t\tboolean illegal = false;\n\t\tSystem.out.println(\"\\n\" + hand[turn].toString() + \"\\n\");\n\t\tSystem.out.println(\"Choose a number, or 'd' for draw, or 'p' for pass.\");\n\t\tcommand = input.nextLine();\n\t\trecord[turn] = command;\n\t\tif(command.equalsIgnoreCase(\"d\"))\t{\n\t\t\tdrawn = deck1.deal();\n\t\t\tif(drawn!=null)\t{\n\t\t\t\thand[turn].addCard(drawn);\n\t\t\t}\n\t\t\telse\t{\n\t\t\t\tSystem.out.print(\"\\n+++++No cards in deck!\");\n\t\t\t}\n\t\t\tplayMove(turn);\n\t\t}\n\t\telse if(command.equalsIgnoreCase(\"p\"))\t{\n\t\t\tif(deck1.isEmpty() || !hand[turn].playable(top))\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse\t{\n\t\t\t\tSystem.out.print(\"\\n+++++Cannot pass!+++++\\n\");\n\t\t\t\tplayMove(turn);\n\t\t\t}\n\t\t}\n\t\telse\t{\n\t\t\tif(isNumber(command))\t{\n\t\t\t\tindex = Integer.parseInt(command);\n\t\t\t}\n\t\t\telse\t{\n\t\t\t\tSystem.out.println(\"Invalid Command!\");\n\t\t\t\tplayMove(turn);\n\t\t\t}\n\t\t\tif(index>=0 && index<hand[turn].countCards())\t{\n\t\t\t\tdealt = hand[turn].seekCard(index);\n\t\t\t\tif(top.getValue()!=8)\t{\n\t\t\t\t\tif(top.getSuit().equals(dealt.getSuit()) || \n\t\t\t\t\t\t\ttop.getValue()==dealt.getValue() || \n\t\t\t\t\t\t\tdealt.getValue()==8)\t{\n\t\t\t\t\t\tif(dealt.getValue()==8)\t{\n\t\t\t\t\t\t\tdealt.setSuit(chooseSuit());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\t{\n\t\t\t\t\t\tillegal = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\t{\n\t\t\t\t\tif(dealt.getValue()==8 || \n\t\t\t\t\t\t\ttop.getChosenSuit().equalsIgnoreCase(dealt.getSuit()))\t{\n\t\t\t\t\t\tillegal = false;\n\t\t\t\t\t}\n\t\t\t\t\telse\t{\n\t\t\t\t\t\tillegal = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(illegal)\t{\n\t\t\t\t\tSystem.out.println(\"Illegal Move!\");\n\t\t\t\t\tplayMove(turn);\n\t\t\t\t}\n\t\t\t\telse\t{\n\t\t\t\t\ttop = dealt;\n\t\t\t\t\thand[turn].removeCard(index);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\t{\n\t\t\t\tSystem.out.println(\"Card does not exist!\");\n\t\t\t\tplayMove(turn);\n\t\t\t}\n\t\t}\n\t\treturn;\n\t}",
"@Test(expected = IllegalArgumentException.class)\n public void moveException1() {\n MarbleSolitaireModel exampleBoard = new MarbleSolitaireModelImpl();\n exampleBoard.move(0, 3, 3, 3);\n }",
"public void invalidMovePrompt() {\n\t\tinvalidPrompted = true;\n\t\tSystem.out.println(\"Invalid move. Please try again\");\n\t}",
"public void getInputAndMove() {\n\t\tSystem.out.println(\"Where to move?\");\n\t\tScanner keyboard = new Scanner(System.in);\n\t\tString input = keyboard.nextLine();\n\t\t\n\t\t\n\t\tAvatar testAvatar = new Avatar(avatar.getLocation());\n\t\ttestAvatar.move(input);\n\n\t\tif (wall.overlapsWith(testAvatar)) {\n\t\t\tSystem.out.println(\"\\nYou have hit a wall\");\n\t\t} \n\t\telse {\n\t\t\tavatar.move(input);\n\t\t\tSystem.out.println(\"\\nYou have moved\");\n\t\t}\n\t}",
"private void executeMove(Move move) {\r\n\t\t//System.out.println(\"executing move\");\r\n\t\tthis.chessGame.movePiece(move);\r\n\t\tthis.chessGame.changeGameState();\r\n\t}",
"public abstract void makeMove(GameStatus gameStatus);",
"@Test(expected = IllegalArgumentException.class)\n public void moveException2() {\n MarbleSolitaireModel exampleBoard = new MarbleSolitaireModelImpl();\n exampleBoard.move(0, 3, 1, 3);\n }",
"public void playGame(Parser p){\n\t\t// until someone wins, loop through turns\n\t\twhile(!Game.gameWon){\n\n\t\t\t// get move from player\n\n\t\t\t// String move = Game.getCurrPlayer().getMove();\n\t\t\tString move = this.network.getMove();\n\t\t\tif(move.length()==2){\n\t\t\t\tmove = p.moveTranslate(move);\n\t\t\t}else{\n\t\t\t\tmove = p.wallTranslate(move);\n\t\t\t}\n\n\t\t\tif(move.isEmpty()){\n\t \tSystem.out.println(\"\\t[Move error]: Move is empty.\");\n\t\t\t\tkickPlayer();\n\t\t\t\tthis.network.kickLastPlayer();\n\t\t\t\tGame.nextTurn();\n\t\t\t\tif(this.checkForWin()){\n\t\t\t\t\tnotifyObservers(ui);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// try to play turn\n\t\t\tif(this.playTurn(move)){\n\t\t\t\tif(this.checkForWin()){\n\t\t\t\t\tplayers.get(curr).clearMoves();\n\t\t\t\t\tnotifyObservers(ui);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tGame.nextTurn();\n\t\t\t}else{\n\t\t\t\tkickPlayer();\n\t\t\t\tthis.network.kickLastPlayer();\n\t\t\t\tGame.nextTurn();\n\t\t\t\tif(this.checkForWin()){\n\t\t\t\t\tplayers.get(curr).clearMoves();\n\t\t\t\t\tnotifyObservers(ui);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tGame.updatePlayer(players.get(curr));\n\t\t\tthis.notifyObservers(this, Game.getBoard());\n\t\t}\n\t}",
"boolean doMove();",
"public abstract boolean doComputerMove(Player player);",
"public void play() {\n HashSet<Board> positionsPlayed = new HashSet<Board>();\n _board = new Board();\n\n while (true) {\n int playerInd = _board.turn().ordinal();\n Move next;\n if (_playing) {\n if (_board.gameOver()) {\n announceWinner();\n _playing = false;\n continue;\n }\n if (_hasGUI) {\n if (_players[playerInd].type().equals(\"human\")) {\n if (_ready) {\n next = _nextMove;\n } else if (_readyCommand) {\n processCommand(_nextCommand);\n next = null;\n } else {\n continue;\n }\n } else {\n next = _players[playerInd].makeMove();\n }\n } else {\n next = _players[playerInd].makeMove();\n }\n assert !_playing || next != null;\n } else {\n if (_hasGUI) {\n System.out.print(\"\");\n if (_readyCommand) {\n processString(_nextCommand);\n }\n } else {\n getMove();\n }\n next = null;\n }\n if (next != null) {\n assert _board.isLegal(next);\n _board.makeMove(next);\n if (_players[playerInd].type().equals(\"machine\") && !_hasGUI) {\n System.out.println(_players[playerInd].side().abbrev().toUpperCase() + \"::\" + next.toString());\n if (_autoprint) {\n System.out.println(_board.toString2());\n }\n }\n if (_board.gameOver()) {\n announceWinner();\n _playing = false;\n }\n }\n _ready = false;\n }\n }",
"public void move() {\n char move;\n\n do {\n System.out.println(\"Move snake: (wasd)\");\n move = scan.nextLine().charAt(0);\n } while(move != 'a' && move != 'w' && move != 's' && move != 'd');\n \n\n switch (move) {\n case 'w':\n if(board[snakePartList.get(0).getSnakePartRowsOld()-1][snakePartList.get(0).getSnakePartCollsOld()] != '*' ) {\n if(board[snakePartList.get(0).getSnakePartRowsOld()-1][snakePartList.get(0).getSnakePartCollsOld()] == '@') {\n eatApple();\n }\n\n if(board[snakePartList.get(0).getSnakePartRowsOld()-1][snakePartList.get(0).getSnakePartCollsOld()] == 'S') {\n keepMoving = false;\n }\n\n for(int i = 0; i < snakePartList.size(); i++) {\n if(i != 0) {\n snakePartList.get(i).setSnakePartRowsNew(snakePartList.get(i-1).getSnakePartRowsOld());\n snakePartList.get(i).setSnakePartCollsNew(snakePartList.get(i-1).getSnakePartCollsOld());\n } else {\n snakePartList.get(i).setSnakePartRowsNew(snakePartList.get(i).getSnakePartRowsOld()-1);\n }\n }\n\n updateBoard();\n\n for(int i = 0; i < snakePartList.size(); i++) {\n snakePartList.get(i).updateOldPlace();\n }\n \n \n } else {\n keepMoving = false;\n }\n break;\n\n case 'a':\n if(board[snakePartList.get(0).getSnakePartRowsOld()][snakePartList.get(0).getSnakePartCollsOld()-1] != '*' ) {\n if( board[snakePartList.get(0).getSnakePartRowsOld()][snakePartList.get(0).getSnakePartCollsOld()-1] == '@') {\n eatApple();\n }\n if( board[snakePartList.get(0).getSnakePartRowsOld()][snakePartList.get(0).getSnakePartCollsOld()-1] == 'S') {\n keepMoving = false;\n }\n for(int i = 0; i < snakePartList.size(); i++) {\n if(i != 0) {\n snakePartList.get(i).setSnakePartCollsNew(snakePartList.get(i-1).getSnakePartCollsOld());\n snakePartList.get(i).setSnakePartRowsNew(snakePartList.get(i-1).getSnakePartRowsOld());\n } else {\n snakePartList.get(i).setSnakePartCollsNew(snakePartList.get(i).getSnakePartCollsOld()-1);\n }\n }\n updateBoard();\n\n for(int i = 0; i < snakePartList.size(); i++) {\n snakePartList.get(i).updateOldPlace();\n }\n\n \n } else {\n keepMoving = false;\n }\n break;\n\n case 's':\n if(board[snakePartList.get(0).getSnakePartRowsOld()+1][snakePartList.get(0).getSnakePartCollsOld()] != '*') {\n if( board[snakePartList.get(0).getSnakePartRowsOld()+1][snakePartList.get(0).getSnakePartCollsOld()] == '@') {\n eatApple();\n }\n if( board[snakePartList.get(0).getSnakePartRowsOld()+1][snakePartList.get(0).getSnakePartCollsOld()] == 'S') {\n keepMoving = false;\n }\n for(int i = 0; i < snakePartList.size(); i++) {\n if(i != 0) {\n snakePartList.get(i).setSnakePartRowsNew(snakePartList.get(i-1).getSnakePartRowsOld());\n snakePartList.get(i).setSnakePartCollsNew(snakePartList.get(i-1).getSnakePartCollsOld());\n } else {\n snakePartList.get(i).setSnakePartRowsNew(snakePartList.get(i).getSnakePartRowsOld()+1);\n }\n }\n updateBoard();\n\n for(int i = 0; i < snakePartList.size(); i++) {\n snakePartList.get(i).updateOldPlace();\n }\n\n \n } else {\n keepMoving = false;\n }\n break;\n\n case 'd':\n if(board[snakePartList.get(0).getSnakePartRowsOld()][snakePartList.get(0).getSnakePartCollsOld()+1] != '*') {\n if(board[snakePartList.get(0).getSnakePartRowsOld()][snakePartList.get(0).getSnakePartCollsOld()+1] == '@') {\n eatApple();\n }\n if(board[snakePartList.get(0).getSnakePartRowsOld()][snakePartList.get(0).getSnakePartCollsOld()+1] == 'S') {\n keepMoving = false;\n }\n for(int i = 0; i < snakePartList.size(); i++) {\n if(i != 0) {\n snakePartList.get(i).setSnakePartCollsNew(snakePartList.get(i-1).getSnakePartCollsOld());\n snakePartList.get(i).setSnakePartRowsNew(snakePartList.get(i-1).getSnakePartRowsOld());\n } else {\n snakePartList.get(i).setSnakePartCollsNew(snakePartList.get(i).getSnakePartCollsOld()+1);\n }\n }\n updateBoard();\n \n for(int i = 0; i < snakePartList.size(); i++) {\n snakePartList.get(i).updateOldPlace();\n }\n\n \n } else {\n keepMoving = false;\n }\n break;\n }\n }",
"public void play() {\r\n int ii = 0;\r\n\r\n System.out.println(\"****************************************************************\");\r\n System.out.println(\"Play game: a move is expressed as \\\"row#,col#\\\", such as \\\"1,2\\\"\");\r\n System.out.println(\"Computer: X Person: O\");\r\n System.out.println(\"****************************************************************\");\r\n while(!isGameEnded()) {\r\n if (ii >= MAX_MOVE_NUMBER) {\r\n\tbreak;\r\n }\r\n\r\n nextMove();\r\n ii++;\r\n }\r\n\r\n if (isPersonWin()) {\r\n System.out.println(\"Person Wins!\");\r\n saveLoseRecord();\r\n }\r\n else if (isComputerWin()) {\r\n System.out.println(\"Computer Wins!\");\r\n }\r\n else {\r\n System.out.println(\"Tie!\");\r\n }\r\n\r\n }",
"@Test\n\tpublic void moveToValidSpace() throws Exception {\n\t\tgame.board.movePiece(knightCorner1Black, 1, 2);\n\t\tgame.board.movePiece(knightCorner2White, 5, 6);\n\t\tgame.board.movePiece(knightSide1Black, 2, 2);\n\t\tgame.board.movePiece(knightSide2White, 4, 5);\n\t\tgame.board.movePiece(knightMiddleWhite, 5, 2);\n\t\tassertEquals(knightCorner1Black, game.board.getPiece(1, 2));\n\t\tassertEquals(knightCorner2White, game.board.getPiece(5, 6));\n\t\tassertEquals(knightSide1Black, game.board.getPiece(2, 2));\n\t\tassertEquals(knightSide2White, game.board.getPiece(4, 5));\n\t\tassertEquals(knightMiddleWhite, game.board.getPiece(5, 2));\n\t}",
"@Test(expected = IllegalArgumentException.class)\n public void moveException2() {\n MarbleSolitaireModel exampleBoard = new TriangleSolitaireModelImpl();\n exampleBoard.move(1, 1, 0, 0);\n }",
"void play(int col) throws IllegalMoveException;",
"public boolean playMove(int x, int y, int playerNum) {\n\n\t\tif (isValidMove(x,y)) {\n\n\t\t\tboard[y][x] = playerNum;\n\t\t\treturn true;\n\t\t\n\t\t} else {\n\n\t\t\treturn false;\n\t\t}\n\n\t}",
"public abstract void makeMove(Move move, PlayerColor playerColor);",
"public boolean isValidMove(Move move) {\n return getPlayerFromBoard(move) == Player.None;\n }",
"@Override\r\n public void playGame() {\r\n printInvalidCommandMessage();\r\n }",
"void makeMove(String move) {\n if (!isLegal(move)) {\n throw new IllegalArgumentException(\"This is an illegal move.\");\n }\n int column = Integer.parseInt(move.substring(2)) - 1;\n int row = Integer.parseInt(move.substring(0, 1)) - 1;\n _board[column][row] = currPlayer;\n alternatePlayer(currPlayer);\n }",
"public boolean isValidMove(Move move) {\n if (this.gameStarted && isSpaceFree(move) && isPlayerTurn(move)) {\n return true; \n }\n return false; \n }",
"@Override\n public IMove doMove(IGameState state) {\n\n //Find macroboard to play in\n for (int[] move : preferredMoves)\n {\n if(state.getField().getMacroboard()[move[0]][move[1]].equals(IField.AVAILABLE_FIELD))\n {\n \n Random rnd = new Random();\n //find move to play\n for (int[] selectedMove : preferredMoves)\n {\n \n int x = move[0]*3 + selectedMove[0];\n int y = move[1]*3 + selectedMove[1];\n if(!state.getField().getBoard()[x][y].contains(IField.EMPTY_FIELD)\n && !state.getField().getBoard()[x][y].contains(IField.AVAILABLE_FIELD))\n {\n try\n {\n x = x + (rnd.nextInt(selectedMove[0] % 2 + 1));\n \n \n } catch (Exception e)\n {\n \n }\n try\n {\n y = y - (rnd.nextInt(selectedMove[0] % 2 - 1));\n \n } catch (Exception e)\n {\n \n }\n try\n {\n x = x - (rnd.nextInt(selectedMove[0] % 2 -1));\n \n \n } catch (Exception e)\n {\n \n }\n \n \n \n \n }\n if(state.getField().getBoard()[x][y].equals(IField.EMPTY_FIELD))\n {\n \n return new Move(x,y);\n }\n }\n }\n }\n\n //NOTE: Something failed, just take the first available move I guess!\n return state.getField().getAvailableMoves().get(0);\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 }",
"void playerMove(State state);",
"@Override\n\tpublic void onMoveError(String msg) {\n\n\t}",
"@Test(expected = IllegalArgumentException.class)\n public void moveException3() {\n MarbleSolitaireModel exampleBoard = new MarbleSolitaireModelImpl();\n exampleBoard.move(0, 3, 0, 3);\n }",
"private void move(MoveAction moveAction) {\n Move move = moveAction.getLoad();\n Container selectedContainer = mContainersManager.getContainer(move.getBowlNumber());\n boolean anotherRound = false;\n\n if (isAValidMove(move.getPlayer(), selectedContainer)) {\n anotherRound = spreadSeedFrom(move.getBowlNumber());\n\n if (isGameEnded()) {\n Action gameEnded;\n if (!mEvenGame) {\n gameEnded = new Winner(mWinner, getRepresentation(), mContainersManager.getAtomicMoves());\n } else {\n gameEnded = new EvenGame(getRepresentation(), mContainersManager.getAtomicMoves());\n }\n\n postOnTurnContext(gameEnded);\n } else {\n postOnTurnContext(new BoardUpdated(getRepresentation(),\n anotherRound, mContainersManager.getAtomicMoves()));\n }\n\n } else if (!isGameEnded()) {\n postOnTurnContext(new InvalidMove(\n move,\n getRepresentation(),\n mActivePlayer\n ));\n }\n\n\n }",
"public boolean tryMove(Move m) {\n \tif(m.getSource().getColor() != turn) return false;\n \treturn m.getSource().move(m);\n }",
"public abstract Piece movePiece(Move move);",
"@Test(expected = IllegalArgumentException.class)\n public void moveException6() {\n MarbleSolitaireModel exampleBoard = new MarbleSolitaireModelImpl();\n exampleBoard.move(2, 1, 0, 1);\n }",
"private void playTurn()\n {\n try\n {\n XMLHandler.saveGame(game, GAME_CLONE_PATH);\n }\n catch(IOException | JAXBException | SAXException ex)\n {\n // TODO... ConsoleUtils.message(\"An internal save error has occured, terminating current game\");\n gameEnded = true;\n return;\n }\n \n moveCycle();\n \n if (!game.validateGame()) \n {\n IllegalBoardPenalty();\n }\n \n String gameOverMessage = game.isGameOver();\n if (gameOverMessage != null) \n {\n //TODO: ConsoleUtils.message(gameOverMessage);\n gameEnded = true;\n }\n \n game.switchPlayer();\n }",
"@Test(expected = IllegalArgumentException.class)\n public void moveException1() {\n MarbleSolitaireModel exampleBoard = new TriangleSolitaireModelImpl();\n exampleBoard.move(1, 1, 4, 4);\n }",
"public abstract boolean changeMove();",
"public static void moveTest() {\n\t\tOthelloBoard Board = new OthelloBoard(BOARD_SIZE,BOARD_SIZE);\n\t Board.setBoard();\n\t Board.decPieceCount();\n\t System.out.println(Board.getPieceCount());\n\t System.out.println(Board.move(\n\t TEST_MOVE_X1, TEST_MOVE_Y1, Board.WHITE_PIECE));\n\t Board.m_Pieces[TEST_PIECE_X][TEST_PIECE_Y]=Board.WHITE_PIECE;\n\t System.out.println(\"\");\n\t System.out.println(\"\");\n\t\tBoard.checkWin();\n\t\tSystem.out.println(\"Valid inputs\");\n\t\tSystem.out.println(\"OthelloBoard.move() - Begin\");\n\t\tSystem.out.println(\"Expected output: false\");\n\t\tSystem.out.println(\"\");\n\t\tSystem.out.println(\"Actual output: \" + \n\t\tBoard.move(OUTPUT_MOVE_TEST_X,OUTPUT_MOVE_TEST_Y,Board.BLACK_PIECE));\n\t System.out.println(\"\");\n\t}",
"@Test(expected = IllegalArgumentException.class)\n public void moveException3() {\n MarbleSolitaireModel exampleBoard = new TriangleSolitaireModelImpl();\n exampleBoard.move(1, 1, 1, 1);\n }",
"private String checkLegalMove(PieceType piece, Location from, Location to) {\n\t\t// Create a string to store the error message in case the move is\n\t\t// invalid.\n\t\tString errorMessage = null;\n\n\t\t// Check that none of the arguments are null.\n\t\tif (piece == null || from == null || to == null) {\n\t\t\terrorMessage = \"Arguments to the move method must not be null.\";\n\t\t\treturn errorMessage;\n\t\t}\n\n\t\t// Make sure that the game has been started first\n\t\tif (!gameStarted) {\n\t\t\terrorMessage = \"Cannot make a move before the game has started.\";\n\t\t\treturn errorMessage;\n\t\t}\n\n\t\t// Get the piece from the from location that is attempting to move.\n\t\tfinal Piece movingPiece = gameBoard.getPieceAt(from);\n\n\t\t// Check whether the move is a valid move on the board.\n\t\terrorMessage = gameBoard.checkValidMove(piece, from, to);\n\t\tif (errorMessage != null) {\n\t\t\treturn errorMessage;\n\t\t}\n\n\t\t// A piece that is not the color whose turn it is cannot move.\n\t\tif (movingPiece.getOwner() != currentTurnColor) {\n\t\t\terrorMessage = \"You cannot move when it is not you turn.\";\n\t\t\treturn errorMessage;\n\t\t}\n\n\t\treturn null;\n\t}",
"@Test\r\n public void should_not_be_allowed_to_move_in_wrong_direction() {\r\n game.nextTurn(); // will throw [1,2] and thus black starts\r\n assertFalse(game.move(Location.R12, Location.R10));\r\n }",
"@Test(expected = IllegalArgumentException.class)\n public void moveException13() {\n MarbleSolitaireModel exampleBoard = new MarbleSolitaireModelImpl();\n exampleBoard.move(0, 0, 0, 2);\n }",
"@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}",
"static boolean tryMove(Direction dir) throws GameActionException {\n\t\treturn tryMove(dir,20,4);\n\t}",
"private boolean movePlayer(String placeToMoveTo) {\n if (placeToMoveTo.equalsIgnoreCase(\"go\") || placeToMoveTo.equals(\"\")) {\n System.out.println(\"Go where?\");\n return false;\n }\n\n // Check to see if the player is trying to move through a valid Exit\n if (currentRoom.getExit1() != null && placeToMoveTo.equalsIgnoreCase(currentRoom.getExit1().getName())) {\n if (this.checkExit(currentRoom.getExit1())) {\n // Move the player and set the current room to the room that they have moved to\n currentRoom = currentRoom.getExit1().getDestination();\n return true;\n }\n } else if (currentRoom.getExit2() != null && placeToMoveTo.equalsIgnoreCase(currentRoom.getExit2().getName())) {\n if (this.checkExit(currentRoom.getExit2())) {\n // Move the player and set the current room to the room that they have moved to\n currentRoom = currentRoom.getExit2().getDestination();\n return true;\n }\n } else if (currentRoom.getExit3() != null && placeToMoveTo.equalsIgnoreCase(currentRoom.getExit3().getName())) {\n if (this.checkExit(currentRoom.getExit3())) {\n // Move the player and set the current room to the room that they have moved to\n currentRoom = currentRoom.getExit3().getDestination();\n return true;\n }\n } else if (currentRoom.getExit4() != null && placeToMoveTo.equalsIgnoreCase(currentRoom.getExit4().getName())) {\n if (this.checkExit(currentRoom.getExit4())) {\n // Move the player and set the current room to the room that they have moved to\n currentRoom = currentRoom.getExit4().getDestination();\n return true;\n }\n } else if (currentRoom.getSecretExit() != null && placeToMoveTo.equalsIgnoreCase(currentRoom.getSecretExit().getName())) {\n if (this.checkExit(currentRoom.getSecretExit())) {\n // Move the player and set the current room to the room that they have moved to\n currentRoom = currentRoom.getSecretExit().getDestination();\n return true;\n }\n } // They have not specified a valid exit\n else {\n System.out.println(\"It doesn't appear as though I can go there.\");\n return false;\n }\n\n return false;\n }",
"abstract public GameMove computerPlay() throws EndGameException, ColumnFullException;",
"@Test(expected = IllegalArgumentException.class)\n public void moveException4() {\n MarbleSolitaireModel exampleBoard = new TriangleSolitaireModelImpl();\n exampleBoard.move(2, 1, 0, 1);\n }",
"@Test(expected = IllegalArgumentException.class)\n public void moveException11() {\n MarbleSolitaireModel exampleBoard = new TriangleSolitaireModelImpl();\n exampleBoard.move(1, 3, 1, 1);\n }",
"public boolean validMove(Player player, Movement move) {\n\n if (!player.hasPieceAt(move.oldP) || player.hasPieceAt(move.newP))\n return false;\n else if (sharedBoard.isBlocked(move) && !board.board[move.oldP.x][move.oldP.y].canJump())\n return false;\n else if (!sharedBoard.isPositionEmpty(move.newP))\n move = new Capture(move);\n\n return board.board[move.oldP.x][move.oldP.y].validMove(move);\n }",
"public void makesMove() {\n\n\t\tint column = 0;\n\n\t\tSystem.out.println(name + \", please indicate which column you'd like to drop the disc\");\n\t\tScanner scan = new Scanner(System.in);\n\n\t\ttry {\n\t\t\tcolumn = scan.nextInt();\n\t\t} catch (InputMismatchException ex) {\n\t\t\tSystem.out.println(\"This is not an integer. Please input an integer!\");\n\t\t\tscan.nextLine();\n\t\t\tcolumn = scan.nextInt();\n\t\t}\n\n\t\t// if move is legal, modify the board to reflect the move; if move is illegal,\n\t\t// prompt the user to try again\n\n\t\twhile (board.isMoveLegal(column) == false) {\n\t\t\tSystem.out.println(name + \", the move is illegal, please try again!\");\n\t\t\tcolumn = scan.nextInt();\n\t\t}\n\n\t\t// if the move is legal, drop the disc to the bottom of the column\n\n\t\tfor (int i = 5; i >= 0; i--) {\n\t\t\tif (board.board[i][column - 1] == 0) {\n\t\t\t\tboard.board[i][column - 1] = playerNumber;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t}",
"@Test(expected = IllegalArgumentException.class)\n public void moveException9() {\n MarbleSolitaireModel exampleBoard = new TriangleSolitaireModelImpl();\n exampleBoard.move(0, 0, 2, 0);\n }",
"@Test(expected = IllegalArgumentException.class)\n public void moveException11() {\n MarbleSolitaireModel exampleBoard = new MarbleSolitaireModelImpl();\n exampleBoard.move(2, 2, 2, 4);\n }",
"@Override\r\n\tpublic Move validateMove(Piece[][] state, Coordinate from, Coordinate to) throws InvalidMoveException {\r\n\t\tList<Coordinate> possibles = getPossibleLocations(from);\r\n\t\tif (!possibles.contains(to))\r\n\t\t\tthrow new InvalidMoveException();\r\n\r\n\t\tMove result = new Move();\r\n\r\n\t\tMoveType type = MoveTypeChecker.getMoveType(getColor(), state, to);\r\n\t\tif (type == null)\r\n\t\t\treturn null;\r\n\r\n\t\tresult.setType(type);\r\n\t\tresult.setFrom(from);\r\n\t\tresult.setTo(to);\r\n\t\tresult.setMovedPiece(this);\r\n\r\n\t\tint i = 1;\r\n\t\tif (to.getX() < from.getX()) {\r\n\t\t\tif (to.getY() < from.getY()) {\r\n\t\t\t\twhile (from.getX() - i > to.getX()) {\r\n\t\t\t\t\tif (state[from.getX() - i][from.getY() - i] != null)\r\n\t\t\t\t\t\tthrow new InvalidMoveException();\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\twhile (from.getX() - i > to.getX()) {\r\n\t\t\t\t\tif (state[from.getX() - i][from.getY() + i] != null)\r\n\t\t\t\t\t\tthrow new InvalidMoveException();\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else if (to.getY() < from.getY()) {\r\n\t\t\twhile (from.getX() + i < to.getX()) {\r\n\t\t\t\tif (state[from.getX() + i][from.getY() - i] != null)\r\n\t\t\t\t\tthrow new InvalidMoveException();\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\twhile (from.getX() + i < to.getX()) {\r\n\t\t\t\tif (state[from.getX() + i][from.getY() + i] != null)\r\n\t\t\t\t\tthrow new InvalidMoveException();\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}",
"@Test(expected = IllegalArgumentException.class)\n public void moveException10() {\n MarbleSolitaireModel exampleBoard = new MarbleSolitaireModelImpl();\n exampleBoard.move(2, 0, 2, -2);\n }",
"@Test(expected = IllegalArgumentException.class)\n public void moveException6() {\n MarbleSolitaireModel exampleBoard = new TriangleSolitaireModelImpl();\n exampleBoard.move(1, 1, 1, 3);\n }",
"public void go(){\n \n turn = true;\n \n // if AI, do computery things\n if(type==\"AI\"){\n \n //let user know that AI is going\n System.out.print(\"\\tThe computer will now make a move..\");\n delay(1000, TicTacToe.game.gridSize); //take a second to go to make it appear as if computer is thinking\n \n while(turn){\n //AI selects a random empty cell and places corrosponding mark\n index = (int)Math.round((TicTacToe.game.gridSize*TicTacToe.game.gridSize-1)*Math.random());\n move(index, TicTacToe.game);\n }\n \n } else {\n //if human, do human stuff\n \n System.out.println(\"\\tPlease place an X on the grid. You can\");\n TicTacToe.user_input = TicTacToe.getInput(\"\\tdo this by typing 1A, 1B, 1C, 2A, etc.: \");\n\n //while it's the player's turn...\n while(turn) {\n \n //validate user input\n if(valid_input(TicTacToe.user_input)){\n \n if(TicTacToe.user_input.length()==2){\n \n column = Integer.parseInt(TicTacToe.user_input.substring(0,1));\n row = letterToNumber(TicTacToe.user_input.substring(1,2));\n \n } else {\n \n column = Integer.parseInt(TicTacToe.user_input.substring(0,2));\n row = letterToNumber(TicTacToe.user_input.substring(2,3));\n \n }\n \n index = TicTacToe.game.gridSize*(row-1)+(column-1);\n \n if(index > (TicTacToe.game.gridSize*TicTacToe.game.gridSize)-1 || index < 0){\n \n TicTacToe.user_input = TicTacToe.getInput(\"That's not a valid spot! Please choose another spot: \");\n } else {\n \n //if valid input, and cell isn't taken already,\n //place mark in selected cell and end turn\n move(index, TicTacToe.game);\n \n if(turn){\n \n TicTacToe.user_input = TicTacToe.getInput(\"That space is already in play! Please choose another spot: \");\n }\n \n }\n \n } else {\n \n TicTacToe.user_input = TicTacToe.getInput(\"That's not valid input. Please choose another spot: \");\n }\n }\n }\n }",
"public void playerTurn(Mark mark) {\n boolean validInput = false;\n String player;\n do {\n if (mark == Mark.CROSS) {\n player = \"'X'\";\n } else {\n player = \"'O'\";\n }\n try {\n System.out.print(\"Player \" + player +\", enter the coordinates of your placement (1, 2 or 3) \\nrow: \");\n int row = scanner.nextInt();\n System.out.print(\"column: \");\n int col = scanner.nextInt();\n validInput = isValidInput(mark, row, col);\n }\n catch (InputMismatchException ex){\n System.out.println(\"Invalid coordinate(s): must be a number. Try again..\");\n scanner.next(); // avoid infinity loop by pointing scanner to the token value that causes exception\n }\n }\n // repeat tot dat input valid is\n while (!validInput);\n }",
"public MoveResult canMovePiece(Alignment player, Coordinate from, Coordinate to);",
"@Override\n\tpublic void movePawn(Pawn pawn, Deck deck,int choice)\n\t{\n\t\tboolean move_Result=false;\n\t\tswitch (choice)\n\t\t{\n\t\tcase 1:\n\t\t\tmove_Result=beginFromStart(pawn,deck);\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tmove_Result=moveByTwo(pawn, deck);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t\t//check if the move that the user chose is valid or make the other move if it's possible\n \n\t\tif(choice==1 && move_Result==false)\n\t\t{\n\t\t\tmoveByTwo(pawn, deck);\n\t\t\t\n\t\t\t\n\t\t}\n\t\telse if(choice==2 && move_Result==false)\n\t\t{\n\t\t\tif ( beginFromStart(pawn,deck) ) \n\t\t\t{\n\t\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//fold to continue\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}",
"@Test(expected = IllegalArgumentException.class)\n public void moveException7() {\n MarbleSolitaireModel exampleBoard = new TriangleSolitaireModelImpl();\n exampleBoard.move(1, 0, 1, -2);\n }",
"@Test\n public void testSimpleMove()\n {\n theEngine.start();\n assertTrue(theEngine.inPlayingState());\n theEngine.movePlayer(1, 0);\n assertTrue(theEngine.inPlayingState());\n }",
"public void illegalMove(){\r\n //Taken care of in view?\n \t//throw new RuntimeException(\"this is a illegal move\");\r\n }",
"public void makeMove(Player player, int input) {\n\t\t// Get all the valid moves if there are any\n\t\tArrayList<ArrayList<Integer>> validMoves = getValidMoves(this.board, player.color);\n\t\tprintValidMoves(validMoves, board);\n\t\tif (!validMoves.isEmpty()) {\n\t\t\tif (setMove(input, validMoves, player.color, this.board)) {\n\t\t\t\tturn++;\n\t\t\t}\n\n\t\t\t// Reset noWinnerCount\n\t\t\tnoWinnerCount = 0;\n\t\t} else {\n\t\t\t// Player can't move, if this counter reaches 2, that means both players can't\n\t\t\t// move and the game will end\n\t\t\tnoWinnerCount++;\n\t\t\tSystem.out.println(\"Out of moves + Count = \" + noWinnerCount);\n\t\t}\n\n\t\t// Input is last player player\n\t\tArrayList<ArrayList<Integer>> validMovesOpponent = getValidMoves(board, player.opponent);\n\t\tif (validMovesOpponent.size() > 0) {\n\t\t\tswitchTurn(player);\n\t\t}\n\t}"
]
| [
"0.72925746",
"0.695466",
"0.6884108",
"0.66829556",
"0.66444796",
"0.66268545",
"0.6623846",
"0.65598476",
"0.65010625",
"0.649578",
"0.6429648",
"0.6427406",
"0.6318435",
"0.63134086",
"0.628067",
"0.6260668",
"0.62386584",
"0.6230597",
"0.62182605",
"0.6217919",
"0.62001824",
"0.61944747",
"0.6187245",
"0.6185882",
"0.6184293",
"0.61733705",
"0.61447287",
"0.61169225",
"0.6092871",
"0.6012258",
"0.5988088",
"0.5972701",
"0.59643435",
"0.5960805",
"0.5952491",
"0.5941027",
"0.59323883",
"0.59322745",
"0.591694",
"0.5906224",
"0.58804405",
"0.58743674",
"0.5868093",
"0.58677804",
"0.5866974",
"0.5866321",
"0.58617103",
"0.5840087",
"0.5828257",
"0.5824916",
"0.5821137",
"0.5802502",
"0.58005595",
"0.57989",
"0.5792987",
"0.57859814",
"0.57850486",
"0.57839835",
"0.5778229",
"0.5771807",
"0.57690173",
"0.5766855",
"0.57538515",
"0.57489455",
"0.5746121",
"0.5744697",
"0.57407975",
"0.574074",
"0.5729056",
"0.57226044",
"0.5719488",
"0.57166904",
"0.571516",
"0.57139236",
"0.5698508",
"0.56949055",
"0.5688241",
"0.56853455",
"0.56806964",
"0.5664745",
"0.566126",
"0.5656628",
"0.56559205",
"0.5653451",
"0.5649763",
"0.5649712",
"0.56401163",
"0.5634369",
"0.56329495",
"0.56304073",
"0.5628226",
"0.56271535",
"0.5625872",
"0.5622876",
"0.56191957",
"0.56130445",
"0.5609311",
"0.56047684",
"0.56040967",
"0.560292"
]
| 0.70731616 | 1 |
Skip until start tag appears | public SceneObject parse(XmlPullParser parser) throws XmlPullParserException, IOException {
while (parser.getEventType() != XmlPullParser.START_TAG) {
parser.next();
if (parser.getEventType() == XmlPullParser.END_DOCUMENT)
throw new XmlPullParserException("Unexpected END_DOCUMENT");
}
SceneObject object = createSceneObject(parser);
if (object == null)
return null;
float opacity = -1;
boolean visible = object.isVisible();
int renderingOrder = -1;
// Parse attributes
AttributeSet attributeSet = Xml.asAttributeSet(parser);
for (XmlAttributeParser attributeParser : mAttributeParsers) {
attributeParser.parse(mContext, object, attributeSet);
}
// TODO refactor
for (int i = 0; i < attributeSet.getAttributeCount(); ++i) {
switch (attributeSet.getAttributeName(i)) {
case "visible":
visible = attributeSet.getAttributeBooleanValue(i, visible);
break;
case "opacity":
opacity = Float.parseFloat(parser.getAttributeValue(i));
break;
case "renderingOrder":
renderingOrder = attributeSet.getAttributeIntValue(i, renderingOrder);
break;
}
}
// TODO refactor
// Apply renderingOrder
if (renderingOrder >= 0 && object.getRenderData() != null) {
object.getRenderData().setRenderingOrder(renderingOrder);
}
// Parse children
while (parser.next() != XmlPullParser.END_TAG) {
if (parser.getEventType() == XmlPullParser.START_TAG) {
SceneObject child = parse(parser);
if (child != null) {
object.addChildObject(child);
}
}
}
// TODO refactor
/*
* These are propagated to children so must be called after children are
* added.
*/
// Apply opacity
if (opacity >= 0.0f) {
object.setOpacity(opacity);
}
// Apply visible
object.setVisible(visible);
return object;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void skip(XmlPullParser parser) throws XmlPullParserException, IOException {\n\t\tif (parser.getEventType() != XmlPullParser.START_TAG) {\n\t\t\tthrow new IllegalStateException();\n\t\t}\n\t\tint depth = 1;\n\t\twhile (depth != 0) {\n\t\t\tswitch (parser.next()) {\n\t\t\tcase XmlPullParser.END_TAG:\n\t\t\t\tdepth--;\n\t\t\t\tbreak;\n\t\t\tcase XmlPullParser.START_TAG:\n\t\t\t\tdepth++;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}",
"private void skip(XmlPullParser parser) throws XmlPullParserException, IOException {\n if (parser.getEventType() != XmlPullParser.START_TAG) {\n throw new IllegalStateException();\n }\n int depth = 1;\n while (depth != 0) {\n switch (parser.next()) {\n case XmlPullParser.END_TAG:\n depth--;\n break;\n case XmlPullParser.START_TAG:\n depth++;\n break;\n }\n }\n }",
"private void skip(XmlPullParser parser) throws XmlPullParserException, IOException {\n if (parser.getEventType() != XmlPullParser.START_TAG) {\n throw new IllegalStateException();\n }\n int depth = 1;\n while (depth != 0) {\n switch (parser.next()) {\n case XmlPullParser.END_TAG:\n depth--;\n break;\n case XmlPullParser.START_TAG:\n depth++;\n break;\n }\n }\n }",
"private static void skip(XmlPullParser parser) throws XmlPullParserException, IOException {\r\n if (parser.getEventType() != XmlPullParser.START_TAG) {\r\n throw new IllegalStateException();\r\n }\r\n int depth = 1;\r\n while (depth != 0) {\r\n switch (parser.next()) {\r\n case XmlPullParser.END_TAG:\r\n depth--;\r\n break;\r\n case XmlPullParser.START_TAG:\r\n depth++;\r\n break;\r\n }\r\n }\r\n }",
"protected void handleStart(HtmlDocument.Tag tag) {\n if (!tag.isSelfTerminating()) {\n // Add to the stack of tags needing closing tag\n mSeenTags.push(new TagWrapper(tag, mBuilder.length()));\n }\n }",
"public void skipTag(String tag) throws ParseException {\n goToTag(tag);\n movePositionToEndOfTag(tag);\n }",
"@Override\n\tpublic void skip() {\n\t}",
"@Override\n\t\tpublic void skippedEntity(String name) throws SAXException {\n\t\t\t\n\t\t}",
"@Override\n\tpublic void skippedEntity(String name) throws SAXException {\n\t\t\n\t}",
"@Override\n\tpublic void skippedEntity(String name) throws SAXException {\n\t\t\n\t}",
"private boolean advanceToTag(final String tag) {\r\n\t\twhile (this.in.readToTag()) {\r\n\t\t\tfinal Type type = this.in.getTag().getType();\r\n\t\t\tif (type == Type.BEGIN) {\r\n\r\n\t\t\t\tif (this.in.getTag().getName().equals(tag)) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tskipObject();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"@Override\r\n public void skippedEntity(String name) throws SAXException {\n }",
"public boolean isEmptyElementTag() {\r\n\t\treturn source.charAt(end-2)=='/';\r\n\t}",
"void skip();",
"private int skipPreamble(char[] input,\n int offset,\n int end,\n int[] lineNr)\n throws XMLParseException {\n char ch;\n\n do {\n offset = this.skipWhitespace(input, offset, end, lineNr);\n\n if (input[offset] != '<') {\n this.expectedInput(\"'<'\", lineNr[0]);\n }\n\n offset++;\n\n if (offset >= end) {\n throw this.unexpectedEndOfData(lineNr[0]);\n }\n\n ch = input[offset];\n\n if ((ch == '!') || (ch == '?')) {\n offset = this.skipBogusTag(input, offset, end, lineNr);\n }\n } while (!isIdentifierChar(ch));\n\n return offset;\n }",
"public int doStartTag( PrintWriter pw ) throws JspException\n\t{\n\t\treturn SKIP_BODY;\n\t}",
"private void readToStartFragment() throws XMLStreamException {\r\n\t\twhile (true) {\r\n\t\t\tXMLEvent nextEvent = eventReader.nextEvent();\r\n\t\t\tif (nextEvent.isStartElement()\r\n\t\t\t\t\t&& ((StartElement) nextEvent).getName().getLocalPart().equals(fragmentRootElementName)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void goToNextTag(String tag) throws ParseException {\n // Get the text inside the column\n String open = \"<\" + tag;\n int pos = html.indexOf(open, position + 1);\n if (pos == -1) {\n throw new ParseException(\"Cannot skip tag because open \" + tag + \" doesnt exist.\", position);\n }\n position = pos;\n }",
"public void handleStartTag(HtmlObjects.Tag t)\n {\n if (t.tag.equalsIgnoreCase(\"P\"))\n {\n m_skipping = false;\n }\n\n if (m_skipping)\n {\n return;\n }\n\n m_tags.add(t);\n }",
"private void skipObject() {\r\n\t\tint depth = 0;\r\n\t\twhile (this.in.readToTag()) {\r\n\t\t\tfinal Type type = this.in.getTag().getType();\r\n\r\n\t\t\tswitch (type) {\r\n\t\t\tcase END:\r\n\t\t\t\tif (depth == 0) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tdepth--;\r\n\t\t\t\tbreak;\r\n\t\t\tcase BEGIN:\r\n\t\t\t\tdepth++;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public static void begin() {\n Log.writeln(\"<xml-begin/> <!-- Everything until xml-end is now valid xml -->\");\n }",
"boolean readUntilStart(Reader pReader,\n String pElement) throws Exception;",
"public void skip()\n {\n skip(1);\n }",
"public void skippedEntity (String name)\n throws SAXException\n {\n // no op\n }",
"static boolean XmlOpeningTagPart(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"XmlOpeningTagPart\")) return false;\n if (!nextTokenIs(b, XMLSTARTTAGSTART)) return false;\n boolean r, p;\n Marker m = enter_section_(b, l, _NONE_);\n r = consumeToken(b, XMLSTARTTAGSTART);\n p = r; // pin = 1\n r = r && report_error_(b, XmlTagName(b, l + 1));\n r = p && report_error_(b, XmlOpeningTagPart_2(b, l + 1)) && r;\n r = p && report_error_(b, XmlOpeningTagPart_3(b, l + 1)) && r;\n r = p && report_error_(b, XmlOpeningTagPart_4(b, l + 1)) && r;\n r = p && consumeToken(b, XMLTAGEND) && r;\n exit_section_(b, l, m, r, p, null);\n return r || p;\n }",
"private void movePositionToEndOfTag(String tag) throws ParseException {\n String closing = \"</\" + tag + \">\";\n position = html.indexOf(closing, position);\n if (position == -1) {\n throw new ParseException(\"Cannot skip tag because closing \" + tag + \" doesnt exist.\", position);\n }\n position += closing.length();\n }",
"private void handleAllStartTags(Tag tagReturnedFromParse, MutableAttributeSet attributeSetReturnedFromParse, int pos) {\n\tif (StepsToFollow == null) {\n\t initializeStepsToFollow();\n\t}\n\tStepsToFollow.processNextStep();\n\ttry {\n\t if (StepsToFollow.tagToFind == null) {\n\t\tthis.strImageDate = StepsToFollow.getStrImageDate();\n\t\tthis.strImageUrl = StepsToFollow.getStrImageUrl();\n//\t\tthis.ldImageDate = StepsToFollow.getLdImageDate();\n\t\tthis.setStrImageWebPageUrlForPreviousDay(StepsToFollow.getStrPrevWebPageUrl());\n\t } else {\n\t\tif (StepsToFollow.tagToFind.equals(tagReturnedFromParse)) {\n\t\t if (MyTestStepToCheck != StepsToFollow.intNextStepToCheck) {\n\t\t\tString strTagToFind = StepsToFollow.tagToFind.toString();\n\t\t\tMyTestResults += strTagToFind + \"|\";\n\t\t\tMyTestStepToCheck = StepsToFollow.intNextStepToCheck;\n\t\t }\n\t\t MyResults = objProcessStartTags.processThisTag(tagReturnedFromParse, attributeSetReturnedFromParse, StepsToFollow.tagToFind, StepsToFollow.attributeToFind, StepsToFollow.strValueToFind, StepsToFollow.intLengthOfValueToFind, StepsToFollow.attributeToGetValueFrom);\n\t\t StepsToFollow.checkReturnValues(MyResults);\n\t\t}\n\t }\n\t} catch (Exception e) {\n\t // TODO Auto-generated catch block\n\t // e.printStackTrace();\n\t String myMsg = \"Error:\";\n\t myMsg += NL + \"ArcamaxWebPageHtmlParser\";\n//\t myMsg += NL + \"imageName: \" + this.strImageName;\n\t myMsg += NL + \"Tag returned: \" + tagReturnedFromParse;\n\t myMsg += NL + \"Tag to find: \" + StepsToFollow.tagToFind;\n\t myMsg += NL + \"Next step to check: \" + StepsToFollow.intNextStepToCheck;\n\t System.out.println(myMsg);\n\t}\n\n }",
"public void skippedEntity(String name) throws SAXException {\r\n\t}",
"@Override\r\n\tpublic void skip() {\n\t\tSystem.out.println(\"Skip\");\r\n\t}",
"protected void page () throws HTMLParseException {\r\n while (block.restSize () == 0) {\r\n switch (nextToken) {\r\n case END:\r\n return;\r\n case LT:\r\n lastTagStart = tagStart;\r\n tagmode = true;\r\n match (LT);\r\n tag (lastTagStart);\r\n break;\r\n case COMMENT:\r\n //block.addToken (new Token (pagepart, Token.COMMENT, tagStart, stringLength));\r\n // 2009.05.28 by in-koo cho\r\n addTokenCheck(new Token (pagepart, Token.COMMENT, tagStart, stringLength));\r\n match (COMMENT);\r\n break;\r\n case SCRIPT:\r\n //block.addToken (new Token (pagepart, Token.SCRIPT, tagStart, stringLength));\r\n addTokenCheck(new Token (pagepart, Token.SCRIPT, tagStart, stringLength));\r\n match (SCRIPT);\r\n break;\r\n case STRING:\r\n if(stringLength > -1){\r\n //block.addToken (new Token (pagepart, Token.TEXT, tagStart, stringLength));\r\n // 2009.05.28 by in-koo cho\r\n addTokenCheck(new Token (pagepart, Token.TEXT, tagStart, stringLength));\r\n }\r\n match (nextToken);\r\n break;\r\n case MT:\r\n if(!tagmode) {\r\n scanString();\r\n }\r\n default:\r\n if(stringLength > -1){\r\n //block.addToken (new Token (pagepart, Token.TEXT, tagStart, stringLength));\r\n // 2009.05.28 by in-koo cho\r\n addTokenCheck(new Token (pagepart, Token.TEXT, tagStart, stringLength));\r\n }\r\n match (nextToken);\r\n }\r\n }\r\n }",
"public void skippedEntity(String name)\n throws SAXException {\n // no op\n }",
"public void testMarkFragmentProcessedImmediatelyAfterMarkFragmentStart() throws Exception {\n\t\tmoveCursorBeforeFragmentStart();\n\n\t\tfragmentReader.markStartFragment();\n\t\tfragmentReader.markFragmentProcessed();\n\t\t\n\t\tfragmentReader.nextEvent(); // skip whitespace\n\t\t// the next element after fragment end is <misc2/>\n\t\tXMLEvent misc2 = fragmentReader.nextEvent(); \n\t\tassertTrue(EventHelper.startElementName(misc2).equals(\"misc2\"));\n\t}",
"public void multiFileStartDocument() throws SAXException\r\n\t{\r\n\t\tsuper.startDocument();\r\n\t\ttagPath = new Stack<Path>();\r\n\t\ttagBeingIgnored = null;\r\n\t\tpassedARecord = false;\r\n\t}",
"public void skippedEntity(String name) throws SAXException {\n this.ensureInitialization();\n super.skippedEntity(name);\n }",
"public boolean readNextTag(final String name) {\r\n\r\n\t\twhile (this.in.readToTag()) {\r\n\t\t\tfinal Type type = this.in.getTag().getType();\r\n\t\t\tif (type == Type.BEGIN) {\r\n\t\t\t\tif (this.in.getTag().getName().equals(name)) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tskipObject();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public static int skipWSX (Document doc, int posn, int end) {\n\t\twhile (posn < end) {\n\t\t\tif (Character.isWhitespace(doc.charAt(posn))) {\n\t\t\t\tposn++;\n\t\t\t} else if (doc.charAt(posn) == '<') {\n\t\t\t\tposn++;\n\t\t\t\twhile (posn < end && doc.charAt(posn) != '>')\n\t\t\t\t\tposn++;\n\t\t\t\tif (posn < end) posn++;\n\t\t\t} else break;\n\t\t}\n\t\treturn posn;\n\t}",
"private int nextNonText( List content, int start) {\r\n if (start < 0) {\r\n start = 0;\r\n }\r\n\r\n int index = start;\r\n int size = content.size();\r\n while( index < size) {\r\n if ( !(content.get( index) instanceof Text)) {\r\n return index;\r\n }\r\n index++;\r\n }\r\n return size;\r\n }",
"public void startContent() throws XPathException {\r\n if (depthOfHole == 0) {\r\n nextReceiver.startContent();\r\n }\r\n }",
"private int skipLeadingWhite( List content, int start) {\r\n if (start < 0) {\r\n start = 0;\r\n }\r\n\r\n int index = start;\r\n int size = content.size();\r\n if (currentFormat.trimAllWhite\r\n || currentFormat.textNormalize\r\n || currentFormat.textTrim) {\r\n while( index < size) {\r\n if ( !isAllWhitespace( content.get(index))) {\r\n return index;\r\n }\r\n index++;\r\n }\r\n }\r\n return index;\r\n }",
"public abstract void onLoadMore(int skipStart);",
"private static StartTag findPreviousOrNext(Source source, int pos, boolean previous) {\n\t\ttry {\r\n\t\t\tStartTag previousComment=source.findPreviousStartTag(pos,SpecialTag.COMMENT.getName());\r\n\t\t\tif (previousComment!=null) {\r\n\t\t\t\tif (previousComment.end>pos) {\r\n\t\t\t\t\t// the current position lies within the comment\r\n\t\t\t\t\tif (previous || pos==previousComment.begin) return previousComment; // return the comment if finding previous or comment starts at pos.\r\n\t\t\t\t\tpos=previousComment.end; // skip all tags within the comment\r\n\t\t\t\t}\r\n\t\t\t\tif (!previous) previousComment=null; // the previous comment is now no longer relevant if we are searching forward\r\n\t\t\t}\r\n\t\t\tString lsource=source.getParseTextLowerCase();\r\n\t\t\tint begin=pos;\r\n\t\t\tdo {\r\n\t\t\t\tbegin=previous?lsource.lastIndexOf('<',begin):lsource.indexOf('<',begin);\r\n\t\t\t\tif (begin==-1) return null;\r\n\t\t\t\tif (previousComment!=null && previousComment.encloses(begin)) return previousComment; // return the comment if finding previous and current position lies within the comment\r\n\t\t\t\tString tagAtCacheKey=SearchCache.getTagKey(begin);\r\n\t\t\t\tTag tag=(Tag)source.getSearchCache().getTag(tagAtCacheKey);\r\n\t\t\t\tif (tag instanceof StartTag) return (StartTag)tag;\r\n\t\t\t\tif (tag!=null || lsource.charAt(begin+1)=='/') continue; // end tag or CACHED_NULL\r\n\t\t\t\tint nameBegin=begin+1;\r\n\t\t\t\tint nameEnd;\r\n\t\t\t\tString name=null;\r\n\t\t\t\tStartTag startTag=null;\r\n\t\t\t\tSpecialTag specialTag=SpecialTag.get(source,nameBegin);\r\n\t\t\t\ttry {\r\n\t\t\t\t\tif (specialTag!=null) {\r\n\t\t\t\t\t\tstartTag=newSpecialStartTag(source,begin,nameBegin,specialTag);\r\n\t\t\t\t\t\tif (startTag!=null) return startTag;\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tnameEnd=source.getIdentifierEnd(nameBegin,true);\r\n\t\t\t\t\tif (nameEnd==-1) {\r\n\t\t\t\t\t\tsource.log(\"StartTag\",null,begin,\"rejected because it has an invalid first character in its name\",-1);\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tname=lsource.substring(nameBegin,nameEnd);\r\n\t\t\t\t\tstartTag=constructWithAttributes(source,begin,name,null);\r\n\t\t\t\t\tif (startTag!=null) return startTag;\r\n\t\t\t\t} finally {\r\n\t\t\t\t\tsource.getSearchCache().setTag(tagAtCacheKey,startTag);\r\n\t\t\t\t}\r\n\t\t\t} while (inRange(source,begin+=(previous?-2:2)));\r\n\t\t} catch (IndexOutOfBoundsException ex) {}\r\n\t\treturn null;\r\n\t}",
"public void goToTag(String tag) throws ParseException {\n // Get the text inside the column\n String open = \"<\" + tag;\n position = html.indexOf(open, position);\n if (position == -1) {\n throw new ParseException(\"Cannot skip tag because open \" + tag + \" doesnt exist.\", position);\n }\n }",
"void startSequence(GroupSG group) throws SAXException;",
"public String next()\r\n/* 35: */ {\r\n/* 36:42 */ String thisResult = this.nextResult;\r\n/* 37: */ \r\n/* 38:44 */ this.nextResult = Tags.untagTopLevelString(this.start, this.input);\r\n/* 39:49 */ if (this.nextResult == null) {\r\n/* 40:49 */ return thisResult;\r\n/* 41: */ }\r\n/* 42:51 */ int index = this.input.indexOf(this.nextResult) + this.nextResult.length();\r\n/* 43: */ \r\n/* 44:53 */ index = this.input.indexOf(\"</\" + this.start + \">\", index) + 3 + this.start.length();\r\n/* 45: */ \r\n/* 46:55 */ this.input = this.input.substring(index);\r\n/* 47: */ \r\n/* 48:57 */ this.nextResult = Tags.tag(this.start, this.nextResult);\r\n/* 49: */ \r\n/* 50: */ \r\n/* 51: */ \r\n/* 52: */ \r\n/* 53:62 */ return thisResult;\r\n/* 54: */ }",
"protected void skipRemainingTagsInCurrentIfd() throws IOException, ExifInvalidFormatException {\n int endOfTags = mIfdStartOffset + OFFSET_SIZE + TAG_SIZE * mNumOfTagInIfd;\n int offset = mTiffStream.getReadByteCount();\n if (offset > endOfTags) {\n return;\n }\n if (mNeedToParseOffsetsInCurrentIfd) {\n while (offset < endOfTags) {\n mTag = readTag();\n offset += TAG_SIZE;\n if (mTag == null) {\n continue;\n }\n checkOffsetOrImageTag(mTag);\n }\n } else {\n skipTo(endOfTags);\n }\n long ifdOffset = readUnsignedLong();\n // For ifd0, there is a link to ifd1 in the end of all tags\n if (mIfdType == IfdId.TYPE_IFD_0\n && (isIfdRequested(IfdId.TYPE_IFD_1) || isThumbnailRequested())) {\n if (ifdOffset > 0) {\n registerIfd(IfdId.TYPE_IFD_1, ifdOffset);\n }\n }\n }",
"private boolean isComplete() {\n if (this.content.charAt(0) != '<' || this.content.charAt(this.content.length() - 1) != '>') {\n throw new IllegalArgumentException(\"Invalid XML file.\");\n }\n Stack<String> xmlTags = new Stack<>();\n for (int i = 0; i < this.content.length();) {\n String currTag = \"\";\n int j = 0;\n for (j = 0; i + j < this.content.length(); ++j) {\n if (this.content.charAt(i + j) == '>') {\n currTag = this.content.substring(i, i + j + 1);\n break;\n }\n }\n String word = \"\";\n if (currTag.charAt(1) == '/') {\n word = currTag.substring(2, currTag.length() - 1);\n if (!word.equals(xmlTags.peek())) {\n throw new IllegalArgumentException(\"Invalid end tag: should be \"\n + xmlTags.peek() + \", but got \" + word);\n }\n xmlTags.pop();\n if (xmlTags.size() == 0 && i + word.length() + 3 < this.content.length() - 1) {\n throw new IllegalArgumentException(\"Content after root tag.\");\n }\n this.result.add(\"end:\" + word);\n }\n else {\n word = currTag.substring(1, currTag.length() - 1);\n if (checkTag(word)) {\n xmlTags.push(word);\n this.result.add(\"start:\" + word);\n }\n else {\n throw new IllegalArgumentException(\"Invalid tag.\");\n }\n }\n i = i + j + 1;\n for (j = i; j < this.content.length(); ++j) {\n if (this.content.charAt(j) == '<') {\n break;\n }\n }\n word = \"\";\n if (i != j) {\n word = this.content.substring(i, j);\n }\n if (word.length() > 0) {\n this.result.add(\"char:\" + word);\n }\n i = j;\n }\n return xmlTags.empty();\n }",
"private void parse() throws XMLStreamException {\n while (reader.hasNext()) {\n if (reader.next() == START_ELEMENT) {\n handleElement();\n }\n }\n }",
"private void TokenStartTag(Token token, TreeConstructor treeConstructor) {\n\t\tif (token.getValue().equals(\"html\"))\r\n\t\t\tTokenAnythingElse(token, treeConstructor, false);\r\n\t\telse\r\n\t\t\tTokenAnythingElse(token, treeConstructor, true);\r\n\t}",
"@Test\n public void testNonEmptyExcerpt_skip() throws IOException {\n checkSkip(excerpt(makeDigits(), 1, 8), 1, 1, '2');\n\n // skip up to the end of the excerpt.\n checkSkip(excerpt(makeDigits(), 2, 6), 6, 6, EOF);\n\n // try to skip past the end of the excerpt.\n checkSkip(excerpt(makeDigits(), 2, 6), 7, 6, EOF);\n }",
"private boolean endTagRequired(UAElement element) {\n \t\tString elementName = element.getElementName();\n \t\tif (\"a\".equalsIgnoreCase(elementName)) return true; //$NON-NLS-1$\n \t\tif (\"p\".equalsIgnoreCase(elementName)) return true; //$NON-NLS-1$\n \t\tif (\"div\".equalsIgnoreCase(elementName)) return true; //$NON-NLS-1$\n \t\tif (\"script\".equalsIgnoreCase(elementName)) return true; //$NON-NLS-1$\n \t\tif (\"textarea\".equalsIgnoreCase(elementName)) return true; //$NON-NLS-1$\n \t\treturn false;\n \t}",
"protected int skipBogusTag(char[] input,\n int offset,\n int end,\n int[] lineNr) {\n int level = 1;\n\n while (offset < end) {\n char ch = input[offset++];\n\n switch (ch) {\n case '\\r':\n if ((offset < end) && (input[offset] == '\\n')) {\n offset++;\n }\n\n lineNr[0]++;\n break;\n case '\\n':\n lineNr[0]++;\n break;\n case '<':\n level++;\n break;\n case '>':\n level--;\n\n if (level == 0) {\n return offset;\n }\n\n break;\n default:\n }\n }\n\n throw this.unexpectedEndOfData(lineNr[0]);\n }",
"private void beforeAttributeNameState() throws SAXException, IOException {\n while (beforeAttributeNameStateImpl()) {\n // Spin.\n }\n }",
"@Override\r\n\tpublic void stoppElement(Enum tag) {\n\t\t\r\n\t}",
"@Override\n\tpublic Tag getPreTag() {\n\t\treturn null;\n\t}",
"public void importElement(XmlPullParser xpp, Epml epml) {\n\t\tlineNumber = xpp.getLineNumber();\n\t\t/*\n\t\t * Import all attributes of this element.\n\t\t */\n\t\timportAttributes(xpp, epml);\n\t\t/*\n\t\t * Create afresh stack to keep track of start tags to match.\n\t\t */\n\t\tArrayList<String> stack = new ArrayList<String>();\n\t\t/*\n\t\t * Add the current tag to this stack, as we still have to find the\n\t\t * matching end tag.\n\t\t */\n\t\tstack.add(tag);\n\t\t/*\n\t\t * As long as the stack is not empty, we're still working on this\n\t\t * object.\n\t\t */\n\t\twhile (!stack.isEmpty()) {\n\t\t\ttry {\n\t\t\t\t/*\n\t\t\t\t * Get next event.\n\t\t\t\t */\n\t\t\t\tint eventType = xpp.next();\n\t\t\t\tif (eventType == XmlPullParser.END_DOCUMENT) {\n\t\t\t\t\t/*\n\t\t\t\t\t * End of document. Should not happen.\n\t\t\t\t\t */\n\t\t\t\t\tepml.log(tag, xpp.getLineNumber(), \"Found end of document\");\n\t\t\t\t\treturn;\n\t\t\t\t} else if (eventType == XmlPullParser.START_TAG) {\n\t\t\t\t\t//System.out.println(xpp.getLineNumber() + \" <\" + xpp.getName() + \">\");\n\t\t\t\t\t/*\n\t\t\t\t\t * Start tag. Push it on the stack.\n\t\t\t\t\t */\n\t\t\t\t\tstack.add(xpp.getName());\n\t\t\t\t\t/*\n\t\t\t\t\t * If this tag is the second on the stack, then it is a\n\t\t\t\t\t * direct child.\n\t\t\t\t\t */\n\t\t\t\t\tif (stack.size() == 2) {\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * For a direct child, check whether the tag is known.\n\t\t\t\t\t\t * If so, take proper action. Note that this needs not\n\t\t\t\t\t\t * to be done for other offspring.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif (importElements(xpp, epml)) {\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t * Known start tag. The end tag has been matched and\n\t\t\t\t\t\t\t * can be popped from the stack.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if ((eventType == XmlPullParser.END_TAG)) {\n\t\t\t\t\t//System.out.println(xpp.getLineNumber() + \" </\" + xpp.getName() + \">\");\n\t\t\t\t\t/*\n\t\t\t\t\t * End tag. Should be identical to top of the stack.\n\t\t\t\t\t */\n\t\t\t\t\tif (xpp.getName().equals(stack.get(stack.size() - 1))) {\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * Yes it is. Pop the stack.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tstack.remove(stack.size() - 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * No it is not. XML violation.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tepml.log(tag, xpp.getLineNumber(), \"Found \" + xpp.getName() + \", expected \"\n\t\t\t\t\t\t\t\t+ stack.get(stack.size() - 1));\n\t\t\t\t\t}\n\t\t\t\t} else if (eventType == XmlPullParser.TEXT) {\n\t\t\t\t\t/*\n\t\t\t\t\t * Plain text. Import it.\n\t\t\t\t\t */\n\t\t\t\t\timportText(xpp.getText(), epml);\n\t\t\t\t}\n\t\t\t} catch (Exception ex) {\n\t\t\t\tepml.log(tag, xpp.getLineNumber(), ex.getMessage());\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t/*\n\t\t * The element has been imported. Now is a good time to check its\n\t\t * validity.\n\t\t */\n\t\tcheckValidity(epml);\n\t}",
"public void skipToken() {\t\t\n\t\t//remove token from line\n\t\tif (token != null)\n\t\t{\n\t\t\tline = line.substring(token.length());\n\t\t}\n\t\t//check if new token in line\n\t\tint pos = findFirstNotWhitespace(line.toCharArray());\n\t\t\n\t\t//read line until next token found\n\t\twhile (pos == -1 && s.hasNextLine())\n\t\t{\n\t\t\t//read next line\n\t\t\tline = s.nextLine();\n\t\t\t//check for start of token\n\t\t\tpos = findFirstNotWhitespace(line.toCharArray());\n\t\t}\n\t\t\n\t\t//no token found till eof\n\t\tif (pos == -1)\n\t\t{\n\t\t\t//set EOF tag\n\t\t\tline = null;\n\t\t}\n\t\t//reset token values\n\t\ttoken = null;\n\t\ttType = null;\n\t}",
"public void openStartTag() throws XMLStreamException {\n write(HtmlObject.HtmlMarkUp.OPEN_BRACKER);\n }",
"@Override\r\n\t\tprotected boolean skipInitialType() {\r\n\t\t\treturn false;\r\n\t\t}",
"void startAll(GroupSG group) throws SAXException;",
"public boolean omitStart() {\n return oStart;\n }",
"public void setStartTagChar(char start_tag) {\n\t\tthis.start_tag = start_tag;\n\t}",
"@Override\n\tpublic void startElement(String arg0, String arg1, String arg2, Attributes arg3) throws SAXException {\n\t\tCurrentTag=arg2;\n\t\tSystem.out.println(\"此处处理的元素是:\"+arg2);\n\t}",
"public boolean skip() {\n return skip;\n }",
"public void startContent() throws XPathException {\n if (activeDepth > 0) {\n super.startContent();\n } else if (matched) {\n activeDepth = 1;\n super.startContent();\n }\n }",
"@Override\n\tpublic int doStartTag() throws JspException {\n\t\ttry {\n\t\t\tJspWriter out = pageContext.getOut();\n\t\t\tout.print(\"<font color='#ff0000'>*Hello11 you have used HTML taglib</font>\");\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\treturn SKIP_BODY;\n\t}",
"protected void tag (int ltagStart) throws HTMLParseException {\r\n Tag tag = new Tag ();\r\n Token token = new Token (tag, false);\r\n switch (nextToken) {\r\n case STRING:\r\n tag.setType (stringValue);\r\n match (STRING);\r\n arglist (tag);\r\n if (tagmode) {\r\n block.setRest (lastTagStart);\r\n } else {\r\n token.setStartIndex (ltagStart);\r\n //block.addToken (token);\r\n // 2009.05.28 by in-koo cho\r\n addTokenCheck(token);\r\n }\r\n break;\r\n case MT:\r\n tagmode = false;\r\n match (MT);\r\n break;\r\n case END:\r\n block.setRest (lastTagStart);\r\n tagmode = false;\r\n return;\r\n default:\r\n arglist (tag);\r\n }\r\n }",
"boolean isBeginInclusive();",
"@Override\n\tpublic void startElement(String arg0, String arg1, String arg2, Attributes arg3) throws SAXException {\n\t\tSystem.out.println(arg2+\"解析开始\");\n\t}",
"@Override\n void startElement(String uri, String localName, String qName, Attributes attributes);",
"private void eatRangeStart() {\n\n Token token = tokens.get(currentTokenPointer++);\n\n if (token.kind == TokenKind.STARTINCLUSIVE) {\n\n startInclusive = true;\n\n } else if (token.kind == TokenKind.STARTEXCLUSIVE) {\n\n startInclusive = false;\n\n } else {\n\n raiseParseProblem(\"expected a version start character '[' or '(' but found '\" + string(token) + \"' at position \" + token.start,\n\n token.start);\n\n }\n\n }",
"public static boolean XmlEmptyTag(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"XmlEmptyTag\")) return false;\n if (!nextTokenIs(b, XMLSTARTTAGSTART)) return false;\n boolean r;\n Marker m = enter_section_(b);\n r = consumeToken(b, XMLSTARTTAGSTART);\n r = r && XmlTagName(b, l + 1);\n r = r && XmlEmptyTag_2(b, l + 1);\n r = r && XmlEmptyTag_3(b, l + 1);\n r = r && XmlEmptyTag_4(b, l + 1);\n r = r && consumeToken(b, XMLEMPTYELEMENTEND);\n exit_section_(b, m, XML_EMPTY_TAG, r);\n return r;\n }",
"private static boolean checkForInnerTags(String line, int lineCounter) {\n String sub = line.substring(3, line.length() - 4);\n if (sub.contains(\"<\") || sub.contains(\"</\")) {\n char tag = sub.charAt(sub.indexOf('<') + 1);\n if (sub.substring(sub.indexOf('>')).indexOf(tag) != -1) {\n System.out.println(\"Error on line \" + lineCounter + \": Error type : Syntax \" + \": Unclosed tag : \" + tag);\n return false;\n }\n }\n return true;\n }",
"@Override\n public void startDocument() throws SAXException {\n }",
"@Override\n\tpublic int doStartTag() throws JspException {\n\t\treturn EVAL_BODY_INCLUDE;\n\t}",
"@Override\n\tpublic int doStartTag() throws JspException {\n\t\treturn EVAL_BODY_INCLUDE;\n\t}",
"private int skipTrialingWhite( List content, int start) {\r\n int size = content.size();\r\n if (start > size) {\r\n start = size;\r\n }\r\n\r\n int index = start;\r\n if (currentFormat.trimAllWhite\r\n || currentFormat.textNormalize\r\n || currentFormat.textTrim) {\r\n while( index >= 0) {\r\n if ( !isAllWhitespace( content.get(index - 1)))\r\n break;\r\n --index;\r\n }\r\n }\r\n return index;\r\n }",
"public int doStartTag() {\r\n // Reset per-invocation state set by nested elements\r\n params = null;\r\n return EVAL_BODY_INCLUDE;\r\n }",
"public boolean getNeedClosingTag() {\n\t\treturn (end_element);\n\t}",
"public void setSkip(boolean skip) {\n this.skip = skip;\n }",
"@Override\r\n public void startDocument() throws SAXException {\n }",
"public void startElement(String namespaceURI, String localName, String qName, Attributes atts)\n throws SAXException {\n log.info(\"startElement : noeud = \"+localName);\n if (N_GENERATION.equalsIgnoreCase(localName)){\n startElement_Generation(namespaceURI, localName, qName, atts);\n }\n if (N_CLASSE.equalsIgnoreCase(localName)){\n startElement_Generer(namespaceURI, localName, qName, atts);\n }\n if (N_TEMPLATE.equalsIgnoreCase(localName)){\n startElement_Template(namespaceURI, localName, qName, atts);\n }\n }",
"@Override\n\tpublic void startDocument() throws SAXException {\n\t\t\n\t}",
"@Override\n\tpublic void startDocument() throws SAXException {\n\t\t\n\t}",
"public void startDocument ()\n throws SAXException\n {\n // no op\n }",
"@Override\n\tpublic void startElement(String uri, String localName, String qName, Attributes attributes) {\n\t\tif (localName.equals(\"doc\")) {\n\t\t\t// Start of a document.\n\t\t\tstartDoc(attributes);\n\t\t} else if (localName.equals(\"w\")) {\n\t\t\t// Start of a word element.\n\t\t\tstartWord(attributes);\n\t\t} else {\n\t\t\t// Huh?\n\t\t\tthrow new RuntimeException(\"Unknown start tag: \" + localName + \", attr: \" + attributes\n\t\t\t\t\t+ \" at \" + describePosition());\n\t\t}\n\t\tsuper.startElement(uri, localName, qName, attributes);\n\t}",
"private static boolean isStartTag(String line) {\n final char c = line.charAt(line.length() - 2);\n return brackets(line) && line.charAt(1) != '/' && (c != '/' && c != '?');\n }",
"void tag4() \n\t{\n\t\t/** javadoc_single_style_tag: This is a JavaDoc single style tag.\n\t}\n\t\n\t/** Test a JavaDoc multi style comment in souce code.\n\t * \n\t */\n\tvoid tag5() \n\t{\n\t\t/** \n\t\t * javadoc_multi_style_tag: This is a JavaDoc multi style tag.\n\t\t */\n\t}\n\t\n\t/** Test a tag not at the start of a line.\n\t * \n\t */\n\tvoid tag6() \n\t{\n\t\t/** \n\t\t * The tag \"not_start_of_line_tag\" should NOT be found.\n\t\t */\n\t}\n\t\n\t/** Test a tag variable in source code.\n\t * \n\t */\n\tvoid tag7() \n\t{\n\t\tint source_code_variable_tag;\n\t\t\n\t\tsource_code_variable_tag += 7;\n\t}\n\n}",
"public void startElement(String localName) throws SAXException {\n\t\tstartElement(\"\", localName, \"\", EMPTY_ATTS);\n\t}",
"public Element removeBeginStartModifier() {\n\t\tsetBeginStartModifierDefined(false);\n\t\treturn (this);\n\t}",
"public void startDocument() throws SAXException {\n \n }",
"public int doStartTag()throws JspException{\r\n\t\t\r\n\t\tout = pageContext.getOut();\r\n\t\ttry{\r\n\t\t\tout.println(\"Before body.\");\r\n\t\t}catch(IOException ex){\r\n\t\t\tthrow new JspException(\"IOException- \" + ex.toString());\r\n\t\t}\r\n\t\t// This is what causes the body to be evaluated in a Classic tag handler!\r\n\t\treturn EVAL_BODY_INCLUDE;\r\n\t}",
"public void testFragmentWrapping() throws XMLStreamException {\n\t\t\n\t\tassertTrue(fragmentReader.hasNext());\n\t\tmoveCursorBeforeFragmentStart();\n\n\t\tfragmentReader.markStartFragment(); // mark the fragment\n\t\tassertTrue(EventHelper.startElementName(eventReader.peek()).equals(\"fragment\"));\n\t\t\n\t\t// StartDocument inserted before StartElement\n\t\tassertTrue(fragmentReader.peek().isStartDocument());\n\t\tassertTrue(fragmentReader.nextEvent().isStartDocument());\n\t\t// StartElement follows in the next step\n\t\tassertTrue(EventHelper.startElementName(fragmentReader.nextEvent()).equals(\"fragment\")); \n\n\t\tmoveCursorToNextElementEvent(); // misc1 start\n\t\tfragmentReader.nextEvent(); // skip it\n\t\tmoveCursorToNextElementEvent(); // misc1 end\n\t\tfragmentReader.nextEvent(); // skip it\n\t\tmoveCursorToNextElementEvent(); // move to end of fragment\n\n\t\t// expected EndElement, peek first which should have no side effect\n\t\tassertTrue(EventHelper.endElementName(fragmentReader.nextEvent()).equals(\"fragment\")); \n\t\t// inserted EndDocument\n\t\tassertTrue(fragmentReader.peek().isEndDocument());\n\t\tassertTrue(fragmentReader.nextEvent().isEndDocument()); \n\t\t\n\t\t// now the reader should behave like the document has finished\n\t\tassertTrue(fragmentReader.peek() == null);\n\t\tassertFalse(fragmentReader.hasNext());\n\t\t\n\t\ttry{\n\t\t\tfragmentReader.nextEvent();\n\t\t\tfail(\"nextEvent should simulate behavior as if document ended\");\n\t\t}\n\t\tcatch (NoSuchElementException expected) {\n\t\t\t//expected\n\t\t}\n\n\t}",
"public static void skipWhile() {\n Observable.fromIterable(sData)\n .skipWhile((item) -> {\n System.out.println(\"item = \" + item);\n return item.equalsIgnoreCase(\"abc\");\n }).subscribe(new MyObserver<>());\n }",
"@Override\n\tpublic void removeFromBeginning() {\n\t}",
"@Override\n\tpublic int getStartOffset() {\n\t\treturn 0;\n\t}",
"public int doStartTag() throws JspException \n\t{\n\t return EVAL_BODY_INCLUDE;\n\t}",
"public void markContentBegin() {\n this.ris.markContentBegin();\n }",
"public abstract void nextElement();",
"void handleStartTag(String sTagName, HashMap attributes,boolean standAlone) {\r\n pageList.add(new StandAloneElement(sTagName, attributes, null));\r\n }",
"SkipStatement createSkipStatement();",
"protected boolean skip(Annotation annotation) {\n \t\treturn false;\n \t}"
]
| [
"0.69083136",
"0.6812622",
"0.6812622",
"0.6725946",
"0.658531",
"0.6356305",
"0.62817514",
"0.62653476",
"0.61619025",
"0.61619025",
"0.6138037",
"0.60431397",
"0.6031032",
"0.59971726",
"0.5965583",
"0.5944581",
"0.5916083",
"0.59117293",
"0.5910329",
"0.59067893",
"0.58983696",
"0.58379555",
"0.5817881",
"0.5810342",
"0.5792351",
"0.57796544",
"0.57751894",
"0.57601607",
"0.5760003",
"0.5754861",
"0.57331127",
"0.57203746",
"0.5654835",
"0.56042695",
"0.5595454",
"0.5580662",
"0.5535354",
"0.5532422",
"0.55274194",
"0.5510676",
"0.5501123",
"0.5492624",
"0.5456127",
"0.54434204",
"0.5441937",
"0.54063267",
"0.54001075",
"0.53947943",
"0.5392359",
"0.5371583",
"0.53607094",
"0.5341645",
"0.53338975",
"0.5316827",
"0.5312721",
"0.53111243",
"0.5309109",
"0.5300641",
"0.5284646",
"0.5269218",
"0.52577394",
"0.52553964",
"0.5231397",
"0.5227886",
"0.5214988",
"0.52112246",
"0.51972437",
"0.51949763",
"0.5174904",
"0.51728976",
"0.5158074",
"0.5156698",
"0.5152338",
"0.5133685",
"0.5133685",
"0.51259595",
"0.51213455",
"0.5120995",
"0.5119846",
"0.51084",
"0.50984466",
"0.50924957",
"0.50924957",
"0.50864583",
"0.5083664",
"0.5074186",
"0.50739014",
"0.50667983",
"0.5065624",
"0.5058789",
"0.5055441",
"0.50553924",
"0.50477886",
"0.5047611",
"0.5047033",
"0.5046036",
"0.5045888",
"0.50374407",
"0.5031737",
"0.5030453",
"0.5020533"
]
| 0.0 | -1 |
Constructors Construct a new TableGenerator. | public TablesGenerator()
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public TableCreation(Table table) {\n this.table = table;\n }",
"public TableDeclaration() {\n }",
"public Table() {\n this.tableName = \"\";\n this.rows = new HashSet<>();\n this.columnsDefinedOrder = new ArrayList<>();\n }",
"public static LearningTable createLearningTable() {\n\t\tLearningTable table = new LearningTable(null, null, null);\n\t\t\n\t\ttable.getAttributes().addAll(createAttributes());\n\t\ttable.getExamples().addAll(createExamples(table.getAttributes()));\n\t\t\n\t\treturn table;\n\t}",
"public Mytable() {\n this(DSL.name(\"mytable\"), null);\n }",
"public TableObject()\r\n {\r\n\tsuper(ObjectType.Table);\r\n\tglobal = false;\r\n }",
"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 }",
"TABLE createTABLE();",
"public DatabaseTable() { }",
"public AgentTable() {\n this(\"agent\", null);\n }",
"public HashTable()\n\t{\n\t\tthis(START_TABELLENGROESSE);\n\t}",
"StreamTable()\n {\n }",
"TableInstance createTableInstance();",
"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}",
"Table createTable();",
"public TableViewFactory() {\n }",
"void initTable();",
"MultTable() //do not use the name of the constructor for the name of another method\n {}",
"public void initTable();",
"@Test\n public void testConstructor(){\n new RowGen(ROW_INDEX, spaces);\n }",
"private Table(Builder builder) {\n super(builder);\n }",
"public TableEx() {\r\n setStyleName(\"gwtEx-Table\");\r\n rf = getRowFormatter();\r\n this.addClickHandler(tableClickTable);\r\n }",
"static LearningTable createFilledLearningTable() {\n\t\tLearningTable table = new LearningTable(null, null, null);\n\t\t\n\t\ttable.getAttributes().addAll(createAttributes());\n\t\ttable.getExamples().addAll(createFilledExamples());\n\t\t\n\t\treturn table;\n\t}",
"public HashTable() {\n\t\tthis(DEFAULT_TABLE_SIZE);\n\t}",
"public TableImpl() { columns = new Column[0]; }",
"public Table() {\n startingCash = 10000;\n renderWinState = false;\n players = new Player[4];\n river = new River();\n deck = new Deck();\n dealer = new Dealer();\n initRiver();\n initPlayers();\n }",
"protected abstract void initialiseTable();",
"public MyHashTable( )\r\n\t{\r\n\t\tthis(DEFAULTTABLESIZE);\r\n\t\t\r\n\t\t\t\r\n\t}",
"public HashTable( )\n\t{\n\t\tthis ( DEFAULT_TABLE_SIZE );\n\t}",
"public Table(int size) {\n\t\tsuper(size);\n\t}",
"public HashTable()\n\t{\n\t\tthis(NUM_BUCKETS);\n\t}",
"@JsonCreator\n private DocumentTable(\n @JsonProperty(value = \"rowCount\", required = true) int rowCount,\n @JsonProperty(value = \"columnCount\", required = true) int columnCount,\n @JsonProperty(value = \"cells\", required = true) List<DocumentTableCell> cells,\n @JsonProperty(value = \"spans\", required = true) List<DocumentSpan> spans) {\n this.rowCount = rowCount;\n this.columnCount = columnCount;\n this.cells = cells;\n this.spans = spans;\n }",
"FromTable createFromTable();",
"private Table(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }",
"public table() {\n initComponents();\n }",
"public TempTable() {\r\n\t\t\tsuper();\r\n\t\t\tthis.clauses = new ArrayList<TempTableHeaderCell>();\r\n\t\t}",
"public PeerTable() {\n super();\n }",
"private TableAccessET() {\n\n }",
"public CursosTable() {\n \n \n }",
"public TableComboBox() {}",
"public MyHashTable( )\n {\n this( DEFAULT_TABLE_SIZE );\n }",
"public BstTable() {\n\t\tbst = new Empty<Key, Value>();\n\t}",
"public ATExpression base_tableExpression();",
"protected TableObject(String name, IValueAccessor accessor) {\n this.name = name;\n this.accessor = accessor;\n }",
"public MonthlyValuesTable(Database database) \n {\n //Constructor calls DbTable's constructor\n super(database);\n setTableName(\"monthlyvalues\");\n }",
"public MyHashTable( int tableSize )\r\n\t{\r\n\t\tthis.size = 0;\r\n\t\tthis.tableSize = nextPrime(tableSize);\r\n\t\ttable = new Object[this.tableSize];\r\n\t\tfor ( int i =0; i< this.tableSize; i++)\r\n\t\t{ this.table[i] = new LinkedArrays<T>(); }\r\n\t\r\n\t}",
"public TableSorter() {\n indexes = new int[0];\n }",
"private ByaTableModel() {\n\t}",
"public CategoryTableTest() {\n super(CategoryTable.class);\n }",
"@SuppressWarnings(\"unused\")\n private AddTable() {\n }",
"@SuppressWarnings(\"unchecked\")\r\n\tpublic HashTable()\r\n\t{\r\n\t\ttable = new HashEntry[SIZES[sizeIdx]];\r\n\t}",
"private TableDefinition(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }",
"public TableDefinition(String tableName) {\n this.tableName = tableName;\n }",
"@SuppressWarnings(\"deprecation\")\n\tprivate TableLayout buildTable() {\n\t\t// Initialize table\n\t\tTableLayout table = new TableLayout(this);\n\t\tLayoutParams tableParams = new LayoutParams(LayoutParams.FILL_PARENT,\n\t\t\t\tLayoutParams.WRAP_CONTENT);\n\t\ttable.setLayoutParams(tableParams);\n\t\ttable.setPadding(10, 10, 10, 10);\n\n\t\t// Initialize generic row params\n\t\tLayoutParams genericRowParams = new TableRow.LayoutParams(\n\t\t\t\tLayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);\n\n\t\tfillTable(table, genericRowParams);\n\t\treturn table;\n\t}",
"public PdfPTable createTable() {\n\t\tPdfPTable t = new PdfPTable(2);\n\t\tt.setWidthPercentage(100);\n\t\tt.setHorizontalAlignment(Element.ALIGN_LEFT);\n\t\tt.getDefaultCell().setBorder(Rectangle.NO_BORDER);\n\t\t// set up the table headers for albums\n\t\tif (state.equals(\"a\")) {\n\t\t\tFont bold = new Font(Font.FontFamily.HELVETICA, 13, Font.BOLD);\n\t\t\t\n\t\t\tPdfPCell nameCell = new PdfPCell();\n\t\t\tnameCell.setBorder(Rectangle.NO_BORDER);\n\t\t\tPhrase name = new Phrase(\"Name\", bold);\n\t\t\tnameCell.addElement(name);\n\t\t\t\n\t\t\tPdfPCell artistCell = new PdfPCell();\n\t\t\tartistCell.setBorder(Rectangle.NO_BORDER);\n\t\t\tPhrase artist = new Phrase(\"Artist\", bold);\n\t\t\tartistCell.addElement(artist);\n\t\t\t\n\t\t\tt.addCell(nameCell);\n\t\t\tt.addCell(artistCell);\n\t\t}\n\t\t// set up the table headers for publications\n\t\telse if (state.equals(\"p\")) {\n\t\t\tFont bold = new Font(Font.FontFamily.HELVETICA, 13, Font.BOLD);\n\t\t\t\n\t\t\tPdfPCell nameCell = new PdfPCell();\n\t\t\tnameCell.setBorder(Rectangle.NO_BORDER);\n\t\t\tPhrase name = new Phrase(\"Name\", bold);\n\t\t\tnameCell.addElement(name);\n\t\t\t\n\t\t\tPdfPCell devisorCell = new PdfPCell();\n\t\t\tdevisorCell.setBorder(Rectangle.NO_BORDER);\n\t\t\tPhrase devisor = new Phrase(\"Devisor\", bold);\n\t\t\tdevisorCell.addElement(devisor);\n\t\t\t\n\t\t\tt.addCell(nameCell);\n\t\t\tt.addCell(devisorCell);\n\t\t}\n\t\ttry {\n\t\t\tResultSet results = db.searchTableByName(table, \"\", true);\n\t\t\twhile(results.next()) {\n\t\t\t\t// add album info to table\n\t\t\t\tif (state.equals(\"a\")) {\n\t\t\t\t\tt.addCell(results.getString(\"name\"));\n\t\t\t\t\tt.addCell(results.getString(\"artist\"));\n\t\t\t\t}\n\t\t\t\t// add publication info to table\n\t\t\t\telse if (state.equals(\"p\")) {\n\t\t\t\t\tt.addCell(results.getString(\"name\"));\n\t\t\t\t\tt.addCell(results.getString(\"devisor\"));\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn t;\n\t}",
"public HashTableChained() {\r\n tableSize = 101;\r\n table = new DList[tableSize];\r\n for (int i = 0; i < tableSize; i++) {\r\n table[i] = new DList<Entry<K, V>>();\r\n }\r\n size = 0;\r\n }",
"public Row(BaseTable table) {\n this.table = table;\n }",
"private void createTable() {\n table = new Table();\n table.bottom();\n table.setFillParent(true);\n }",
"private void createTable() {\n\t\tfreqTable = new TableView<>();\n\n\t\tTableColumn<WordFrequency, Integer> column1 = new TableColumn<WordFrequency, Integer>(\"No.\");\n\t\tcolumn1.setCellValueFactory(new PropertyValueFactory<WordFrequency, Integer>(\"serialNumber\"));\n\n\t\tTableColumn<WordFrequency, String> column2 = new TableColumn<WordFrequency, String>(\"Word\");\n\t\tcolumn2.setCellValueFactory(new PropertyValueFactory<WordFrequency, String>(\"word\"));\n\n\t\tTableColumn<WordFrequency, Integer> column3 = new TableColumn<WordFrequency, Integer>(\"Count\");\n\t\tcolumn3.setCellValueFactory(new PropertyValueFactory<WordFrequency, Integer>(\"count\"));\n\n\t\tList<TableColumn<WordFrequency, ?>> list = new ArrayList<TableColumn<WordFrequency, ?>>();\n\t\tlist.add(column1);\n\t\tlist.add(column2);\n\t\tlist.add(column3);\n\n\t\tfreqTable.getColumns().addAll(list);\n\t}",
"public HtmlTableCell(){\n\n }",
"public BasicTable(String name) {\n setId(name);\n }",
"public Creator_4_tables() {\n// this.sourceUnits = sourceUnits;\n sourceUnits = new HashMap<String, PojoSourceCreatorUnit>();\n sourceTemplatePool.logEnvOnSrcCreate = app.cfg.getCfgBean().logEnvOnSrcCreate;\n env.setLogLeading(\"--cfenv--\");\n }",
"public HtmlTable createTable() {\n\t\tHtmlTable table = null;\n\t\tif (recordList != null) {\n\t\t\ttable = new HtmlTable();\n\t\t\tint irow = 0;\n\t\t\tfor (CSVRecord record : recordList) {\n\t\t\t\tHtmlTr tr = createTr(record, irow);\n\t\t\t\ttable.appendChild(tr);\n\t\t\t\tirow++;\n\t\t\t}\n\t\t}\n\t\treturn table;\n\t}",
"public DynamicSchemaTable() {\n this(\"dynamic_schema\", null);\n }",
"public TdRuspHijo() { }",
"public EditingTable() {\n\t\tsuper();\n\t\tinitialize();\n\t}",
"public DatabaseTable(String tableName, String sequenceName) {\n this.tableName = tableName;\n this.sequenceName = sequenceName;\n }",
"public BaseLootTableProvider(DataGenerator dataGeneratorIn) {\n super(dataGeneratorIn);\n this.generator = dataGeneratorIn;\n }",
"Table8 create(Table8 table8);",
"Table getBaseTable();",
"public TableFactory getTableFactory() { return new BasicTableFactory(); }",
"public TableRow() {\n\t\tthis.cells = new ArrayList<TableCell>();\n\t}",
"public TableGeneratorsCellRenderer(CodeGenerator[] codeGenerators) {\n super();\n this.codeGenerators = codeGenerators;\n }",
"public MyHashTable() {\n\t\tthis(DefaultCapacity);\n\t}",
"public TwoTieredTable(String name) \n\t{\n\t\tthis.name = name;\n\t}",
"public TableForm() {\n initComponents();\n \n setMyTable();\n }",
"public TableDefinition(Class<T> model){\n this.singleton = this;\n this.model = model;\n try {\n OBJECT = Class.forName(model.getName());\n createTableDefinition();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"tbls createtbls();",
"public SymbolTable(){\r\n\t\tthis(INIT_CAPACITY);\r\n\t}",
"public SwitchColTable() {\r\r\r\r\n }",
"TD createTD();",
"private void initTable() {\n \t\t// init table\n \t\ttable.setCaption(TABLE_CAPTION);\n \t\ttable.setPageLength(10);\n \t\ttable.setSelectable(true);\n \t\ttable.setRowHeaderMode(Table.ROW_HEADER_MODE_INDEX);\n \t\ttable.setColumnCollapsingAllowed(true);\n \t\ttable.setColumnReorderingAllowed(true);\n \t\ttable.setSelectable(true);\n \t\t// this class handles table actions (see handleActions method below)\n \t\ttable.addActionHandler(this);\n \t\ttable.setDescription(ACTION_DESCRIPTION);\n \n \t\t// populate Toolkit table component with test SQL table rows\n \t\ttry {\n \t\t\tQueryContainer qc = new QueryContainer(\"SELECT * FROM employee\",\n \t\t\t\t\tsampleDatabase.getConnection());\n \t\t\ttable.setContainerDataSource(qc);\n \t\t} catch (SQLException e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t\t// define which columns should be visible on Table component\n \t\ttable.setVisibleColumns(new Object[] { \"FIRSTNAME\", \"LASTNAME\",\n \t\t\t\t\"TITLE\", \"UNIT\" });\n \t\ttable.setItemCaptionPropertyId(\"ID\");\n \t}",
"public void createTapTable(TableConfig tableConfig) throws ConfigurationException;",
"public Time_table() {\n initComponents();\n }",
"HashTable() {\n int trueTableSize = nextPrime(tableSize);\n HT = new FlightDetails[nextPrime(trueTableSize)];\n }",
"BTable createBTable();",
"@Override\n public Iterator<Iterable<T>> iterator() {\n return new TableIterator();\n }",
"public DataTable(JTable t) {\r\n initComponents();\r\n setupComponents(t);\r\n }",
"public HighScoreTable(){\r\n\r\n\t}",
"TableImpl(int id) {\n this.id = id;\n }",
"Table getTable();",
"public DatabaseTable(DatabaseTable table) {\n tableName = table.getTableName();\n sequenceName = table.getSequenceName();\n Iterator i = table.getColumns().iterator();\n while (i.hasNext()) {\n DatabaseColumn thisColumn = (DatabaseColumn) i.next();\n DatabaseColumn column = new DatabaseColumn(thisColumn);\n this.addColumn(column);\n }\n }",
"public DebugTableModel() {\r\n }",
"public TableInfo (String tableName)\n\t\t{\n\t\t\tthis (tableName, null);\n\t\t}",
"public PgTable(final String name) {\n this.name = name;\n }",
"public HashTableChained() {\n sizeBucket = 101;\n defTable = new DList[sizeBucket];\n for(int i=0; i<sizeBucket; i++) {\n defTable[i] = new DList();\n }\n size = 0;\n }",
"public Generator(){}",
"protected void constructTable(Logger l, Statement s, int run)\n throws SQLException{\n createTable(s, run);\n insertResults(l,s,run);\n }",
"public LookupTable() {\r\n initComponents();\r\n txtPageSize.setText(BeanUtil.concat(pageSize));\r\n }",
"protected void constructTable(Logger l, Statement s, int run)\n throws SQLException{\n createTable(s, run);\n insertResults(l,s,run);\n }"
]
| [
"0.74029636",
"0.7046618",
"0.7021383",
"0.6750472",
"0.6683207",
"0.66281873",
"0.6579418",
"0.6552444",
"0.65466875",
"0.652443",
"0.65218717",
"0.64639056",
"0.6462848",
"0.6461612",
"0.6457531",
"0.6438509",
"0.6424137",
"0.6424129",
"0.6421649",
"0.63424337",
"0.6325035",
"0.63103986",
"0.630218",
"0.6296537",
"0.6289323",
"0.6285992",
"0.6263477",
"0.6263453",
"0.62414956",
"0.6225612",
"0.62134707",
"0.62098515",
"0.6166487",
"0.6149004",
"0.6142539",
"0.61354786",
"0.6124438",
"0.61214393",
"0.6110968",
"0.61019516",
"0.60826695",
"0.60601395",
"0.6020282",
"0.6008484",
"0.5996039",
"0.5975685",
"0.5967964",
"0.5959752",
"0.59551114",
"0.59478986",
"0.59391016",
"0.59367836",
"0.59360385",
"0.59180635",
"0.59161514",
"0.59153754",
"0.5912717",
"0.5908906",
"0.59006006",
"0.5893606",
"0.58891356",
"0.5885265",
"0.58850163",
"0.586753",
"0.5866575",
"0.58660567",
"0.58635956",
"0.58612174",
"0.58592135",
"0.584676",
"0.58444554",
"0.5836373",
"0.5830491",
"0.58271366",
"0.58260596",
"0.58179426",
"0.5816048",
"0.5812352",
"0.5812197",
"0.5809204",
"0.5807735",
"0.58075285",
"0.58022046",
"0.5799507",
"0.57956547",
"0.5795475",
"0.57801837",
"0.5768446",
"0.5765189",
"0.5757664",
"0.57437396",
"0.57383806",
"0.57251614",
"0.5706587",
"0.57059646",
"0.57022846",
"0.56975853",
"0.56934226",
"0.5692049",
"0.5689852"
]
| 0.81141806 | 0 |
Private methods process element type definitions | public void generateDTD(InputSource src)
throws Exception
{
DTDParser parser = new DTDParser();
DTD dtd;
dtd = parser.parseExternalSubset(src, null);
processElementTypes(dtd);
System.out.println(createAllTablesQuery);
FileWriter catq= new FileWriter("createAllTables.sql");
catq.write(createAllTablesQuery);
catq.close();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"TypeElement getTypeElement();",
"protected void processTypes()\n {\n wsdl.setWsdlTypes(new XSModelTypes());\n }",
"public void setElementType(String element_type) {\n\t\tthis.element_type = element_type;\n\t}",
"void visitElement_issue_type(org.w3c.dom.Element element) { // <issue-type>\n // element.getValue();\n org.w3c.dom.NamedNodeMap attrs = element.getAttributes();\n for (int i = 0; i < attrs.getLength(); i++) {\n org.w3c.dom.Attr attr = (org.w3c.dom.Attr)attrs.item(i);\n if (attr.getName().equals(\"name\")) { // <issue-type name=\"???\">\n list.issueTypes.add(attr.getValue());\n }\n }\n org.w3c.dom.NodeList nodes = element.getChildNodes();\n for (int i = 0; i < nodes.getLength(); i++) {\n org.w3c.dom.Node node = nodes.item(i);\n switch (node.getNodeType()) {\n case org.w3c.dom.Node.CDATA_SECTION_NODE:\n // ((org.w3c.dom.CDATASection)node).getData();\n break;\n case org.w3c.dom.Node.ELEMENT_NODE:\n org.w3c.dom.Element nodeElement = (org.w3c.dom.Element)node;\n break;\n case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE:\n // ((org.w3c.dom.ProcessingInstruction)node).getTarget();\n // ((org.w3c.dom.ProcessingInstruction)node).getData();\n break;\n }\n }\n }",
"ElementType getElementType();",
"public void parseTypeInfo( Element element, GraphObject go ) {\n NodeList elems = element.getElementsByTagName( \"label\" );\n if ( elems != null && elems.getLength() > 0 ) {\n String label = elems.item( 0 ).getTextContent();\n ( (GNode)go ).setTypeLabel( label );\n }\n ArrayList<AbstractTypeDescriptor> descriptors = new ArrayList<>();\n elems = element.getElementsByTagName( GenericTypeDescriptor.getTagName() );\n if ( elems != null && elems.getLength() > 0 ) {\n for ( int n = 0; n < elems.getLength(); n++ ) {\n AbstractTypeDescriptor descr = GenericTypeDescriptor.getInstanceFromXMLDOM( (Element)elems.item( 0 ) );\n descriptors.add( descr );\n }\n }\n elems = element.getElementsByTagName( WordnetTypeDescriptor.getTagName() );\n if ( elems != null && elems.getLength() > 0 ) {\n for ( int n = 0; n < elems.getLength(); n++ ) {\n AbstractTypeDescriptor descr = WordnetTypeDescriptor.getInstanceFromXMLDOM( (Element)elems.item( 0 ) );\n descriptors.add( descr );\n }\n }\n ( (GNode)go ).setTypeDescriptors( descriptors.toArray( new AbstractTypeDescriptor[ descriptors.size() ] ) );\n }",
"protected abstract Type loadDefaultElement();",
"void visitElement_issue_types(org.w3c.dom.Element element) { // <issue-types>\n // element.getValue();\n org.w3c.dom.NodeList nodes = element.getChildNodes();\n for (int i = 0; i < nodes.getLength(); i++) {\n org.w3c.dom.Node node = nodes.item(i);\n switch (node.getNodeType()) {\n case org.w3c.dom.Node.CDATA_SECTION_NODE:\n // ((org.w3c.dom.CDATASection)node).getData();\n break;\n case org.w3c.dom.Node.ELEMENT_NODE:\n org.w3c.dom.Element nodeElement = (org.w3c.dom.Element)node;\n if (nodeElement.getTagName().equals(\"issue-type\")) {\n visitElement_issue_type(nodeElement);\n }\n break;\n case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE:\n // ((org.w3c.dom.ProcessingInstruction)node).getTarget();\n // ((org.w3c.dom.ProcessingInstruction)node).getData();\n break;\n }\n }\n }",
"private void buildTypeInformation(final Device device,\n final XMLStreamReader reader)\n throws XMLStreamException, ParsingException {\n String name;\n int numberOfElementsInTypeTag = 0;\n while (reader.hasNext()) {\n int type = reader.next();\n switch (type) {\n case XMLStreamReader.START_ELEMENT:\n name = reader.getLocalName();\n switch (Parameter.valueOf(name.toUpperCase())) {\n case POWERUSAGE:\n device.getType().setPowerUsage(Double\n .parseDouble(getXMLText(reader)));\n break;\n case GROUPOFCOMPLECTS:\n device.getType().setGroupOfComplects(getXMLText(\n reader));\n break;\n default:\n throw new ParsingException(\"Using of illegal tag!\");\n }\n break;\n case XMLStreamReader.END_ELEMENT:\n if (numberOfElementsInTypeTag == 1) {\n return;\n }\n numberOfElementsInTypeTag++;\n break;\n default:\n break;\n }\n }\n }",
"Type getElementType();",
"Element getGenericElement();",
"@Override\r\n \tpublic int getElementType() {\r\n \t\treturn 0; \r\n \t}",
"MediaPackageElement.Type getElementType();",
"ElementDefinition createElementDefinition();",
"public Class getType(ElementList element) {\r\n return element.type();\r\n }",
"ElementSetNameType createElementSetNameType();",
"@Override\r\n\tpublic void visit(TypedefDefinition typedefDefinition) {\n\r\n\t}",
"protected abstract void onElementRegistered(Level level, T element);",
"void simpleContent(ComplexTypeSG type) throws SAXException;",
"@Override\n public void parseXml(Element ele, LoadContext lc) {\n\n }",
"DOMType() {\n // Constructs an empty type node\n }",
"private void processElement(Element element) {\n\n\t\tprocessBaseAnnotatins(element);\n\n//\t\tSystem.out.println(\" ===> Get all annotations \");\n\n\t\tfor (AnnotationMirror annotationMirror : elementUtils.getAllAnnotationMirrors(element)) {\n//\t\t\tSystem.out.println(\" ===> \" + annotationMirror);\n\t\t\tString annotationName = annotationMirror.getAnnotationType().asElement().toString();\n\t\t\tString annotationPackage = annotationMirror.getAnnotationType().asElement().getEnclosingElement()\n\t\t\t\t\t.toString();\n\n\t\t\tif (!baseAnnotations.contains(annotationName) && !annotationPackage.startsWith(\"java.lang.annotation\")) {\n\t\t\t\tprocessAdditionalAnnotation(annotationMirror);\n\t\t\t}\n\t\t}\n\t}",
"protected void parseElements(XmlElement processElement) {\n\n parseStartEvents(processElement);\n parseActivities(processElement);\n parseEndEvents(processElement);\n parseSequenceFlow(processElement);\n }",
"void startComplexContent(ComplexTypeSG type) throws SAXException;",
"public String getElementType() {\n\t\treturn (element_type);\n\t}",
"private void serializeOutOfTypeSystemElements() throws SAXException {\n if (cds.marker != null) {\n return;\n }\n if (cds.sharedData == null) {\n return;\n }\n Iterator<OotsElementData> it = cds.sharedData.getOutOfTypeSystemElements().iterator();\n while (it.hasNext()) {\n OotsElementData oed = it.next();\n workAttrs.clear();\n // Add ID attribute\n addIdAttribute(workAttrs, oed.xmiId);\n\n // Add other attributes\n Iterator<XmlAttribute> attrIt = oed.attributes.iterator();\n while (attrIt.hasNext()) {\n XmlAttribute attr = attrIt.next();\n addAttribute(workAttrs, attr.name, attr.value);\n }\n // debug\n if (oed.elementName.qName.endsWith(\"[]\")) {\n Misc.internalError(new Exception(\n \"XMI Cas Serialization: out of type system data has type name ending with []\"));\n }\n // serialize element\n startElement(oed.elementName, workAttrs, oed.childElements.size());\n\n // serialize features encoded as child elements\n Iterator<XmlElementNameAndContents> childElemIt = oed.childElements.iterator();\n while (childElemIt.hasNext()) {\n XmlElementNameAndContents child = childElemIt.next();\n workAttrs.clear();\n Iterator<XmlAttribute> attrIter = child.attributes.iterator();\n while (attrIter.hasNext()) {\n XmlAttribute attr = attrIter.next();\n addAttribute(workAttrs, attr.name, attr.value);\n }\n\n if (child.contents != null) {\n startElement(child.name, workAttrs, 1);\n addText(child.contents);\n } else {\n startElement(child.name, workAttrs, 0);\n }\n endElement(child.name);\n }\n\n endElement(oed.elementName);\n }\n }",
"TypeDescription validated();",
"public final Type element_type() throws RecognitionException {\r\n Type type = null;\r\n\r\n\r\n Token INTEGER_TYPE109=null;\r\n Type id_type110 =null;\r\n\r\n\r\n try {\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:661:5: ( BOOLEAN_TYPE | INTEGER_TYPE | FLOATING_POINT_TYPE | id_type )\r\n int alt89=4;\r\n switch ( input.LA(1) ) {\r\n case BOOLEAN_TYPE:\r\n {\r\n alt89=1;\r\n }\r\n break;\r\n case INTEGER_TYPE:\r\n {\r\n alt89=2;\r\n }\r\n break;\r\n case FLOATING_POINT_TYPE:\r\n {\r\n alt89=3;\r\n }\r\n break;\r\n case LOCAL_VARIABLE:\r\n {\r\n alt89=4;\r\n }\r\n break;\r\n default:\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 89, 0, input);\r\n\r\n throw nvae;\r\n\r\n }\r\n\r\n switch (alt89) {\r\n case 1 :\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:661:7: BOOLEAN_TYPE\r\n {\r\n match(input,BOOLEAN_TYPE,FOLLOW_BOOLEAN_TYPE_in_element_type3735); \r\n\r\n type = typeFactory.getInt1Type();\r\n\r\n }\r\n break;\r\n case 2 :\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:662:7: INTEGER_TYPE\r\n {\r\n INTEGER_TYPE109=(Token)match(input,INTEGER_TYPE,FOLLOW_INTEGER_TYPE_in_element_type3745); \r\n\r\n String is = (INTEGER_TYPE109!=null?INTEGER_TYPE109.getText():null); is = is.substring(1, is.length());int i =Integer.parseInt(is);\r\n if(i == 8){\r\n type = typeFactory.getInt8Type();\r\n }else if(i == 16){\r\n type = typeFactory.getInt16Type();\r\n }else if(i == 32){\r\n type = typeFactory.getInt32Type();\r\n }else if(i == 64){\r\n type = typeFactory.getInt64Type();\r\n }else{\r\n type = typeFactory.getIntNType(i);\r\n }\r\n \r\n\r\n }\r\n break;\r\n case 3 :\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:675:7: FLOATING_POINT_TYPE\r\n {\r\n match(input,FLOATING_POINT_TYPE,FOLLOW_FLOATING_POINT_TYPE_in_element_type3755); \r\n\r\n type = typeFactory.getFloatType();\r\n\r\n }\r\n break;\r\n case 4 :\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:676:7: id_type\r\n {\r\n pushFollow(FOLLOW_id_type_in_element_type3765);\r\n id_type110=id_type();\r\n\r\n state._fsp--;\r\n\r\n\r\n type = id_type110;\r\n\r\n }\r\n break;\r\n\r\n }\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n\r\n finally {\r\n \t// do for sure before leaving\r\n }\r\n return type;\r\n }",
"public final void setElementType(solarpowerconversioncalculator.proxies.ElementType elementtype)\n\t{\n\t\tsetElementType(getContext(), elementtype);\n\t}",
"public interface CCRDocumentTypes extends DocumentTypes{\n\tpublic String MEDCOMMONS_AFFINITY_DOMAIN = \"MedCommons Patient Identifier\";\n\n public String CCR_CHANGE_NOTIFICATION_STATUS_PENDING = \"Pending\";\n \n public String CCR_CHANGE_NOTIFICATION_STATUS_NOTIFIED = \"Notified\";\n\n public static final String MEDCOMMONS_PATIENT_ID_TYPE = \"MedCommons Account Id\";\n\n\t\n\t/**\n\t * The URN of the namespace for CCR documents. This is the value that appears\n\t * in the XML header.\n\t */\n\tpublic static final String CCR_NAMESPACE_URN = \"urn:astm-org:CCR\";\n\n\t/**\n\t * Location of the XSD on disk\n\t */\n\tpublic static String XSD_LOCATION = \"conf/CCR_20051109.xsd\";\n\t\n\t/**\n\t * The URI of the namespace for CCR documents. This is the value that is returned by \n\t * the JDOM getNamespaceURI() method.\n\t */\n\tpublic static final String CCR_NAMESPACE_URI = \"uri:\" + CCR_NAMESPACE_URN;\n\t\n\t/**\n\t * Schema validation OFF - only unvalidated parsing performed.\n\t */\n\tpublic final static String SCHEMA_VALIDATION_OFF = \"OFF\";\n\t/**\n\t * Schema validation LENIENT - CCRs are parsed; validation errors returned as warning messages but\n\t * processing proceeds.\n\t */\n\tpublic final static String SCHEMA_VALIDATION_LENIENT = \"LENIENT\";\n\t\n\t/**\n\t * Schema validation STRICT - Any schema validation failures return an error.\n\t */\n\tpublic final static String SCHEMA_VALIDATION_STRICT = \"STRICT\";\n\n}",
"public void visit(BinCITypesDefStatement x) {\n }",
"private void processTypes(Node root) {\n\t\tfinal boolean newContext =\n\t\t\t(root instanceof Block || root instanceof ForLoop);\n\n\t\tif (newContext) {\n\t\t\tthis.variableMaps\n\t\t\t\t.push(new VariableTypeMap(this.variableMaps.peek()));\n\t\t}\n\n\t\tif (!root.getChildren().isEmpty()) {\n\t\t\tfor (int i = 0; i < root.getChildren().size(); ++i) {\n\t\t\t\tNode child = root.getChildren().get(i);\n\t\t\t\tif (root instanceof Call call && (!call.isPrimary() && i == 0\n\t\t\t\t\t|| call.isPrimary() && i == 1)) {\n\t\t\t\t\t// Skip the method name lookup\n\t\t\t\t\tchild.setType(Type.unknownType());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tthis.processTypes(child);\n\t\t\t}\n\t\t}\n\t\troot.process(this);\n\n\t\tif (newContext) {\n\t\t\tthis.variableMaps.pop();\n\t\t}\n\t}",
"public LighterTypes(Types base, Elements elements) {\n this.baseTypes = base;\n this.elements = elements;\n }",
"public void generateTypesForXSD(ParameterMetaData pmd) throws IOException\n {\n QName xmlType = pmd.getXmlType();\n if(xmlType.getNamespaceURI().equals(Constants.NS_SCHEMA_XSD) == false)\n generateType(xmlType, pmd.getJavaType(), buildElementNameMap(pmd));\n\n if (pmd.getOperationMetaData().getStyle() == Style.DOCUMENT || pmd.isInHeader())\n generateElement(pmd.getXmlName(), xmlType);\n\n //Attachment type\n if(pmd.isSwA())\n wsdl.registerNamespaceURI(Constants.NS_SWA_MIME, \"mime\");\n }",
"private void retrieveAll(Definition def)\r\n\t{\n\t\t\r\n\t\t\r\n\t\tjavax.wsdl.Types types=def.getTypes();\r\n\t\tif(types==null) return;\r\n\t\t\r\n\t\tSchema sch=(Schema) def.getTypes().getExtensibilityElements().get(0);\r\n\t\tElement elm=sch.getElement();\r\n\t\tString tns=sch.getElement().getAttribute(\"targetNamespace\");\r\n\t\t\r\n\t\tNodeList nl=elm.getChildNodes();\t\t\r\n\t\tElement elmnt;\r\n\t\tnsInc++;\r\n\t\tfor(int i=0;i<nl.getLength();i++)\r\n\t\t{\r\n\t\t\t\r\n\t\t\tif (checkElementName(nl.item(i), \"element\" ))\r\n\t\t\t{\r\n\t\t\t\telmnt=(Element)(nl.item(i));\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\tOMElement omm=\tcreateOMFromSchema((Element)nl.item(i),tns);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\tQName qname=new QName(tns,elmnt.getAttribute(\"name\"));//omm.getNamespace().getPrefix());\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\ttmpNameAndType.put(qname, omm);\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}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\r\n\t}",
"private void parseElement(String type, List<Identifier> identifiers,\n\t\t\tList<Name> names, List<Location> locations,\n\t\t\tList<RelatedObject> relatedObjects, List<Subject> subjects,\n\t\t\tList<Description> descriptions, List<Coverage> coverages,\n\t\t\tList<RelatedInfo> relatedInfos, List<Right> rights,\n\t\t\tList<ExistenceDate> existenceDates,\n\t\t\tList<CitationInfo> citationInfos, List<AccessPolicy> accessPolicies) {\n\t\tif (type != null && !type.isEmpty()) {\n\t\t\tthis.data.put(\"type\", type);\n\t\t}\n\n\t\t// get the identifiers for rifcs element\n\t\tif (identifiers != null && !identifiers.isEmpty()) {\n\t\t\tparseIdentifiersForRIFCSElement(identifiers);\n\t\t}\n\n\t\t// get names and nameparts for rifcs element\n\t\tif (names != null && !names.isEmpty()) {\n\t\t\tparseNamesForRIFCSElement(names);\n\t\t}\n\n\t\t// get locations for rifcs element\n\t\tif (locations != null && !locations.isEmpty()) {\n\t\t\tparseLocationsForRIFCSElement(locations);\n\t\t}\n\n\t\t// get the related objects for rifcs element\n\t\tif (relatedObjects != null && !relatedObjects.isEmpty()) {\n\t\t\tparseRelatedObjectsForRIFCSElement(relatedObjects);\n\t\t}\n\n\t\t// get the subjects for rifcs element\n\t\tif (subjects != null && !subjects.isEmpty()) {\n\t\t\tboolean isMultiple = \"person\".equals(type);\n\t\t\tparseSubjectsForRIFCSElement(subjects, isMultiple);\n\t\t}\n\n\t\t// get the descriptions for rifcs element\n\t\tif (descriptions != null && !descriptions.isEmpty()) {\n\t\t\tparseDescriptionsForRIFCSElement(descriptions);\n\t\t}\n\n\t\t// get the related info for rifcs element\n\t\tif (relatedInfos != null && !relatedInfos.isEmpty()) {\n\t\t\tparseRelatedInfosForRIFCSElement(relatedInfos);\n\t\t}\n\n\t\t// get the existance dates for rifcs element\n\t\tif (existenceDates != null && !existenceDates.isEmpty()) {\n\t\t\tparseExistenceDatesForRIFCSElement(existenceDates);\n\t\t}\n\n//\t\t// get the coverages for rifcs element\n//\t\tif (coverages != null && !coverages.isEmpty()) {\n//\t\t\tparseCoveragesForRIFCSElement(coverages);\n//\t\t}\n\n//\t\t// get the right for rifcs element\n//\t\tif (rights != null && !rights.isEmpty()) {\n//\t\t\tparseRightsForRIFCSElement(rights);\n//\t\t}\n\n//\t\t// get the citation info for rifcs element\n//\t\tif (citationInfos != null && !citationInfos.isEmpty()) {\n//\t\t\tparseCitationInfosForRIFCSElement(citationInfos);\n//\t\t}\n\n//\t\t// get the access policy for rifcs element\n//\t\tif (accessPolicies != null && !accessPolicies.isEmpty()) {\n//\t\t\tparseAccessPoliciesForRIFCSElement(accessPolicies);\n//\t\t}\n\t}",
"public static ExaminationType_type0 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{\n ExaminationType_type0 object = null;\n // initialize a hash map to keep values\n java.util.Map attributeMap = new java.util.HashMap();\n java.util.List extraAttributeList = new java.util.ArrayList<org.apache.axiom.om.OMAttribute>();\n \n\n int event;\n java.lang.String nillableValue = null;\n java.lang.String prefix =\"\";\n java.lang.String namespaceuri =\"\";\n try {\n \n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n\n \n\n \n // Note all attributes that were handled. Used to differ normal attributes\n // from anyAttributes.\n java.util.Vector handledAttributes = new java.util.Vector();\n \n\n \n while(!reader.isEndElement()) {\n if (reader.isStartElement() || reader.hasText()){\n \n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\"nil\");\n if (\"true\".equals(nillableValue) || \"1\".equals(nillableValue)){\n throw new org.apache.axis2.databinding.ADBException(\"The element: \"+\"ExaminationType_type0\" +\" cannot be null\");\n }\n \n\n java.lang.String content = reader.getElementText();\n \n if (content.indexOf(\":\") > 0) {\n // this seems to be a Qname so find the namespace and send\n prefix = content.substring(0, content.indexOf(\":\"));\n namespaceuri = reader.getNamespaceURI(prefix);\n object = ExaminationType_type0.Factory.fromString(content,namespaceuri);\n } else {\n // this seems to be not a qname send and empty namespace incase of it is\n // check is done in fromString method\n object = ExaminationType_type0.Factory.fromString(content,\"\");\n }\n \n \n } else {\n reader.next();\n } \n } // end of while loop\n \n\n\n\n } catch (javax.xml.stream.XMLStreamException e) {\n throw new java.lang.Exception(e);\n }\n\n return object;\n }",
"private static interface DefDocumentProcessor\n\t{\n\t\t/**\n\t\t * Called for every element found during processing of the s.t.\n\t\t * path.\n\t\t * @param documentPath an abstract pathname of the document\n\t\t * @throws XMLFormatException if document appears to be corrupted\n\t\t */\n\t\tvoid processElement(File documentPath) \n\t\t\tthrows XMLFormatException;\n\t}",
"public Class getType(ElementMap element) {\r\n return element.valueType();\r\n }",
"String getModeledType(Object elementID) throws Exception;",
"public static ExaminationType_type1 parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{\n ExaminationType_type1 object = null;\n // initialize a hash map to keep values\n java.util.Map attributeMap = new java.util.HashMap();\n java.util.List extraAttributeList = new java.util.ArrayList<org.apache.axiom.om.OMAttribute>();\n \n\n int event;\n java.lang.String nillableValue = null;\n java.lang.String prefix =\"\";\n java.lang.String namespaceuri =\"\";\n try {\n \n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n\n \n\n \n // Note all attributes that were handled. Used to differ normal attributes\n // from anyAttributes.\n java.util.Vector handledAttributes = new java.util.Vector();\n \n\n \n while(!reader.isEndElement()) {\n if (reader.isStartElement() || reader.hasText()){\n \n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\"nil\");\n if (\"true\".equals(nillableValue) || \"1\".equals(nillableValue)){\n throw new org.apache.axis2.databinding.ADBException(\"The element: \"+\"ExaminationType_type0\" +\" cannot be null\");\n }\n \n\n java.lang.String content = reader.getElementText();\n \n if (content.indexOf(\":\") > 0) {\n // this seems to be a Qname so find the namespace and send\n prefix = content.substring(0, content.indexOf(\":\"));\n namespaceuri = reader.getNamespaceURI(prefix);\n object = ExaminationType_type1.Factory.fromString(content,namespaceuri);\n } else {\n // this seems to be not a qname send and empty namespace incase of it is\n // check is done in fromString method\n object = ExaminationType_type1.Factory.fromString(content,\"\");\n }\n \n \n } else {\n reader.next();\n } \n } // end of while loop\n \n\n\n\n } catch (javax.xml.stream.XMLStreamException e) {\n throw new java.lang.Exception(e);\n }\n\n return object;\n }",
"void endComplexContent(ComplexTypeSG type) throws SAXException;",
"public TypeElement getTypeElement() {\n return this.te;\n }",
"protected abstract void fromXmlEx(Element source)\n throws PSUnknownNodeTypeException;",
"void visit(DocumentType documentType);",
"protected void parseClassElements(TypeDeclaration argType,\r\n\t\t\tIClassCodeGenConfig argDaoConfig,\r\n\t\t\tMap<String, String> argImportClasses) {\r\n\t\tList<BodyDeclaration> bodys = argType.getMembers();\r\n\t\tif (bodys != null) {\r\n\r\n\t\t\t// Get DO class name.\r\n\t\t\tString doPackagePath = getRelativePackageForClass(\r\n\t\t\t\t\targDaoConfig.getPackagePath(), CODEGEN_DO_PACKAGE_PATH);\r\n\t\t\tString doName = getDOName(argDaoConfig.getName());\r\n\t\t\tString doClassName = doPackagePath + \".\" + doName;\r\n\r\n\t\t\tfor (BodyDeclaration bodyDeclar : bodys) {\r\n\t\t\t\tif (bodyDeclar instanceof MethodDeclaration) {\r\n\r\n\t\t\t\t\tMethodDeclaration md = (MethodDeclaration) bodyDeclar;\r\n\r\n\t\t\t\t\t// method's name\r\n\t\t\t\t\tString methodName = md.getName();\r\n\r\n\t\t\t\t\t// comment's map\r\n\t\t\t\t\tMap<String, String> commentsMap = getCommentForClassElement(md);\r\n\r\n\t\t\t\t\tMethodConfig methodConfig = new MethodConfig();\r\n\t\t\t\t\tmethodConfig.setName(methodName);\r\n\r\n\t\t\t\t\t// add annotations for the method\r\n\t\t\t\t\taddAnnotationForConfig(md.getAnnotations(), methodConfig);\r\n\r\n\t\t\t\t\tString returnType = getReturnType(methodConfig, doClassName);\r\n\t\t\t\t\tString mdReturnType = md.getType().toString();\r\n\r\n\t\t\t\t\tif (!StringUtils.isEmpty(returnType)) {\r\n\t\t\t\t\t\treturnType = getClassNameFromImportClasses(returnType,\r\n\t\t\t\t\t\t\t\targImportClasses);\r\n\t\t\t\t\t\tmethodConfig.setReturnType(returnType);\r\n\t\t\t\t\t\targDaoConfig.setOverride();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\treturnType = getClassNameFromImportClasses(\r\n\t\t\t\t\t\t\t\tmdReturnType, argImportClasses);\r\n\t\t\t\t\t\tmethodConfig.setReturnType(mdReturnType);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// add import class for all elements in class.\r\n\t\t\t\t\taddImportClassForConfig(methodConfig, returnType,\r\n\t\t\t\t\t\t\targImportClasses);\r\n\r\n\t\t\t\t\t// Set method's comment and return's comment.\r\n\t\t\t\t\tCommentConfig methodComment = new CommentConfig();\r\n\t\t\t\t\tmethodComment.setValue(commentsMap.get(METHOD_COMMENT));\r\n\t\t\t\t\tmethodConfig.setConfigObject(CommentConfig.MAIN_TAG,\r\n\t\t\t\t\t\t\tmethodComment);\r\n\t\t\t\t\tmethodConfig.setReturnComment(commentsMap\r\n\t\t\t\t\t\t\t.get(RETURN_COMMENT));\r\n\r\n\t\t\t\t\tparseParameters(md, methodConfig, commentsMap, doClassName,\r\n\t\t\t\t\t\t\targDaoConfig, argImportClasses);\r\n\r\n\t\t\t\t\tparseExceptions(md, argDaoConfig, methodConfig,\r\n\t\t\t\t\t\t\tcommentsMap, doClassName);\r\n\r\n\t\t\t\t\tBlockStmt body = md.getBody();\r\n\t\t\t\t\tif (body != null) {\r\n\t\t\t\t\t\tString statement = body.toString();\r\n\t\t\t\t\t\tif (!StringUtils.isEmpty(statement)) {\r\n\t\t\t\t\t\t\tBodyConfig bodyConfig = new BodyConfig();\r\n\t\t\t\t\t\t\tstatement = CodeGenUtils.clearBrace(statement);\r\n\t\t\t\t\t\t\tbodyConfig.setValue(statement);\r\n\t\t\t\t\t\t\tmethodConfig.setConfigObject(BodyConfig.MAIN_TAG,\r\n\t\t\t\t\t\t\t\t\tbodyConfig);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// add default exception\r\n\t\t\t\t\t// addDefaultException(methodConfig,\r\n\t\t\t\t\t// CODEGEN_DAO_DEFAULT_EXCEPTION);\r\n\r\n\t\t\t\t\tmethodConfig.clearAnnotations();\r\n\r\n\t\t\t\t\t// add method configuration into the daoConfig\r\n\t\t\t\t\targDaoConfig.setConfigObject(MethodConfig.MAIN_TAG,\r\n\t\t\t\t\t\t\tmethodConfig);\r\n\t\t\t\t} else if (bodyDeclar instanceof FieldDeclaration) {\r\n\t\t\t\t\tFieldConfig fieldConfig = new FieldConfig();\r\n\r\n\t\t\t\t\tFieldDeclaration fd = (FieldDeclaration) bodyDeclar;\r\n\t\t\t\t\tString modify = ModifierSet.getModify(fd.getModifiers());\r\n\t\t\t\t\tString className = fd.getType().toString();\r\n\t\t\t\t\tif (argImportClasses.containsKey(className)) {\r\n\t\t\t\t\t\tclassName = argImportClasses.get(className);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfieldConfig.setModify(modify);\r\n\t\t\t\t\tfieldConfig.setClassName(className);\r\n\r\n\t\t\t\t\tList<VariableDeclarator> list = fd.getVariables();\r\n\t\t\t\t\tif (list != null) {\r\n\t\t\t\t\t\tfor (VariableDeclarator vd : list) {\r\n\t\t\t\t\t\t\tString name = vd.getId().getName();\r\n\t\t\t\t\t\t\tString value = null;\r\n\t\t\t\t\t\t\tif (vd.getInit() != null) {\r\n\t\t\t\t\t\t\t\tvalue = vd.getInit().toString();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tfieldConfig.setName(name);\r\n\t\t\t\t\t\t\tif (!StringUtils.isEmpty(value)) {\r\n\t\t\t\t\t\t\t\tfieldConfig.setValue(value);\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\targDaoConfig.setConfigObject(FieldConfig.MAIN_TAG,\r\n\t\t\t\t\t\t\tfieldConfig);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"IElementDef parse(ConfigSource configSource);",
"public String getElementClass ();",
"public Class getType(Element element) {\r\n Class type = element.type();\r\n \r\n if(type == void.class) {\r\n return contact.getType();\r\n }\r\n return type;\r\n }",
"public TypeParameterListNode getTypeParameters()throws ClassCastException;",
"public Integer getType()\r\n\t\t{ return element instanceof Schema ? SCHEMA : element instanceof Alias ? ALIAS : ELEMENT; }",
"public String getElementType()\n {\n return elementType;\n }",
"protected abstract void analyze(E element) throws EX;",
"public void visit(BaseNode node) {\n String type = node.getTypeName();\n if (!nodeToSearch.contains(type))\n return;\n\n if (subRule.equals(\"wsdl\") || subRule.equals(\"xsd\")) {\n validWsdl(node, ctx);\n } else if (subRule.equals(\"process\")) {\n validProcess(node, ctx);\n }\n\n }",
"protected abstract Object handleElement(Element aElement) throws AeXMLDBException;",
"public void setElementType(QName elementType) {\n this.fieldElementType = elementType;\n }",
"public final void setElementType(com.mendix.systemwideinterfaces.core.IContext context, solarpowerconversioncalculator.proxies.ElementType elementtype)\n\t{\n\t\tif (elementtype != null)\n\t\t\tgetMendixObject().setValue(context, MemberNames.ElementType.toString(), elementtype.toString());\n\t\telse\n\t\t\tgetMendixObject().setValue(context, MemberNames.ElementType.toString(), null);\n\t}",
"protected void parseRootElement() {\n\n // This is the Activiti method body for parsing through the XML object model\n // The Joda Engine needs less information than Activiti. That's why some methods are commented out.\n parseProcessDefinitions();\n }",
"public interface BeanDefinitionParser {\r\n\r\n /**\r\n * 解析element\r\n * @param element\r\n * @param beanDefinitionMap\r\n */\r\n public void parse(Element element, Map<String, BeanDefinition> beanDefinitionMap) throws IOException;\r\n}",
"@XmlAttribute(name=\"elementClass\")\n public void setElementType(String elementType)\n {\n this.elementType = elementType;\n }",
"void emptyType(ComplexTypeSG type) throws SAXException;",
"protected void normalizeElemTypeForEquiv()\r\n\t\t\tthrows RestrizioniSpecException {\r\n\t\ttry {\r\n\t\t\tScope scope = new Scope(this.archiType);\r\n\t\t\tNormalizeParts normalizeParts = new NormalizeParts(scope);\r\n\t\t\tElemType elemType = normalizeParts.normalizeElemTypeFromAEI(this.idecl);\r\n\t\t\tthis.equivalenza.setEt(elemType);\r\n\t\t\t}\r\n\t\tcatch (NormalizeException e)\r\n\t\t\t{\r\n\t\t\tthrow new RestrizioniSpecException(e);\r\n\t\t\t}\r\n\t}",
"private boolean isInnerType(IModelElement element) {\n \n \t\tif (element != null && element.getElementType() == IModelElement.TYPE) {\n \n \t\t\tIModelElement parent = element.getParent();\n \t\t\tif (parent != null) {\n \t\t\t\tint parentElementType = parent.getElementType();\n \t\t\t\treturn (parentElementType != IModelElement.SOURCE_MODULE);\n \t\t\t}\n \t\t}\n \n \t\treturn false;\n \t}",
"@SuppressWarnings(\"unchecked\")\n private void initElements() {\n\n try {\n\n Elements marker = null;\n\n for (Annotation annotation : this.getClass().getDeclaredAnnotations()) {\n if(annotation instanceof Elements) {\n marker = (Elements) annotation;\n }\n }\n\n if(marker == null) {\n String msg = \"Expected @Elements annotation on Screen class\";\n log.error(msg);\n throw new FrameworkException(msg);\n }\n\n PlatformType platform = DriverWrapper.getActivePlatform();\n Validate.notNull(platform);\n\n Class<? extends BaseElements> elementsClass = null;\n\n if(marker.elements().equals(BaseElements.class)) {\n // do we have individual iOS or Android elements?\n if(PlatformType.ANDROID == platform) {\n elementsClass = marker.androidElements();\n\n } else if(PlatformType.IOS == platform) {\n elementsClass = marker.iosElements();\n } else {\n throw new IllegalArgumentException(\"Un-supported platform\");\n }\n\n } else {\n // just take combined merged elements\n elementsClass = marker.elements();\n }\n\n if(marker.elements().equals(BaseElements.class)) {\n throw new IllegalArgumentException(\"Expected that you provide an elements class\");\n }\n\n Constructor<? extends BaseElements> constructor = elementsClass.getConstructor();\n this.elements = constructor.newInstance();\n\n PageFactory.initElements(new AppiumFieldDecorator(driver), elements);\n\n this.elements.init(driver);\n\n } catch(Exception e) {\n\n log.error(\"Failed to initialize page elements\", e);\n throw new FrameworkException(e);\n }\n }",
"XClass getElementClass();",
"public abstract jq_Type getDeclaredType();",
"void processElement(File documentPath) \n\t\t\tthrows XMLFormatException;",
"public void checkTypes() {\n this.root.accept(this);\n }",
"public TypeElement<?>[] getTypeElements() {\n\t\t\treturn (this.TypeElements.size() == 0)\n\t\t\t\t\t?EmptyTypeElements\n\t\t\t\t\t:this.TypeElements.values().toArray(EmptyTypeElements);\n\t\t}",
"private Object parseElementRaw(XmlElement element) throws Exception\n {\n ElementType type = ElementType.valueOf(element.getName().toUpperCase());\n switch (type)\n {\n case INTEGER:\n return parseInt(element.getValue());\n case REAL:\n return Double.valueOf(element.getValue());\n case STRING:\n return element.getValue();\n case DATE:\n return m_dateFormat.parse(element.getValue());\n case DATA:\n return base64decode(element.getValue());\n case ARRAY:\n return parseArray(element);\n case TRUE:\n return Boolean.TRUE;\n case FALSE:\n return Boolean.FALSE;\n case DICT:\n return parseDict(element);\n default:\n throw new RuntimeException(\"Unexpected type: \" + element.getName());\n }\n }",
"public void computeTypeIds() {\n classes.add(null);\n jsonObjects.add(new JsonObject(program));\n \n // Do java.lang.String first to reserve typeId 1 for the mashup case.\n computeSourceClass(program.getTypeJavaLangString());\n assert (classes.size() == 2);\n \n /*\n * Compute the list of classes than can successfully satisfy cast\n * requests, along with the set of types they can be successfully cast to.\n * Do it in super type order.\n */\n for (Iterator it = program.getDeclaredTypes().iterator(); it.hasNext();) {\n JReferenceType type = (JReferenceType) it.next();\n if (type instanceof JClassType) {\n computeSourceClass((JClassType) type);\n }\n }\n \n for (Iterator it = program.getAllArrayTypes().iterator(); it.hasNext();) {\n JArrayType type = (JArrayType) it.next();\n computeSourceClass(type);\n }\n \n // pass our info to JProgram\n program.initTypeInfo(classes, jsonObjects);\n program.recordQueryIds(queryIds);\n }",
"private static void addAnnotations(Elements elements, AnnotatedTypeFactory atypeFactory,\n AnnotatedTypeMirror alub,\n ArrayList<AnnotatedTypeMirror> types) {\n Set<AnnotatedTypeMirror> visited = Collections.newSetFromMap(new IdentityHashMap<AnnotatedTypeMirror,Boolean>());\n addAnnotationsImpl(elements, atypeFactory, alub, visited, types);\n }",
"private Object addElement(XmlElement e, Method method, Object[] args) {\n/* 167 */ Class<?> rt = method.getReturnType();\n/* */ \n/* */ \n/* 170 */ String nsUri = \"##default\";\n/* 171 */ String localName = method.getName();\n/* */ \n/* 173 */ if (e != null) {\n/* */ \n/* 175 */ if (e.value().length() != 0)\n/* 176 */ localName = e.value(); \n/* 177 */ nsUri = e.ns();\n/* */ } \n/* */ \n/* 180 */ if (nsUri.equals(\"##default\")) {\n/* */ \n/* 182 */ Class<?> c = method.getDeclaringClass();\n/* 183 */ XmlElement ce = c.<XmlElement>getAnnotation(XmlElement.class);\n/* 184 */ if (ce != null) {\n/* 185 */ nsUri = ce.ns();\n/* */ }\n/* */ \n/* 188 */ if (nsUri.equals(\"##default\"))\n/* */ {\n/* 190 */ nsUri = getNamespace(c.getPackage());\n/* */ }\n/* */ } \n/* */ \n/* */ \n/* 195 */ if (rt == void.class) {\n/* */ \n/* */ \n/* 198 */ boolean isCDATA = (method.getAnnotation(XmlCDATA.class) != null);\n/* */ \n/* 200 */ StartTag st = new StartTag(this.document, nsUri, localName);\n/* 201 */ addChild(st);\n/* 202 */ for (Object arg : args) {\n/* */ Text text;\n/* 204 */ if (isCDATA) { text = new Cdata(this.document, st, arg); }\n/* 205 */ else { text = new Pcdata(this.document, st, arg); }\n/* 206 */ addChild(text);\n/* */ } \n/* 208 */ addChild(new EndTag());\n/* 209 */ return null;\n/* */ } \n/* 211 */ if (TypedXmlWriter.class.isAssignableFrom(rt))\n/* */ {\n/* 213 */ return _element(nsUri, localName, rt);\n/* */ }\n/* */ \n/* 216 */ throw new IllegalSignatureException(\"Illegal return type: \" + rt);\n/* */ }",
"@Override\n public Set<ElementValidator> process(ProcessingEnvironment processingEnvironment) {\n TypeElement typeElement = element();\n if (typeElement.getKind().isInterface() || isImmutable()) {\n ElementFilter.methodsIn(typeElement.getEnclosedElements()).stream()\n .filter(this::isMethodProcessable)\n .forEach(this::computeAttribute);\n } else {\n // private/static/final members fields are skipped\n ElementFilter.fieldsIn(typeElement.getEnclosedElements()).stream()\n .filter(element -> !element.getModifiers().contains(Modifier.PRIVATE) &&\n !element.getModifiers().contains(Modifier.STATIC) &&\n (!element.getModifiers().contains(Modifier.FINAL) || isImmutable()))\n .forEach(this::computeAttribute);\n }\n\n Set<ProcessableElement<?>> elements = new LinkedHashSet<>();\n attributes().values().forEach(\n attribute -> elements.add((ProcessableElement<?>) attribute));\n\n elements.addAll(listeners.values());\n Set<ElementValidator> validations = new LinkedHashSet<>();\n elements.forEach(element -> validations.addAll(element.process(processingEnvironment)));\n\n ElementValidator validator = new ElementValidator(element(), processingEnvironment);\n Entity entity = annotationOf(Entity.class).orElse(null);\n if (entity != null &&\n !Names.isEmpty(entity.name()) && !SourceVersion.isIdentifier(entity.name())) {\n validator.error(\"Invalid class identifier \" + entity.name(), Entity.class);\n }\n if (element().getNestingKind() == NestingKind.ANONYMOUS) {\n validator.error(\"Entity annotation cannot be applied to anonymous class\");\n }\n if (element().getKind() == ElementKind.ENUM) {\n validator.error(\"Entity annotation cannot be applied to an enum class\");\n }\n if (attributes.values().isEmpty()) {\n validator.error(\"Entity contains no attributes\");\n }\n if (!isReadOnly() && attributes.values().size() == 1 &&\n attributes.values().iterator().next().isGenerated()) {\n validator.warning(\n \"Entity contains only a single generated attribute may fail to persist\");\n }\n validations.add(validator);\n return validations;\n }",
"@Override\r\n\tpublic void postVisit(ASTNode node) {\r\n\t\tif (node instanceof AbstractTypeDeclaration || node instanceof AnonymousClassDeclaration) {\r\n\t\t\tIType resolved_type = NodeBinding(node);\r\n\t\t\tboolean type_equals = resolved_type == null ? false : resolved_type.equals(it);\r\n\t\t\t// boolean has_element = irc.IsHasElement();\r\n\t\t\tif (type_equals) {// && has_element\r\n\t\t\t\tif (this.initial_node != null) {\r\n\t\t\t\t\tthis.initial_node.accept(this);\r\n\t\t\t\t}\r\n\t\t\t\t// IRGeneratorForOneProject.GetInstance().FetchITypeIR((it)).SetFieldLevel((IRForOneField)irc);\r\n\t\t\t\tIRGeneratorHelper.HandleVariablesContainerConnectToIMember(graph.GetVariableNodes(), ele_factory.UniversalElement(it));\r\n\t\t\t}\r\n\t\t}\r\n\t\tsuper.postVisit(node);\r\n\t}",
"public QName getElementType() {\n return fieldElementType;\n }",
"public Element addElement(Element rootElement,String type,Document document){\n\t\t// define school elements \n\t\tElement node = document.createElement(type); \n\t\trootElement.appendChild(node);\n\t\treturn node;\n\t}",
"public interface Member2 extends org.apache.xmlbeans.XmlAnySimpleType\n {\n java.util.List getListValue();\n java.util.List xgetListValue();\n void setListValue(java.util.List list);\n /** @deprecated */\n java.util.List listValue();\n /** @deprecated */\n java.util.List xlistValue();\n /** @deprecated */\n void set(java.util.List list);\n public static final org.apache.xmlbeans.SchemaType type = (org.apache.xmlbeans.SchemaType)\n org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(Member2.class.getClassLoader(), \"schemaorg_apache_xmlbeans.system.sXMLSCHEMA\").resolveHandle(\"anona0e6type\");\n \n /**\n * An anonymous inner XML type.\n *\n * This is a union type. Instances are of one of the following types:\n * org.apache.xmlbeans.XmlAnyURI\n * org.apache.xmlbeans.impl.xb.xsdschema.NamespaceList$Member2$Item$Member\n */\n public interface Item extends org.apache.xmlbeans.XmlAnySimpleType\n {\n java.lang.Object getObjectValue();\n void setObjectValue(java.lang.Object val);\n /** @deprecated */\n java.lang.Object objectValue();\n /** @deprecated */\n void objectSet(java.lang.Object val);\n org.apache.xmlbeans.SchemaType instanceType();\n public static final org.apache.xmlbeans.SchemaType type = (org.apache.xmlbeans.SchemaType)\n org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(Item.class.getClassLoader(), \"schemaorg_apache_xmlbeans.system.sXMLSCHEMA\").resolveHandle(\"anon16cetype\");\n \n /**\n * An anonymous inner XML type.\n *\n * This is an atomic type that is a restriction of org.apache.xmlbeans.impl.xb.xsdschema.NamespaceList$Member2$Item$Member.\n */\n public interface Member extends org.apache.xmlbeans.XmlToken\n {\n public static final org.apache.xmlbeans.SchemaType type = (org.apache.xmlbeans.SchemaType)\n org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(Member.class.getClassLoader(), \"schemaorg_apache_xmlbeans.system.sXMLSCHEMA\").resolveHandle(\"anon0c73type\");\n \n org.apache.xmlbeans.StringEnumAbstractBase enumValue();\n void set(org.apache.xmlbeans.StringEnumAbstractBase e);\n \n static final Enum TARGET_NAMESPACE = Enum.forString(\"##targetNamespace\");\n static final Enum LOCAL = Enum.forString(\"##local\");\n \n static final int INT_TARGET_NAMESPACE = Enum.INT_TARGET_NAMESPACE;\n static final int INT_LOCAL = Enum.INT_LOCAL;\n \n /**\n * Enumeration value class for org.apache.xmlbeans.impl.xb.xsdschema.NamespaceList$Member2$Item$Member.\n * These enum values can be used as follows:\n * <pre>\n * enum.toString(); // returns the string value of the enum\n * enum.intValue(); // returns an int value, useful for switches\n * // e.g., case Enum.INT_TARGET_NAMESPACE\n * Enum.forString(s); // returns the enum value for a string\n * Enum.forInt(i); // returns the enum value for an int\n * </pre>\n * Enumeration objects are immutable singleton objects that\n * can be compared using == object equality. They have no\n * public constructor. See the constants defined within this\n * class for all the valid values.\n */\n static final class Enum extends org.apache.xmlbeans.StringEnumAbstractBase\n {\n /**\n * Returns the enum value for a string, or null if none.\n */\n public static Enum forString(java.lang.String s)\n { return (Enum)table.forString(s); }\n /**\n * Returns the enum value corresponding to an int, or null if none.\n */\n public static Enum forInt(int i)\n { return (Enum)table.forInt(i); }\n \n private Enum(java.lang.String s, int i)\n { super(s, i); }\n \n static final int INT_TARGET_NAMESPACE = 1;\n static final int INT_LOCAL = 2;\n \n public static final org.apache.xmlbeans.StringEnumAbstractBase.Table table =\n new org.apache.xmlbeans.StringEnumAbstractBase.Table\n (\n new Enum[]\n {\n new Enum(\"##targetNamespace\", INT_TARGET_NAMESPACE),\n new Enum(\"##local\", INT_LOCAL),\n }\n );\n private static final long serialVersionUID = 1L;\n private java.lang.Object readResolve() { return forInt(intValue()); } \n }\n \n /**\n * A factory class with static methods for creating instances\n * of this type.\n */\n \n public static final class Factory\n {\n public static org.apache.xmlbeans.impl.xb.xsdschema.NamespaceList.Member2.Item.Member newValue(java.lang.Object obj) {\n return (org.apache.xmlbeans.impl.xb.xsdschema.NamespaceList.Member2.Item.Member) type.newValue( obj ); }\n \n public static org.apache.xmlbeans.impl.xb.xsdschema.NamespaceList.Member2.Item.Member newInstance() {\n return (org.apache.xmlbeans.impl.xb.xsdschema.NamespaceList.Member2.Item.Member) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance( type, null ); }\n \n public static org.apache.xmlbeans.impl.xb.xsdschema.NamespaceList.Member2.Item.Member newInstance(org.apache.xmlbeans.XmlOptions options) {\n return (org.apache.xmlbeans.impl.xb.xsdschema.NamespaceList.Member2.Item.Member) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance( type, options ); }\n \n private Factory() { } // No instance of this class allowed\n }\n }\n \n /**\n * A factory class with static methods for creating instances\n * of this type.\n */\n \n public static final class Factory\n {\n public static org.apache.xmlbeans.impl.xb.xsdschema.NamespaceList.Member2.Item newValue(java.lang.Object obj) {\n return (org.apache.xmlbeans.impl.xb.xsdschema.NamespaceList.Member2.Item) type.newValue( obj ); }\n \n public static org.apache.xmlbeans.impl.xb.xsdschema.NamespaceList.Member2.Item newInstance() {\n return (org.apache.xmlbeans.impl.xb.xsdschema.NamespaceList.Member2.Item) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance( type, null ); }\n \n public static org.apache.xmlbeans.impl.xb.xsdschema.NamespaceList.Member2.Item newInstance(org.apache.xmlbeans.XmlOptions options) {\n return (org.apache.xmlbeans.impl.xb.xsdschema.NamespaceList.Member2.Item) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance( type, options ); }\n \n private Factory() { } // No instance of this class allowed\n }\n }\n \n /**\n * A factory class with static methods for creating instances\n * of this type.\n */\n \n public static final class Factory\n {\n public static org.apache.xmlbeans.impl.xb.xsdschema.NamespaceList.Member2 newValue(java.lang.Object obj) {\n return (org.apache.xmlbeans.impl.xb.xsdschema.NamespaceList.Member2) type.newValue( obj ); }\n \n public static org.apache.xmlbeans.impl.xb.xsdschema.NamespaceList.Member2 newInstance() {\n return (org.apache.xmlbeans.impl.xb.xsdschema.NamespaceList.Member2) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance( type, null ); }\n \n public static org.apache.xmlbeans.impl.xb.xsdschema.NamespaceList.Member2 newInstance(org.apache.xmlbeans.XmlOptions options) {\n return (org.apache.xmlbeans.impl.xb.xsdschema.NamespaceList.Member2) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance( type, options ); }\n \n private Factory() { } // No instance of this class allowed\n }\n }",
"void type() throws IOException {\n\t\tmatch(Tag.BASIC);\n\t\tif (look.tag != '[')\n\t\t\treturn; // Type -> basic\t\t\t\t\t// dims -> epsilon\n\t\telse\n\t\t\tdims(); // parse array type\n\t}",
"protected abstract String getType();",
"private void fillEmbeddedTypes() {\n List<String> otherClassesNames = new ArrayList<>(PRIMITIVE_TYPES);\n otherClassesNames.add(\"[]\");\n otherClassesNames.add(\"...\");\n\n List<TypeConstructor> otherClasses = new ArrayList<>();\n for (String type : otherClassesNames) {\n Classifier classifier = new Classifier(type, Language.JAVA, \"\", null, new ArrayList<MemberEntity>(), \"\");\n otherClasses.add(classifier);\n QualifiedName name = new QualifiedName(OTHER_PACKAGE, type);\n classes.put(name, classifier);\n parameters.put(name, new ParametersDescription());\n superTypes.put(name, new ArrayList<JavaType>());\n createClassMaps(name);\n }\n\n PackageEntity otherPackage = new PackageEntity(OTHER_PACKAGE, Language.JAVA, otherClasses,\n new ArrayList<MemberEntity>(), new ArrayList<PackageEntity>(), \"\", null);\n packages.put(OTHER_PACKAGE, otherPackage);\n\n for (TypeConstructor otherClass : otherClasses) {\n otherClass.setContainingPackage(otherPackage);\n }\n }",
"protected abstract boolean processElement(Element node, int uolId) throws\n PropertyException;",
"private void processElementType(ElementType elementType)\n throws Exception\n {\n\n out = new FileWriter(elementType.name.getLocalName() + \".sql\");\n\n // Write a 'create table' query for the element type.\n \n out.write(NEWLINE);\n out.write(\"CREATE TABLE \");\n out.write(elementType.name.getLocalName());\n out.write(\"(\");\n out.write(NEWLINE);\n out.write(INDENT);\n out.write(\"ID INT IDENTITY(1,1) PRIMARY KEY,\");\n out.write(NEWLINE);\n out.write(INDENT);\n out.write(\"RTN_ID INT FOREIGN KEY REFERENCES RTN(ID),\");\n out.write(NEWLINE);\n out.write(INDENT);\n createAllTablesQuery+=\"CREATE TABLE \"+elementType.name.getLocalName()+\"(\"+NEWLINE+INDENT+\"ID INT IDENTITY(1,1) PRIMARY KEY,\"+NEWLINE+INDENT;\n createAllTablesQuery+=\"RTN_ID INT FOREIGN KEY REFERENCES RTN(ID),\"+NEWLINE+INDENT;\n Hashtable<Enumeration,Collections> hash= elementType.parents;\n Enumeration en =hash.elements();\n while( en. hasMoreElements() )\n {\n ElementType ee= (ElementType) en.nextElement();\n out.write(ee.name.getLocalName()+\"_ID\");\n out.write(\" INT FOREIGN KEY REFERENCES \"+ee.name.getLocalName() +\"(ID)\");\n out.write(\",\");\n out.write(NEWLINE);\n out.write(INDENT);\n createAllTablesQuery+=ee.name.getLocalName()+\"_ID\"+\" INT FOREIGN KEY REFERENCES \"+ee.name.getLocalName() +\"(ID),\"+NEWLINE+INDENT;\n\n\n \n }\n out.write(\"DEW_POS VARCHAR(MAX)\");\n out.write(\",\");\n out.write(NEWLINE);\n out.write(INDENT);\n out.write(\"DOC_ID INT\");\n out.write(\",\");\n out.write(NEWLINE);\n out.write(INDENT);\n createAllTablesQuery+=\"DEW_POS VARCHAR(MAX),\"+NEWLINE+INDENT+\"DOC_ID INT,\"+NEWLINE+INDENT;\n \n //out.write(NEWLINE);\n\n // Process the attributes, adding one property for each.\n\n processAttributes(elementType.attributes);\n\n // Process the content, adding properties for each child element.\n\n switch (elementType.contentType)\n {\n case ElementType.CONTENT_ANY:\n case ElementType.CONTENT_MIXED:\n throw new Exception(\"Can't process element types with mixed or ANY content: \" + elementType.name.getUniversalName());\n\n /* case ElementType.CONTENT_ELEMENT:\n processElementContent(elementType.content, elementType.children);\n break;*/\n\n case ElementType.CONTENT_PCDATA:\n processPCDATAContent(elementType);\n break;\n\n case ElementType.CONTENT_EMPTY:\n // No content to process.\n break;\n }\n\n // Close the Table.\n out.write(NEWLINE);\n out.write(\")\");\n out.write(NEWLINE);\n out.write(NEWLINE);\n createAllTablesQuery+=NEWLINE+\")\"+NEWLINE+NEWLINE;\n // Close the file\n\n out.close();\n }",
"public void addElement() {\n\t\tXmlNode newNode = new XmlNode(rootNode, this);// make a new default-type field\n\t\taddElement(newNode);\n\t}",
"@Override\n\tpublic void type() {\n\t\t\n\t}",
"@Override\n\tpublic void startElement(String uri, String localName, String qName,\n\t\t\tAttributes atts) throws SAXException {\n\t\tbuilder.setLength(0);\n\t\tif (localName.equals(\"dimen\")) {\n\t\t\tconfigDimen = new ConfigDimen();\n\t\t\tbuilder.setLength(0);\n\t\t\tString name = atts.getValue(\"name\");\n\t\t\tString type = atts.getValue(\"type\");\n\t\t\tconfigDimen.name = name;\n\t\t\tconfigDimen.type = type;\n\t\t} else if (localName.equals(\"boolean\")) {\n\t\t\tconfigBoolean = new ConfigBoolean();\n\t\t\tconfigBoolean.name = atts.getValue(\"name\");\n\t\t} else if (localName.equals(\"interger\")) {\n\t\t\tString name = atts.getValue(\"name\");\n\t\t\tString value = atts.getValue(\"value\");\n\t\t\tString type = atts.getValue(\"type\");\n\t\t\tif (type == null || type.isEmpty() || type.equals(\"px\")) {\n\t\t\t\tmInteger.put(name, Integer.parseInt(value));\n\t\t\t} else if (type.equals(\"dp\") || type.equals(\"dip\")) {\n\t\t\t\tmInteger.put(name,\n\t\t\t\t\t\tTools.dip2px(mContext, Integer.parseInt(value)));\n\t\t\t}\n\t\t} else if (localName.equals(\"float\")) {\n\t\t\tString name = atts.getValue(\"name\");\n\t\t\tString value = atts.getValue(\"value\");\n\t\t\tString type = atts.getValue(\"type\");\n\t\t\tif (type == null || type.isEmpty() || type.equals(\"px\")) {\n\t\t\t\tmFloat.put(name, Float.parseFloat(value));\n\t\t\t} else if (type.equals(\"dp\") || type.equals(\"dip\")) {\n\t\t\t\tfinal float scale = appContext.mContainerContext.getResources()\n\t\t\t\t\t\t.getDisplayMetrics().density;\n\t\t\t\tmFloat.put(name, (Float.parseFloat(value) * scale));\n\t\t\t}\n\t\t} else if (localName.equals(\"string\")) {\n\t\t\tconfigString = new ConfigString();\n\t\t\tconfigString.name = atts.getValue(\"name\");\n\n\t\t} else if (localName.equals(\"string-array\")) {\n\t\t\tparentName = atts.getValue(\"name\");\n\t\t\tparentTag = \"string-array\";\n\t\t\tstringList = new ArrayList<String>();\n\t\t\tif (mStringArray.containsKey(parentName)) {\n\t\t\t\tmStringArray.remove(parentName);\n\t\t\t}\n\t\t} else if (localName.equals(\"item\")) {\n\t\t\tif (parentTag.equals(\"string-array\")) {\n\n\t\t\t}\n\t\t}\n\t}",
"public void organizeInternalStructure( ) throws LoaderException\r\n {\r\n // Fist cast the object for easier use and validation\r\n IEmpty empty = null;\r\n try\r\n {\r\n empty = ( IEmpty )element;\r\n }\r\n catch( ClassCastException e )\r\n {\r\n throw new LoaderException( \"Class does not implement IEmpty.\", e );\r\n }\r\n \r\n if(((IActivity)element).getName( )==null)\r\n throw new LoaderException(\"The empty element must have a name defined\");\r\n }",
"QName getType();",
"private static void elementsToSubValuesForStoring( Value value, NodeList list, String type )\n\t{\n\t\tNode node;\n\t\tValue childValue;\n\t\tStringBuilder builder = new StringBuilder();\n\t\tfor( int i = 0; i < list.getLength(); i++ ) {\n\t\t\tnode = list.item( i );\n\t\t\tswitch( node.getNodeType() ) {\n\t\t\t\tcase Node.ATTRIBUTE_NODE:\n\t\t\t\t\tif ( !node.getNodeName().equals( JOLIE_TYPE_ATTRIBUTE ) ) {\n\t\t\t\t\t\tgetAttribute( value, node.getNodeName() ).setValue( node.getNodeValue() );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase Node.ELEMENT_NODE:\n\t\t\t\t\tchildValue = value.getNewChild( (node.getLocalName() == null) ? node.getNodeName() : node.getLocalName() );\n\t\t\t\t\tString subElType = setAttributesForStoring( childValue, node );\n\t\t\t\t\telementsToSubValuesForStoring( childValue, node.getChildNodes(), subElType );\n\t\t\t\t\tbreak;\n\t\t\t\tcase Node.CDATA_SECTION_NODE:\n\t\t\t\tcase Node.TEXT_NODE:\n\t\t\t\t\tbuilder.append( node.getNodeValue() );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif ( builder.length() > 0 ) {\n\t\t\tif ( type.equals( \"string\" ) ) {\n\t\t\t\tvalue.setValue( builder.toString() );\n\t\t\t} else if ( type.equals( \"int\" ) ) {\n\t\t\t\tvalue.setValue( new Integer( builder.toString() ) );\n\t\t\t} else if ( type.equals( \"double\" ) ) {\n\t\t\t\tvalue.setValue( new Double( builder.toString() ) );\n\t\t\t}\n\t\t}\n\t}",
"final protected boolean addElement(Object pID, TypeElement<?> pTypeElement) {\n\t\t\tif(!this.verifySecretID(pID)) return false;\n\t\t\t\n\t\t\tif((pTypeElement == null) || this.TypeElements.containsKey(pTypeElement.getIdentity())) return false;\n\t\t\tthis.TypeElements.put(pTypeElement.getIdentity(), pTypeElement);\n\t\t\treturn true;\n\t\t}",
"public interface WrapperProcessor {\n\n\tabstract void processSingle(ElementWrapper wrapper);\n\n\tdefault void process(ElementWrapper wrapper) {\n\n\t\tprocessSingle(wrapper);\n\n\t\tif (wrapper instanceof ComplexElementWrapper) {\n\n\t\t\tif (!((ComplexElementWrapper) wrapper).getChildren().isEmpty()) {\n\n\t\t\t\tComplexElementWrapper elem = (ComplexElementWrapper) wrapper;\n\n\t\t\t\tfor (ElementWrapper child : elem.getChildren()) {\n\n\t\t\t\t\tprocess(child);\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t}\n\n}",
"private static void addAnnotationsImpl(Elements elements, AnnotatedTypeFactory atypeFactory,\n AnnotatedTypeMirror alub,\n Set<AnnotatedTypeMirror> visited,\n ArrayList<AnnotatedTypeMirror> types) {\n\n final AnnotatedTypeMirror origalub = alub;\n boolean shouldAnnoOrig = false;\n Set<AnnotationMirror> putOnOrig = AnnotationUtils.createAnnotationSet();\n\n // get rid of wildcards and type variables\n if (alub.getKind() == TypeKind.WILDCARD) {\n final QualifierHierarchy qualifierHierarchy = atypeFactory.getQualifierHierarchy();\n //TODO: TYPEVAR handling of LUB doesn't make much sense, as a stop gap for unannotated\n //TODO: LOWER/UPPER bounds we'll glb the annotations and add them to the lower bound\n //TODO: this will not handle component annotations if we have compound types as the\n //TODO: lower bound (which for type variables would only happen on a capture)\n Set<? extends AnnotationMirror> lowerBounds = new HashSet<>(qualifierHierarchy.getTopAnnotations().size());\n for (AnnotatedTypeMirror type : types) {\n\n final Set<? extends AnnotationMirror> annos = findEffectiveLowerBoundAnnotations(qualifierHierarchy, type);\n if (lowerBounds.isEmpty()) {\n lowerBounds = annos;\n } else if (!annos.isEmpty()) { //for some reason this algorithm some times adds the lub itself\n //into the list of type which may lead to an empty annos set\n lowerBounds = qualifierHierarchy.greatestLowerBounds(lowerBounds, annos);\n }\n }\n\n ((AnnotatedWildcardType)alub).getSuperBound().replaceAnnotations(lowerBounds);\n\n\n //TODO: AGAIN, ALL LUB CODE SHOULD BE EXTRACTED OUT TO IT'S OWN CLASS OR THE TYPE HIERARCHY\n //TODO: AND REWRITTEN\n boolean allWildcards = true;\n for (int i = 0; i < types.size() && allWildcards; i++) {\n if (types.get(i).getKind() != TypeKind.WILDCARD) {\n allWildcards = false;\n }\n }\n\n if (allWildcards) {\n if (wildcards.contains(alub.getUnderlyingType())) {\n return;\n }\n wildcards.add(alub.getUnderlyingType());\n final List<AnnotatedTypeMirror> upperBounds = new ArrayList<>(types.size());\n for (final AnnotatedTypeMirror type : types) {\n upperBounds.add(((AnnotatedWildcardType)type).getExtendsBound());\n }\n\n alub = ((AnnotatedWildcardType) alub).getExtendsBound();\n\n annotateAsLub(atypeFactory.getProcessingEnv(), atypeFactory, alub, upperBounds);\n return;\n\n } else {\n //old behavior\n alub = ((AnnotatedWildcardType) alub).getExtendsBound();\n }\n\n\n // TODO using the getEffective versions copies objects, losing side-effects.\n }\n while (alub.getKind() == TypeKind.TYPEVAR) {\n //TODO: TYPEVAR handling of LUB doesn't make much sense, as a stop gap for unannotated\n //TODO: LOWER/UPPER bounds we'll glb the annotations and add them to the lower bound\n //TODO: this will not handle component annotations if we have compound types as the\n //TODO: lower bound (which for type variables would only happen on a capture)\n Set<? extends AnnotationMirror> glb = glbAll(atypeFactory.getQualifierHierarchy(), types);\n ((AnnotatedTypeVariable)alub).getLowerBound().replaceAnnotations(glb);\n alub = ((AnnotatedTypeVariable)alub).getUpperBound();\n }\n\n if (visited.contains(alub)) {\n return;\n }\n visited.add(alub);\n\n for (int i = 0; i < types.size(); ++i) {\n final AnnotatedTypeMirror typei = types.get(i);\n\n if (!(typei.getAnnotations().isEmpty() ||\n bottomsOnly(elements, atypeFactory, typei.getAnnotations()))) {\n shouldAnnoOrig = true;\n }\n\n if (typei.getKind() == TypeKind.WILDCARD) {\n putOnOrig.addAll(typei.getAnnotations());\n AnnotatedWildcardType wildcard = (AnnotatedWildcardType) typei;\n if (wildcard.getExtendsBound() != null) {\n types.set(i, wildcard.getExtendsBound().deepCopy());\n } else if (wildcard.getSuperBound() != null) {\n types.set(i, wildcard.getSuperBound().deepCopy());\n }\n }\n if (typei.getKind() == TypeKind.TYPEVAR) {\n putOnOrig.addAll(typei.getAnnotations());\n AnnotatedTypeVariable typevar = (AnnotatedTypeVariable) types.get(i);\n if (typevar.getUpperBound() != null) {\n types.set(i, typevar.getUpperBound());\n } else if (typevar.getLowerBound() != null) {\n types.set(i, typevar.getLowerBound());\n }\n }\n }\n\n Collection<? extends AnnotationMirror> unification = Collections.emptySet();\n\n boolean isFirst = true;\n for (AnnotatedTypeMirror type : types) {\n if (type.getAnnotations().isEmpty()) {\n continue;\n }\n // TODO: unification fails with an empty set of annotations.\n // Why are they sometimes empty, e.g. in the FlowNegation test case.\n\n if (isFirst) {\n unification = type.getAnnotations();\n } else {\n unification = atypeFactory.getQualifierHierarchy().leastUpperBounds(unification, type.getAnnotations());\n }\n isFirst = false;\n }\n\n // Remove a previously existing unqualified annotation on the type.\n alub.replaceAnnotations(unification);\n\n if (alub.getKind() == TypeKind.DECLARED) {\n AnnotatedDeclaredType adt = (AnnotatedDeclaredType) alub;\n\n for (int i = 0; i < adt.getTypeArguments().size(); ++i) {\n AnnotatedTypeMirror adtArg = adt.getTypeArguments().get(i);\n ArrayList<AnnotatedTypeMirror> dTypesArg = new ArrayList<>();\n for (int j = 0; j < types.size(); ++j) {\n if (types.get(j).getKind() == TypeKind.DECLARED) {\n AnnotatedDeclaredType adtypej = (AnnotatedDeclaredType) types.get(j);\n if (adtypej.getTypeArguments().size() == adt.getTypeArguments().size()) {\n dTypesArg.add(adtypej.getTypeArguments().get(i));\n } else {\n // TODO: actually not just the number of type arguments should match, but\n // the base types should be equal. See test case framework/GenericTest1\n // for when this test fails.\n }\n }\n }\n\n //TODO: If we have a list of raw types, or null/raw types this code can create an empty set of\n //TODO: type arguments (dTypesArg) below. This will then cause an exception.\n //TODO: To test this: make the conditional always true and run the nullness checker on\n //TODO: jdk/nullness/src/java/lang/ref/ReferenceQueue.java\n //TODO: I think this will only happen when we \"fix-up\" the lub type with a wildcard\n //TODO: in which case, the type annotator will add the annotation from the bound of\n //TODO: the type parameter for which the wildcard is an argument and we will NOT have an\n //TODO: unannotated type. That said, we might want to just call that here to ensure\n //TODO: that when this is called in places that are not followed by annotate implicit\n //TODO: the type is fully annotated\n if (!dTypesArg.isEmpty()) {\n addAnnotationsImpl(elements, atypeFactory, adtArg, visited, dTypesArg);\n }\n }\n } else if (alub.getKind() == TypeKind.ARRAY) {\n AnnotatedArrayType aat = (AnnotatedArrayType) alub;\n\n ArrayList<AnnotatedTypeMirror> compTypes = new ArrayList<>();\n for (AnnotatedTypeMirror atype : types) {\n if (atype.getKind() == TypeKind.ARRAY) {\n compTypes.add(((AnnotatedArrayType)atype).getComponentType());\n }\n }\n\n if (aat.getComponentType().getKind() == TypeKind.TYPEVAR) {\n //TODO: TERRIBLE HACK UNTIL WE FIX LUB\n final AnnotatedTypeVariable lubAtv = (AnnotatedTypeVariable) aat.getComponentType();\n final List<AnnotatedTypeVariable> subtypesAsTvs =\n LubTypeVariableAnnotator.getSubtypesAsTypevars(lubAtv, compTypes);\n\n if (subtypesAsTvs != null) {\n LubTypeVariableAnnotator.annotateTypeVarAsLub(lubAtv, subtypesAsTvs, atypeFactory);\n } else {\n addAnnotationsImpl(elements, atypeFactory, aat.getComponentType(), visited, compTypes);\n }\n } else {\n addAnnotationsImpl(elements, atypeFactory, aat.getComponentType(), visited, compTypes);\n }\n }\n if (alub != origalub && shouldAnnoOrig) {\n // These two are not the same if origalub is a wildcard or type variable.\n // In that case, add the found annotations to the type variable also.\n // Do not put the annotations inferred for the declared type\n // on a type variable/wildcard.\n // origalub.replaceAnnotations(alub.getAnnotations());\n // Instead, keep track of the annotations that originally\n // existed on the type variable, stored in putOnOrig, and\n // put them back on now.\n origalub.replaceAnnotations(putOnOrig);\n }\n }",
"public TypeDefinitionElements getTypeDefinitionAccess() {\r\n\t\treturn pTypeDefinition;\r\n\t}",
"private void parseValueTypeDefinition(SchemaDescription desc,\n\t\t\tXMPMetadata metadata) throws XmpParsingException,\n\t\t\tXMLStreamException {\n\t\t// <rdf:Seq>\n\t\texpectNextSpecificTag(XMLStreamReader.START_ELEMENT, \"Seq\",\n\t\t\t\t\"Expected Seq Declaration\");\n\t\tint elmtType = reader.get().nextTag();\n\t\tString type, namespaceURI, prefix, description;\n\t\tList<PDFAFieldDescription> fields;\n\t\twhile (elmtType == XMLStreamReader.START_ELEMENT) {\n\t\t\ttype = null;\n\t\t\tnamespaceURI = null;\n\t\t\tprefix = null;\n\t\t\tdescription = null;\n\t\t\tfields = null;\n\t\t\texpectCurrentLocalName(\"li\");\n\t\t\telmtType = reader.get().nextTag();\n\t\t\twhile (elmtType == XMLStreamReader.START_ELEMENT) {\n\t\t\t\tif (reader.get().getLocalName().equals(\"type\")) {\n\t\t\t\t\ttype = reader.get().getElementText();\n\t\t\t\t} else if (reader.get().getLocalName().equals(\"namespaceURI\")) {\n\t\t\t\t\tnamespaceURI = reader.get().getElementText();\n\t\t\t\t} else if (reader.get().getLocalName().equals(\"prefix\")) {\n\t\t\t\t\tprefix = reader.get().getElementText();\n\t\t\t\t} else if (reader.get().getLocalName().equals(\"description\")) {\n\t\t\t\t\tdescription = reader.get().getElementText();\n\t\t\t\t} else if (reader.get().getLocalName().equals(\"field\")) {\n\t\t\t\t\tfields = parseFieldDescription(metadata);\n\n\t\t\t\t} else {\n\t\t\t\t\tthrow new XmpUnexpectedElementException(\n\t\t\t\t\t\t\t\"Unexpected property definition in one of ValueType Descriptions of PDF/A Extension schemas description\");\n\t\t\t\t}\n\t\t\t\telmtType = reader.get().nextTag();\n\t\t\t}\n\t\t\tif ((type != null) && (namespaceURI != null) && (prefix != null)\n\t\t\t\t\t&& (description != null)) {\n\t\t\t\tdesc.addValueType(type, namespaceURI, prefix, description,\n\t\t\t\t\t\tfields);\n\t\t\t} else {\n\t\t\t\tthrow new XmpRequiredPropertyException(\n\t\t\t\t\t\t\"one property declaration in PDF/A Extension is not complete\");\n\t\t\t}\n\t\t\telmtType = reader.get().nextTag();\n\t\t}\n\t\texpectNextSpecificTag(XMLStreamReader.END_ELEMENT, \"valueType\",\n\t\t\t\t\"Expected End of ValueType Declaration\");\n\n\t}",
"private void parseElementForTaskdefs(Element element)\n {\n for (Iterator targetsIterator = element.getDescendants(new ElementFilter(\"taskdef\")); targetsIterator.hasNext();)\n {\n Element taskdefElement = (Element) targetsIterator.next();\n Taskdef taskdef = new Taskdef(taskdefElement, this);\n\n addTaskdef(taskdef);\n }\n }",
"public T caseTypedElement(TypedElement object) {\r\n\t\treturn null;\r\n\t}",
"public interface IMPDElement {\n /**\n * This method returns a vector of pointers to dash::xml::INode objects which correspond to additional <em>XML Elements</em> of certain\n * MPD elements. These <em>XML Elements</em> are not specified in <em>ISO/IEC 23009-1, Part 1, 2012</em>. \\n\n * See the example in the class description for details.\n * @return a vector of pointers to dash::xml::INode objects\n */\n public Vector<Node> GetAdditionalSubNodes();\n\n /**\n * This method returns a map with key values and mapped values of type std::string of all <em>XML Attributes</em> of certain MPD elements. \\n\n * Some of these <em>XML Attributes</em> are not specified in <em>ISO/IEC 23009-1, Part 1, 2012</em>. \\n\n * See the example in the class description for details.\n * @return a map with key values and mapped values, both of type std::string\n */\n public HashMap<String, String> GetRawAttributes();\n}",
"public void process(Element element, Map<String, Type> localMap) {\r\n\t\r\n\t\tinspectHybrid(element, localMap);\r\n\t \r\n\t List content = element.getContent();\r\n\t Iterator iterator = content.iterator();\r\n\t \r\n\t while (iterator.hasNext()) {\r\n\t Object o = iterator.next();\r\n\t if (o instanceof Element) {\r\n\t Element child = (Element) o;\r\n\t process(child, localMap); \r\n\t }\r\n\t }\r\n\t}",
"public static HelloAuthenticatedWithEntitlements parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{\n HelloAuthenticatedWithEntitlements object =\n new HelloAuthenticatedWithEntitlements();\n\n int event;\n java.lang.String nillableValue = null;\n java.lang.String prefix =\"\";\n java.lang.String namespaceuri =\"\";\n try {\n \n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n\n \n if (reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\"type\")!=null){\n java.lang.String fullTypeName = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\n \"type\");\n if (fullTypeName!=null){\n java.lang.String nsPrefix = null;\n if (fullTypeName.indexOf(\":\") > -1){\n nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(\":\"));\n }\n nsPrefix = nsPrefix==null?\"\":nsPrefix;\n\n java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(\":\")+1);\n \n if (!\"helloAuthenticatedWithEntitlements\".equals(type)){\n //find namespace for the prefix\n java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix);\n return (HelloAuthenticatedWithEntitlements)ExtensionMapper.getTypeObject(\n nsUri,type,reader);\n }\n \n\n }\n \n\n }\n\n \n\n \n // Note all attributes that were handled. Used to differ normal attributes\n // from anyAttributes.\n java.util.Vector handledAttributes = new java.util.Vector();\n \n\n \n \n reader.next();\n \n \n while (!reader.isStartElement() && !reader.isEndElement()) reader.next();\n \n if (reader.isStartElement() && new javax.xml.namespace.QName(\"http://ws.sample\",\"param0\").equals(reader.getName())){\n \n nillableValue = reader.getAttributeValue(\"http://www.w3.org/2001/XMLSchema-instance\",\"nil\");\n if (!\"true\".equals(nillableValue) && !\"1\".equals(nillableValue)){\n \n java.lang.String content = reader.getElementText();\n \n object.setParam0(\n org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content));\n \n } else {\n \n \n reader.getElementText(); // throw away text nodes if any.\n }\n \n reader.next();\n \n } // End of if for expected property start element\n \n else {\n \n }\n \n while (!reader.isStartElement() && !reader.isEndElement())\n reader.next();\n \n if (reader.isStartElement())\n // A start element we are not expecting indicates a trailing invalid property\n throw new org.apache.axis2.databinding.ADBException(\"Unexpected subelement \" + reader.getLocalName());\n \n\n\n\n } catch (javax.xml.stream.XMLStreamException e) {\n throw new java.lang.Exception(e);\n }\n\n return object;\n }",
"OurIfcElementType createOurIfcElementType();",
"private void validateTyped(IBean bean) {\r\n \t\tSet<ITypeDeclaration> typedDeclarations = bean.getRestrictedTypeDeclaratios();\r\n \t\tif (!typedDeclarations.isEmpty()) {\r\n \t\t\tSet<IParametedType> allTypes = bean.getAllTypes();\r\n \t\t\tfor (ITypeDeclaration typedDeclaration : typedDeclarations) {\r\n \t\t\t\tIType typedType = typedDeclaration.getType();\r\n \t\t\t\tif (typedType != null) {\r\n \t\t\t\t\tboolean typeWasFound = false;\r\n \t\t\t\t\tfor (IParametedType type : allTypes) {\r\n \t\t\t\t\t\tif (type != null && typedType.getFullyQualifiedName().equals(type.getType().getFullyQualifiedName())) {\r\n \t\t\t\t\t\t\ttypeWasFound = true;\r\n \t\t\t\t\t\t\tbreak;\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t}\r\n \t\t\t\t\tif (!typeWasFound) {\r\n \t\t\t\t\t\tString message = bean instanceof IClassBean\r\n \t\t\t\t\t\t\t? CDIValidationMessages.ILLEGAL_TYPE_IN_TYPED_DECLARATION_IN_BEAN_CLASS\r\n \t\t\t\t\t\t\t: bean instanceof IProducerField\r\n \t\t\t\t\t\t\t? CDIValidationMessages.ILLEGAL_TYPE_IN_TYPED_DECLARATION_IN_PRODUCER_FIELD\r\n \t\t\t\t\t\t\t: bean instanceof IProducerMethod\r\n \t\t\t\t\t\t\t? CDIValidationMessages.ILLEGAL_TYPE_IN_TYPED_DECLARATION_IN_PRODUCER_METHOD\r\n \t\t\t\t\t\t\t: CDIValidationMessages.ILLEGAL_TYPE_IN_TYPED_DECLARATION;\r\n \t\t\t\t\t\taddError(message, CDIPreferences.ILLEGAL_TYPE_IN_TYPED_DECLARATION, typedDeclaration, bean.getResource());\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}"
]
| [
"0.6983001",
"0.6448569",
"0.6298356",
"0.626653",
"0.6215105",
"0.6182069",
"0.616921",
"0.61614007",
"0.6052852",
"0.60395867",
"0.59115845",
"0.5892528",
"0.58364785",
"0.5813006",
"0.5761079",
"0.5737034",
"0.5691962",
"0.5648925",
"0.56038016",
"0.5602407",
"0.5602404",
"0.55989546",
"0.5586154",
"0.5582507",
"0.5581",
"0.5570655",
"0.5568179",
"0.55207217",
"0.5506684",
"0.5489165",
"0.5480553",
"0.54799145",
"0.5460935",
"0.54585814",
"0.5454378",
"0.5453749",
"0.5453578",
"0.5449159",
"0.5444257",
"0.5436987",
"0.5428637",
"0.54248804",
"0.5424667",
"0.5397293",
"0.53949976",
"0.5392709",
"0.5371613",
"0.5318001",
"0.53120106",
"0.531196",
"0.5310814",
"0.52951205",
"0.52790695",
"0.52777386",
"0.52630776",
"0.52560496",
"0.525468",
"0.5246985",
"0.5245695",
"0.52393013",
"0.5234054",
"0.52159333",
"0.52143407",
"0.52067107",
"0.51950026",
"0.5186643",
"0.5185523",
"0.51842546",
"0.51817054",
"0.5177395",
"0.517242",
"0.5166709",
"0.51568574",
"0.51455075",
"0.51443684",
"0.51311016",
"0.51274997",
"0.5125797",
"0.5119001",
"0.5117259",
"0.5115706",
"0.51120675",
"0.511064",
"0.51063704",
"0.5105636",
"0.50939786",
"0.5089816",
"0.50896025",
"0.5081039",
"0.50800705",
"0.5079678",
"0.5079",
"0.5078393",
"0.5058567",
"0.505044",
"0.50344473",
"0.5024201",
"0.50227386",
"0.5019825",
"0.50161225",
"0.5011717"
]
| 0.0 | -1 |
Check if the element is treated as a Table. If not, return and don't process it now. Instead, we will process it when we encounter it in each of its parents. if (!isTable(elementType)) return; Open a new FileWriter for the query. | private void processElementType(ElementType elementType)
throws Exception
{
out = new FileWriter(elementType.name.getLocalName() + ".sql");
// Write a 'create table' query for the element type.
out.write(NEWLINE);
out.write("CREATE TABLE ");
out.write(elementType.name.getLocalName());
out.write("(");
out.write(NEWLINE);
out.write(INDENT);
out.write("ID INT IDENTITY(1,1) PRIMARY KEY,");
out.write(NEWLINE);
out.write(INDENT);
out.write("RTN_ID INT FOREIGN KEY REFERENCES RTN(ID),");
out.write(NEWLINE);
out.write(INDENT);
createAllTablesQuery+="CREATE TABLE "+elementType.name.getLocalName()+"("+NEWLINE+INDENT+"ID INT IDENTITY(1,1) PRIMARY KEY,"+NEWLINE+INDENT;
createAllTablesQuery+="RTN_ID INT FOREIGN KEY REFERENCES RTN(ID),"+NEWLINE+INDENT;
Hashtable<Enumeration,Collections> hash= elementType.parents;
Enumeration en =hash.elements();
while( en. hasMoreElements() )
{
ElementType ee= (ElementType) en.nextElement();
out.write(ee.name.getLocalName()+"_ID");
out.write(" INT FOREIGN KEY REFERENCES "+ee.name.getLocalName() +"(ID)");
out.write(",");
out.write(NEWLINE);
out.write(INDENT);
createAllTablesQuery+=ee.name.getLocalName()+"_ID"+" INT FOREIGN KEY REFERENCES "+ee.name.getLocalName() +"(ID),"+NEWLINE+INDENT;
}
out.write("DEW_POS VARCHAR(MAX)");
out.write(",");
out.write(NEWLINE);
out.write(INDENT);
out.write("DOC_ID INT");
out.write(",");
out.write(NEWLINE);
out.write(INDENT);
createAllTablesQuery+="DEW_POS VARCHAR(MAX),"+NEWLINE+INDENT+"DOC_ID INT,"+NEWLINE+INDENT;
//out.write(NEWLINE);
// Process the attributes, adding one property for each.
processAttributes(elementType.attributes);
// Process the content, adding properties for each child element.
switch (elementType.contentType)
{
case ElementType.CONTENT_ANY:
case ElementType.CONTENT_MIXED:
throw new Exception("Can't process element types with mixed or ANY content: " + elementType.name.getUniversalName());
/* case ElementType.CONTENT_ELEMENT:
processElementContent(elementType.content, elementType.children);
break;*/
case ElementType.CONTENT_PCDATA:
processPCDATAContent(elementType);
break;
case ElementType.CONTENT_EMPTY:
// No content to process.
break;
}
// Close the Table.
out.write(NEWLINE);
out.write(")");
out.write(NEWLINE);
out.write(NEWLINE);
createAllTablesQuery+=NEWLINE+")"+NEWLINE+NEWLINE;
// Close the file
out.close();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private boolean isTable(ElementType elementType)\n {\n\n return (!elementType.children.isEmpty() ||\n !elementType.attributes.isEmpty());\n }",
"private void addTableProperty(ElementType elementType, boolean multiValued)\n throws Exception\n {\n if (!multiValued)\n {\n // out.write(\",\");\n out.write(NEWLINE);\n out.write(INDENT);\n out.write(\"m_\");\n out.write(elementType.name.getLocalName());\n out.write(\" VARCHAR(50)\");\n createAllTablesQuery+=NEWLINE+INDENT+\"m_\"+elementType.name.getLocalName()+\" VARCHAR(50)\";\n\n }else\n {\n // out.write(\",\");\n /* out.write(NEWLINE);\n out.write(INDENT);\n out.write(\"m_\");\n out.write(elementType.name.getLocalName());\n */\n }\n \n }",
"@Override\n\t\tpublic void endElement(String uri, String localName, String qName) throws SAXException {\n\t\t\tif(user) {\n\t\t\t\ttry {\n\t\t\t\t\tif(qName.equalsIgnoreCase(\"NAME\")){\n\t\t\t\t\t\tcreateNewTable();\n\t\t\t\t\t}\n\t\t\t\t\telse if(localName.equalsIgnoreCase(\"SIZE\")){\n\t\t\t\t\t\tString[] myTable = {nameOfField, nameOfFieldType+ \"(\" + value + \")\"};\n\t\t\t\t\t\tstore(myTable);\n\t\t\t\t\t}\t\n\t\t\t\t\telse if(localName.equalsIgnoreCase(\"FIELDTYPE\")){\n\t\t\t\t\t\tString[] myTable = {nameOfField, nameOfFieldType};\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(!nameOfFieldType.equalsIgnoreCase(\"char\"))\n\t\t\t\t\t\t\tstore(myTable);\n\t\t\t\t\t}\n\t\t\t\t} catch (WoodsException e) {}\n\t\t\t\t\n\t\t\t\tuser = false;\n\t\t\t}\n\t\t}",
"private boolean isMultiTable() {\n\t\treturn fromElement.getQueryable() != null &&\n\t\t\t\tfromElement.getQueryable().isMultiTable();\n\t}",
"public void impl(String tableName, String path, String encryptionType, String compressionType) {\n\t\tString query = selectQuery + tableName;\n\t\tAppLogger.getLogger().debug(\"firing query: \" + query);\n\t\tResultSet rs = null;\n\t\tResultSetMetaData rsmd = null;\n\n\t\tBufferedWriter bw = null;\n\n\t\ttry {\n\n\t\t\tdbconnection = this.ps.getConnection();\n\n\t\t\tAppLogger.getLogger().debug(\"Config received: \" + hdfsuri);\n\n\t\t\tFileSystem dfs = FileSystem.get(new URI(hdfsuri), this.conf);\n\t\t\tif (path.charAt(path.length() - 1) != '/')\n\t\t\t\tpath = hdfsuri + path + \"/\" + tableName + \".csv\";\n\t\t\telse\n\t\t\t\tpath = hdfsuri + path + tableName + \".csv\";\n\n\t\t\tbw = new BufferedWriter(new OutputStreamWriter(dfs.create(new Path(path))));\n\n\t\t\tdbstatement = dbconnection.createStatement();\n\n\t\t\trs = dbstatement.executeQuery(query);\n\n\t\t\trsmd = rs.getMetaData();\n\t\t\tint i = 1;\n\n\t\t\twhile (i <= rsmd.getColumnCount()) {\n\t\t\t\tString columnName = rsmd.getColumnName(i) + \" ,\";\n\t\t\t\tif (i == rsmd.getColumnCount())\n\t\t\t\t\tcolumnName = columnName.substring(0, columnName.length() - 2);\n\t\t\t\tbw.write(columnName);\n\t\t\t\ti++;\n\t\t\t}\n\n\t\t\tbw.write(QueryIOConstants.NEW_LINE);\n\n\t\t\trs.setFetchSize(1000);\n\n\t\t\twhile (rs.next()) {\n\t\t\t\tfor (i = 1; i <= rsmd.getColumnCount() - 1; i++) {\n\t\t\t\t\tbw.write(rs.getString(rsmd.getColumnName(i)) + \" ,\");\n\t\t\t\t}\n\t\t\t\tbw.write(rs.getString(rsmd.getColumnName(i)));\n\t\t\t\tbw.write(QueryIOConstants.NEW_LINE);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tAppLogger.getLogger().fatal(e.getMessage(), e);\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (bw != null)\n\t\t\t\t\tbw.close();\n\t\t\t} catch (Exception e) {\n\t\t\t\tAppLogger.getLogger().fatal(\"Error closing outputstream connection.\", e);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tif (dbstatement != null) {\n\t\t\t\t\tdbstatement.close();\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tAppLogger.getLogger().fatal(\"Error closing statements.\", e);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tif (dbconnection != null) {\n\t\t\t\t\tdbconnection.close();\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tAppLogger.getLogger().fatal(\"Error closing connection.\", e);\n\t\t\t}\n\t\t}\n\t}",
"public synchronized void saveTable() \n\t{\n\t\ttry {\n\t\t\tFileOutputStream fos = new FileOutputStream(tableFile);\n\t\t\t\n\t\t\tObjectOutputStream oos = new ObjectOutputStream(fos);\n\t\t\toos.writeObject(htRecords);\n\t\t\toos.close();\n\t\t\tfos.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\tthrow new RuntimeException(\"Cannot save : FileNotFoundException\",e);\n\t\t} catch (IOException e) {\n\t\t\tthrow new RuntimeException(\"Cannot save : IOException\",e);\n\t\t}\n\t}",
"private void writeTableContents(BufferedWriter writer, ISuite suite,\r\n\t\t\tResultTable table) throws IOException {\r\n\r\n\t\tMap<String, ResultVo> dataMap = table.getResultData();\r\n\t\tString closer = \"</tbody></table></div>\";\r\n\t\tdataMap.forEach((key, value) -> {\r\n\t\t\tString datagenerator = \"\";\r\n\t\t\tString message = value.getExpectionMessage() != null ? value\r\n\t\t\t\t\t.getExpectionMessage() : \"\";\r\n\t\t\tSystem.out.println(message);\r\n\t\t\tdatagenerator = \"<tr><td>\" + value.getTestCaeId() + \"</td><td>\"\r\n\t\t\t\t\t+ value.getMethodName() + \"</td><td>\" + value.getPrioirty()\r\n\t\t\t\t\t+ \"</td><td>\" + value.getTotalTime() + \"</td>\";\r\n\r\n\t\t\tswitch (value.getResult().toString()) {\r\n\t\t\tcase \"pass\":\r\n\t\t\t\tdatagenerator += \"<td style='color:#4CAF50;font-weight:bold;'>\"\r\n\t\t\t\t\t\t+ value.getResult() + \"</td>\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"fail\":\r\n\t\t\t\tdatagenerator += \"<td style='color:#EF5350;font-weight:bold;'>\"\r\n\t\t\t\t\t\t+ \"<i class='material-icons' style='font-size: 16px;'></i><span>\"\r\n\t\t\t\t\t\t+ value.getResult() + \"</span></td>\";\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase \"skip\":\r\n\t\t\t\tdatagenerator += \"<td style='color:#4FC3F7;font-weight:bold;'>\"\r\n\t\t\t\t\t\t+ value.getResult() + \"</td>\";\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\ttry {\r\n\t\t\t\twriter.write(datagenerator);\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\twriter.write(closer);\r\n\t}",
"public void endTable() throws IOException;",
"public void setFilaDatosExportarXmlTablaAmortiDetalle(TablaAmortiDetalle tablaamortidetalle,Document document,Element element) {\r\n\t\t\r\n\r\n\t\tElement elementId = document.createElement(TablaAmortiDetalleConstantesFunciones.ID);\r\n\t\telementId.appendChild(document.createTextNode(tablaamortidetalle.getId().toString().trim()));\r\n\t\telement.appendChild(elementId);\r\n\r\n\t\tif(parametroGeneralUsuario.getcon_exportar_campo_version()){\r\n\r\n\t\tElement elementVersionRow = document.createElement(TablaAmortiDetalleConstantesFunciones.VERSIONROW);\r\n\t\telementVersionRow.appendChild(document.createTextNode(tablaamortidetalle.getVersionRow().toString().trim()));\r\n\t\telement.appendChild(elementVersionRow);\r\n\t\t}\r\n\r\n\r\n\t\tElement elementempresa_descripcion = document.createElement(TablaAmortiDetalleConstantesFunciones.IDEMPRESA);\r\n\t\telementempresa_descripcion.appendChild(document.createTextNode(tablaamortidetalle.getempresa_descripcion()));\r\n\t\telement.appendChild(elementempresa_descripcion);\r\n\r\n\t\tElement elementsucursal_descripcion = document.createElement(TablaAmortiDetalleConstantesFunciones.IDSUCURSAL);\r\n\t\telementsucursal_descripcion.appendChild(document.createTextNode(tablaamortidetalle.getsucursal_descripcion()));\r\n\t\telement.appendChild(elementsucursal_descripcion);\r\n\r\n\t\tElement elementejercicio_descripcion = document.createElement(TablaAmortiDetalleConstantesFunciones.IDEJERCICIO);\r\n\t\telementejercicio_descripcion.appendChild(document.createTextNode(tablaamortidetalle.getejercicio_descripcion()));\r\n\t\telement.appendChild(elementejercicio_descripcion);\r\n\r\n\t\tElement elementperiodo_descripcion = document.createElement(TablaAmortiDetalleConstantesFunciones.IDPERIODO);\r\n\t\telementperiodo_descripcion.appendChild(document.createTextNode(tablaamortidetalle.getperiodo_descripcion()));\r\n\t\telement.appendChild(elementperiodo_descripcion);\r\n\r\n\t\tElement elementtasa_descripcion = document.createElement(TablaAmortiDetalleConstantesFunciones.IDTASA);\r\n\t\telementtasa_descripcion.appendChild(document.createTextNode(tablaamortidetalle.gettasa_descripcion()));\r\n\t\telement.appendChild(elementtasa_descripcion);\r\n\r\n\t\tElement elementfactura_descripcion = document.createElement(TablaAmortiDetalleConstantesFunciones.IDFACTURA);\r\n\t\telementfactura_descripcion.appendChild(document.createTextNode(tablaamortidetalle.getfactura_descripcion()));\r\n\t\telement.appendChild(elementfactura_descripcion);\r\n\r\n\t\tElement elementtipointervalo_descripcion = document.createElement(TablaAmortiDetalleConstantesFunciones.IDTIPOINTERVALO);\r\n\t\telementtipointervalo_descripcion.appendChild(document.createTextNode(tablaamortidetalle.gettipointervalo_descripcion()));\r\n\t\telement.appendChild(elementtipointervalo_descripcion);\r\n\r\n\t\tElement elementfecha_emision = document.createElement(TablaAmortiDetalleConstantesFunciones.FECHAEMISION);\r\n\t\telementfecha_emision.appendChild(document.createTextNode(tablaamortidetalle.getfecha_emision().toString().trim()));\r\n\t\telement.appendChild(elementfecha_emision);\r\n\r\n\t\tElement elementfecha_vencimiento = document.createElement(TablaAmortiDetalleConstantesFunciones.FECHAVENCIMIENTO);\r\n\t\telementfecha_vencimiento.appendChild(document.createTextNode(tablaamortidetalle.getfecha_vencimiento().toString().trim()));\r\n\t\telement.appendChild(elementfecha_vencimiento);\r\n\r\n\t\tElement elementfecha_inicial = document.createElement(TablaAmortiDetalleConstantesFunciones.FECHAINICIAL);\r\n\t\telementfecha_inicial.appendChild(document.createTextNode(tablaamortidetalle.getfecha_inicial().toString().trim()));\r\n\t\telement.appendChild(elementfecha_inicial);\r\n\r\n\t\tElement elementfecha_final = document.createElement(TablaAmortiDetalleConstantesFunciones.FECHAFINAL);\r\n\t\telementfecha_final.appendChild(document.createTextNode(tablaamortidetalle.getfecha_final().toString().trim()));\r\n\t\telement.appendChild(elementfecha_final);\r\n\r\n\t\tElement elementvalor = document.createElement(TablaAmortiDetalleConstantesFunciones.VALOR);\r\n\t\telementvalor.appendChild(document.createTextNode(tablaamortidetalle.getvalor().toString().trim()));\r\n\t\telement.appendChild(elementvalor);\r\n\r\n\t\tElement elementinteres = document.createElement(TablaAmortiDetalleConstantesFunciones.INTERES);\r\n\t\telementinteres.appendChild(document.createTextNode(tablaamortidetalle.getinteres().toString().trim()));\r\n\t\telement.appendChild(elementinteres);\r\n\r\n\t\tElement elementcapital = document.createElement(TablaAmortiDetalleConstantesFunciones.CAPITAL);\r\n\t\telementcapital.appendChild(document.createTextNode(tablaamortidetalle.getcapital().toString().trim()));\r\n\t\telement.appendChild(elementcapital);\r\n\r\n\t\tElement elementnumero_cuotas = document.createElement(TablaAmortiDetalleConstantesFunciones.NUMEROCUOTA);\r\n\t\telementnumero_cuotas.appendChild(document.createTextNode(tablaamortidetalle.getnumero_cuotas().toString().trim()));\r\n\t\telement.appendChild(elementnumero_cuotas);\r\n\r\n\t\tElement elementanio_descripcion = document.createElement(TablaAmortiDetalleConstantesFunciones.IDANIO);\r\n\t\telementanio_descripcion.appendChild(document.createTextNode(tablaamortidetalle.getanio_descripcion()));\r\n\t\telement.appendChild(elementanio_descripcion);\r\n\r\n\t\tElement elementmes_descripcion = document.createElement(TablaAmortiDetalleConstantesFunciones.IDMES);\r\n\t\telementmes_descripcion.appendChild(document.createTextNode(tablaamortidetalle.getmes_descripcion()));\r\n\t\telement.appendChild(elementmes_descripcion);\r\n\t}",
"@Override\n public boolean hasNext() {\n if (generateAllTables && childRow != null) {\n getFromParent = false;\n return true;\n }\n\n // Current table still has more\n if (tableIterators.get(currentTableIndex).hasNext()) {\n return true;\n }\n\n // We went over all the tables\n if (currentTableIndex == tableCount - 1) {\n return false;\n }\n\n // Go to the next table\n currentTableIndex++;\n currentTable = selectedTables.get(currentTableIndex);\n\n return hasNext();\n }",
"public interface TableWriter {\n \n /** Sets the details of a column. Fails if col is bigger than the existing internal\n * array; use setColumnMetadata(array) to set the size */\n// public void setColumnMetadata(int col, ColumnInfo columnInfo) throws IOException;\n\n /** Starts the writer */\n public void open() throws IOException;\n \n /** Sets all the column details */\n public void startTable(ColumnInfo[] colInfo) throws IOException;\n\n /** Writes the given array of values out */\n public void writeRow(Object[] colValues) throws IOException;\n\n /** Ends a table (eg closes tags) */\n public void endTable() throws IOException;\n \n /** Close the writer */\n public void close() throws IOException;\n \n /** If the writer needs to stop before normal completion, call this. It will,\n * if appropriate, write some message to indicate that the table is incomplete */\n public void abort() throws IOException;\n \n /** Returns the mime type that this writer produces */\n public String getMimeType();\n\n /** Writes a table wrapping error output */ \n public void writeErrorTable(String errorMessage) throws IOException;\n}",
"public <E> Table<E> getTable(String name, Class<E> elementType) {\n assert elementType != null;\n\n // First look for a table.\n TableInSchema table = tableMap.get(name);\n if (table != null) {\n return table.getTable(elementType);\n }\n // Then look for a table-function with no arguments.\n Collection<TableFunctionInSchema> tableFunctions = membersMap.get(name);\n if (tableFunctions != null) {\n for (TableFunctionInSchema tableFunctionInSchema : tableFunctions) {\n TableFunction tableFunction = tableFunctionInSchema.getTableFunction();\n if (tableFunction.getParameters().isEmpty()) {\n //noinspection unchecked\n return tableFunction.apply(Collections.emptyList());\n }\n }\n }\n return null;\n }",
"void visit(final Table table);",
"public TaskPage checkTypColumn() throws InterruptedException, IOException {\n\n List<WebElement> totalRows = driver.findElements(By.xpath(\"//*[@id='grid']//table//tr[*]/td[9]\"));\n waitUntilListIsLoaded(totalRows);\n\n for (int row = 1; row <= totalRows.size(); row++) {\n // Fetch the text of 'typ' column\n String typ = driver.findElement(By.xpath(\"//*[@id='grid']//table//tr[\"+row+\"]/td[9]\")).getText();\n Assert.assertEquals(typ,\"Bug\");\n System.out.println(\"Row \"+row+\" data is \"+typ);\n }\n\n return this;\n }",
"public TSETInfoTables parseXml(String fileName) { \n\t\ttry { \n\t\t\tDocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); \n\t\t\tDocumentBuilder db = dbf.newDocumentBuilder(); \n\t\t\tDocument document = db.parse(fileName); \n\t\t\tNodeList TSETInfoTablesNodeList = document.getChildNodes(); \n\t\t\tNode TSETInfoTablesNode = TSETInfoTablesNodeList.item(0); \n\t\t\t//if (!columnNode.hasChildNodes()) continue;\n\t\t\t\n\t\t\t// pojo\n\t\t\tTSETInfoTables infoTables = new TSETInfoTables();\n\t\t\tList<MetaDB> metaDBList = new ArrayList<MetaDB>();\n\t\t\t//infoTables.setMetaDBList(metaDBList);\n\t\t\t\n\t\t\tNodeList metaDBNodeList = TSETInfoTablesNode.getChildNodes();\n\t\t\tfor (int i = 0; i < metaDBNodeList.getLength(); i++) { \n\t\t\t\tNode metaDBNode = metaDBNodeList.item(i);\n\t\t\t\t// tackle the CRLF character, otherwise it will be treated as a empty node.\n\t\t\t\tif (!metaDBNode.hasChildNodes()) continue;\n\t\t\t\tMetaDB metaDB = new MetaDB();\n\t\t\t\t//metaDBList.add(metaDB);\n\t\t\t\tthis.parseMetaDBAttribute(metaDBNode, metaDB);\n\t\t\t\tList<Table> tableList = new ArrayList<Table>();\n\t\t\t\t//metaDB.setTableList(tableList);\n\t\t\t\t\n\t\t\t\tNodeList tableNodeList = metaDBNode.getChildNodes(); \n\t\t\t\tfor (int j = 0; j < tableNodeList.getLength(); j++) { \n\t\t\t\t\tNode tableNode = tableNodeList.item(j); \n\t\t\t\t\tif (!tableNode.hasChildNodes()) continue;\n\t\t\t\t\tTable table = new Table();\n\t\t\t\t\t//tableList.add(table);\n\t\t\t\t\tthis.parseTableAttribute(tableNode, table);\n\t\t\t\t\tList<Column> columnList = new ArrayList<Column>();\n\t\t\t\t\t//table.setColumnList(columnList);\n\t\t\t\t\t\n\t\t\t\t\tNodeList columnNodeList = tableNode.getChildNodes(); \n\t\t\t\t\tfor (int k = 0; k < columnNodeList.getLength(); k++) { \n\t\t\t\t\t\tNode columnNode = columnNodeList.item(k);\n\t\t\t\t\t\tif (!columnNode.hasChildNodes()) continue;\n\t\t\t\t\t\t//this.parseAttribute(columnNode);\n\t\t\t\t\t\tColumn column = new Column();\n\t\t\t\t\t\t//columnList.add(column);\n\t\t\t\t\t\tthis.parseColumnAttribute(columnNode, column);\n\t\t\t\t\t\t\n\t\t\t\t\t\tNodeList columnContentNodeList = columnNode.getChildNodes();\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor(int m = 0; m < columnContentNodeList.getLength(); m++) {\n\t\t\t\t\t\t\t//Node columnContent = columnContentList.item(m);\n\t\t\t\t\t\t\tNode columnContentNode = columnContentNodeList.item(m);\n\t\t\t\t\t\t\t// The CRLF character will be treated as a node, so using IF.\n\t\t\t\t\t\t\tif (columnContentNode.hasChildNodes()) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (columnContentNode.getNodeName().equals(\"columnName\")) {\n\t\t\t\t\t\t\t\t\tcolumn.setName(columnContentNode.getTextContent());\n\t\t\t\t\t\t\t\t} else if (columnContentNode.getNodeName().equals(\"columnType\")) {\n\t\t\t\t\t\t\t\t\tcolumn.setType(columnContentNode.getTextContent());\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tlogger.error(\"unknown column content.\");\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\t\t\t\t\t\tcolumnList.add(column);\n\t\t\t\t\t} \n\t\t\t\t\ttable.setColumnList(columnList);\n\t\t\t\t\ttableList.add(table);\n\t\t\t\t\tlogger.info(j + \" table tackled.\");\n\t\t\t\t} \n\t\t\t\tmetaDB.setTableList(tableList);\n\t\t\t\tmetaDBList.add(metaDB);\n\t\t\t\tlogger.info(i + \" metaDB tackled.\");\n\t\t\t} \n\t\t\tinfoTables.setMetaDBList(metaDBList);\n\t\t\tlogger.info(\"Parse XML success.\");\n\t\t\treturn infoTables;\n\t\t} catch (FileNotFoundException e) { \n\t\t\tlogger.error(e.getMessage());\n\t\t} catch (ParserConfigurationException e) { \n\t\t\tlogger.error(e.getMessage());\n\t\t} catch (SAXException e) { \n\t\t\tlogger.error(e.getMessage());\n\t\t} catch (IOException e) { \n\t\t\tlogger.error(e.getMessage());\n\t\t} \n\t\treturn null;\n\t}",
"protected abstract void addTables();",
"private void addTables() {\r\n for (SQLTable table : getType().getTables()) {\r\n if (getExpr4Tables().get(table) == null) {\r\n getExpr4Tables().put(table, new HashMap<String,AttributeTypeInterface>());\r\n }\r\n }\r\n\r\n }",
"public synchronized void saveTableInJson(Table table) throws IOException {\r\n Gson gson = new GsonBuilder().setPrettyPrinting().create();\r\n\r\n /*\r\n * I don't know why but this line below doesn't work...\r\n * The strange thing is it was working fine, but just in one moment stopped.\r\n * I checked everything, I even reverted the done work to the initial state.\r\n * Nothing helped.\r\n */\r\n //gson.toJson(table, new FileWriter(stringPathToTable));\r\n\r\n String jsonTable = gson.toJson(table);\r\n FileWriter fileWriter = new FileWriter(stringPathToTable);\r\n fileWriter.write(jsonTable);\r\n fileWriter.close();\r\n }",
"@Test\n public void operator_table() {\n OutputNode output = new OutputNode(\"testing\", typeOf(Result.class), typeOf(String.class));\n OperatorNode operator = new OperatorNode(\n classOf(SimpleOp.class), typeOf(Result.class), typeOf(String.class),\n output, new DataTableNode(\"t\", typeOf(DataTable.class), typeOf(String.class)));\n InputNode root = new InputNode(operator);\n MockContext context = new MockContext();\n context.put(\"t\", new BasicDataTable.Builder<>().build());\n testing(root, context, op -> {\n op.process(\"Hello, world!\");\n });\n assertThat(context.get(\"testing\"), contains(\"Hello, world!TABLE\"));\n }",
"public void endElement(String qname, int depth) {\n if (open) {\n if (depth >= this.depth + 1) {\n if (actions.isOpen()) {\n actions.endElement(qname, depth, true);\n }\n }\n }\n if (qname.equals(mainTag) && depth == this.depth) {\n open = false;\n\n ParseFiles.getInstance().printOnTSVFile(mainTable, WID, \"\\t\");\n ParseFiles.getInstance().printOnTSVFile(mainTable, drug_WID, \"\\t\");\n ParseFiles.getInstance().printOnTSVFile(mainTable, partner, \"\\t\");\n if (knownActionFlags) {\n ParseFiles.getInstance().printOnTSVFile(mainTable, position, \"\\t\");\n ParseFiles.getInstance().printOnTSVFile(mainTable, knownAction, \"\\n\");\n } else {\n ParseFiles.getInstance().printOnTSVFile(mainTable, position, \"\\n\");\n }\n\n (new DrugBankSplitReference()).split(references, WID, refTable);\n }\n }",
"protected abstract String getAlterTable(boolean nextLine, boolean only);",
"public TapTable findOneTable(String tableName);",
"public org.apache.spark.sql.SchemaRDD table (java.lang.String tableName) { throw new RuntimeException(); }",
"public abstract void buildTable(PdfPTable table);",
"public boolean updateInformationSchemaTable(){\n\t\tSchema currentSchema = Schema.getSchemaInstance();\n\t\tString currentSchemaName = currentSchema.getCurrentSchema();\n\t\tboolean isFound = false;\n\t\ttry {\n\t\t\tRandomAccessFile tablesTableFile = new RandomAccessFile(\"information_schema.table.tbl\", \"rw\");\n\n\t\t\t//Searching to see if the information schema is present or not\n\t\t\twhile(tablesTableFile.getFilePointer() < tablesTableFile.length()){\n\t\t\t\tString readSchemaName = \"\";\n\t\t\t\tbyte varcharLength = tablesTableFile.readByte();\n\t\t\t\tfor(int j = 0; j < varcharLength; j++)\n\t\t\t\t\treadSchemaName += (char)tablesTableFile.readByte();\n\n\t\t\t\tif(readSchemaName.equals(currentSchemaName)){\n\t\t\t\t\tString readTableName = \"\";\n\t\t\t\t\tbyte varcharTableLength = tablesTableFile.readByte();\n\t\t\t\t\tfor(int j = 0; j < varcharTableLength; j++)\n\t\t\t\t\t\treadTableName += (char)tablesTableFile.readByte();\n\n\t\t\t\t\tif(readTableName.equals(tableName)){\n\t\t\t\t\t\tisFound = true;\n\t\t\t\t\t\tSystem.out.println(\"Table '\" + tableName + \"' already exits...\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\ttablesTableFile.readLong();\n\t\t\t\t} else {\n\t\t\t\t\tbyte traverseLength = tablesTableFile.readByte();\n\t\t\t\t\tfor(int j = 0; j < traverseLength; j++)\n\t\t\t\t\t\ttablesTableFile.readByte();\n\t\t\t\t\ttablesTableFile.readLong();\n\t\t\t\t}\t\n\t\t\t}\n\n\t\t\tif(!isFound){\n\t\t\t\t//Traversing to the end of file\n\t\t\t\ttablesTableFile.seek(tablesTableFile.length());\n\t\t\t\ttablesTableFile.writeByte(currentSchemaName.length()); // TABLE_SCHEMA\n\t\t\t\ttablesTableFile.writeBytes(currentSchemaName);\n\t\t\t\ttablesTableFile.writeByte(tableName.length()); // TABLE_NAME\n\t\t\t\ttablesTableFile.writeBytes(tableName);\n\t\t\t\ttablesTableFile.writeLong(0); // TABLE_ROWS\n\t\t\t}\n\n\t\t\ttablesTableFile.close();\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}\t\n\t\treturn isFound;\n\t}",
"private RecordImpl(Table tableParent, long lRecord, RecordType rt) throws IOException\n\t{\n\t\t_tableParent\t= tableParent;\n\t\t_lRecord\t\t= lRecord;\n\t\tif (rt.getAny().size() > 0)\n\t\t{\n\t\t\tElement el = (Element) rt.getAny().get(0);\n\t\t\tif (el.getOwnerDocument() != getDocument())\n\t\t\t{\n\t\t\t\t_doc = el.getOwnerDocument();\n\t\t\t}\n\t\t}\n\t\tsetRecordType(rt);\n\t}",
"@Override\n protected ASTNode getTargetTableNode(ASTNode tree) {\n ASTNode tabName = (ASTNode)tree.getChild(0);\n assert tabName.getToken().getType() == HiveParser.TOK_TABNAME :\n \"Expected tablename as first child of \" + operation + \" but found \" + tabName.getName();\n return tabName;\n }",
"private boolean limpiarTablaDocs(Table t)\n\t{\n\t\tt.removeAll(); //borra todo?\n\t\treturn true;\n\t}",
"private static void loadTableData() {\n\n\t\tBufferedReader in = null;\n\t\ttry {\n\t\t\tin = new BufferedReader(new FileReader(dataDir + tableInfoFile));\n\n\t\t\twhile (true) {\n\n\t\t\t\t// read next line\n\t\t\t\tString line = in.readLine();\n\t\t\t\tif (line == null) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tString[] tokens = line.split(\" \");\n\t\t\t\tString tableName = tokens[0];\n\t\t\t\tString tableFileName = tokens[1];\n\n\t\t\t\ttableNameToSchema.put(tableName, new HashMap<String, Type>());\n\t\t\t\ttableNameToOrdredSchema.put(tableName,\n\t\t\t\t\t\tnew ArrayList<ColumnInfo>());\n\n\t\t\t\t// attributes data\n\t\t\t\tfor (int i = 2; i < tokens.length;) {\n\n\t\t\t\t\tString attName = tokens[i++];\n\t\t\t\t\tString attTypeName = (tokens[i++]);\n\n\t\t\t\t\tType attType = null;\n\n\t\t\t\t\t/*\n\t\t\t\t\t * Undefined, how to represent dates, crazy longs probably\n\t\t\t\t\t * won't need this for now...\n\t\t\t\t\t */\n\t\t\t\t\tif (attTypeName.equals(\"CHAR\")) {\n\t\t\t\t\t\tattType = Types.getCharType(Integer\n\t\t\t\t\t\t\t\t.valueOf(tokens[i++]));\n\t\t\t\t\t} else if (attTypeName.equals(\"DATE\")) {\n\t\t\t\t\t\tattType = Types.getDateType();\n\t\t\t\t\t} else if (attTypeName.equals(\"DOUBLE\")) {\n\t\t\t\t\t\tattType = Types.getDoubleType();\n\t\t\t\t\t} else if (attTypeName.equals(\"FLOAT\")) {\n\t\t\t\t\t\tattType = Types.getFloatType();\n\t\t\t\t\t} else if (attTypeName.equals(\"INTEGER\")) {\n\t\t\t\t\t\tattType = Types.getIntegerType();\n\t\t\t\t\t} else if (attTypeName.equals(\"LONG\")) {\n\t\t\t\t\t\tattType = Types.getLongType();\n\t\t\t\t\t} else if (attTypeName.equals(\"VARCHAR\")) {\n\t\t\t\t\t\tattType = Types.getVarcharType();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new RuntimeException(\"Invalid type: \"\n\t\t\t\t\t\t\t\t+ attTypeName);\n\t\t\t\t\t}\n\n\t\t\t\t\ttableNameToSchema.get(tableName).put(attName, attType);\n\n\t\t\t\t\tColumnInfo ci = new ColumnInfo(attName, attType);\n\t\t\t\t\ttableNameToOrdredSchema.get(tableName).add(ci);\n\n\t\t\t\t}\n\n\t\t\t\t// at this point, table info loaded.\n\n\t\t\t\t// Create table\n\t\t\t\tmyDatabase.getQueryInterface().createTable(tableName,\n\t\t\t\t\t\ttableNameToSchema.get(tableName));\n\n\t\t\t\t// Now, load data into newly created table\n\t\t\t\treadTable(tableName, tableFileName);\n\n\t\t\t}\n\n\t\t\tin.close();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tHelpers.print(e.getStackTrace().toString(),\n\t\t\t\t\tutil.Consts.printType.ERROR);\n\t\t}\n\n\t}",
"private void createTable(BufferedWriter writer, ResultTable tableData)\r\n\t\t\tthrows IOException {\r\n\t\tint height = (37 * tableData.getDataCount()) + 56\r\n\t\t\t\t+ (tableData.getExpectionMessageData().size() * 4);\r\n\t\tString container = \"<div style='width: 766px;background-color: #FFFFFF;box-shadow: 1px 1px 1px #888888;;height: \"\r\n\t\t\t\t+ height + \"px;position: absolute;top: 165px;left: 554px'>\";\r\n\t\tString table = \"<table style='top:10px;position:absolute;width: 750px;left:8px;'><tbody>\";\r\n\t\tString headers = \"<tr><th>TestCase Id</th><th>Method Name</th><th>Servrity</th><th>Time Taken</th><th>Result</th></tr>\";\r\n\r\n\t\twriter.write(container + table + headers);\r\n\r\n\t}",
"private static void populateTable(Table resultantTable,\n\t\t\tTable tableToAppySelectionOn, ArrayList<Integer> listOfIndices)\n\t\t\tthrows IOException {\n\n\t\t// now write to the .dat file describing the Where clause\n\t\tFileWriter fwr = new FileWriter(resultantTable.tableFilePath, true);\n\t\tBufferedWriter bwr = new BufferedWriter(fwr);\n\n\t\tString tuple;\n\t\tint tupleNo = 0;\n\t\t\n\t\t// this string builder object is used to speed up the processing of writing in files\n\t\tStringBuilder sb = new StringBuilder(\"\");\n\t\tint count = 0;\n\t\t\n\t\twhile ((tuple = tableToAppySelectionOn.returnTuple()) != null) {\n\t\t\t\n\t\t\ttupleNo++;\n\t\t\t// this is the string that I need to write down\n\t\t\tif (listOfIndices.contains(tupleNo)) {\n\t\t\t\t/*bwr.write(tuple);\n\t\t\t\tbwr.write(\"\\n\");\n\t\t\t\tbwr.flush();*/\n\t\t\t\t++count;\n\t\t\t\t// this is the condition when we write in the file, this just corresponds to one I/O\n\t\t\t\tif(count == 100000000){\n\t\t\t\t\tsb.append(tuple + \"\\n\");\n\t\t\t\t\tbwr.write(sb.toString());\n\t\t\t\t\tcount = 0;\n\t\t\t\t\tsb = new StringBuilder(\"\");\n\t\t\t\t}else{\n\t\t\t\t\tsb.append(tuple + \"\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// if the above condition is not satisfied, then just write the string builder to the file\n\t\tcount = 0;\n\t\tbwr.write(sb.toString());\n\t\tsb = null;\n\t\tbwr.close();\n\t}",
"private TableInformation readTable(String tablePath, Component parent)\n {\n // Read the table's data from the database\n TableInformation tableInfo = dbTable.loadTableData(tablePath,\n false,\n false,\n false,\n false,\n parent);\n\n // Check that the data was successfully loaded from the database and\n // that the table isn't empty\n if (!tableInfo.isErrorFlag() && tableInfo.getData().length != 0)\n {\n // Get the table's type definition\n TypeDefinition typeDefn = tableTypeHandler.getTypeDefinition(tableInfo.getType());\n\n // Get the data and place it in an array for reference below. Add\n // columns to contain the table type and path\n String[][] data = CcddUtilities.appendArrayColumns(tableInfo.getData(), 2);\n int typeColumn = data[0].length - TYPE_COLUMN_DELTA;\n int pathColumn = data[0].length - PATH_COLUMN_DELTA;\n\n // Get the index of the column containing the data type for this\n // table if it has one\n int dataTypeColumn = typeDefn.getColumnIndexByInputType(InputDataType.PRIM_AND_STRUCT);\n\n // Step through each row\n for (int row = 0; row < data.length && !tableInfo.isErrorFlag(); row++)\n {\n // Use the index column to store the table path and type for\n // reference during script execution\n data[row][typeColumn] = tableInfo.getType();\n data[row][pathColumn] = tablePath;\n\n // Store the data from the table in the combined storage array\n combinedData = CcddUtilities.concatenateArrays(combinedData,\n new String[][] {data[row]});\n\n // Check if this is a table reference (a data type column was\n // found and it does not contain a primitive data type)\n if (dataTypeColumn != -1\n && !dataTypeHandler.isPrimitive(data[row][dataTypeColumn]))\n {\n // Get the column containing the variable name for this\n // table\n int varNameColumn = typeDefn.getColumnIndexByInputType(InputDataType.VARIABLE);\n\n // Check that a variable name column was found\n if (varNameColumn != -1)\n {\n // Get the column containing the array size for this\n // table\n int arraySizeColumn = typeDefn.getColumnIndexByInputType(InputDataType.ARRAY_INDEX);\n\n // Check if the data type or variable name isn't blank,\n // and if an array size column doesn't exist or that\n // the row doesn't reference an array definition. This\n // is necessary to prevent appending the prototype\n // information for this data type structure\n if ((!data[row][dataTypeColumn].isEmpty()\n || !data[row][varNameColumn].isEmpty())\n && (arraySizeColumn == -1\n || data[row][arraySizeColumn].isEmpty()\n || ArrayVariable.isArrayMember(data[row][varNameColumn])))\n {\n // Get the variable in the format\n // dataType.variableName, prepend a comma to\n // separate the new variable from the preceding\n // variable path, then break down the child table\n readTable(tablePath\n + \",\"\n + data[row][dataTypeColumn]\n + \".\"\n + data[row][varNameColumn],\n parent);\n }\n }\n // Table has no variable name column\n else\n {\n tableInfo.setErrorFlag();\n break;\n }\n }\n }\n }\n\n return tableInfo;\n }",
"public void writeTable(Table table, String pathName, String filename){\n\n Record tempRow; \n String tempString;\n FileWriter fw;\n\n //create file\n try {\n fw = new FileWriter(pathName + filename);\n \n //add table name\n fw.write(table.getName());\n fw.write(\"\\n\");\n\n //add each row to a new line\n //get primary keys and loop over to add rows\n List<String> keys = table.getPrimaryKeys();\n for (int i = 0; i < keys.size(); i++){\n tempRow = table.getRow(keys.get(i));\n tempString = tempRow.getAllItemString();\n fw.write(tempString);\n fw.write(\"\\n\");\n }\n\n fw.close();\n } catch (IOException ex){\n System.out.println(\"ERROR: failed to create file \" + filename);\n }\n }",
"private ConfigurationHTMLPrinter endTable() {\n return decrementIndent().println(\"</table>\");\n }",
"public void analyzeCreateTableStmt(TCreateTableSqlStatement stmt) {\n\t\tString tableName=stmt.getTargetTable().toString();\n\t\tif(Input.tablesInfo.get(tableName)!=null){System.out.println(\"Table already exists..\"); return;}\n\t\tTColumnDefinition column;\n\t\ttry \n\t\t{\n\t\tFile file =new File(\"Resources/metadata.txt\");\n\t\tString NF=\"Resources/\"+tableName+\".csv\";\n\t\tFile newFile =new File(NF);\n\t\tif(!newFile.exists())\n\t\t\tnewFile.createNewFile();\n\t\tif(!file.exists())\n\t\t\t\tfile.createNewFile();\n\t\t\t\t\n\t\t\tFileWriter fileWritter = new FileWriter(file,true);\n\t\t\tBufferedWriter bufferWritter = new BufferedWriter(fileWritter);\n\t\t\t//bufferWritter.newLine(); \n\t\t\tbufferWritter.write(\"<begin_table>\".trim());\n\t\t\tbufferWritter.newLine(); bufferWritter.write(tableName);\n\t\t\n\t\t\tfor(int i=0;i<stmt.getColumnList().size();i++)\n\t\t{\n bufferWritter.newLine();\n column = stmt.getColumnList().getColumn(i);\n bufferWritter.write(column.getColumnName().toString().trim());\n \n }\n\t\t\n\t\tbufferWritter.newLine();\n\t\tbufferWritter.write(\"<end_table>\".trim());bufferWritter.newLine(); \n\t\tbufferWritter.close();\n\t\tSystem.out.println(\"Table created successfully...\");\n\t\t}\t\n\t\t catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t\n\t}",
"public void dumpTable(File toFile, boolean append, String where)\n throws DBException\n {\n DBSelect<gDBR> dbSel = null;\n if (!StringTools.isBlank(where)) {\n dbSel = new DBSelect<gDBR>(this, where);\n }\n this.dumpTable(toFile, append, dbSel, /*String[]*/null);\n }",
"public boolean isTableField()\n {\n boolean ret = false;\n try {\n ret = getField().getCollection() instanceof Table;\n } catch (final CacheReloadException e) {\n LOG.error(\"CacheReloadException\", e);\n }\n return ret;\n }",
"public static DSSchemaIFace processDOM(Document aDoc) {\n\t\tDSSchemaDef schemaDef = new DSSchemaDef();\n\t\tNode schemaNode = DBUIUtils.findNode(aDoc, \"schema\");\n\t\tif (schemaNode == null) {\n\t\t\tSystem.out.println(\"*** Error DOM is missing its schema node!\");\n\t\t\tschemaDef = null;\n\t\t\treturn null;\n\t\t}\n\n\t\tNodeList tableList = schemaNode.getChildNodes();\n\t\tif (tableList != null) {\n\t\t\tfor (int i = 0; i < tableList.getLength(); i++) {\n\t\t\t\tNode tableNode = tableList.item(i);\n\t\t\t\tif (tableNode.getNodeType() != Node.TEXT_NODE) {\n\t\t\t\t\tString nodeName = tableNode.getNodeName();\n\t\t\t\t\tif (nodeName != null && nodeName.equals(\"table\")) {\n\t\t\t\t\t\tString name = DBUIUtils\n\t\t\t\t\t\t\t\t.findAttrValue(tableNode, \"name\");\n\t\t\t\t\t\tif (name != null && name.length() > 0) {\n\t\t\t\t\t\t\tDSTableDef tableDef = new DSTableDef(name);\n\t\t\t\t\t\t\tschemaDef.addTable(tableDef);\n\t\t\t\t\t\t\tNodeList fieldList = tableNode.getChildNodes();\n\t\t\t\t\t\t\tif (fieldList != null) {\n\t\t\t\t\t\t\t\tfor (int j = 0; j < fieldList.getLength(); j++) {\n\t\t\t\t\t\t\t\t\tNode field = fieldList.item(j);\n\t\t\t\t\t\t\t\t\tif (field != null\n\t\t\t\t\t\t\t\t\t\t\t&& field.getNodeType() != Node.TEXT_NODE) {\n\t\t\t\t\t\t\t\t\t\tString fldName = DBUIUtils\n\t\t\t\t\t\t\t\t\t\t\t\t.findAttrValue(field, \"name\");\n\t\t\t\t\t\t\t\t\t\tif (fldName == null\n\t\t\t\t\t\t\t\t\t\t\t\t|| fldName.length() == 0) {\n\t\t\t\t\t\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t\t\t\t\t\t.println(\"*** Error field DOM node is missing its name!\");\n\t\t\t\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tString dataType = DBUIUtils\n\t\t\t\t\t\t\t\t\t\t\t\t.findAttrValue(field,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"dataType\");\n\t\t\t\t\t\t\t\t\t\tif (dataType == null\n\t\t\t\t\t\t\t\t\t\t\t\t|| dataType.length() == 0) {\n\t\t\t\t\t\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t\t\t\t\t\t.println(\"*** Error field DOM node is missing its data type!\");\n\t\t\t\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t// handle missing value\n\t\t\t\t\t\t\t\t\t\tNode missingValueList = DBUIUtils\n\t\t\t\t\t\t\t\t\t\t\t\t.findNode(field,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tMISSINGVALUELIST);\n\t\t\t\t\t\t\t\t\t\tVector missingValueCodeVector = new Vector();\n\t\t\t\t\t\t\t\t\t\t// System.out.println(\"before parsing missing value in schema parser\");\n\t\t\t\t\t\t\t\t\t\tif (missingValueList != null) {\n\t\t\t\t\t\t\t\t\t\t\t// System.out.println(\"after missingValue list is not null1\");\n\t\t\t\t\t\t\t\t\t\t\tNodeList missingValue = missingValueList\n\t\t\t\t\t\t\t\t\t\t\t\t\t.getChildNodes();\n\t\t\t\t\t\t\t\t\t\t\t// System.out.println(\"after get missing value list kids2\");\n\t\t\t\t\t\t\t\t\t\t\tif (missingValue != null) {\n\t\t\t\t\t\t\t\t\t\t\t\t// System.out.println(\"after missingvalue list is not null3\");\n\t\t\t\t\t\t\t\t\t\t\t\tfor (int k = 0; k < missingValue\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getLength(); k++) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t// System.out.println(\"in missing value element4\");\n\t\t\t\t\t\t\t\t\t\t\t\t\tNode missingcodeNode = missingValue\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.item(k);\n\t\t\t\t\t\t\t\t\t\t\t\t\tString missingCode = DBUIUtils\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.findNodeValue(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmissingcodeNode,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tMISSINGVALUECODE);\n\t\t\t\t\t\t\t\t\t\t\t\t\t// System.out.println(\"the missing value code add to vector \"+missingCode);\n\t\t\t\t\t\t\t\t\t\t\t\t\tmissingValueCodeVector\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.add(missingCode);\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\n\t\t\t\t\t\t\t\t\t\tString keyType = DBUIUtils\n\t\t\t\t\t\t\t\t\t\t\t\t.findAttrValue(field, \"keyType\");\n\t\t\t\t\t\t\t\t\t\tif (keyType != null) {\n\t\t\t\t\t\t\t\t\t\t\tif (keyType\n\t\t\t\t\t\t\t\t\t\t\t\t\t.equals(KEY_DESC[DSTableKeyIFace.PRIMARYKEY])) {\n\t\t\t\t\t\t\t\t\t\t\t\ttableDef.addPrimaryKey(fldName,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdataType,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmissingValueCodeVector);\n\t\t\t\t\t\t\t\t\t\t\t} else if (keyType\n\t\t\t\t\t\t\t\t\t\t\t\t\t.equals(KEY_DESC[DSTableKeyIFace.SECONDARYKEY])) {\n\t\t\t\t\t\t\t\t\t\t\t\ttableDef.addSecondaryKey(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfldName, dataType,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmissingValueCodeVector);\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\ttableDef.addField(fldName,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdataType,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmissingValueCodeVector);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\ttableDef.addField(fldName,\n\t\t\t\t\t\t\t\t\t\t\t\t\tdataType,\n\t\t\t\t\t\t\t\t\t\t\t\t\tmissingValueCodeVector);\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} else {\n\t\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t\t.println(\"*** Error table DOM node is missing its name!\");\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t.println(\"*** Error chiuld of schema is not \\\"table\\\"!\");\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn schemaDef;\n\t}",
"public void writeTable(){\n\n PersistenceUtil pu= PersistenceUtil.getInstance();\n EntityManagerFactory emf =pu.getEmf();\n EntityManager em = emf.createEntityManager();\n\n\n\n final Integer[] i = {0};\n\n tabela.getColumns().forEach((Consumer<TableColumn<Map, String>>) col -> {\n col.setCellValueFactory(new MapValueFactory<>(\"column\" + (i[0]).toString()));\n\n\n if(alegereBD!=\"0\")\n switch(alegereTabela){\n case \"Artists\":\n\n if(i[0]==0)\n col.setText(\"id\");\n if(i[0]==1)\n col.setText(\"Name\");\n if(i[0]==2)\n col.setText(\"Country\");\n if(i[0]==3)\n col.setText(\"\");\n if(i[0]==4)\n col.setText(\"\");\n textField1.disableProperty().setValue(false);\n textField2.disableProperty().setValue(false);\n\n textField3.disableProperty().setValue(true);\n textField4.disableProperty().setValue(true);\n textField5.disableProperty().setValue(true);\n\n\n\n\n break;\n case \"Albums\":\n if(i[0]==0)\n col.setText(\"id\");\n if(i[0]==1)\n col.setText(\"Name\");\n if(i[0]==2)\n col.setText(\"Genre\");\n if(i[0]==3)\n col.setText(\"Artist\");\n if(i[0]==4)\n col.setText(\"Realease\");\n\n textField3.disableProperty().setValue(false);\n textField4.disableProperty().setValue(false);\n textField5.disableProperty().setValue(false);\n\n textField1.disableProperty().setValue(true);\n textField2.disableProperty().setValue(true);\n\n\n break;\n case \"Genres\":\n if(i[0]==0)\n col.setText(\"id\");\n if(i[0]==1)\n col.setText(\"Name\");\n if(i[0]==2)\n col.setText(\"\");\n if(i[0]==3)\n col.setText(\"\");\n if(i[0]==4)\n col.setText(\"\");\n\n textField1.disableProperty().setValue(true);\n textField2.disableProperty().setValue(true);\n textField3.disableProperty().setValue(true);\n textField4.disableProperty().setValue(true);\n textField5.disableProperty().setValue(true);\n\n break;\n case \"Charts\":\n if(i[0]==0)\n col.setText(\"id\");\n if(i[0]==1)\n col.setText(\"Album\");\n if(i[0]==2)\n col.setText(\"Artist\");\n if(i[0]==3)\n col.setText(\"Position\");\n if(i[0]==4)\n col.setText(\"\");\n\n textField1.disableProperty().setValue(true);\n textField2.disableProperty().setValue(true);\n textField3.disableProperty().setValue(true);\n textField4.disableProperty().setValue(true);\n textField5.disableProperty().setValue(true);\n\n break;\n }\n\n\n System.out.println(i[0]);\n i[0]++;\n });\n\n\n\n tabela.setItems(generateDataInMap());\n }",
"private boolean executeQuery(String inputPath, String inputFile, String outputType, String outputPath, String outputFile) throws InterruptedException{\n \tDatabase database = null;\n \t//DatabaseTools.getDatabase(\"io.metadew.iesi.connection.database.sqlite.SqliteDatabase\");\n \t\n \tObjectMapper objectMapper = new ObjectMapper();\n \tDataObjectOperation dataObjectOperation = new DataObjectOperation(inputFile);\n \t\n \tfor (DataObject dataObject : dataObjectOperation.getDataObjects()) {\n \t\tMetadataTable metadataTable = objectMapper.convertValue(dataObject.getData(), MetadataTable.class);\n \t\tFileTools.appendToFile(outputFile, \"\", DatabaseHandler.getInstance().getCreateStatement(database, metadataTable, \"IESI_\"));\n \t}\n \t\n \tthis.getActionExecution().getActionControl().increaseSuccessCount();\n return true;\n }",
"void exportToAJP(JTable tableToExport, String tabName, String pathToExportTo) throws IOException \n {\n BufferedWriter out;//defines a writer\n TableModel model = tableToExport.getModel();\n \n CodeSource codeSource = ExportToAJP.class.getProtectionDomain().getCodeSource();\n File jarFile = new File(URLDecoder.decode(codeSource.getLocation().getPath(), \"UTF-8\"));\n pathToExportTo = jarFile.getParentFile().getPath();\n //creates new save in the install dir/saves folder\n out = new BufferedWriter(new FileWriter(pathToExportTo+\"\\\\saves\\\\\"+tabName+\".ajp\"));\n \n try \n { //writes the tabled headers to the .ajp\n for(int i=0; i < model.getColumnCount(); i++) {\n if (i!=model.getColumnCount()-1)\n out.write(model.getColumnName(i) + \",\");\n else\n out.write(model.getColumnName(i));\n }\n out.write(\"\\n\");//new line\n //cycles each cell after the headers and writes to the csv file\n for(int i=0; i< model.getRowCount(); i++) {\n for(int j=0; j < model.getColumnCount(); j++) {\n if (model.getValueAt(i,j)!= null)//checks for empty cell\n {\n if (j!=model.getColumnCount()-1)\n out.write(model.getValueAt(i,j).toString()+\",\");\n else\n out.write(model.getValueAt(i,j).toString());\n }\n else if (j!=model.getColumnCount()-1)\n out.write(\",\");\n }\n out.write(\"\\n\");\n }\n } catch (IOException e) {}\n finally //checks if the writter worked\n {\n try {\n if(out != null){\n out.close();//closes file for deletion and other manipulation\n } else {\n System.out.println(\"Buffer has not been initialized!\");\n }\n } catch (IOException e) {}\n }\n }",
"public static void findElemInTable(XSComplexTypeDecl type, XSElementDecl elem, SymbolHash elemDeclHash) throws XMLSchemaException {\n/* 572 */ String name = elem.fName + \",\" + elem.fTargetNamespace;\n/* */ \n/* 574 */ XSElementDecl existingElem = null;\n/* 575 */ if ((existingElem = (XSElementDecl)elemDeclHash.get(name)) == null) {\n/* */ \n/* 577 */ elemDeclHash.put(name, elem);\n/* */ }\n/* */ else {\n/* */ \n/* 581 */ if (elem == existingElem) {\n/* */ return;\n/* */ }\n/* 584 */ if (elem.fType != existingElem.fType)\n/* */ {\n/* 586 */ throw new XMLSchemaException(\"cos-element-consistent\", new Object[] { type.fName, elem.fName });\n/* */ }\n/* */ } \n/* */ }",
"public Element getElement() {\n return table;\n }",
"private String extractTableName() {\n\t\treturn fromElement.getQueryable().getTableName();\n\t}",
"private void UpdateTable() {\n\t\t\t\t\n\t\t\t}",
"public void write(FileWriter out) throws IOException {\n out.write(\"#\" + query + System.lineSeparator());\n yesTree.write(out);\n noTree.write(out);\n }",
"private void persistTable() {\n\n final EditText edit = findViewById(editId);\n final EditText edit2 = findViewById(editId2);\n String fileName = tableId;\n try {\n FileOutputStream fos = getBaseContext().openFileOutput(fileName, Context.MODE_PRIVATE);\n ObjectOutputStream os = new ObjectOutputStream(fos);\n os.writeObject(table);\n os.close();\n fos.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n edit.setText(table.getSerializedProducts());\n if (lastProductAdded != null)\n edit2.setText(lastProductAdded.getName());\n else\n edit2.setText(\"\");\n\n productNames = table.getProductNames();\n currentlySelectedProduct=0;\n\n refreshPrice();\n\n if (table.map.size() == 0) {\n deleteFile(tableId);\n return;\n }\n }",
"public void readTableData() {\n\t\tint colCount = driver.findElements(By.xpath(\"//*[@id='industry-filter-results']/div[2]/table/tbody/tr[1]/th\"))\n\t\t\t\t.size();\n\t\tSystem.out.println(\"colCount\" + colCount);\n\t\t// Find row size\n\t\tint rowCount = driver\n\t\t\t\t.findElements(By.xpath(\"//*[@id='industry-filter-results']/div[2]/table/tbody/tr/td/parent::*\")).size();\n\t\tSystem.out.println(\"rowCount\" + rowCount);\n\t\t// Find xpath for 1st row and 1st column. Break into multiple parts such\n\t\t// that row and column no can be iterated.\n\t\tString firstPart = \"(//*[@id='industry-filter-results']/div[2]/table/tbody/tr/td[2]/parent::tr)[\";\n\t\tString secondPart = \"1\";\n\t\tString thirdPart = \"]\";\n\t\tboolean flag = false;\n\t\t// Loop through rows one by one. Start from 1st row till row count.\n\t\tfor (int i = 1; i <= rowCount; i++) {\n\t\t\t// For every row, loop through columns one by one. Start from 1st\n\t\t\t// column till column count.\n\t\t\tfor (int j = 1; j <= colCount; j++) {\n\t\t\t\tString finalPart = firstPart + i + secondPart + j + thirdPart;\n\t\t\t\tSystem.out.println(finalPart);\n\t\t\t\tString text = driver.findElement(By.xpath(finalPart)).getText();\n\t\t\t\tSystem.out.print(text + \" | \");\n\t\t\t\t//If we need to stop after a particular text is matched use if condition\n\t\t\t\tif(text.contains(\"abc\")){\n\t\t\t\t\tSystem.out.println(text);\n\t\t\t\t\tflag = true;//Set flag as true(Logic from Naveen automation labs)\n\t\t\t\t\tbreak;//This will stop iterating the columns.(https://www.youtube.com/watch?v=Rjs9qLRP9tM&list=PLFGoYjJG_fqo4oVsa6l_V-_7-tzBnlulT&index=18)\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t\tif(flag){\n\t\t\t\tbreak;//This will break outer loop only if flag is true. i.e. we have retrieved the text that we need. If not it will continue with next iteration.\n\t\t\t}\n\t\t}\n\t}",
"public boolean recreateDBTables(Object[] sqlBuffer, java.io.PrintWriter out) throws Exception;",
"String storeTable(String name) {\n PrintWriter writer = null;\n Table t = tables.get(name);\n\n try {\n\n /** Boolean decides if to overwrite the file if false, or continue if true */\n FileWriter fw = new FileWriter(name + \".tbl\", false);\n writer = new PrintWriter(fw);\n\n writer.println(t.getColString());\n\n int i = 1;\n for (; i < t.rowSize(); i += 1) {\n writer.println(t.getRowString(i));\n }\n\n writer.print(t.getRowString(i));\n writer.close();\n return \"\";\n\n } catch (IOException e) {\n return \"ERROR: Invalid Table\";\n } catch (NullPointerException e) {\n return \"ERROR: Invalid Table\";\n }\n\n\n }",
"@Override\r\n public void updateTable() {\n FileManager fileManager = new FileManager();\r\n InputStream input = fileManager.readFileFromRAM(fileManager.XML_DIR, FILE_NAME);\r\n if(input != null){\r\n dropTable();\r\n createTable();\r\n parserXml(input); \r\n }else{\r\n Log.i(FILE_NAME,\"file is null\");\r\n }\r\n \r\n }",
"interface DataTableFile extends TableDataSource {\n\n /**\n * Creates a new file of the given table. The table is initialised and\n * contains 0 row entries. If the table already exists in the database then\n * this will throw an exception.\n * <p>\n * On exit, the object will be initialised and loaded with the given table.\n *\n * @param def the definition of the table.\n */\n void create(DataTableDef def) throws IOException;\n\n /**\n * Updates a file of the given table. If the table does not exist, then it\n * is created. If the table already exists but is different, then the\n * existing table is modified to incorporate the new fields structure.\n * <p>\n * The DataTableFile must have previously been 'load(table_name)' before\n * this call.\n * <p>\n * Implementations of this method may choose to reorganise information that\n * the relational schemes are dependant on (the row order for example). If\n * this method returns 'true' then we must also reindex the schemes.\n * <p>\n * <strong>NOTE:</strong> If the new format has columns that are not\n * included in the new format then the columns are deleted.\n *\n * @param def the definition of the table.\n * @return true if the table topology has changed.\n */\n boolean update(DataTableDef def) throws IOException;\n\n /**\n * This is called periodically when this data table file requires some\n * maintenance. It is recommended that this method is called every\n * time the table is initialized (loaded).\n * <p>\n * The DataTableFile must have previously been 'load(table_name)' before\n * this call.\n * <p>\n * This method may change the topology of the rows (delete rows that are\n * marked as deleted), therefore if the method returns true you need to\n * re-index the schemes.\n *\n * @return true if the table topology was changed.\n */\n boolean doMaintenance() throws IOException;\n\n// /**\n// * A recovery method that returns a DataTableDef object for this data\n// * table file that was last used in a call to 'create' or 'update'. This\n// * information should be kept in a secondary table topology store but it\n// * is useful to keep this information in the data table file just incase\n// * something bad happens, or tables are moved to another database.\n// */\n// DataTableDef recoverLastDataTableDef() throws IOException;\n\n /**\n * Loads a previously created table. A table can be loaded in read only\n * mode, in which case any methods that write to the DataTableFile will\n * throw an IOException.\n *\n * @param table_name the name of the table.\n * @param read_only if true then the table file is opened as read-only.\n */\n void load(String table_name, boolean read_only) throws IOException;\n\n /**\n * Shuts down the table. This is called when the table is closed and the\n * resources it uses are to be freed back to the system. This is called\n * as part of the database shut down procedure or called when we want to\n * free the resources associated with this table.\n */\n void shutdown() throws IOException;\n\n /**\n * Deletes the data table file in the file system. This is used to clear\n * up resources after a table has been dropped. The table must be shut\n * down before this method is called.\n * <p>\n * NOTE: Use this with care. All data is lost!\n */\n void drop();\n\n /**\n * Flushes all information that may be cached in memory to disk. This\n * includes any relational data, any cached data that hasn't made it to\n * the file system yet. It will write out all persistant information\n * and leave the table in a state where it is fully represented in the\n * file system.\n */\n void updateFile() throws IOException;\n\n /**\n * Locks the data in the file to prevent the system overwritting entries\n * that have been marked as removed. This is necessary so we may still\n * safely read removed entries from the table while the table is locked.\n */\n void addRowsLock();\n\n /**\n * Unlocks the data in the file to indicate that the system may safely\n * overwrite removed entries in the file.\n */\n void removeRowsLock();\n\n /**\n * Returns true if the file currently has all of its rows locked.\n */\n boolean hasRowsLocked();\n\n// /**\n// * The number of rows that are currently stored in this table. This number\n// * does not include the rows that have been marked as removed.\n// */\n// int rowCount();\n\n /**\n * Returns true if the given row index points to a valid and available\n * row entry. Returns false if the row entry has been marked as removed,\n * or the index goes outside the bounds of the table.\n */\n boolean isRowValid(int record_index) throws IOException;\n\n /**\n * Adds a complete new row into the table. If the table is in a row locked\n * state, then this will always add a new entry to the end of the table.\n * Otherwise, new entries are added where entries were previously removed.\n * <p>\n * This will update any column indices that are set.\n *\n */\n int addRow(RowData row_data) throws IOException;\n\n /**\n * Removes a row from the table at the given index. This will only mark\n * the entry as removed, and will not actually remove the data. This is\n * because a process is allowed to read the data even after the row has been\n * marked as removed (if the rows have been locked).\n * <p>\n * This will update any column indices that are set.\n *\n * @param row_index the raw row index of the entry to be marked as removed.\n */\n void removeRow(int row_index) throws IOException;\n\n// /**\n// * Returns a DataCell object of the entry at the given column, row\n// * index in the table. This will always work provided there was once data\n// * stored at that index, even if the row has been marked as deleted.\n// */\n// DataCell getCellAt(int column, int row) throws IOException;\n\n /**\n * Returns a unique number. This is incremented each time it is accessed.\n */\n long nextUniqueKey() throws IOException;\n\n}",
"public WebElement getResultTable() {\n System.out.println(\"[step] getResultTable\");\n return page.findElement(resultTable);\n }",
"@Override\n public Class<MytableRecord> getRecordType() {\n return MytableRecord.class;\n }",
"@Override\n\tpublic void preVisit( TTable table )\n\t{\n\n\t\tETableSource type = table.getTableType();\n\n\t\tswitch ( type )\n\t\t{\n\t\t\tcase objectname:\n\t\t\t\tthis.addParseResult( table );\n\t\t\t\tbreak;\n\t\t\tcase subquery:\n\t\t\t\ttable.getSubquery().accept( this );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tLOG.warn( \"Unsupported TTable type: \" + type );\n\t\t\t\tbreak;\n\t\t}\n\t}",
"private static boolean HandleTabInTables(TextEditor This, LogicalDirection direction) \r\n {\r\n if (!This.AcceptsRichContent)\r\n {\r\n return false; \r\n }\r\n\r\n if (This.Selection.IsTableCellRange) \r\n {\r\n // When table cell range is selected, Tab simply collapses \r\n // a selection to a content of a first cell\r\n This.Selection.SetCaretToPosition(This.Selection.Start, LogicalDirection.Backward, /*allowStopAtLineEnd:*/false, /*allowStopNearSpace:*/false);\r\n return true;\r\n } \r\n\r\n if (This.Selection.IsEmpty && TextPointerBase.IsAtRowEnd(This.Selection.End)) \r\n { \r\n // From the end of row we go to the first cell of a next row\r\n TableCell cell = null; \r\n TableRow row = ((TextPointer)This.Selection.End).Parent as TableRow;\r\n Invariant.Assert(row != null);\r\n TableRowGroup body = row.RowGroup;\r\n int rowIndex = body.Rows.IndexOf(row); \r\n\r\n if (direction == LogicalDirection.Forward) \r\n { \r\n if (rowIndex + 1 < body.Rows.Count)\r\n { \r\n cell = body.Rows[rowIndex + 1].Cells[0];\r\n }\r\n }\r\n else \r\n {\r\n if (rowIndex > 0) \r\n { \r\n cell = body.Rows[rowIndex - 1].Cells[body.Rows[rowIndex - 1].Cells.Count - 1];\r\n } \r\n }\r\n\r\n if (cell != null)\r\n { \r\n This.Selection.Select(cell.ContentStart, cell.ContentEnd);\r\n } \r\n return true; \r\n }\r\n\r\n // Check if selection is within a table\r\n TextElement parent = ((TextPointer)This.Selection.Start).Parent as TextElement;\r\n while (parent != null && !(parent is TableCell))\r\n { \r\n parent = parent.Parent as TextElement;\r\n } \r\n if (parent is TableCell) \r\n {\r\n TableCell cell = (TableCell)parent; \r\n TableRow row = cell.Row;\r\n TableRowGroup body = row.RowGroup;\r\n\r\n int cellIndex = row.Cells.IndexOf(cell); \r\n int rowIndex = body.Rows.IndexOf(row);\r\n\r\n if (direction == LogicalDirection.Forward) \r\n {\r\n if (cellIndex + 1 < row.Cells.Count) \r\n {\r\n cell = row.Cells[cellIndex + 1];\r\n }\r\n else if (rowIndex + 1 < body.Rows.Count) \r\n {\r\n cell = body.Rows[rowIndex + 1].Cells[0]; \r\n } \r\n else\r\n { \r\n //\r\n }\r\n }\r\n else \r\n {\r\n if (cellIndex > 0) \r\n { \r\n cell = row.Cells[cellIndex - 1];\r\n } \r\n else if (rowIndex > 0)\r\n {\r\n cell = body.Rows[rowIndex - 1].Cells[body.Rows[rowIndex - 1].Cells.Count - 1];\r\n } \r\n else\r\n { \r\n // \r\n }\r\n } \r\n\r\n Invariant.Assert(cell != null);\r\n This.Selection.Select(cell.ContentStart, cell.ContentEnd);\r\n return true; \r\n }\r\n\r\n return false; \r\n }",
"TableType getTableType()\n {\n return tableType;\n }",
"public void setElementType(QName elementType) {\n this.fieldElementType = elementType;\n }",
"private void outputBuildTableFunction(PrintWriter out) {\n\t\t\n\t\tout.println(\" private void buildTable() {\");\n\t\t\n\t\tout.println(\" GrammarState[] graph;\");\n\t\t\n\t\tfor (String rulename : grammardef.getTable().keySet()) {\n\t\t\t\n\t\t\tout.println(\" table.put(\\\"\" + rulename + \"\\\", new HashMap<String, GrammarRule>());\");\n\t\t\t\n\t\t\tfor (String tokname : grammardef.getTable().get(rulename).keySet()) {\n\t\t\t\t\n\t\t\t\tGrammarRule rule = grammardef.getTable().get(rulename).get(tokname);\n\t\t\t\t\n\t\t\t\tString multi = rule.isMultiChild() ? \"true\" : \"false\";\n\t\t\t\tString sub = rule.isSubrule() ? \"true\" : \"false\";\n\t\t\t\t\n\t\t\t\tint i = 0;\n\t\t\t\tout.println(\" graph = new GrammarState[\" + rule.getGraph().size() + \"];\");\n\t\t\t\tfor (GrammarState state : rule.getGraph()) {\n\t\t\t\t\tout.println(\" graph[\" + (i++) + \"] = new GrammarState(\\\"\" + state.name + \"\\\", \" + state.type + \");\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tout.println(\" table.get(\\\"\" + rulename + \"\\\").put(\\\"\" + tokname + \"\\\", new GrammarRule(\\\"\" + rule.getName() + \"\\\", \" + multi + \", \" + sub + \", graph));\");\n\t\t\t\tout.println();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tout.println(\" }\");\n\t\t\n\t}",
"public synchronized void writeFromFileIntoDB()throws IOWrapperException, IOIteratorException{\r\n \r\n fromFile_Name=Controller.CLASSES_TMP_FILENAME;\r\n iow_ReadFromFile = new IOWrapper();\r\n \r\n //System.out.println(\"Readin' from \"+fromFile_Name);\r\n \r\n iow_ReadFromFile.setupInput(fromFile_Name,0);\r\n \r\n iter_ReadFromFile = iow_ReadFromFile.getLineIterator();\r\n iow_ReadFromFile.setupOutput(this.dbname,this.username,this.password,this.hostname,this.port);\r\n \r\n iow_ReadFromFile.sendOutputQuery(\"DROP TABLE IF EXISTS \"+outtable);\r\n \r\n iow_ReadFromFile.sendOutputQuery(\r\n \"CREATE TABLE IF NOT EXISTS \"\r\n +outtable+\" (\"\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[0]+\" int(10) NOT NULL AUTO_INCREMENT, \"//wort_nr\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[1]+\" varchar(225), \"//wort_alph\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[2]+\" int(10), \"//krankheit \r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[3]+\" int(10), \"//farbe1 \r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[4]+\" real(8,2), \"//farbe1prozent\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[5]+\" int(10), \"//farbe2\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[6]+\" real(8,2), \"//farbe2prozent\r\n +\"PRIMARY KEY (\"+Controller.COLUMN_NAMES_FOR_DB_OUT[0]+\")) \"\r\n +\"ENGINE=MyISAM\"\r\n );\r\n while(iter_ReadFromFile.hasNext()){\r\n singleProgress+=1;\r\n String[] data = (String[])iter_ReadFromFile.next();\r\n \r\n //System.out.println(\"--> processing line \"+data);\r\n //escape quotes ' etc for SQL query\r\n if(data[1].matches(\".*'.*\")||data[1].matches(\".*\\\\.*\")){\r\n int sl = data[1].length();\r\n String escapedString = \"\";\r\n \r\n for (int i = 0; i < sl; i++) {\r\n char ch = data[1].charAt(i);\r\n switch (ch) {\r\n case '\\'':\r\n escapedString +='\\\\';\r\n escapedString +='\\'';\r\n break;\r\n case '\\\\':\r\n escapedString +='\\\\';\r\n escapedString +='\\\\';\r\n break;\r\n default :\r\n escapedString +=ch;\r\n break;\r\n }\r\n }\r\n data[1]=escapedString;\r\n }\r\n \r\n String insertStatement=\"INSERT INTO \"\r\n +outtable+\" (\"\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[0]+\", \"//node id\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[1]+\", \"//label\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[2]+\", \"//class id \r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[3]+\", \"//class id 1 \r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[4]+\", \"//percent\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[5]+\", \"//class id 2\r\n +Controller.COLUMN_NAMES_FOR_DB_OUT[6]+\") \"//percent \r\n +\"VALUES ('\"\r\n +data[0]+\"', '\"\r\n +data[1]+\"', '\"\r\n +data[2]+\"', '\"\r\n +data[3]+\"', '\"\r\n +data[4]+\"', '\"\r\n +data[5]+\"', '\"\r\n +data[6]+\"')\";\r\n \r\n //System.out.println(\"Sending insert statement:\"+insertStatement);\r\n iow_ReadFromFile.sendOutputQuery(insertStatement);\r\n }\r\n \r\n \r\n //iow_ReadFromFile.closeOutput();\r\n \r\n this.stillWorks=false;\r\n writeIntoDB=false;\r\n System.out.println(\"*\\tData written into database.\");\r\n\t}",
"public void exportTableInfoDefinitions(FileEnvVar exportFile,\n boolean includeTableTypes,\n boolean includeInputTypes,\n boolean includeDataTypes,\n String outputType,\n boolean addEOFMarker,\n boolean addSOFMarker) throws CCDDException, Exception\n {\n // Placeholder\n }",
"public void load() throws Throwable\n {\n // addCompositeTypes();\n\n Db typeRecordTable = new Db(null, 0);\n typeRecordTable.set_error_stream(System.err);\n typeRecordTable.set_errpfx(\"Catalog Retrieval Error\");\n typeRecordTable.open(CatalogManager.getCurrentDirectory()+\n File.separator+\n CompositeTypeRecord.databaseFileName, \n null, Db.DB_BTREE, Db.DB_CREATE, 0644);\n \n Db typeFieldRecordTable = new Db(null, 0);\n typeFieldRecordTable.set_error_stream(System.err);\n typeFieldRecordTable.set_errpfx(\"Catalog Retrieval Error\");\n typeFieldRecordTable.open(CatalogManager.getCurrentDirectory()+\n File.separator+\n TypeFieldRecord.databaseFileName, \n null, Db.DB_BTREE, Db.DB_CREATE, 0644);\n \n // Acquire an iterator for the table.\n Dbc outerIterator;\n outerIterator = typeRecordTable.cursor(null, 0);\n \n Dbc innerIterator;\n innerIterator = typeFieldRecordTable.cursor(null, 0);\n \n IntegerDbt outerKey = new IntegerDbt();\n CompositeTypeRecord typeRecord = new CompositeTypeRecord();\n \n while (outerIterator.get(outerKey, typeRecord, Db.DB_NEXT) == 0) {\n typeRecord.parse();\n if (Constants.VERBOSE) System.out.println(typeRecord);\n\t // if(!typeRecord.getIsInferred()) {\n\t\tCompositeType t = new CompositeType(typeRecord.getTypeName(), \n\t\t\t\t\t\t typeRecord.getIsInferred());\n\t\t\n\t\tIntegerArrayDbt innerKey = new IntegerArrayDbt(new int[] {outerKey.getInteger(), 0});\n\t\tTypeFieldRecord typeFieldRecord = new TypeFieldRecord();\n\t\t\n\t\tif (innerIterator.get(innerKey, typeFieldRecord, Db.DB_SET_RANGE) == 0) {\n\t\t int[] indices = innerKey.getIntegerArray();\n\t\t if (indices[0] == outerKey.getInteger()) {\n\t\t\ttypeFieldRecord.parse();\n\t\t\tif (Constants.VERBOSE) System.out.println(typeFieldRecord);\n\t\t\tt.addAttribute(typeFieldRecord.getFieldName(), \n\t\t\t\t findPrimitiveType(typeFieldRecord.getFieldType()),\n\t\t\t\t typeFieldRecord.getSize());\n\t\t\t\n\t\t\twhile (innerIterator.get(innerKey, typeFieldRecord, Db.DB_NEXT) == 0) {\n\t\t\t indices = innerKey.getIntegerArray();\n\t\t\t if (indices[0] != outerKey.getInteger()) break;\n\t\t\t typeFieldRecord.parse();\n\t\t\t if (Constants.VERBOSE) System.out.println(typeFieldRecord);\n\t\t\t t.addAttribute(typeFieldRecord.getFieldName(), \n\t\t\t\t\t findPrimitiveType(typeFieldRecord.getFieldType()),\n\t\t\t\t\t typeFieldRecord.getSize());\n\t\t\t}\n\t\t }\n\t\t}\n\t\taddCompositeType(t);\n\t\t//}\n }\n\n innerIterator.close();\n outerIterator.close();\n typeRecordTable.close(0);\n typeFieldRecordTable.close(0);\n }",
"private void createMainTable(Section subCatPart)\r\n throws BadElementException, MalformedURLException, IOException {\r\n \r\n \r\n PdfPTable table = new PdfPTable(model.getColumnCount());\r\n table.setWidthPercentage(100.0f);\r\n \r\n PdfPCell c1;\r\n for(int i = 0; i < model.getColumnCount(); i++){\r\n c1 = new PdfPCell(new Phrase(model.getColumnName(i)));\r\n c1.setHorizontalAlignment(Element.ALIGN_CENTER);\r\n table.addCell(c1);\r\n }\r\n table.setHeaderRows(1);\r\n\r\n for(int row = 0; row < model.getRowCount(); row++){\r\n for (int col = 0; col < model.getColumnCount(); col++) {\r\n String input = model.getValueAt(row, col).toString();\r\n if(input.equals(\"true\"))\r\n input = \"X\";\r\n if(input.equals(\"false\"))\r\n input = \"\";\r\n PdfPCell cell = new PdfPCell(new Phrase(input));\r\n cell.setHorizontalAlignment(Element.ALIGN_CENTER);\r\n table.addCell(cell);\r\n \r\n }\r\n }\r\n subCatPart.add(table);\r\n }",
"private void prepareLayout() {\n\n\t\tm_layouts = new ArrayList<SQLTableLayout>();\n\n\t\t//\n\t\t// construct the table tag\n\t\t//\n\t\tSQLTableLayout layout = new SQLTableLayout(TAG_TABLE_NAME);\n\t\tlayout.addFieldToSQLTableLayout(TAG_FIELD_ID, \"INTEGER primary key\",\n\t\t\t\t\"tag id\");\n\t\tlayout.addFieldToSQLTableLayout(TAG_FIELD_NAME, \"TEXT\", \"tag name\");\n\t\tlayout.addFieldToSQLTableLayout(TAG_FIELD_CREATE_DATE, \"TEXT\",\n\t\t\t\t\"creation date of tag\");\n\t\tlayout.addFieldToSQLTableLayout(TAG_FIELD_USAGE, \"INTEGER\",\n\t\t\t\t\"tag usage in repository\");\n\t\tm_layouts.add(layout);\n\n\t\t//\n\t\t// construct the table file\n\t\t//\n\t\tlayout = new SQLTableLayout(FILE_TABLE_NAME);\n\t\tlayout.addFieldToSQLTableLayout(FILE_FIELD_ID, \"INTEGER primary key\",\n\t\t\t\t\"file id\");\n\t\tlayout.addFieldToSQLTableLayout(FILE_FIELD_PATH, \"TEXT\", \"path of file\");\n\t\tlayout.addFieldToSQLTableLayout(FILE_FIELD_TYPE, \"TEXT\", \"type of file\");\n\t\tlayout.addFieldToSQLTableLayout(FILE_FIELD_CREATE_DATE, \"TEXT\",\n\t\t\t\t\"creation date of file\");\n\t\tlayout.addFieldToSQLTableLayout(FILE_FIELD_HASH_SUM, \"TEXT\",\n\t\t\t\t\"hash sum of file\");\n\t\tm_layouts.add(layout);\n\n\t\t//\n\t\t// construct the mapping table\n\t\t//\n\t\tlayout = new SQLTableLayout(MAP_TABLE_NAME);\n\t\tlayout.addFieldToSQLTableLayout(MAP_FIELD_ID, \"INTEGER primary key\",\n\t\t\t\t\"map id\");\n\t\tlayout.addFieldToSQLTableLayout(MAP_FIELD_FILE, \"INTEGER\", \"file id\");\n\t\tlayout.addFieldToSQLTableLayout(MAP_FIELD_TAG, \"INTEGER\", \"tag id\");\n\t\tm_layouts.add(layout);\n\n\t\t//\n\t\t// construct the directory table\n\t\t//\n\t\tlayout = new SQLTableLayout(DIRECTORY_TABLE_NAME);\n\t\tlayout.addFieldToSQLTableLayout(DIRECTORY_FIELD_ID,\n\t\t\t\t\"INTEGER primary key\", \"directory id\");\n\t\tlayout.addFieldToSQLTableLayout(DIRECTORY_FIELD_PATH, \"TEXT\",\n\t\t\t\t\"path of directory\");\n\t\tm_layouts.add(layout);\n\n\t\t//\n\t\t// construct pending file table\n\t\t//\n\t\tlayout = new SQLTableLayout(PENDING_FILE_TABLE_NAME);\n\t\tlayout.addFieldToSQLTableLayout(PENDING_FIELD_ID,\n\t\t\t\t\"INTEGER primary key\", \"pending id\");\n\t\tlayout.addFieldToSQLTableLayout(PENDING_FIELD_PATH, \"TEXT\",\n\t\t\t\t\"pending path of file\");\n\t\tm_layouts.add(layout);\n\n\t\t//\n\t\t// construct synchronized table\n\t\t//\n\t\tlayout = new SQLTableLayout(SYNC_TABLE_NAME);\n\t\tlayout.addFieldToSQLTableLayout(SYNC_FIELD_ID, \"INTEGER primary key\",\n\t\t\t\t\"sync id\");\n\t\tlayout.addFieldToSQLTableLayout(SYNC_FIELD_PATH, \"TEXT\",\n\t\t\t\t\"path of synced file\");\n\t\tlayout.addFieldToSQLTableLayout(SYNC_FIELD_DATE, \"TEXT\", \"sync date\");\n\t\tlayout.addFieldToSQLTableLayout(SYNC_FIELD_TAGS, \"TEXT\",\n\t\t\t\t\"tags of synced file\");\n\t\tlayout.addFieldToSQLTableLayout(SYNC_FIELD_HASH_SUM, \"TEXT\",\n\t\t\t\t\"hash sum of synced file\");\n\t\tm_layouts.add(layout);\n\t}",
"private void changeToScanTable() {\n\t\tswitch (fileType) {\n\t\tcase INVENTORY:\n\t\t\ttableView.setItems(presentationInventoryData);\n\t\t\tbreak;\n\t\tcase INITIAL:\n\t\t\ttableView.setItems(presentationInitialData);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\ttableView.getColumns().clear();\n\t\t\tbreak;\n\t\t} // End switch statement\n\t}",
"public void printTable() {\r\n \tif (table.size() == 0)\r\n Logger.error(\"Table \" + table.getType() + \" is empty!\");\r\n else {\r\n table.forEachRow(new EachRowListenerPrint());\r\n }\r\n }",
"public void callBack(TreeBuffer tb, PrintWriter p) {\r\n\t\t//if the tree item is invisible, it's image will be null so skip the whole line\r\n\t\tif (tb.getImage() == null)\r\n\t\t\treturn;\r\n\r\n\t\t//selected node\r\n\t\tString bold = \"\";\r\n\t\tString unbold = \"\";\r\n\t\tif (tb.getHandle() == tb.getSelected()) {\r\n\t\t\tbold = \"<b>\";\r\n\t\t\tunbold = \"</b>\";\r\n\t\t}\r\n\r\n\t\tString text = tb.getText();\r\n\t\tString handle = new Integer(tb.getHandle()).toString();\r\n\t\tString name = getFullName();\r\n\t\tint level = tb.getLevel();\r\n\r\n\t\tStringBuffer output = new StringBuffer();\r\n\t\toutput.append(\"<TR>\");\r\n\r\n\t\t//select radio buttons or check boxes\r\n\t\tif (tb.getSelectMode() != TreeBuffer.SELECT_NONE) {\r\n\t\t\toutput.append(\"<TD WIDTH=\\\"1%\\\"\");\r\n\t\t\tif (_tableCellStyle != null)\r\n\t\t\t\toutput.append(\" style=\\\"\" + _tableCellStyle + \"\\\"\");\r\n\t\t\telse if (_tableCellClass != null)\r\n\t\t\t\toutput.append(\" class=\\\"\" + _tableCellClass + \"\\\"\");\r\n\t\t\toutput.append(\" valign=\\\"top\\\">\");\r\n\t\t}\r\n\t\tif (tb.getSelectable()) {\r\n\t\t\tif (tb.getSelectMode() == TreeBuffer.SELECT_ONE) {\r\n\t\t\t\toutput.append(\"<INPUT NAME=\\\"\" + getFullName() + \"Select\\\" TYPE=\\\"RADIO\\\"\" + \" VALUE=\\\"\" + handle + \"\\\"\");\r\n\t\t\t\tif (tb.getHandle() == tb.getSelected())\r\n\t\t\t\t\toutput.append(\" CHECKED \");\r\n\t\t\t\toutput.append(\"> \");\r\n\t\t\t} else if (tb.getSelectMode() == TreeBuffer.SELECT_MANY) {\r\n\t\t\t\toutput.append(\"<INPUT NAME=\\\"\" + getFullName() + handle + \"_Select\\\" TYPE=\\\"CHECKBOX\\\" VALUE=\\\"\" + handle + \"\\\"\");\r\n\t\t\t\tif (tb.getSelected(tb.getHandle()))\r\n\t\t\t\t\toutput.append(\" CHECKED \");\r\n\t\t\t\toutput.append(\">\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (tb.getSelectMode() != TreeBuffer.SELECT_NONE)\r\n\t\t\toutput.append(\"</TD>\");\r\n\r\n\t\t//write out the first anchor\r\n\r\n\t\tif (_tableCellClass != null)\r\n\t\t\toutput.append(\"<TD NOWRAP valign=\\\"top\\\" class=\\\"\" + _tableCellClass + \"\\\"><a name=\\\"\" + name + handle + \"\\\"></a>\");\r\n\t\telse if (_tableCellStyle != null)\r\n\t\t\toutput.append(\"<TD NOWRAP valign=\\\"top\\\" style=\\\"\" + _tableCellStyle + \"\\\"><a name=\\\"\" + name + handle + \"\\\"></a>\");\r\n\t\telse\r\n\t\t\toutput.append(\"<TD NOWRAP valign=\\\"top\\\"><a name=\\\"\" + name + handle + \"\\\"></a>\");\r\n\r\n\t\t//do the indent based on level\r\n\t\tif (_tb.getShowRoot() && (level > 0)) {\r\n\t\t\tfor (int i = 0; i < level; i++)\r\n\t\t\t\toutput.append(\" \");\r\n\t\t} else if (!_tb.getShowRoot() && (level > 1)) {\r\n\t\t\tfor (int i = 1; i < level; i++)\r\n\t\t\t\toutput.append(\" \");\r\n\t\t}\r\n\r\n\t\t//Expand/Contract image\r\n\t\tString img = new String(_nullImage);\r\n\r\n\t\tif (tb.hasChildren()) {\r\n\t\t\tString op;\r\n\t\t\tif (tb.isExpanded()) {\r\n\t\t\t\top = \"C\";\r\n\t\t\t\timg = _contractImage;\r\n\t\t\t} else {\r\n\t\t\t\top = \"E\";\r\n\t\t\t\timg = _expandImage;\r\n\t\t\t}\r\n\r\n\t\t\tif (_tb.getMode() == TreeBuffer.MODE_LINK) {\r\n\t\t\t\toutput.append(\"<a href=\\\"javascript:\" + name + \"_expandContract('\" + handle + \"','\" + op + \"')\\\">\");\r\n\t\t\t\toutput.append(\"<img src=\\\"\" + img + \"\\\" border=\\\"0\\\"></a>\");\r\n\t\t\t} else\r\n\t\t\t\toutput.append(\"<INPUT TYPE=\\\"IMAGE\\\" BORDER=\\\"0\\\" NAME = \\\"\" + name + \"_\" + handle + \"_\" + op + \"\\\" SRC=\\\"\" + img + \"\\\">\");\r\n\t\t} else\r\n\t\t\toutput.append(\"<img src=\\\"\" + img + \"\\\" border=\\\"0\\\">\");\r\n\r\n\t\toutput.append(bold);\r\n\r\n\t\t//File/Folder image and text\r\n\t\tString link = tb.getURL();\r\n\t\tString border = \"\\\"0\\\"\";\r\n\r\n\t\tif (tb.getImageURL() != null) {\r\n\r\n\t\t\tif (_window) {\r\n\r\n\t\t\t\toutput.append(\r\n\t\t\t\t\t\"<a href=\\\"javascript:doNothing();\\\" onclick=\\\"javascript:window.open('\"\r\n\t\t\t\t\t\t+ tb.getImageURL()\r\n\t\t\t\t\t\t+ \"', '\"\r\n\t\t\t\t\t\t+ _windowName\r\n\t\t\t\t\t\t+ \"','toolbars=\"\r\n\t\t\t\t\t\t+ _windowToolbar\r\n\t\t\t\t\t\t+ \",directories=\"\r\n\t\t\t\t\t\t+ _windowDirectories\r\n\t\t\t\t\t\t+ \",scrollbars=\"\r\n\t\t\t\t\t\t+ _windowScrollbars\r\n\t\t\t\t\t\t+ \",location=\"\r\n\t\t\t\t\t\t+ _windowLocation\r\n\t\t\t\t\t\t+ \",status=\"\r\n\t\t\t\t\t\t+ _windowStatus\r\n\t\t\t\t\t\t+ \",menubar=\"\r\n\t\t\t\t\t\t+ _windowMenubar\r\n\t\t\t\t\t\t+ \",resizable=\"\r\n\t\t\t\t\t\t+ _windowResizable\r\n\t\t\t\t\t\t+ \",width=\"\r\n\t\t\t\t\t\t+ _windowWidth\r\n\t\t\t\t\t\t+ \",height=\"\r\n\t\t\t\t\t\t+ _windowHeight\r\n\t\t\t\t\t\t+ \"');\\\">\");\r\n\r\n\t\t\t} else {\r\n\t\t\t\toutput.append(\"<a href=\\\"\" + encodeURL(tb.getImageURL()) + \"\\\"\");\r\n\t\t\t\tif (_targetFrame != null)\r\n\t\t\t\t\toutput.append(\" target=\\\"\" + _targetFrame + \"\\\" \");\r\n\t\t\t\toutput.append(\">\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\toutput.append(\"<img src=\\\"\" + tb.getImage() + \"\\\" border=\" + border + \">\");\r\n\r\n\t\tif (tb.getImageURL() != null)\r\n\t\t\toutput.append(\"</a>\");\r\n\r\n\t\t//text for file or folder\r\n\t\tif (link != null) {\r\n\r\n\t\t\tif (_window && _anchorClass != null) {\r\n\r\n\t\t\t\toutput.append(\r\n\t\t\t\t\t\"<a class=\\\"\"\r\n\t\t\t\t\t\t+ _anchorClass\r\n\t\t\t\t\t\t+ \"\\\" href=\\\"javascript:doNothing();\\\" onclick=\\\"javascript:window.open('\"\r\n\t\t\t\t\t\t+ _tb.replaceUno(link)\r\n\t\t\t\t\t\t+ \"', '\"\r\n\t\t\t\t\t\t+ _windowName\r\n\t\t\t\t\t\t+ \"','toolbars=\"\r\n\t\t\t\t\t\t+ _windowToolbar\r\n\t\t\t\t\t\t+ \",directories=\"\r\n\t\t\t\t\t\t+ _windowDirectories\r\n\t\t\t\t\t\t+ \",scrollbars=\"\r\n\t\t\t\t\t\t+ _windowScrollbars\r\n\t\t\t\t\t\t+ \",location=\"\r\n\t\t\t\t\t\t+ _windowLocation\r\n\t\t\t\t\t\t+ \",status=\"\r\n\t\t\t\t\t\t+ _windowStatus\r\n\t\t\t\t\t\t+ \",menubar=\"\r\n\t\t\t\t\t\t+ _windowMenubar\r\n\t\t\t\t\t\t+ \",resizable=\"\r\n\t\t\t\t\t\t+ _windowResizable\r\n\t\t\t\t\t\t+ \",width=\"\r\n\t\t\t\t\t\t+ _windowWidth\r\n\t\t\t\t\t\t+ \",height=\"\r\n\t\t\t\t\t\t+ _windowHeight\r\n\t\t\t\t\t\t+ \"');\\\">\");\r\n\r\n\t\t\t} else if (_window && _anchorClass == null) {\r\n\r\n\t\t\t\toutput.append(\r\n\t\t\t\t\t\"<a href=\\\"javascript:doNothing();\\\" onclick=\\\"javascript:window.open('\"\r\n\t\t\t\t\t\t+ _tb.replaceUno(link)\r\n\t\t\t\t\t\t+ \"', '\"\r\n\t\t\t\t\t\t+ _windowName\r\n\t\t\t\t\t\t+ \"','toolbars=\"\r\n\t\t\t\t\t\t+ _windowToolbar\r\n\t\t\t\t\t\t+ \",directories=\"\r\n\t\t\t\t\t\t+ _windowDirectories\r\n\t\t\t\t\t\t+ \",scrollbars=\"\r\n\t\t\t\t\t\t+ _windowScrollbars\r\n\t\t\t\t\t\t+ \",location=\"\r\n\t\t\t\t\t\t+ _windowLocation\r\n\t\t\t\t\t\t+ \",status=\"\r\n\t\t\t\t\t\t+ _windowStatus\r\n\t\t\t\t\t\t+ \",menubar=\"\r\n\t\t\t\t\t\t+ _windowMenubar\r\n\t\t\t\t\t\t+ \",resizable=\"\r\n\t\t\t\t\t\t+ _windowResizable\r\n\t\t\t\t\t\t+ \",width=\"\r\n\t\t\t\t\t\t+ _windowWidth\r\n\t\t\t\t\t\t+ \",height=\"\r\n\t\t\t\t\t\t+ _windowHeight\r\n\t\t\t\t\t\t+ \"');\\\">\");\r\n\r\n\t\t\t} else if (_anchorClass != null) {\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\toutput.append(\"<a class=\\\"\" + _anchorClass + \"\\\" href=\\\"\" + encodeURL(_tb.replaceUno(link)) + \"\\\"\");\r\n\t\t\t\tif (_targetFrame != null)\r\n\t\t\t\t\toutput.append(\"target=\\\"\" + _targetFrame + \"\\\" \");\r\n\t\t\t\toutput.append(\">\");\r\n\t\t\t} else {\r\n\t\t\t\toutput.append(\"<a href=\\\"\" + encodeURL(_tb.replaceUno(link)) + \"\\\"\");\r\n\t\t\t\tif (_targetFrame != null)\r\n\t\t\t\t\toutput.append(\"target=\\\"\" + _targetFrame + \"\\\" \");\r\n\t\t\t\toutput.append(\">\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t//output.append(\"<font face=\\\"Helvetica\\\" SIZE=\\\"2\\\"><SPAN STYLE=\\\"font-size:12;\\\">\" + text + \"</SPAN></font>\");\r\n\t\tif (_tableCellClass == null) {\r\n\r\n\t\t\tif (_fontTagStart != null)\r\n\t\t\t\toutput.append(_fontTagStart + _nodePtSizeSpanStart + text + _nodePtSizeSpanEnd + _fontTagEnd);\r\n\t\t\telse\r\n\t\t\t\toutput.append(\"<font face=\\\"Helvetica\\\" SIZE=\\\"2\\\">\" + _nodePtSizeSpanStart + text + _nodePtSizeSpanEnd + \"</font>\");\r\n\t\t} else {\r\n\t\t\toutput.append(text);\r\n\t\t}\r\n\r\n\t\tif (link != null)\r\n\t\t\toutput.append(\"</a>\");\r\n\r\n\t\t//Add any additional images to the line\r\n\t\tfor (int i = 0; i < _tb.getAdditionalImageCount(); i++) {\r\n\t\t\tString img2 = _tb.getAdditionalImage(i);\r\n\t\t\tString txt = _tb.getAdditionalText(i);\r\n\t\t\tString u = _tb.getAdditionalURL(i);\r\n\t\t\tif (u != null) {\r\n\t\t\t\tu = _tb.replaceUno(u);\r\n\t\t\t\toutput.append(\"<a href=\\\"\" + u + \"\\\"\");\r\n\t\t\t\tif (_targetFrame != null)\r\n\t\t\t\t\toutput.append(\"target=\\\"\" + _targetFrame + \"\\\" \");\r\n\t\t\t\toutput.append(\">\");\r\n\t\t\t}\r\n\r\n\t\t\toutput.append(\"<img src=\\\"\" + img2 + \"\\\" border=\\\"0\\\" alt=\\\"\" + txt + \"\\\">\");\r\n\t\t\tif (u != null)\r\n\t\t\t\toutput.append(\"</a>\");\r\n\t\t}\r\n\r\n\t\toutput.append(unbold);\r\n\t\toutput.append(\"</TD>\");\r\n\t\tp.println(output.toString());\r\n\t\tVector nodeComps = _tb.getNodeComponents();\r\n\t\tif (nodeComps != null) {\r\n\t\t\tfor (int i = 0; i < nodeComps.size(); i++) {\r\n\t\t\t\tint row = tb.getRow();\r\n\t\t\t\tp.print(\"<TD VALIGN=\\\"top\\\"\");\r\n\t\t\t\tif (_tableCellStyle != null)\r\n\t\t\t\t\tp.print(\" style=\\\"\" + _tableCellStyle + \"\\\"\");\r\n\t\t\t\telse if (_tableCellClass != null)\r\n\t\t\t\t\tp.print(\" class=\\\"\" + _tableCellClass + \"\\\"\");\r\n\t\t\t\tint headerNo = i + 1;\r\n\t\t\t\tif (headerNo < tb.getHeaderCount()) {\r\n\t\t\t\t\tString align = _tb.getHeaderAlign(headerNo);\r\n\t\t\t\t\tif (align != null)\r\n\t\t\t\t\t\tp.print(\" align =\\\"\" + align + \"\\\"\");\r\n\t\t\t\t}\r\n\t\t\t\tp.println(\">\");\r\n\t\t\t\ttry {\r\n\t\t\t\t\tif (row > -1)\r\n\t\t\t\t\t\tprocessPropertyExpressions(row);\r\n\t\t\t\t\tHtmlComponent comp = ((HtmlComponent) nodeComps.elementAt(i));\r\n\t\t\t\t\tif (!comp.getVisible())\r\n\t\t\t\t\t\tp.println(\" \");\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tcomp.generateHTML(p, row);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tMessageLog.writeErrorMessage(\"callback of Tree\", e, this);\r\n\t\t\t\t}\r\n\t\t\t\tp.println(\"</TD>\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t//finish it up\r\n\t\tp.println(\"</TR>\");\r\n\r\n\t}",
"public DbFileIterator iterator(final TransactionId tid) { \t\n// some code goes here\n \t\n \tDbFileIterator dbfi = new DbFileIterator() {\n \tint pgno = 0;\n \tHeapPage currPg = null;\n \tString name = Database.getCatalog().getTableName(getId());\n \tint tblid = Database.getCatalog().getTableId(name);\n \tint open = 0; \t\n \t\n \t//Todo: pass along the tid from the outer method.\n \t//DONE. by making tid param final.\n \tTransactionId m_tid = tid;\n \t\n \tIterator<Tuple> titr = null;\n \t\n\t\t\t@Override\n\t\t\tpublic void rewind() throws DbException, TransactionAbortedException {\n\t\t\t\tclose();\n\t\t\t\topen();\n\t\t\t}\n\t\t\t\n\t\t\tpublic void nextPage() throws DbException, TransactionAbortedException {\n\n\t\t\t\tif (pgno >= numPages())\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tcurrPg = (HeapPage) Database.getBufferPool().getPage(m_tid, new HeapPageId(tblid, pgno), simpledb.Permissions.READ_ONLY);\n\t\t\t\t\ttitr = currPg.iterator();\n\t\t\t\t\tif (titr == null)\n\t\t\t\t\t\tthrow new DbException(\"blah blah blah\");\n\t\t\t\t\tpgno++;\n\t\t\t\t\treturn;\n\t\t\t\t} catch (DbException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tthrow new DbException(\"page was not found or no more iterators..?\");\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void open() throws DbException, TransactionAbortedException {\n\t\t\t\topen = 1;\n\t\t\t\tpgno = 0;\n\t\t\t\tnextPage();\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic Tuple next() throws DbException, TransactionAbortedException,\n\t\t\t\t\tNoSuchElementException {\n\t\t\t\tif (open != 1)\n\t\t\t\t\tthrow new NoSuchElementException();\n\t\t\t\tif (!titr.hasNext())\n\t\t\t\t\tnextPage();\n\t\t\t\treturn titr.next();\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic boolean hasNext() throws DbException, TransactionAbortedException {\n\t\t\t\tif (open !=1)\n\t\t\t\t\treturn false;\n\t\t\t\tif (titr == null) //TODO: remove\n\t\t\t\t\tthrow new DbException(Integer.toString(pgno) + Integer.toString(open) + Integer.toString(numPages()) + m_f.getPath());\n\t\t\t\tif (!titr.hasNext())\n\t\t\t\t\tnextPage();\n\t\t\t\tif (titr.hasNext())\n\t\t\t\t\treturn true;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void close() {\n\t\t\t\topen = 0;\n\t\t\t\ttitr = null;\n\t\t\t}\n\t\t};\n return dbfi;\n }",
"@Override\n\tpublic boolean isEmpty() {\n\t\tif (entityType2tableName.isEmpty())\n\t\t\treturn true;\n\t\t\n\t\t// the hard way \n\t\ttry {\n\t\t\tStatement st = connection.createStatement(\n\t\t\t\t\tResultSet.TYPE_SCROLL_INSENSITIVE,\n\t\t ResultSet.CONCUR_READ_ONLY);\n\t\t\t\n\t\t\tfor (String tableName: entityType2tableName.values()) {\n\t\t\t\t//ResultSet set = st.executeQuery(\"SELECT * FROM \"+tableName+\";\");\n\t\t\t\t\n\t\t\t\tResultSet set = st.executeQuery(\"SELECT * FROM \"+tableName+\" LIMIT 1\");\n\t\t\t\t\n\t\t\t\tif (!set.next())\n\t\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t}\n\t\t} catch (SQLException e1) {\n\t\t\te1.printStackTrace();\n\t\t\tthrow new RuntimeException(\"Error while checking if the table is empty\",e1);\n\t\t}\n\t\t\n\t\treturn false;\n\t}",
"public static void writeIntoCSVFromTable() {\n try {\n backItUp(ROOT);\n backItUp(ROOT + Calendar.getInstance().getTime() + \"/\");\n } catch (Throwable e) {\n itsLogger.error(e.getMessage(), e);\n }\n\n }",
"WebElement getTableRecordAtIndex(int idx);",
"public void readTableData2() {\n\t\tint colCount = driver.findElements(By.xpath(\"//*[@id='industry-filter-results']/div[2]/table/tbody/tr[1]/th\"))\n\t\t\t\t.size();\n\t\tSystem.out.println(\"colCount\" + colCount);\n\t\t// Find row size\n\t\tint rowCount = driver\n\t\t\t\t.findElements(By.xpath(\"//*[@id='industry-filter-results']/div[2]/table/tbody/tr/td/parent::*\")).size();\n\t\tSystem.out.println(\"rowCount\" + rowCount);\n\t\t// Find xpath for 1st row and 1st column. Break into multiple parts such\n\t\t// that row and column no can be iterated.\n\t\tString firstPart = \"(//*[@id='industry-filter-results']/div[2]/table/tbody/tr/td[2]/parent::tr)[\";\n\t\tString secondPart = \"]\";\n\t\t// Loop through rows one by one. Start from 1st row till row count.\n\t\tfor (int i = 1; i <= rowCount; i++) {\n\t\t\t\tString finalPart = firstPart + i + secondPart;\n\t\t\t\tSystem.out.println(finalPart);\n\t\t\t\tString text = driver.findElement(By.xpath(finalPart)).getText();\n\t\t\t\tSystem.out.print(text + \" | \");\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"public abstract void write(T dataElement);",
"@Override\r\n\tpublic boolean accept(Node node) {\r\n\t\tif(node instanceof Div || node instanceof TableTag || node instanceof TableRow || node instanceof TableColumn)\r\n\t\t\treturn true;\r\n\t\treturn false;\r\n\t}",
"@Override public void generateReport(IvyXmlWriter xw,DyviseDatabase db,List<TraceLockLocation> used)\n{\n if (xw != null) {\n xw.begin(\"TYPE\");\n xw.field(\"KIND\",\"JOIN\");\n xw.field(\"ID\",++item_counter);\n for (TraceLockLocation tll : location_set) {\n\t tll.outputXml(xw,false);\n }\n xw.end(\"TYPE\");\n }\n\n used.addAll(location_set);\n}",
"public void SerializeTable(ObjectOutputStream out) {\n\t\t\n\t}",
"void writeObj(MyAllTypesSecond aRecord, StrategyI xmlStrat);",
"public abstract DataSet getTablesByType(InputStream inputSteam,\r\n String name, String pattern, String type)\r\n throws Exception;",
"private void analyzeLoadIntoIcebergTable() throws AnalysisException {\n Path sourcePath = sourceDataPath_.getPath();\n String tmpTableName = QueryStringBuilder.createTmpTableName(dbName_,\n tableName_.getTbl());\n QueryStringBuilder.Create createTableQueryBuilder =\n QueryStringBuilder.Create.builder().table(tmpTableName, true);\n try {\n FileSystem fs = sourcePath.getFileSystem(FileSystemUtil.getConfiguration());\n Path filePathForLike = sourcePath;\n // LIKE <file format> clause needs a file to infer schema, for directories: list\n // the files under the directory and pick the first one.\n if (fs.isDirectory(sourcePath)) {\n RemoteIterator<? extends FileStatus> fileStatuses = FileSystemUtil.listFiles(fs,\n sourcePath, true, \"\");\n while (fileStatuses.hasNext()) {\n FileStatus fileStatus = fileStatuses.next();\n String fileName = fileStatus.getPath().getName();\n if (fileStatus.isFile() && !FileSystemUtil.isHiddenFile(fileName)) {\n filePathForLike = fileStatus.getPath();\n break;\n }\n }\n }\n String magicString = FileSystemUtil.readMagicString(filePathForLike);\n if (magicString.substring(0, 4).equals(ParquetFileWriter.MAGIC_STR)) {\n createTableQueryBuilder.like(\"PARQUET\", \"%s\").storedAs(\"PARQUET\");\n } else if (magicString.substring(0, 3).equals(OrcFile.MAGIC)) {\n createTableQueryBuilder.like(\"ORC\", \"%s\").storedAs(\"ORC\");\n } else {\n throw new AnalysisException(String.format(\"INPATH contains unsupported LOAD \"\n + \"format, file '%s' has '%s' magic string.\", filePathForLike, magicString));\n }\n createTableQueryBuilder.tableLocation(\"%s\");\n createTableQueryBuilder.property(\"TEMPORARY\", \"true\");\n } catch (IOException e) {\n throw new AnalysisException(\"Failed to generate CREATE TABLE subquery \"\n + \"statement. \", e);\n }\n createTmpTblQuery_ = createTableQueryBuilder.build();\n QueryStringBuilder.Insert insertTblQueryBuilder = QueryStringBuilder.Insert.builder()\n .overwrite(overwrite_)\n .table(tableName_.toString());\n QueryStringBuilder.Select insertSelectTblQueryBuilder =\n QueryStringBuilder.Select.builder().selectList(\"*\").from(tmpTableName);\n insertTblQueryBuilder.select(insertSelectTblQueryBuilder);\n insertTblQuery_ = insertTblQueryBuilder.build();\n dropTmpTblQuery_ = QueryStringBuilder.Drop.builder().table(tmpTableName).build();\n }",
"private boolean isInnerType(IModelElement element) {\n \n \t\tif (element != null && element.getElementType() == IModelElement.TYPE) {\n \n \t\t\tIModelElement parent = element.getParent();\n \t\t\tif (parent != null) {\n \t\t\t\tint parentElementType = parent.getElementType();\n \t\t\t\treturn (parentElementType != IModelElement.SOURCE_MODULE);\n \t\t\t}\n \t\t}\n \n \t\treturn false;\n \t}",
"public boolean buildTable() {\n int count = table.getChildCount();\n for (int i = 0; i < count; i++) {\n View child = table.getChildAt(i);\n if (child instanceof TableRow) ((ViewGroup) child).removeAllViews();\n }\n\n //Dynamically adds rows based on the size of the destinations array\n for(int i = 0; i < orderedDestinations.size(); i++){\n // Inflates the search_results_table_row_attributes.xml file\n TableRow row = (TableRow) inflater.inflate(R.layout.search_results_table_row_attributes, null);\n\n //Finds oritentation and alters the row width if in landscape\n if(getResources().getConfiguration().orientation == 2) {\n LinearLayout ll = ((LinearLayout)row.findViewById(R.id.layout_contents));\n ll.getLayoutParams().width = 1700;\n ll.requestLayout();\n }\n\n //adds contents of the destination to the row\n ((TextView)row.findViewById(R.id.desti)).setText((i+1) + \") \" + orderedDestinations.get(i).name);\n ((TextView)row.findViewById(R.id.address)).setText(orderedDestinations.get(i).address);\n table.addView(row);\n }\n return true;\n }",
"public synchronized void getAllFromDbAndWriteIntoTempFiles() throws IOWrapperException, IOIteratorException{\r\n\r\n readFromDB = true;\r\n iow=new IOWrapper();\r\n iow.setupOutput(this.dbname,this.username,this.password,this.hostname,this.port);\r\n iow.setupInput(this.dbname,this.username,this.password,this.hostname,this.port);\r\n \r\n iter = iow.sendInputQuery(\"SELECT COUNT(*) FROM \"+nodetable);\r\n try {\r\n maxProgerss+=Integer.parseInt(((String[])iter.next())[0]); \r\n } catch (NullPointerException e) {maxProgerss+=100;}\r\n iter = iow.sendInputQuery(\"SELECT COUNT(*) FROM \"+edgetable);\r\n try {\r\n maxProgerss+=Integer.parseInt(((String[])iter.next())[0]);\r\n } catch (NullPointerException e) {maxProgerss+=100;}\r\n //iow.closeOutput();\r\n \r\n\r\n \r\n //nodelist\r\n iter = iow.select(nodetable,nodeCols);\r\n iow.setupOutput(Controller.NODES_TMP_FILENAME);\r\n while (iter.hasNext()) {\r\n singleProgress+=1;\r\n String[] data = (String[])iter.next();\r\n iow.writeLine(data[0]+\"\\t\"+data[1]);\r\n }\r\n iow.closeOutput();\r\n\t\r\n //edgelist\r\n iter=iow.select(edgetable,edgeCols);\r\n iow.setupOutput(Controller.EDGES_TMP_FILENAME);\r\n while (iter.hasNext()) {\r\n\t singleProgress+=1;\r\n String[] data = (String[])iter.next();\r\n iow.writeLine(data[0]+\"\\t\"+data[1]+\"\\t\"+data[2]);\r\n //System.out.println(\"wwsl: \"+data[0]+\"\\t\"+data[1]+\"\\t\"+data[2]);\r\n }\r\n iow.closeOutput();\r\n readFromDB=false;\r\n this.stillWorks=false;\r\n }",
"public static void writeBlocks(Element element, PrintWriter writer){\n int concl = 0;\n String type = element.getElementsByTag(\"h3\").first().text().split(\" \")[0];\n System.out.print(\" Parsing \" + type + \"s: \");\n for (Element block: element.select(\"ul.blockList,ul.blockListLast > li.blockList\")){\n if (type.equals(\"Field\")) concl += writeField(block, writer);\n else concl += writeMethod(block, writer);\n }\n if (concl == 0) System.out.println(\"Success\");\n else System.out.println(\"Failure\");\n }",
"@Override\n public TraversalControl visitGraphQLObjectType(GraphQLObjectType objectType, TraverserContext<GraphQLSchemaElement> context) {\n changeNode(context, updatedElement);\n\n // inserts a new element after the current one in the schema\n insertAfter(context, newElement);\n\n // inserts a new element before the current one in teh schema\n insertBefore(context, newElement);\n\n // deletes the current element from the schema\n deleteNode(context);\n\n\n return CONTINUE;\n }",
"public String getTableTypeString() {\n \t\treturn \"\";\n \t}",
"Table getTable();",
"private static void SaveTable(Class<?> itemClass, List<CSVItem> data) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException, NoSuchFieldException {\n\t\tString tl = (String)itemClass.getMethod(\"readTitle\").invoke(null, null);\n\t\tString val = \"\";\n\t\tString fn = (String)itemClass.getField(\"file\").get(val);\n\t\t\n\t\t\n\t\t\n\t\tfn = \"C:\\\\Users\\\\Chebakov.AA\\\\neo4j\\\\import\\\\pitc\\\\\" + fn + \".csv\";\n\t\ttry (OutputStreamWriter out = new OutputStreamWriter(new FileOutputStream(fn), \"UTF8\")) { //\"cp1251\"\n\t\t\tout.write(tl + \"\\r\\n\");\n\t\t\tdata.stream()\n\t\t\t\t.map(v -> v.readDataRow())\n\t\t\t\t.forEach(v -> {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tout.write(v + \"\\r\\n\");\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"Object getTables();",
"@Override\n public boolean hasNext() {\n \n if (iter != null && iter.hasNext()) {\n return true;\n }\n do {\n index++;\n if (index >= table.length) {\n return false;\n }\n } while (table[index] == null);\n iter = table[index].iterator();\n return iter.hasNext();\n }",
"public boolean isSetWholeTbl()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(WHOLETBL$2) != 0;\n }\n }",
"public interface TableStructure extends Structure {\n FieldStructure getFieldByJava(String javaName);\n\n\n FieldStructure getFieldBySql(String sqlName);\n\n\n int getFieldCount();\n\n\n Map getFieldsByJavaKey();\n\n\n Map getFieldsBySqlKey();\n\n\n String getJavaName();\n\n\n String getType();\n\n\n List<String> getFunctionalKeyFields();\n\n\n List<String> getSqlPrimaryKeyFields();\n}",
"private void upgradeFilesetTable(TableInfo tableInfo) throws Exception {\n String dsName = tableInfo.getParameters().get(Constants.Explore.CDAP_NAME);\n // except the name was always prefixed by cdap.user.<name>\n dsName = dsName.substring(\"cdap.user.\".length(), dsName.length());\n Id.DatasetInstance datasetID = Id.DatasetInstance.from(Id.Namespace.DEFAULT, dsName);\n DatasetSpecification spec = datasetFramework.getDatasetSpec(datasetID);\n\n // enable the new table\n enableDataset(datasetID, spec);\n\n try (SystemDatasetInstantiator datasetInstantiator = datasetInstantiatorFactory.create()) {\n Dataset dataset = datasetInstantiator.getDataset(datasetID);\n\n // if this is a time partitioned file set, we need to add all partitions\n if (dataset instanceof TimePartitionedFileSet) {\n TimePartitionedFileSet tpfs = (TimePartitionedFileSet) dataset;\n Set<PartitionDetail> partitionDetails = tpfs.getPartitions(null);\n if (!partitionDetails.isEmpty()) {\n QueryHandle handle = exploreTableManager.addPartitions(datasetID, partitionDetails);\n QueryStatus status = waitForCompletion(handle);\n // if add partitions failed, stop\n if (status.getStatus() != QueryStatus.OpStatus.FINISHED) {\n throw new ExploreException(\"Failed to add all partitions to dataset \" + datasetID);\n }\n }\n }\n }\n\n // now it is safe to drop the old table\n dropTable(tableInfo.getTableName());\n }",
"public static void readTable(String tableName, String filename) {\n\n\t\t// System.out.println(filename);\n\n\t\tBufferedReader in = null;\n\t\ttry {\n\t\t\tin = new BufferedReader(new FileReader(dataDir + filename));\n\n\t\t\twhile (true) {\n\n\t\t\t\tString line = in.readLine();\n\n\t\t\t\tif (line == null) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// remove | at end for tokenization\n\t\t\t\tline = line.substring(0, line.length() - 1);\n\n\t\t\t\t// line into tokens\n\t\t\t\tString[] tokens = line.split(attributeDelimiter);\n\t\t\t\tint numAttributes = tokens.length;\n\n\t\t\t\tassert (tokens.length == tableNameToOrdredSchema.get(tableName)\n\t\t\t\t\t\t.size());\n\n\t\t\t\tObject[] arr = new Object[numAttributes];\n\n\t\t\t\tfor (int i = 0; i < tokens.length; i++) {\n\n\t\t\t\t\tClass<?> type = tableNameToOrdredSchema.get(tableName).get(\n\t\t\t\t\t\t\ti).getType().getCorrespondingJavaClass();\n\t\t\t\t\tObject val = null;\n\n\t\t\t\t\tif (type.isAssignableFrom(String.class)) {\n\t\t\t\t\t\tval = tokens[i];\n\t\t\t\t\t} else if (type.isAssignableFrom(java.util.Date.class)) {\n\t\t\t\t\t\tval = new java.util.Date(tokens[i]);\n\t\t\t\t\t} else if (type.isAssignableFrom(java.lang.Integer.class)) {\n\t\t\t\t\t\tval = Integer.parseInt(tokens[i]);\n\t\t\t\t\t} else if (type.isAssignableFrom(java.lang.Double.class)) {\n\t\t\t\t\t\tval = Double.parseDouble(tokens[i]);\n\t\t\t\t\t} else if (type.isAssignableFrom(java.lang.Long.class)) {\n\t\t\t\t\t\tval = Long.parseLong(tokens[i]);\n\t\t\t\t\t} else if (type.isAssignableFrom(java.lang.Float.class)) {\n\t\t\t\t\t\tval = Float.parseFloat(tokens[i]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new RuntimeException(\"Type problem\");\n\t\t\t\t\t}\n\n\t\t\t\t\tarr[i] = val;\n\n\t\t\t\t}\n\n\t\t\t\tSampleRow row = new SampleRow(tableNameToOrdredSchema\n\t\t\t\t\t\t.get(tableName), arr);\n\n\t\t\t\tmyDatabase.getQueryInterface().insertRow(tableName, row);\n\n\t\t\t}\n\n\t\t\tin.close();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}",
"private Element getDiffTable(Element diffResultTable, SimpleImmutableEntry<String, List<File>> diffResult) {\n Element diffTable = diffResultTable.clone();\n Element diffFileNameContainer = diffTable.select(\".fileName\").first();\n Element diffMatchesContainer = diffTable.select(\".matches\").first();\n Element diffMatchContainer = diffResultTable.select(\".match\").first().clone();\n\n for (Element element : diffTable.select(\".match\"))\n element.remove();\n\n diffFileNameContainer.text(diffResult.getKey());\n\n for (File f : diffResult.getValue()) {\n Element container = diffMatchContainer.clone();\n\n if (deletedFiles.contains(f.getPath())) {\n container.addClass(\"deleted\");\n }\n\n container.text(f.getPath());\n diffMatchesContainer.appendChild(container);\n }\n return diffTable;\n }",
"void exporter(JTable tab, File file) {\n try {\r\n\r\n TableModel model = tab.getModel();\r\n FileWriter out = new FileWriter(file);\r\n for (int i = 0; i < model.getColumnCount(); i++) {\r\n out.write(model.getColumnName(i) + \"\\t\");\r\n }\r\n out.write(\"\\n\");\r\n\r\n for (int i = 0; i < model.getRowCount(); i++) {\r\n for (int j = 0; j < model.getColumnCount(); j++) {\r\n out.write(model.getValueAt(i, j).toString() + \"\\t\");\r\n }\r\n out.write(\"\\n\");\r\n }\r\n\r\n out.close();\r\n } catch (Exception err) {\r\n err.printStackTrace();\r\n }\r\n }",
"private void inserts() {\n DBPeer.fetchTableRows();\n DBPeer.fetchTableIndexes();\n \n Map<Number160, Data> tabRows = DBPeer.getTabRows();\n\t\tMap<Number160, Data> tabIndexes = DBPeer.getTabIndexes();\n\t\t\n String tabName = null;\n Number160 tabKey = null;\n FreeBlocksHandler freeBlocks = null;\n Map<String, IndexHandler> indexHandlers = new HashMap<>();\n TableRows tr = null;\n TableIndexes ti = null;\n \n logger.trace(\"INSERT-WHOLE\", \"BEGIN\", Statement.experiment);\n \n for (Insert ins: inserts) {\n \n if (tabName == null) {\n \ttabName = ins.getTabName();\n \ttabKey = Number160.createHash(tabName);\n \tfreeBlocks = new FreeBlocksHandler(tabName);\n \ttry {\n \t\t\t\ttr = (TableRows) tabRows.get(tabKey).getObject();\n \t\t\t\tti = (TableIndexes) tabIndexes.get(tabKey).getObject();\n \t\t\t} catch (ClassNotFoundException | IOException e) {\n \t\t\t\tlogger.error(\"Data error\", e);\n \t\t\t}\n \tfor (String index: ti.getIndexes()) {\n \t\tindexHandlers.put(index, new IndexHandler(ins.getPeer()));\n \t}\n \tfor (String index: ti.getUnivocalIndexes()) {\n \t\tindexHandlers.put(index, new IndexHandler(ins.getPeer()));\n \t}\n } else if (!tabName.equals(ins.getTabName())) {\n \t\t\ttry {\n \t\t\t\ttabRows.put(tabKey, new Data(tr));\n \t\t\ttabIndexes.put(tabKey, new Data(ti));\n \t\t\ttabName = ins.getTabName();\n \ttabKey = Number160.createHash(tabName);\n \t\t\t\ttr = (TableRows) tabRows.get(tabKey).getObject();\n \t\t\t\tti = (TableIndexes) tabIndexes.get(tabKey).getObject();\n \t\t\t\tfreeBlocks.update();\n \tfreeBlocks = new FreeBlocksHandler(tabName);\n \tindexHandlers.clear();\n \tfor (String index: ti.getIndexes()) {\n \t\tindexHandlers.put(index, new IndexHandler(ins.getPeer()));\n \t}\n \tfor (String index: ti.getUnivocalIndexes()) {\n \t\tindexHandlers.put(index, new IndexHandler(ins.getPeer()));\n \t}\n \t\t\t} catch (ClassNotFoundException | IOException e) {\n \t\t\t\tlogger.error(\"Data error\", e);\n \t\t\t}\n } \n \n ins.init(freeBlocks, indexHandlers, tr, ti);\n \n }\n \n boolean done = false;\n while (!done) {\n \tint countTrue = 0;\n \tfor (Insert ins: inserts) {\n \t\tif (ins.getDone()) {\n \t\t\tcountTrue++;\n \t\t}\n \t}\n \tif (countTrue == inserts.size()) {\n \t\tdone = true;\n \t}\n }\n \n freeBlocks.update();\n\n try {\n\t\t\ttabRows.put(tabKey, new Data(tr));\n\t\t\ttabIndexes.put(tabKey, new Data(ti));\n\t\t} catch (IOException e) {\n\t\t\tlogger.error(\"Data error\", e);\n\t\t}\n \n DBPeer.updateTableRows();\n DBPeer.updateTableIndexes();\n \n logger.trace(\"INSERT-WHOLE\", \"END\", Statement.experiment);\n }",
"public static boolean showTable(String tableName){\n try{\n File table = new File(tableName+\"Data.csv\");\n Scanner tableReader = new Scanner(table);\n while (tableReader.hasNextLine()){\n System.out.println(tableReader.nextLine());\n }\n tableReader.close();\n return true;\n }catch(IOException e){\n e.printStackTrace();\n return false;\n }\n }",
"@Test\n public void table_array_nest_modified() throws Exception {\n runEncoder(\"table-array-nest-modified\",\n new TomlWriter.Builder().indentTablesBy(2).build());\n }",
"@Override\r\n\tprotected String getTable() {\n\t\treturn TABLE;\r\n\t}",
"private void createGoogleDriveFilesTable(){\n cellTableOfGoogleDriveFile.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.ENABLED);\n\n // Add a text columns to show the details.\n TextColumn<GoogleDriveFile> columnFirstLine = new TextColumn<GoogleDriveFile>() {\n @Override\n public String getValue(GoogleDriveFile object) {\n return object.getId();\n }\n };\n cellTableOfGoogleDriveFile.addColumn(columnFirstLine, \"ID\");\n\n TextColumn<GoogleDriveFile> columnSecondLine = new TextColumn<GoogleDriveFile>() {\n @Override\n public String getValue(GoogleDriveFile object) {\n return object.getName();\n }\n };\n cellTableOfGoogleDriveFile.addColumn(columnSecondLine, \"Name\");\n\n TextColumn<GoogleDriveFile> townColumn = new TextColumn<GoogleDriveFile>() {\n @Override\n public String getValue(GoogleDriveFile object) {\n return object.getKind();\n }\n };\n cellTableOfGoogleDriveFile.addColumn(townColumn, \"Kind\");\n\n TextColumn<GoogleDriveFile> countryColumn = new TextColumn<GoogleDriveFile>() {\n @Override\n public String getValue(GoogleDriveFile object) {\n return object.getMimeType();\n }\n };\n cellTableOfGoogleDriveFile.addColumn(countryColumn, \"MimeType\");\n\n final SingleSelectionModel<GoogleDriveFile> selectionModel = new SingleSelectionModel<>();\n cellTableOfGoogleDriveFile.setSelectionModel(selectionModel);\n }"
]
| [
"0.6403945",
"0.5214109",
"0.5024008",
"0.49617657",
"0.48120517",
"0.4740802",
"0.4693316",
"0.46455312",
"0.46083948",
"0.4593534",
"0.45860216",
"0.458513",
"0.45603728",
"0.45473772",
"0.45319209",
"0.4523397",
"0.45203575",
"0.44890058",
"0.44077495",
"0.4394145",
"0.4379118",
"0.43683237",
"0.43452168",
"0.43069777",
"0.42995724",
"0.42808494",
"0.4278315",
"0.42724362",
"0.4250405",
"0.4249907",
"0.42302513",
"0.42299312",
"0.41755775",
"0.41711313",
"0.41681373",
"0.41622895",
"0.4152126",
"0.41478056",
"0.41402197",
"0.41378582",
"0.41349834",
"0.4115816",
"0.41085553",
"0.41063085",
"0.4104993",
"0.40959704",
"0.40951005",
"0.40902156",
"0.40887266",
"0.40872487",
"0.40756488",
"0.40625533",
"0.4052666",
"0.40480456",
"0.40475336",
"0.40460983",
"0.40438455",
"0.4037595",
"0.40316752",
"0.40297875",
"0.4028244",
"0.40241975",
"0.40217018",
"0.40130696",
"0.40006775",
"0.3995876",
"0.39937323",
"0.39911395",
"0.39894068",
"0.39867282",
"0.39849392",
"0.39836347",
"0.39834142",
"0.39819413",
"0.39786482",
"0.39769053",
"0.3967361",
"0.39665103",
"0.39605212",
"0.39603278",
"0.39584345",
"0.3954863",
"0.39547074",
"0.3954413",
"0.39532784",
"0.39522147",
"0.39499855",
"0.39476198",
"0.39464137",
"0.39432704",
"0.39354414",
"0.39336932",
"0.39333573",
"0.39325565",
"0.39283362",
"0.39240018",
"0.3919403",
"0.3912116",
"0.39120427",
"0.39098066"
]
| 0.71182424 | 0 |
If an element type has any attributes or child elements, it is treated as a Table. Otherwise, it is treated as a property. BUG! This code actually misses a special case. If an element type has no children, no attributes, and no parents, it needs to be treated as a Table. However, the corresponding XML document is: ]> which really isn't worth worrying about... | private boolean isTable(ElementType elementType)
{
return (!elementType.children.isEmpty() ||
!elementType.attributes.isEmpty());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Integer getType()\r\n\t\t{ return element instanceof Schema ? SCHEMA : element instanceof Alias ? ALIAS : ELEMENT; }",
"private void processElementType(ElementType elementType)\n throws Exception\n {\n\n out = new FileWriter(elementType.name.getLocalName() + \".sql\");\n\n // Write a 'create table' query for the element type.\n \n out.write(NEWLINE);\n out.write(\"CREATE TABLE \");\n out.write(elementType.name.getLocalName());\n out.write(\"(\");\n out.write(NEWLINE);\n out.write(INDENT);\n out.write(\"ID INT IDENTITY(1,1) PRIMARY KEY,\");\n out.write(NEWLINE);\n out.write(INDENT);\n out.write(\"RTN_ID INT FOREIGN KEY REFERENCES RTN(ID),\");\n out.write(NEWLINE);\n out.write(INDENT);\n createAllTablesQuery+=\"CREATE TABLE \"+elementType.name.getLocalName()+\"(\"+NEWLINE+INDENT+\"ID INT IDENTITY(1,1) PRIMARY KEY,\"+NEWLINE+INDENT;\n createAllTablesQuery+=\"RTN_ID INT FOREIGN KEY REFERENCES RTN(ID),\"+NEWLINE+INDENT;\n Hashtable<Enumeration,Collections> hash= elementType.parents;\n Enumeration en =hash.elements();\n while( en. hasMoreElements() )\n {\n ElementType ee= (ElementType) en.nextElement();\n out.write(ee.name.getLocalName()+\"_ID\");\n out.write(\" INT FOREIGN KEY REFERENCES \"+ee.name.getLocalName() +\"(ID)\");\n out.write(\",\");\n out.write(NEWLINE);\n out.write(INDENT);\n createAllTablesQuery+=ee.name.getLocalName()+\"_ID\"+\" INT FOREIGN KEY REFERENCES \"+ee.name.getLocalName() +\"(ID),\"+NEWLINE+INDENT;\n\n\n \n }\n out.write(\"DEW_POS VARCHAR(MAX)\");\n out.write(\",\");\n out.write(NEWLINE);\n out.write(INDENT);\n out.write(\"DOC_ID INT\");\n out.write(\",\");\n out.write(NEWLINE);\n out.write(INDENT);\n createAllTablesQuery+=\"DEW_POS VARCHAR(MAX),\"+NEWLINE+INDENT+\"DOC_ID INT,\"+NEWLINE+INDENT;\n \n //out.write(NEWLINE);\n\n // Process the attributes, adding one property for each.\n\n processAttributes(elementType.attributes);\n\n // Process the content, adding properties for each child element.\n\n switch (elementType.contentType)\n {\n case ElementType.CONTENT_ANY:\n case ElementType.CONTENT_MIXED:\n throw new Exception(\"Can't process element types with mixed or ANY content: \" + elementType.name.getUniversalName());\n\n /* case ElementType.CONTENT_ELEMENT:\n processElementContent(elementType.content, elementType.children);\n break;*/\n\n case ElementType.CONTENT_PCDATA:\n processPCDATAContent(elementType);\n break;\n\n case ElementType.CONTENT_EMPTY:\n // No content to process.\n break;\n }\n\n // Close the Table.\n out.write(NEWLINE);\n out.write(\")\");\n out.write(NEWLINE);\n out.write(NEWLINE);\n createAllTablesQuery+=NEWLINE+\")\"+NEWLINE+NEWLINE;\n // Close the file\n\n out.close();\n }",
"TypeElement getTypeElement();",
"private void addTableProperty(ElementType elementType, boolean multiValued)\n throws Exception\n {\n if (!multiValued)\n {\n // out.write(\",\");\n out.write(NEWLINE);\n out.write(INDENT);\n out.write(\"m_\");\n out.write(elementType.name.getLocalName());\n out.write(\" VARCHAR(50)\");\n createAllTablesQuery+=NEWLINE+INDENT+\"m_\"+elementType.name.getLocalName()+\" VARCHAR(50)\";\n\n }else\n {\n // out.write(\",\");\n /* out.write(NEWLINE);\n out.write(INDENT);\n out.write(\"m_\");\n out.write(elementType.name.getLocalName());\n */\n }\n \n }",
"ElementType getElementType();",
"@Override\r\n\tpublic boolean accept(Node node) {\r\n\t\tif(node instanceof Div || node instanceof TableTag || node instanceof TableRow || node instanceof TableColumn)\r\n\t\t\treturn true;\r\n\t\treturn false;\r\n\t}",
"@SuppressWarnings(\"unchecked\")\n private boolean handleProperties(final Document doc, final Element parent,\n final String prefix, final String name, final Object prop,\n boolean nameTobeFixed)\n {\n boolean hasFixMe = false;\n Element el = null;\n if (prop == null)\n {\n String fixedName = nameTobeFixed ? fixName(name, prefix) : name;\n hasFixMe = fixedName.startsWith(FIXME_INVALID_PREFIX);\n el = doc.createElement(ELEM_PROPERTY);\n el.setAttribute(ATTR_NAME, fixedName);\n }\n else if (prop instanceof Map)\n {\n Map<String, Object> sortedProps = sortMap((Map<String, Object>) prop);\n el = doc.createElement(ELEM_PROPERTY_SET);\n if (name != null)\n {\n String fixedName = nameTobeFixed ? fixName(name, prefix) : name;\n hasFixMe = fixedName.startsWith(FIXME_INVALID_PREFIX);\n el.setAttribute(ATTR_NAME, fixedName);\n }\n for (String key : sortedProps.keySet())\n {\n hasFixMe = hasFixMe\n | handleProperties(doc, el, prefix, key, sortedProps\n .get(key), false);\n }\n }\n else if (prop instanceof Collection)\n {\n String fixedName = nameTobeFixed ? fixName(name, prefix) : name;\n hasFixMe = fixedName.startsWith(FIXME_INVALID_PREFIX);\n el = doc.createElement(ELEM_PROPERTY);\n el.setAttribute(ATTR_NAME, fixedName);\n Iterator iter = ((Collection) prop).iterator();\n Element values = null;\n // Create a ELEM_PVALUES element if there are collection is empty, in\n // which case it creates an empty pvalues element or if the instance of\n // elements is String. Otherwise a propertySet element is created in\n // the next recursive call.\n if(((Collection) prop).isEmpty() || iter.next() instanceof String)\n {\n values = doc.createElement(ELEM_PVALUES);\n el.appendChild(values);\n }\n else\n {\n values = el;\n }\n for (Object obj : (Collection) prop)\n {\n hasFixMe = hasFixMe\n | handleProperties(doc, values, prefix, null, obj, false);\n }\n }\n else if (prop instanceof PSPair)\n {\n PSPair pair = (PSPair) prop;\n el = doc.createElement(ELEM_PAIR);\n el.setAttribute(ATTR_VALUE + \"1\", toString(pair.getFirst()));\n el.setAttribute(ATTR_VALUE + \"2\", toString(pair.getSecond()));\n }\n else if (parent.getNodeName().equals(ELEM_PVALUES))\n {\n el = doc.createElement(ELEM_PVALUE);\n el.appendChild(doc.createTextNode(toString(prop)));\n }\n else\n {\n String fixedName = nameTobeFixed ? fixName(name, prefix) : name;\n hasFixMe = fixedName.startsWith(FIXME_INVALID_PREFIX);\n el = doc.createElement(ELEM_PROPERTY);\n el.setAttribute(ATTR_NAME, fixedName);\n el.setAttribute(ATTR_VALUE, toString(prop));\n }\n parent.appendChild(el);\n return hasFixMe;\n }",
"@Override\r\n\tpublic ElementKind getElementKind() \r\n\t{\r\n\t\t/* if the Property is just a reference,\r\n\t\t * return the type of the referent */\r\n\t\tif (referent != null) return referent.getElementKind();\r\n\r\n\t\treturn ElementKind.PROPERTY;\r\n\t}",
"@Override\r\n \tpublic int getElementType() {\r\n \t\treturn 0; \r\n \t}",
"private boolean isInnerType(IModelElement element) {\n \n \t\tif (element != null && element.getElementType() == IModelElement.TYPE) {\n \n \t\t\tIModelElement parent = element.getParent();\n \t\t\tif (parent != null) {\n \t\t\t\tint parentElementType = parent.getElementType();\n \t\t\t\treturn (parentElementType != IModelElement.SOURCE_MODULE);\n \t\t\t}\n \t\t}\n \n \t\treturn false;\n \t}",
"Type getElementType();",
"public TSETInfoTables parseXml(String fileName) { \n\t\ttry { \n\t\t\tDocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); \n\t\t\tDocumentBuilder db = dbf.newDocumentBuilder(); \n\t\t\tDocument document = db.parse(fileName); \n\t\t\tNodeList TSETInfoTablesNodeList = document.getChildNodes(); \n\t\t\tNode TSETInfoTablesNode = TSETInfoTablesNodeList.item(0); \n\t\t\t//if (!columnNode.hasChildNodes()) continue;\n\t\t\t\n\t\t\t// pojo\n\t\t\tTSETInfoTables infoTables = new TSETInfoTables();\n\t\t\tList<MetaDB> metaDBList = new ArrayList<MetaDB>();\n\t\t\t//infoTables.setMetaDBList(metaDBList);\n\t\t\t\n\t\t\tNodeList metaDBNodeList = TSETInfoTablesNode.getChildNodes();\n\t\t\tfor (int i = 0; i < metaDBNodeList.getLength(); i++) { \n\t\t\t\tNode metaDBNode = metaDBNodeList.item(i);\n\t\t\t\t// tackle the CRLF character, otherwise it will be treated as a empty node.\n\t\t\t\tif (!metaDBNode.hasChildNodes()) continue;\n\t\t\t\tMetaDB metaDB = new MetaDB();\n\t\t\t\t//metaDBList.add(metaDB);\n\t\t\t\tthis.parseMetaDBAttribute(metaDBNode, metaDB);\n\t\t\t\tList<Table> tableList = new ArrayList<Table>();\n\t\t\t\t//metaDB.setTableList(tableList);\n\t\t\t\t\n\t\t\t\tNodeList tableNodeList = metaDBNode.getChildNodes(); \n\t\t\t\tfor (int j = 0; j < tableNodeList.getLength(); j++) { \n\t\t\t\t\tNode tableNode = tableNodeList.item(j); \n\t\t\t\t\tif (!tableNode.hasChildNodes()) continue;\n\t\t\t\t\tTable table = new Table();\n\t\t\t\t\t//tableList.add(table);\n\t\t\t\t\tthis.parseTableAttribute(tableNode, table);\n\t\t\t\t\tList<Column> columnList = new ArrayList<Column>();\n\t\t\t\t\t//table.setColumnList(columnList);\n\t\t\t\t\t\n\t\t\t\t\tNodeList columnNodeList = tableNode.getChildNodes(); \n\t\t\t\t\tfor (int k = 0; k < columnNodeList.getLength(); k++) { \n\t\t\t\t\t\tNode columnNode = columnNodeList.item(k);\n\t\t\t\t\t\tif (!columnNode.hasChildNodes()) continue;\n\t\t\t\t\t\t//this.parseAttribute(columnNode);\n\t\t\t\t\t\tColumn column = new Column();\n\t\t\t\t\t\t//columnList.add(column);\n\t\t\t\t\t\tthis.parseColumnAttribute(columnNode, column);\n\t\t\t\t\t\t\n\t\t\t\t\t\tNodeList columnContentNodeList = columnNode.getChildNodes();\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor(int m = 0; m < columnContentNodeList.getLength(); m++) {\n\t\t\t\t\t\t\t//Node columnContent = columnContentList.item(m);\n\t\t\t\t\t\t\tNode columnContentNode = columnContentNodeList.item(m);\n\t\t\t\t\t\t\t// The CRLF character will be treated as a node, so using IF.\n\t\t\t\t\t\t\tif (columnContentNode.hasChildNodes()) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif (columnContentNode.getNodeName().equals(\"columnName\")) {\n\t\t\t\t\t\t\t\t\tcolumn.setName(columnContentNode.getTextContent());\n\t\t\t\t\t\t\t\t} else if (columnContentNode.getNodeName().equals(\"columnType\")) {\n\t\t\t\t\t\t\t\t\tcolumn.setType(columnContentNode.getTextContent());\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tlogger.error(\"unknown column content.\");\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\t\t\t\t\t\tcolumnList.add(column);\n\t\t\t\t\t} \n\t\t\t\t\ttable.setColumnList(columnList);\n\t\t\t\t\ttableList.add(table);\n\t\t\t\t\tlogger.info(j + \" table tackled.\");\n\t\t\t\t} \n\t\t\t\tmetaDB.setTableList(tableList);\n\t\t\t\tmetaDBList.add(metaDB);\n\t\t\t\tlogger.info(i + \" metaDB tackled.\");\n\t\t\t} \n\t\t\tinfoTables.setMetaDBList(metaDBList);\n\t\t\tlogger.info(\"Parse XML success.\");\n\t\t\treturn infoTables;\n\t\t} catch (FileNotFoundException e) { \n\t\t\tlogger.error(e.getMessage());\n\t\t} catch (ParserConfigurationException e) { \n\t\t\tlogger.error(e.getMessage());\n\t\t} catch (SAXException e) { \n\t\t\tlogger.error(e.getMessage());\n\t\t} catch (IOException e) { \n\t\t\tlogger.error(e.getMessage());\n\t\t} \n\t\treturn null;\n\t}",
"public static void findElemInTable(XSComplexTypeDecl type, XSElementDecl elem, SymbolHash elemDeclHash) throws XMLSchemaException {\n/* 572 */ String name = elem.fName + \",\" + elem.fTargetNamespace;\n/* */ \n/* 574 */ XSElementDecl existingElem = null;\n/* 575 */ if ((existingElem = (XSElementDecl)elemDeclHash.get(name)) == null) {\n/* */ \n/* 577 */ elemDeclHash.put(name, elem);\n/* */ }\n/* */ else {\n/* */ \n/* 581 */ if (elem == existingElem) {\n/* */ return;\n/* */ }\n/* 584 */ if (elem.fType != existingElem.fType)\n/* */ {\n/* 586 */ throw new XMLSchemaException(\"cos-element-consistent\", new Object[] { type.fName, elem.fName });\n/* */ }\n/* */ } \n/* */ }",
"ElementSetNameType createElementSetNameType();",
"private boolean isMultiTable() {\n\t\treturn fromElement.getQueryable() != null &&\n\t\t\t\tfromElement.getQueryable().isMultiTable();\n\t}",
"@Override\n\t\tpublic void endElement(String uri, String localName, String qName) throws SAXException {\n\t\t\tif(user) {\n\t\t\t\ttry {\n\t\t\t\t\tif(qName.equalsIgnoreCase(\"NAME\")){\n\t\t\t\t\t\tcreateNewTable();\n\t\t\t\t\t}\n\t\t\t\t\telse if(localName.equalsIgnoreCase(\"SIZE\")){\n\t\t\t\t\t\tString[] myTable = {nameOfField, nameOfFieldType+ \"(\" + value + \")\"};\n\t\t\t\t\t\tstore(myTable);\n\t\t\t\t\t}\t\n\t\t\t\t\telse if(localName.equalsIgnoreCase(\"FIELDTYPE\")){\n\t\t\t\t\t\tString[] myTable = {nameOfField, nameOfFieldType};\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(!nameOfFieldType.equalsIgnoreCase(\"char\"))\n\t\t\t\t\t\t\tstore(myTable);\n\t\t\t\t\t}\n\t\t\t\t} catch (WoodsException e) {}\n\t\t\t\t\n\t\t\t\tuser = false;\n\t\t\t}\n\t\t}",
"private PropertyCard createPropertyElement(Element eElement) {\r\n\t\tif ( PropertyCard.PropertyType.valueOf(eElement.getElementsByTagName(\"type\").item(0).getTextContent()) == PropertyCard.PropertyType.UTILITY )\r\n\t\t{\r\n\t\t return new UtilityPropertyCard(\r\n\t\t\t Integer.parseInt(eElement.getAttribute(\"id\"))\r\n\t\t\t ,eElement.getElementsByTagName(\"name\").item(0).getTextContent()\r\n\t\t\t ,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue1\").item(0).getTextContent())\r\n\t\t\t ,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue2\").item(0).getTextContent())\r\n\t\t );\r\n\t\t}\r\n\t\telse if (PropertyCard.PropertyType.valueOf(eElement.getElementsByTagName(\"type\").item(0).getTextContent()) == PropertyCard.PropertyType.RAILING )\r\n\t\t{\r\n\t\t return new RailingPropertyCard(\r\n\t\t\t Integer.parseInt(eElement.getAttribute(\"id\"))\r\n\t\t\t ,eElement.getElementsByTagName(\"name\").item(0).getTextContent()\r\n\t\t\t ,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue1\").item(0).getTextContent())\r\n\t\t\t ,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue2\").item(0).getTextContent())\r\n\t\t\t ,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue3\").item(0).getTextContent())\r\n\t\t\t ,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue4\").item(0).getTextContent())\r\n\t\t\t ,Integer.parseInt(eElement.getElementsByTagName(\"mortgageValue\").item(0).getTextContent())\r\n\t\t );\r\n\t\t}\r\n\t\telse if ( PropertyCard.PropertyType.valueOf(eElement.getElementsByTagName(\"type\").item(0).getTextContent()) == PropertyCard.PropertyType.SIMPLE )\r\n\t\t{\r\n\t\t\treturn new PlotPropertyCard(\r\n\t\t\t\tInteger.parseInt(eElement.getAttribute(\"id\"))\r\n\t\t\t\t,eElement.getElementsByTagName(\"name\").item(0).getTextContent()\r\n\t\t\t\t,PlotPropertyCard.Colour_Type.valueOf(eElement.getElementsByTagName(\"colour\").item(0).getTextContent())\r\n\t\t\t\t,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue0\").item(0).getTextContent())\r\n\t\t\t\t,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue1\").item(0).getTextContent())\r\n\t\t\t\t,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue2\").item(0).getTextContent())\r\n\t\t\t\t,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue3\").item(0).getTextContent())\r\n\t\t\t\t,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue4\").item(0).getTextContent())\r\n\t\t\t\t,Integer.parseInt(eElement.getElementsByTagName(\"rentalValueHotel\").item(0).getTextContent())\r\n\t\t\t\t,Integer.parseInt(eElement.getElementsByTagName(\"mortgageValue\").item(0).getTextContent())\r\n\t\t\t\t,Integer.parseInt(eElement.getElementsByTagName(\"houseCost\").item(0).getTextContent())\r\n\t\t\t\t,Integer.parseInt(eElement.getElementsByTagName(\"hotelCost\").item(0).getTextContent())\r\n\t\t\t);\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"public Element getElement() {\n return table;\n }",
"public boolean isSetTableType() {\n return this.tableType != null;\n }",
"DOMType() {\n // Constructs an empty type node\n }",
"@Test\n public void testNestedUserTypes() throws Throwable\n {\n String type1 = createType(\"CREATE TYPE %s ( s set<text>, m map<text, text>, l list<text>)\");\n\n String type2 = createType(\"CREATE TYPE %s ( s set < frozen < \" + type1 + \" >>,)\");\n\n createTable(\"CREATE TABLE %s (id int PRIMARY KEY, val frozen<\" + type2 + \">)\");\n\n execute(\"INSERT INTO %s (id, val) VALUES (0, { s : {{ s : {'foo', 'bar'}, m : { 'foo' : 'bar' }, l : ['foo', 'bar']} }})\");\n\n // TODO: check result once we have an easy way to do it. For now we just check it doesn't crash\n execute(\"SELECT * FROM %s\");\n }",
"public void fromXml(Element e)\n throws PSUnknownNodeTypeException\n {\n // base class handling\n super.fromXml(e);\n\n //save state so we can restore when finished w/ updates\n int state = getState();\n\n setPosition(PSXMLDomUtil.checkAttributeInt(e, SEQUENCE_ATTR, false));\n\n //todo: ph - this is not safe\n // Read the field name from the primary key:\n m_strFieldName = getLocator().getPart(KEY_COL_FIELDNAME);\n\n PSXmlTreeWalker tree = new PSXmlTreeWalker(e);\n\n Element elOp = tree.getNextElement(XML_NODE_OPERATOR);\n tree.setCurrent(e);\n if (elOp == null)\n {\n Object[] args = {getNodeName(), XML_NODE_OPERATOR, \"null\"};\n throw new PSUnknownNodeTypeException(\n IPSObjectStoreErrors.XML_ELEMENT_INVALID_CHILD, args);\n }\n \n String op = PSXmlTreeWalker.getElementData(elOp);\n if (!isValidOperator(op))\n {\n Object[] args = {getNodeName(), XML_NODE_OPERATOR, op};\n throw new PSUnknownNodeTypeException(\n IPSObjectStoreErrors.XML_ELEMENT_INVALID_CHILD, args);\n }\n \n // this one is optional for backward compatibility\n Element extElOp = tree.getNextElement(XML_NODE_EXTOPERATOR);\n tree.setCurrent(e);\n String extOp = PSXmlTreeWalker.getElementData(extElOp); // empty if not found\n \n Element elFieldType = tree.getNextElement(XML_NODE_FIELDTYPE);\n tree.setCurrent(e);\n if (elFieldType == null)\n {\n Object[] args = {getNodeName(), XML_NODE_FIELDTYPE, \"null\"};\n throw new PSUnknownNodeTypeException(\n IPSObjectStoreErrors.XML_ELEMENT_INVALID_CHILD, args);\n }\n\n m_strFieldType = PSXmlTreeWalker.getElementData(elFieldType);\n\n if (!isValidFieldType(m_strFieldType))\n {\n Object[] args = {getNodeName(), XML_NODE_FIELDTYPE, m_strFieldType};\n throw new PSUnknownNodeTypeException(\n IPSObjectStoreErrors.XML_ELEMENT_INVALID_CHILD, args);\n }\n\n Element elFieldLabel = tree.getNextElement(XML_NODE_FIELDLABEL);\n tree.setCurrent(e);\n if (elFieldLabel == null)\n {\n Object[] args = {getNodeName(), XML_NODE_FIELDLABEL, \"null\"};\n throw new PSUnknownNodeTypeException(\n IPSObjectStoreErrors.XML_ELEMENT_INVALID_CHILD, args);\n }\n\n m_strDisplayName = PSXmlTreeWalker.getElementData(elFieldLabel);\n\n Element elFieldMnemonic = tree.getNextElement(XML_NODE_FIELDMNEMONIC);\n tree.setCurrent(e);\n if (elFieldMnemonic != null)\n setMnemonic(PSXmlTreeWalker.getElementData(elFieldLabel));\n\n // Optional\n Element elVal = tree.getNextElement(XML_NODE_FIELDVALUE);\n tree.setCurrent(e);\n\n List values = null;\n if (elVal != null)\n {\n String value = PSXmlTreeWalker.getElementData(elVal);\n if (null != value )\n {\n if (value.length() > 0)\n {\n values = PSStringOperation.getSplittedList(value, ',');\n }\n else\n values = new ArrayList();\n }\n }\n // method handles all cases\n setValues(op, extOp, values);\n\n Element elDesc = tree.getNextElement(XML_NODE_DESCRIPTION);\n tree.setCurrent(e);\n\n if (elDesc != null)\n m_strDescription = PSXmlTreeWalker.getElementData(elDesc);\n\n // optional keywords\n m_choices = null;\n Element elChoices = tree.getNextElement(PSDisplayChoices.XML_NODE_NAME);\n if (elChoices != null)\n m_choices = new PSDisplayChoices(elChoices);\n tree.setCurrent(e);\n\n //set state to match what it was in serialized object\n setState(state);\n }",
"private static boolean expectedInterfaceType(Expr e) {\n \t\treturn e.attrExpectedTyp() instanceof PscriptTypeInterface || e.attrExpectedTyp() instanceof PscriptTypeTypeParam;\n \t}",
"public void testIsStylisticElement() throws Exception {\n assertFalse(cfg.isStylisticElement(\"test\"));\n cfg.associateStylisticAndAntiElements(\"test\", null, permittedChildren);\n cfg.associateStylisticAndAntiElements(\"stylistic\", null,\n permittedChildren);\n assertTrue(cfg.isStylisticElement(\"test\"));\n assertTrue(cfg.isStylisticElement(\"stylistic\"));\n assertFalse(cfg.isStylisticElement(\"child\"));\n }",
"public interface TableSectionBuilder extends ElementBuilderBase<TableSectionBuilder> {\n\n String UNSUPPORTED_HTML =\n \"Table section elements do not support setting inner html or text. \"\n + \"Use startTR() instead to append a table row to the section.\";\n\n /**\n * Horizontal alignment of data in cells. See the align attribute for HTMLTheadElement for\n * details.\n */\n TableSectionBuilder align(String align);\n\n /**\n * Alignment character for cells in a column.\n *\n * @see <a href=\"http://www.w3.org/TR/1999/REC-html401-19991224/struct/tables.html#adef-char\">W3C\n * HTML Specification</a>\n */\n TableSectionBuilder ch(String ch);\n\n /**\n * Offset of alignment character.\n *\n * @see <a\n * href=\"http://www.w3.org/TR/1999/REC-html401-19991224/struct/tables.html#adef-charoff\">W3C\n * HTML Specification</a>\n */\n TableSectionBuilder chOff(String chOff);\n\n /**\n * Vertical alignment of data in cells. See the valign attribute for HTMLTheadElement for details.\n */\n TableSectionBuilder vAlign(String vAlign);\n}",
"@objid (\"818dee09-2959-443b-9223-8a8a24ff4879\")\n PropertyTableDefinition getDefinedTable();",
"protected abstract boolean processElement(Element node, int uolId) throws\n PropertyException;",
"protected abstract Type loadDefaultElement();",
"Element getGenericElement();",
"protected abstract String getFactPropertyType(Object property);",
"public TypeElement getTypeElement() {\n return this.te;\n }",
"void emptyType(ComplexTypeSG type) throws SAXException;",
"public XMLElement(Properties conversionTable) {\n this(conversionTable, false, true, true);\n }",
"private static void _valueToStorageDocument(\n\t\tValue value,\n\t\tElement element,\n\t\tDocument doc\n\t) {\n\t\t// Supports only string, int and double\n\t\tif ( value.isString() ) {\n\t\t\telement.appendChild( doc.createTextNode( value.strValue() ) );\n\t\t\telement.setAttribute( JOLIE_TYPE_ATTRIBUTE, \"string\" );\n\t\t} else if ( value.isInt() ) {\n\t\t\telement.appendChild( doc.createTextNode( new Integer( value.intValue() ).toString() ) );\n\t\t\telement.setAttribute( JOLIE_TYPE_ATTRIBUTE, \"int\" );\n\t\t} else if ( value.isDouble() ) {\n\t\t\telement.appendChild( doc.createTextNode( new Double( value.doubleValue() ).toString() ) );\n\t\t\telement.setAttribute( JOLIE_TYPE_ATTRIBUTE, \"double\" );\n\t\t} else {\n\t\t\telement.setAttribute( JOLIE_TYPE_ATTRIBUTE, \"void\" );\n\t\t}\n\n\t\t// adding other attributes\n\t\tMap<String, ValueVector> attrs = getAttributesOrNull( value );\n\t\tif ( attrs != null ) {\n\t\t\tfor( Entry<String, ValueVector> attrEntry : attrs.entrySet() ) {\n\t\t\t\telement.setAttribute(\n\t\t\t\t\tattrEntry.getKey(),\n\t\t\t\t\tattrEntry.getValue().first().strValue() );\n\t\t\t}\n\t\t}\n\n\t\t// adding subelements\n\t\tElement currentElement;\n\t\tfor( Entry<String, ValueVector> entry : value.children().entrySet() ) {\n\t\t\tif ( !entry.getKey().startsWith( \"@\" ) ) {\n\t\t\t\tfor( Value val : entry.getValue() ) {\n\t\t\t\t\tcurrentElement = doc.createElement( entry.getKey() );\n\t\t\t\t\telement.appendChild( currentElement );\n\t\t\t\t\t_valueToStorageDocument( val, currentElement, doc );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"@Test\n public void testAlteringUserTypeNestedWithinSet() throws Throwable\n {\n String[] columnTypePrefixes = {\"frozen<set<\", \"set<frozen<\"};\n for (String columnTypePrefix : columnTypePrefixes)\n {\n String ut1 = createType(\"CREATE TYPE %s (a int)\");\n String columnType = columnTypePrefix + KEYSPACE + \".\" + ut1 + \">>\";\n\n createTable(\"CREATE TABLE %s (x int PRIMARY KEY, y \" + columnType + \")\");\n\n execute(\"INSERT INTO %s (x, y) VALUES(1, {1} )\");\n assertRows(execute(\"SELECT * FROM %s\"), row(1, set(userType(1))));\n flush();\n\n execute(\"ALTER TYPE \" + KEYSPACE + \".\" + ut1 + \" ADD b int\");\n execute(\"INSERT INTO %s (x, y) VALUES(2, {{a:2, b:2}})\");\n execute(\"INSERT INTO %s (x, y) VALUES(3, {{a:3}})\");\n execute(\"INSERT INTO %s (x, y) VALUES(4, {{b:4}})\");\n\n assertRows(execute(\"SELECT * FROM %s\"),\n row(1, set(userType(1))),\n row(2, set(userType(2, 2))),\n row(3, set(userType(3, null))),\n row(4, set(userType(null, 4))));\n\n flush();\n\n assertRows(execute(\"SELECT * FROM %s\"),\n row(1, set(userType(1))),\n row(2, set(userType(2, 2))),\n row(3, set(userType(3, null))),\n row(4, set(userType(null, 4))));\n }\n }",
"@Override\n\t\tpublic void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {\n\t\t\t\tif(qName.equalsIgnoreCase(\"TABLE\")) {\n\t\t\t\t\tuser = true;\n\t\t\t\t\ttable = true;\n\t\t\t\t}\n\t\t\t\telse if(localName.equalsIgnoreCase(\"FIELDNAME\")){\t\n\t\t\t\t\tuser = true;\n\t\t\t\t\tfieldName = true;\n\t\t\t\t}\n\t\t\t\telse if(localName.equalsIgnoreCase(\"FIELDTYPE\")){\t\n\t\t\t\t\tuser = true;\n\t\t\t\t\tfieldType = true;\n\t\t\t\t}\n\t\t\t\telse if(localName.equalsIgnoreCase(\"SIZE\")){\n\t\t\t\t\tuser = true;\n\t\t\t\t\tsize = true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfor(int i = 0;i< attributes.getLength();i++) {\n\t\t\t\t\tSystem.out.println(attributes.getQName(i) + \": \" + attributes.getValue(i));\n\t\t\t\t}\n\t\t}",
"private static String setAttributesForStoring( Value value, Node node )\n\t{\n\t\tNamedNodeMap map = node.getAttributes();\n\t\tString type = \"\";\n\t\tif ( map != null ) {\n\t\t\tNode attr;\n\t\t\tfor( int i = 0; i < map.getLength(); i++ ) {\n\t\t\t\tattr = map.item( i );\n\t\t\t\tif ( !attr.getNodeName().equals( JOLIE_TYPE_ATTRIBUTE ) ) { // do not consider attribute type\n\t\t\t\t\tgetAttribute( value, (attr.getLocalName() == null) ? attr.getNodeName() : attr.getLocalName() ).setValue( attr.getNodeValue() );\n\t\t\t\t} else {\n\t\t\t\t\ttype = attr.getNodeValue();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn type;\n\t}",
"@Override\r\n\tpublic boolean getElemento(T elemento) {\n\t\treturn false;\r\n\t}",
"protected abstract Object handleElement(Element aElement) throws AeXMLDBException;",
"public SchemaAttribute getEmptyTabularColumn()\n {\n SchemaAttribute schemaAttribute = new SchemaAttribute();\n\n ElementType elementType = new ElementType();\n\n elementType.setElementOrigin(ElementOrigin.LOCAL_COHORT);\n elementType.setElementTypeId(SchemaElementMapper.TABULAR_COLUMN_TYPE_GUID);\n elementType.setElementTypeName(SchemaElementMapper.TABULAR_COLUMN_TYPE_NAME);\n\n schemaAttribute.setType(elementType);\n\n return schemaAttribute;\n }",
"private static void elementsToSubValuesForStoring( Value value, NodeList list, String type )\n\t{\n\t\tNode node;\n\t\tValue childValue;\n\t\tStringBuilder builder = new StringBuilder();\n\t\tfor( int i = 0; i < list.getLength(); i++ ) {\n\t\t\tnode = list.item( i );\n\t\t\tswitch( node.getNodeType() ) {\n\t\t\t\tcase Node.ATTRIBUTE_NODE:\n\t\t\t\t\tif ( !node.getNodeName().equals( JOLIE_TYPE_ATTRIBUTE ) ) {\n\t\t\t\t\t\tgetAttribute( value, node.getNodeName() ).setValue( node.getNodeValue() );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase Node.ELEMENT_NODE:\n\t\t\t\t\tchildValue = value.getNewChild( (node.getLocalName() == null) ? node.getNodeName() : node.getLocalName() );\n\t\t\t\t\tString subElType = setAttributesForStoring( childValue, node );\n\t\t\t\t\telementsToSubValuesForStoring( childValue, node.getChildNodes(), subElType );\n\t\t\t\t\tbreak;\n\t\t\t\tcase Node.CDATA_SECTION_NODE:\n\t\t\t\tcase Node.TEXT_NODE:\n\t\t\t\t\tbuilder.append( node.getNodeValue() );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif ( builder.length() > 0 ) {\n\t\t\tif ( type.equals( \"string\" ) ) {\n\t\t\t\tvalue.setValue( builder.toString() );\n\t\t\t} else if ( type.equals( \"int\" ) ) {\n\t\t\t\tvalue.setValue( new Integer( builder.toString() ) );\n\t\t\t} else if ( type.equals( \"double\" ) ) {\n\t\t\t\tvalue.setValue( new Double( builder.toString() ) );\n\t\t\t}\n\t\t}\n\t}",
"@Test\n\tpublic void ach_doc_type_xml_test () {\n\t\tAssert.assertEquals(achHeaderData.size(), ACH_DOC_TYPE.match(xmlData));\n\t}",
"TableType getTableType()\n {\n return tableType;\n }",
"public void setElementType(String element_type) {\n\t\tthis.element_type = element_type;\n\t}",
"public ATExpression base_tableExpression();",
"@Override\n\t\tpublic void inAListExpr(AListExpr node) {\n\t\t\ttry {\t\n\t\t\t\t if(node.getExpr().toString().contains(\"String\")){\n\t\t\t\t\t symbolTable.put(node.getExpr().toString(), klasses.get(\"String\"));\n\t\t\t\t }\n\t\t\t\t if(node.getExpr().toString().contains(\"Bool\")){\n\t\t\t\t\t symbolTable.put(node.getExpr().toString(), klasses.get(\"Bool\"));\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t}\n\t\t\t\t if(node.getExpr().toString().contains(\"Int\")){\n\t\t\t\t\t symbolTable.put(node.getExpr().toString(), klasses.get(\"Int\"));\n\t\t\t\t\t \n\t\t\t\t }\n\t\t\t\t if(node.getExpr().toString().contains(\"IO\")){\n\t\t\t\t\t symbolTable.put(node.getExpr().toString(), klasses.get(\"IO\"));\n\t\t\t\t }\n\t\t\t\t if(node.getExpr().toString().contains(\"Error\")){\n\t\t\t\t\t symbolTable.put(node.getExpr().toString(), klasses.get(\"Error\"));\n\t\t\t\t\t\t\t\t \n\t\t\t\t }\n\t\t\t\t if(node.getExpr().toString().contains(\"void\")){\n\t\t\t\t\t symbolTable.put(node.getExpr().toString(), klasses.get(\"void\"));\n\t\t\t\t\t \n\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t}catch(SemanticException e) {\n\t\t\t\t\t\n\t\t\t\t}\n\t\t}",
"private boolean isNodeTypeAttribute(String attributeName, String attributeValue) {\r\n boolean match = false;\r\n if (!StringUtils.isBlank(attributeName) && !StringUtils.isBlank(attributeValue) && !StringUtils.isBlank(getJsonTypeAttributeName())) {\r\n if (attributeName.equalsIgnoreCase(getJsonTypeAttributeName())) {\r\n if (attributeValue.equalsIgnoreCase(\"boolean\")) {\r\n _current.setType(XML2JSONObject.Type.Boolean);\r\n }\r\n else if (attributeValue.equalsIgnoreCase(\"number\")) {\r\n _current.setType(XML2JSONObject.Type.Number);\r\n }\r\n else if (attributeValue.equalsIgnoreCase(\"array\")) {\r\n _current.setType(XML2JSONObject.Type.Array);\r\n }\r\n match = true;\r\n\r\n }\r\n }\r\n return match;\r\n }",
"public static DSSchemaIFace processDOM(Document aDoc) {\n\t\tDSSchemaDef schemaDef = new DSSchemaDef();\n\t\tNode schemaNode = DBUIUtils.findNode(aDoc, \"schema\");\n\t\tif (schemaNode == null) {\n\t\t\tSystem.out.println(\"*** Error DOM is missing its schema node!\");\n\t\t\tschemaDef = null;\n\t\t\treturn null;\n\t\t}\n\n\t\tNodeList tableList = schemaNode.getChildNodes();\n\t\tif (tableList != null) {\n\t\t\tfor (int i = 0; i < tableList.getLength(); i++) {\n\t\t\t\tNode tableNode = tableList.item(i);\n\t\t\t\tif (tableNode.getNodeType() != Node.TEXT_NODE) {\n\t\t\t\t\tString nodeName = tableNode.getNodeName();\n\t\t\t\t\tif (nodeName != null && nodeName.equals(\"table\")) {\n\t\t\t\t\t\tString name = DBUIUtils\n\t\t\t\t\t\t\t\t.findAttrValue(tableNode, \"name\");\n\t\t\t\t\t\tif (name != null && name.length() > 0) {\n\t\t\t\t\t\t\tDSTableDef tableDef = new DSTableDef(name);\n\t\t\t\t\t\t\tschemaDef.addTable(tableDef);\n\t\t\t\t\t\t\tNodeList fieldList = tableNode.getChildNodes();\n\t\t\t\t\t\t\tif (fieldList != null) {\n\t\t\t\t\t\t\t\tfor (int j = 0; j < fieldList.getLength(); j++) {\n\t\t\t\t\t\t\t\t\tNode field = fieldList.item(j);\n\t\t\t\t\t\t\t\t\tif (field != null\n\t\t\t\t\t\t\t\t\t\t\t&& field.getNodeType() != Node.TEXT_NODE) {\n\t\t\t\t\t\t\t\t\t\tString fldName = DBUIUtils\n\t\t\t\t\t\t\t\t\t\t\t\t.findAttrValue(field, \"name\");\n\t\t\t\t\t\t\t\t\t\tif (fldName == null\n\t\t\t\t\t\t\t\t\t\t\t\t|| fldName.length() == 0) {\n\t\t\t\t\t\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t\t\t\t\t\t.println(\"*** Error field DOM node is missing its name!\");\n\t\t\t\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tString dataType = DBUIUtils\n\t\t\t\t\t\t\t\t\t\t\t\t.findAttrValue(field,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"dataType\");\n\t\t\t\t\t\t\t\t\t\tif (dataType == null\n\t\t\t\t\t\t\t\t\t\t\t\t|| dataType.length() == 0) {\n\t\t\t\t\t\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t\t\t\t\t\t.println(\"*** Error field DOM node is missing its data type!\");\n\t\t\t\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t// handle missing value\n\t\t\t\t\t\t\t\t\t\tNode missingValueList = DBUIUtils\n\t\t\t\t\t\t\t\t\t\t\t\t.findNode(field,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tMISSINGVALUELIST);\n\t\t\t\t\t\t\t\t\t\tVector missingValueCodeVector = new Vector();\n\t\t\t\t\t\t\t\t\t\t// System.out.println(\"before parsing missing value in schema parser\");\n\t\t\t\t\t\t\t\t\t\tif (missingValueList != null) {\n\t\t\t\t\t\t\t\t\t\t\t// System.out.println(\"after missingValue list is not null1\");\n\t\t\t\t\t\t\t\t\t\t\tNodeList missingValue = missingValueList\n\t\t\t\t\t\t\t\t\t\t\t\t\t.getChildNodes();\n\t\t\t\t\t\t\t\t\t\t\t// System.out.println(\"after get missing value list kids2\");\n\t\t\t\t\t\t\t\t\t\t\tif (missingValue != null) {\n\t\t\t\t\t\t\t\t\t\t\t\t// System.out.println(\"after missingvalue list is not null3\");\n\t\t\t\t\t\t\t\t\t\t\t\tfor (int k = 0; k < missingValue\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.getLength(); k++) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t// System.out.println(\"in missing value element4\");\n\t\t\t\t\t\t\t\t\t\t\t\t\tNode missingcodeNode = missingValue\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.item(k);\n\t\t\t\t\t\t\t\t\t\t\t\t\tString missingCode = DBUIUtils\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.findNodeValue(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmissingcodeNode,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tMISSINGVALUECODE);\n\t\t\t\t\t\t\t\t\t\t\t\t\t// System.out.println(\"the missing value code add to vector \"+missingCode);\n\t\t\t\t\t\t\t\t\t\t\t\t\tmissingValueCodeVector\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.add(missingCode);\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\n\t\t\t\t\t\t\t\t\t\tString keyType = DBUIUtils\n\t\t\t\t\t\t\t\t\t\t\t\t.findAttrValue(field, \"keyType\");\n\t\t\t\t\t\t\t\t\t\tif (keyType != null) {\n\t\t\t\t\t\t\t\t\t\t\tif (keyType\n\t\t\t\t\t\t\t\t\t\t\t\t\t.equals(KEY_DESC[DSTableKeyIFace.PRIMARYKEY])) {\n\t\t\t\t\t\t\t\t\t\t\t\ttableDef.addPrimaryKey(fldName,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdataType,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmissingValueCodeVector);\n\t\t\t\t\t\t\t\t\t\t\t} else if (keyType\n\t\t\t\t\t\t\t\t\t\t\t\t\t.equals(KEY_DESC[DSTableKeyIFace.SECONDARYKEY])) {\n\t\t\t\t\t\t\t\t\t\t\t\ttableDef.addSecondaryKey(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfldName, dataType,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmissingValueCodeVector);\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\ttableDef.addField(fldName,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdataType,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmissingValueCodeVector);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\ttableDef.addField(fldName,\n\t\t\t\t\t\t\t\t\t\t\t\t\tdataType,\n\t\t\t\t\t\t\t\t\t\t\t\t\tmissingValueCodeVector);\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} else {\n\t\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t\t.println(\"*** Error table DOM node is missing its name!\");\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t.println(\"*** Error chiuld of schema is not \\\"table\\\"!\");\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn schemaDef;\n\t}",
"void simpleContent(ComplexTypeSG type) throws SAXException;",
"@Test\n public void test032() throws Throwable {\n XmlEntityRef xmlEntityRef0 = new XmlEntityRef(\"6KNmrh>UL8QaL\");\n // Undeclared exception!\n try {\n Component component0 = xmlEntityRef0.td();\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // Td component can be added only to a TableRow.\n //\n }\n }",
"private Property as_property_value(RDFNode rdfnode, PropertyType type) {\n Property prop = new Property(type);\n\n switch (type.getPropertyValueType()) {\n case COMPLEX:\n if (rdfnode.isResource()) {\n List<Property> subprops = new ArrayList<>();\n\n for (PropertyConstraint subpropcon : type.getComplexPropertyConstraints()) {\n PropertyType subtype = subpropcon.getPropertyType();\n NodeIterator iter = model.listObjectsOfProperty(rdfnode.asResource(),\n as_property(subtype.getDomainPredicate()));\n\n while (iter.hasNext()) {\n Property subprop = as_property_value(iter.next(), subtype);\n\n if (subprop != null) {\n subprops.add(subprop);\n }\n }\n }\n\n prop.setComplexValue(subprops);\n\n return prop;\n } else {\n return null;\n }\n case DATE_TIME:\n if (rdfnode.isLiteral() && rdfnode.asLiteral().getValue() instanceof XSDDateTime) {\n XSDDateTime dt = XSDDateTime.class.cast(rdfnode.asLiteral().getValue());\n\n if (dt != null) {\n prop.setDateTimeValue(as_date_time(dt));\n }\n\n return prop;\n } else {\n return null;\n }\n case LONG:\n if (rdfnode.isLiteral()) {\n prop.setLongValue(rdfnode.asLiteral().getLong());\n\n return prop;\n } else {\n return null;\n }\n case STRING:\n if (rdfnode.isLiteral()) {\n prop.setStringValue(rdfnode.asLiteral().getString());\n\n return prop;\n } else {\n return null;\n }\n default:\n throw new RuntimeException(\"Unhandled value type\");\n }\n }",
"protected XMLElement(Properties conversionTable,\n boolean skipLeadingWhitespace,\n boolean fillBasicConversionTable,\n boolean ignoreCase) {\n this.ignoreCase = ignoreCase;\n this.skipLeadingWhitespace = skipLeadingWhitespace;\n this.tagName = null;\n this.contents = \"\";\n this.attributes = new Properties();\n this.children = new Vector();\n this.conversionTable = conversionTable;\n this.lineNr = 0;\n\n if (fillBasicConversionTable) {\n this.conversionTable.put(\"lt\", \"<\");\n this.conversionTable.put(\"gt\", \">\");\n this.conversionTable.put(\"quot\", \"\\\"\");\n this.conversionTable.put(\"apos\", \"'\");\n this.conversionTable.put(\"amp\", \"&\");\n }\n }",
"public StringDt getTypeElement() { \n\t\tif (myType == null) {\n\t\t\tmyType = new StringDt();\n\t\t}\n\t\treturn myType;\n\t}",
"@Test\n public void operator_table() {\n OutputNode output = new OutputNode(\"testing\", typeOf(Result.class), typeOf(String.class));\n OperatorNode operator = new OperatorNode(\n classOf(SimpleOp.class), typeOf(Result.class), typeOf(String.class),\n output, new DataTableNode(\"t\", typeOf(DataTable.class), typeOf(String.class)));\n InputNode root = new InputNode(operator);\n MockContext context = new MockContext();\n context.put(\"t\", new BasicDataTable.Builder<>().build());\n testing(root, context, op -> {\n op.process(\"Hello, world!\");\n });\n assertThat(context.get(\"testing\"), contains(\"Hello, world!TABLE\"));\n }",
"public boolean testModelordraughting(EIfcfillareastyle type) throws SdaiException;",
"private TableSchema createTableSchema(Node entity) {\n\t\tString physicalName = handler.getChildValueByProperty(entity,\n\t\t\t\t\"EntityProps.Physical_Name\");\n\t\tString name = entity.getAttributes().getNamedItem(\"Name\").getNodeValue().trim();\n\t\tString id = entity.getAttributes().getNamedItem(\"id\").getNodeValue().trim();\n\t\tnodeMap.put(id, entity);\n\t\tTableSchema tableSchema = new TableSchema(\"\", \"\");\n\t\tif (physicalName != null) {\n\t\t\tphysicalNameMap.put(id, physicalName);\n\t\t\ttableSchema.setName(physicalName);\n\t\t} else {\n\t\t\ttableSchema.setName(name);\n\t\t}\n\n\t\treturn tableSchema;\n\t}",
"@Test\n\tpublic void addProperty() {\n\t\tXMLTagParser.addNewElement(\"Person\");\n\t\tXMLTagParser.editElement(\"Person\", \"residence\", \"milan\");\n\n\t\tXMLTagParser.editProperty(\"Person\", \"residence\", \"isRenting\", \"false\");\n\t\tassertEquals(XMLTagParser.getPropertyValueFromTag(\"Person\", \"residence\", \"isRenting\"), \"false\");\n\t\tXMLTagParser.editProperty(\"Person\", \"residence\", \"hasGarage\", \"true\");\n\t\tassertEquals(XMLTagParser.getPropertyValueFromTag(\"Person\", \"residence\", \"hasGarage\"), \"true\");\n\t}",
"ElementDefinition createElementDefinition();",
"public boolean isTableField()\n {\n boolean ret = false;\n try {\n ret = getField().getCollection() instanceof Table;\n } catch (final CacheReloadException e) {\n LOG.error(\"CacheReloadException\", e);\n }\n return ret;\n }",
"public Class getType(Element element) {\r\n Class type = element.type();\r\n \r\n if(type == void.class) {\r\n return contact.getType();\r\n }\r\n return type;\r\n }",
"public String getTableTypeString() {\n \t\treturn \"\";\n \t}",
"static TableRandomName xmlGetFromElements(Element eItem) {\n TableRandomName oO = new TableRandomName();\n\n oO.sName = xmlControl.unEscapeChars(eItem.getChild(\"sName\").getText());\n oO.sRace = xmlControl.unEscapeChars(eItem.getChild(\"sRace\").getText());\n oO.bLast = eItem.getChild(\"bLast\").getText().equalsIgnoreCase(\"true\");\n oO.bFemale = eItem.getChild(\"bFemale\").getText().equalsIgnoreCase(\"true\");\n oO.bMale = eItem.getChild(\"bMale\").getText().equalsIgnoreCase(\"true\");\n\n return oO;\n }",
"private AzureDataLakeStoreDatasetTypeProperties innerTypeProperties() {\n return this.innerTypeProperties;\n }",
"public String getElementType()\n {\n return elementType;\n }",
"public Class getAttributeType();",
"@Override\n\t\tpublic void outALtExpr(ALtExpr node) {\n\t\t\ttypes2.put(node, BOOL);\n\t\t}",
"public int getPropertyType() {\n\t\treturn 0;\n\t}",
"@Test\n public void testAlteringUserTypeNestedWithinList() throws Throwable\n {\n String[] columnTypePrefixes = {\"frozen<list<\", \"list<frozen<\"};\n for (String columnTypePrefix : columnTypePrefixes)\n {\n String ut1 = createType(\"CREATE TYPE %s (a int)\");\n String columnType = columnTypePrefix + KEYSPACE + \".\" + ut1 + \">>\";\n\n createTable(\"CREATE TABLE %s (x int PRIMARY KEY, y \" + columnType + \")\");\n\n execute(\"INSERT INTO %s (x, y) VALUES(1, [1] )\");\n assertRows(execute(\"SELECT * FROM %s\"), row(1, list(userType(1))));\n flush();\n\n execute(\"ALTER TYPE \" + KEYSPACE + \".\" + ut1 + \" ADD b int\");\n execute(\"INSERT INTO %s (x, y) VALUES(2, [{a:2, b:2}])\");\n execute(\"INSERT INTO %s (x, y) VALUES(3, [{a:3}])\");\n execute(\"INSERT INTO %s (x, y) VALUES(4, [{b:4}])\");\n\n assertRows(execute(\"SELECT * FROM %s\"),\n row(1, list(userType(1))),\n row(2, list(userType(2, 2))),\n row(3, list(userType(3, null))),\n row(4, list(userType(null, 4))));\n\n flush();\n\n assertRows(execute(\"SELECT * FROM %s\"),\n row(1, list(userType(1))),\n row(2, list(userType(2, 2))),\n row(3, list(userType(3, null))),\n row(4, list(userType(null, 4))));\n }\n }",
"@Test\r\n public void testGetType() {\r\n System.out.println(\"getType\");\r\n Table instance = new Table(\"S\",2);\r\n String expResult = \"S\";\r\n String result = instance.getType();\r\n assertEquals(expResult, result);\r\n \r\n }",
"public boolean isProperty();",
"Type attribType(JCTree tree, Env<AttrContext> env) {\n \tDEBUG.P(this,\"attribType(2)\");\n Type result = attribTree(tree, env, TYP, Type.noType);\n \n //DEBUG.P(\"result=\"+result);\n //DEBUG.P(\"result.tag=\"+TypeTags.toString(result.tag));\n DEBUG.P(0,this,\"attribType(2)\");\n return result;\n }",
"public interface ATTabulation extends ATExpression {\n\n\t/**\n\t * The table expression must evaluate to a native table\n\t * Example: <code>`(m()[idx+1]).tableExpression == `(m())</code>\n\t * @return the table expression\n\t */\n\tpublic ATExpression base_tableExpression();\n\t\n\t/**\n\t * The index expression must evaluate to a native number\n\t * Example: <code>`(m()[idx+1]).indexExpression == `(idx.+(1))</code>\n\t * @return the index expression\n\t */\n\tpublic ATExpression base_indexExpression();\n\t\n}",
"@Override\n\t\tpublic void outANoExpr(ANoExpr node) {\n\t\t\ttypes2.put(node, BOOL);\n\t\t}",
"@objid (\"e6f7930d-e513-40f5-a7a6-044fb7df6be5\")\n void setDefinedTable(PropertyTableDefinition value);",
"Table getBaseTable();",
"@Test\n public void testAlteringUserTypeNestedWithinMap() throws Throwable\n {\n String[] columnTypePrefixes = {\"frozen<map<text, \", \"map<text, frozen<\"};\n for (String columnTypePrefix : columnTypePrefixes)\n {\n String ut1 = createType(\"CREATE TYPE %s (a int)\");\n String columnType = columnTypePrefix + KEYSPACE + \".\" + ut1 + \">>\";\n\n createTable(\"CREATE TABLE %s (x int PRIMARY KEY, y \" + columnType + \")\");\n\n execute(\"INSERT INTO %s (x, y) VALUES(1, {'firstValue':{a:1}})\");\n assertRows(execute(\"SELECT * FROM %s\"), row(1, map(\"firstValue\", userType(1))));\n flush();\n\n execute(\"ALTER TYPE \" + KEYSPACE + \".\" + ut1 + \" ADD b int\");\n execute(\"INSERT INTO %s (x, y) VALUES(2, {'secondValue':{a:2, b:2}})\");\n execute(\"INSERT INTO %s (x, y) VALUES(3, {'thirdValue':{a:3}})\");\n execute(\"INSERT INTO %s (x, y) VALUES(4, {'fourthValue':{b:4}})\");\n\n assertRows(execute(\"SELECT * FROM %s\"),\n row(1, map(\"firstValue\", userType(1))),\n row(2, map(\"secondValue\", userType(2, 2))),\n row(3, map(\"thirdValue\", userType(3, null))),\n row(4, map(\"fourthValue\", userType(null, 4))));\n\n flush();\n\n assertRows(execute(\"SELECT * FROM %s\"),\n row(1, map(\"firstValue\", userType(1))),\n row(2, map(\"secondValue\", userType(2, 2))),\n row(3, map(\"thirdValue\", userType(3, null))),\n row(4, map(\"fourthValue\", userType(null, 4))));\n }\n }",
"@Override\n\t\tpublic void outALeExpr(ALeExpr node) {\n\t\t\ttypes2.put(node, BOOL);\n\t\t}",
"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 void setElementType(QName elementType) {\n this.fieldElementType = elementType;\n }",
"public boolean isSetWholeTbl()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(WHOLETBL$2) != 0;\n }\n }",
"public boolean isTyped() {\n return underlyingTree.isTyped();\n }",
"public interface TElement extends HasID, THasPropertyChange, PropertyChangeListener, Serializable {\n\n /**\n * Used if a requested attribute is not a member of the TElement derived\n * Class.\n */\n public final Object NOT_DEFINED = \"ATT_NOT_DEFINED\";\n\n /**\n * return the attribute value or teal.sim.TElement.NOT_DEFINED\n **/\n public Object getProperty(String attName);\n\n /**\n * set the attribute value return value is success\n **/\n public boolean setProperty(String attName, Object value);\n\n public void addRoute(Route r);\n \n /** \n * Establish a route from this object's source attribute and the targeted \n * attribute of another TElement. \n **/\n public void addRoute(String attribute, TElement listener, String targetName);\n \n \n /** \n * Remove a route from this object's source attribute and the target's output attribute. \n **/\n public void removeRoute(String attribute, TElement listener, String targetName);\n}",
"public Element createJDOMRepresentation(PropertySet properties){\n\t\t\n\t\t//Create an empty \"root\" element\n\t\tElement rootProp = new Element(\"properties\");\n\t\trootProp.setName(\"properties\");\n\t\t\n\t\t//Iterate through the properties of this PropertySet\n\t\tIterator<Property> iterator = properties.iterator();\n\t\twhile(iterator.hasNext()){\n\t\t\t\n\t\t\t//Get the current Property\n\t\t\tProperty property = iterator.next();\n\t\t\t\n\t\t\t//Create a new Element representing this property\n\t\t\tElement prop = new Element(\"property\");\n\t\t\t\n\t\t\t//Add the appropriate attributes\n\t\t\tprop.setAttribute(\"name\", property.getName());\n\t\t\tprop.setAttribute(\"type\",String.valueOf(property.getMeasure().getType()));\n\t\t\tprop.setAttribute(\"description\", property.getDescription());\n\t\t\tprop.setAttribute(\"positive_impact\", String.valueOf(property.isPositive()));\n\t\t\t\n\t\t\t//TODO: Check how to get rid of this if statements - IDEA: Initialize these fields at value \"\"\n\t\t\tif(property.getMeasure().getMetricName() != null){\n\t\t\t\tprop.setAttribute(\"metricName\", property.getMeasure().getMetricName());\n\t\t\t}else{\n\t\t\t\tprop.setAttribute(\"metricName\", \"\");\n\t\t\t}\n\t\t\t\n\t\t\tif(property.getMeasure().getRulesetPath() != null){\n\t\t\t\tprop.setAttribute(\"ruleset\", property.getMeasure().getRulesetPath());\n\t\t\t}else{\n\t\t\t\tprop.setAttribute(\"ruleset\", \"\");\n\t\t\t}\n\t\t\tprop.setAttribute(\"tool\", property.getMeasure().getTool());\n\t\t\t//Save the thresholds as well (ascending order) \n\t\t\t//Create a node (element) containing the thresholds of the property\n\t\t\tElement thresholds = new Element(\"thresholds\");\n\t\t\tfor(int i = 0; i < property.getThresholds().length; i++){\n\t\t\t\t\n\t\t\t\t//Create a threshold Element\n\t\t\t\tElement t = new Element(\"threshold\");\n\t\t\t\t\n\t\t\t\t//Set the appropriate value of the threshold\n\t\t\t\tt.setText(String.valueOf(property.getThresholds()[i]));\n\t\t\t\t\n\t\t\t\t//Attach the current threshold element to the element named \"thresholds\"\n\t\t\t\tthresholds.addContent(t);\n\t\t\t}\n\t\t\t\n\t\t\t//Attach the \"thresholds\" sub element to the \"property\" element\n\t\t\tprop.addContent(thresholds);\n\t\t\t\n\t\t\t//Attach the \"property\" element to the \"properties\" parent element\n\t\t\trootProp.addContent(prop);\n\t\t}\n\t\t\n\t\t//Return the \"root\" element of the properties\n\t\treturn rootProp;\t\n\t}",
"public T caseTypedElement(TypedElement object) {\r\n\t\treturn null;\r\n\t}",
"public boolean isElementDefinition()\n {\n return elementDefinition;\n }",
"public boolean isElementDefinition()\n {\n return elementDefinition;\n }",
"public String getElementType() {\n\t\treturn (element_type);\n\t}",
"void visitElement_issue_type(org.w3c.dom.Element element) { // <issue-type>\n // element.getValue();\n org.w3c.dom.NamedNodeMap attrs = element.getAttributes();\n for (int i = 0; i < attrs.getLength(); i++) {\n org.w3c.dom.Attr attr = (org.w3c.dom.Attr)attrs.item(i);\n if (attr.getName().equals(\"name\")) { // <issue-type name=\"???\">\n list.issueTypes.add(attr.getValue());\n }\n }\n org.w3c.dom.NodeList nodes = element.getChildNodes();\n for (int i = 0; i < nodes.getLength(); i++) {\n org.w3c.dom.Node node = nodes.item(i);\n switch (node.getNodeType()) {\n case org.w3c.dom.Node.CDATA_SECTION_NODE:\n // ((org.w3c.dom.CDATASection)node).getData();\n break;\n case org.w3c.dom.Node.ELEMENT_NODE:\n org.w3c.dom.Element nodeElement = (org.w3c.dom.Element)node;\n break;\n case org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE:\n // ((org.w3c.dom.ProcessingInstruction)node).getTarget();\n // ((org.w3c.dom.ProcessingInstruction)node).getData();\n break;\n }\n }\n }",
"private static boolean isSuitableElement(Element element) {\n \n \t\tif (element instanceof ElementCSSInlineStyle\n \t\t\t\t&& isAttributeAvailable(element, STYLE_TAG_NAME)) {\n \t\t\treturn true;\n \t\t}\n \n \t\treturn false;\n \t}",
"public void testTwoTable() {\n\n String\tsql\t= \"SELECT t.AD_Table_ID, t.TableName, c.AD_Column_ID, c.ColumnName FROM AD_Table t, AD_Column c WHERE t.AD_Table_ID=c.AD_Table_ID AND t.IsActive='Y'\";\n AccessSqlParser\tfixture\t= new AccessSqlParser(sql);\n\n assertEquals(\"AccessSqlParser[AD_Table=t,AD_Column=c|0]\", fixture.toString());\n }",
"private static void initDatatypeProperties() {\n OntModel ontologie = ModelFactory.createOntologyModel();\n OntologyFactory.readOntology(ontologyPath, ontologie);\n ontologie.add(ontologie);\n datatypeProperties.addAll(ontologie.listDatatypeProperties().toList());\n }",
"@Override\n\tpublic void preVisit( TTable table )\n\t{\n\n\t\tETableSource type = table.getTableType();\n\n\t\tswitch ( type )\n\t\t{\n\t\t\tcase objectname:\n\t\t\t\tthis.addParseResult( table );\n\t\t\t\tbreak;\n\t\t\tcase subquery:\n\t\t\t\ttable.getSubquery().accept( this );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tLOG.warn( \"Unsupported TTable type: \" + type );\n\t\t\t\tbreak;\n\t\t}\n\t}",
"public Table(ElementStructure structure) {\n\t\tsuper(structure);\n\t\tfields = structure.data.fieldArray(vis.positionFields());\n\t\tpadding = ModelUtil.getPadding(vis, StyleTarget.makeElementTarget(null), 2);\n\t\tpadding.top += 15; // For the titles\n\t\tfraction = divideColumnSpace(fields);\n\t\tStyleTarget styleTarget = StyleTarget.makeElementTarget(\"text\");\n\t\tfontSize = ModelUtil.getFontSize(vis, styleTarget, 12);\n\t}",
"ComplexType getTechnologySpecificComplexType();",
"public abstract boolean isNodeTypeCollection();",
"private void parseProperties()\n {\n List children = rootElement.getChildren(\"property\");\n\n for (Object aChildren : children)\n {\n Element child = (Element) aChildren;\n Property property = new Property(child, properties, this);\n }\n }",
"@Override\r\n\tpublic String getType() {\n\t\treturn \"column\";\r\n\t}",
"@Test\n\tpublic void testSchemaIsComplete() {\n\t\tOrientGraph g = factory.getTx();\n\t\tOrientVertexType t = g.getVertexType(\"ElementTrace\");\n\t\tassertThat(t, is(notNullValue()));\n\t\t\n\t\tOrientEdgeType et = g.getEdgeType(\"Accesses\");\n\t}",
"default <E> E checkTable(final byte[] isSub,\n final SObjectWithClass expected, final E argument, final SType type,\n final SourceSection sourceSection, final ExceptionSignalingNode exception) {\n byte sub = isSub[type.id];\n if (sub == SUBTYPE) {\n return argument;\n } else if (sub == FAIL) {\n reportError(argument, type, expected, sourceSection, exception);\n }\n return null;\n }",
"public Type typeCheck(SymbolTable stable) throws TypeCheckError {\n final Type tleft = _left.typeCheck(stable);\n final Type tright = _right.typeCheck(stable);\n\n if (tleft.isSimple() && tright.isSimple()) {\n if (tleft != tright) {\n if (tleft instanceof BooleanType) {\n _right = new CastExpr(_right, Type.Boolean);\n }\n else if (tright instanceof BooleanType) {\n _left = new CastExpr(_left, Type.Boolean);\n }\n else if (tleft instanceof NumberType ||\n tright instanceof NumberType) {\n _left = new CastExpr(_left, Type.Real);\n _right = new CastExpr(_right, Type.Real);\n }\n else { // both compared as strings\n _left = new CastExpr(_left, Type.String);\n _right = new CastExpr(_right, Type.String);\n }\n }\n }\n else if (tleft instanceof ReferenceType) {\n _right = new CastExpr(_right, Type.Reference);\n }\n else if (tright instanceof ReferenceType) {\n _left = new CastExpr(_left, Type.Reference);\n }\n // the following 2 cases optimize @attr|.|.. = 'string'\n else if (tleft instanceof NodeType && tright == Type.String) {\n _left = new CastExpr(_left, Type.String);\n }\n else if (tleft == Type.String && tright instanceof NodeType) {\n _right = new CastExpr(_right, Type.String);\n }\n // optimize node/node\n else if (tleft instanceof NodeType && tright instanceof NodeType) {\n _left = new CastExpr(_left, Type.String);\n _right = new CastExpr(_right, Type.String);\n }\n else if (tleft instanceof NodeType && tright instanceof NodeSetType) {\n // compare(Node, NodeSet) will be invoked\n }\n else if (tleft instanceof NodeSetType && tright instanceof NodeType) {\n swapArguments(); // for compare(Node, NodeSet)\n }\n else {\n // At least one argument is of type node, node-set or result-tree\n\n // Promote an expression of type node to node-set\n if (tleft instanceof NodeType) {\n _left = new CastExpr(_left, Type.NodeSet);\n }\n if (tright instanceof NodeType) {\n _right = new CastExpr(_right, Type.NodeSet);\n }\n\n // If one arg is a node-set then make it the left one\n if (tleft.isSimple() ||\n tleft instanceof ResultTreeType &&\n tright instanceof NodeSetType) {\n swapArguments();\n }\n\n // Promote integers to doubles to have fewer compares\n if (_right.getType() instanceof IntType) {\n _right = new CastExpr(_right, Type.Real);\n }\n }\n return _type = Type.Boolean;\n }"
]
| [
"0.54063267",
"0.533944",
"0.52032983",
"0.5133161",
"0.51273656",
"0.5043679",
"0.50240743",
"0.4931927",
"0.49301597",
"0.48704374",
"0.48639554",
"0.48566076",
"0.4856478",
"0.4841693",
"0.48357117",
"0.48356065",
"0.4834112",
"0.48278177",
"0.48183808",
"0.48114392",
"0.47837374",
"0.47563592",
"0.47210914",
"0.47196543",
"0.46635917",
"0.46631083",
"0.46418053",
"0.46373972",
"0.46348006",
"0.46322203",
"0.4629095",
"0.46052134",
"0.45947692",
"0.45792186",
"0.4576812",
"0.45699635",
"0.4568754",
"0.45671055",
"0.4561224",
"0.45590234",
"0.4543695",
"0.45399296",
"0.45389012",
"0.45151412",
"0.4505",
"0.45020467",
"0.44949865",
"0.44885886",
"0.4470175",
"0.4469654",
"0.44682714",
"0.44678247",
"0.44642797",
"0.44625732",
"0.44471347",
"0.44401786",
"0.44380897",
"0.4438076",
"0.44375676",
"0.44354227",
"0.44346747",
"0.44311106",
"0.44236055",
"0.44212234",
"0.44133493",
"0.44129062",
"0.44113937",
"0.4408812",
"0.44022983",
"0.4392712",
"0.43815485",
"0.43766236",
"0.43758282",
"0.43735808",
"0.4368438",
"0.43579438",
"0.43480065",
"0.43440548",
"0.4338355",
"0.4333866",
"0.4324678",
"0.4321518",
"0.43165997",
"0.43162814",
"0.43131343",
"0.43131343",
"0.43128887",
"0.43114126",
"0.4310473",
"0.43068302",
"0.42983043",
"0.42978457",
"0.42977816",
"0.42973208",
"0.4297214",
"0.42943054",
"0.4292537",
"0.42909193",
"0.42881244",
"0.42836565"
]
| 0.6872656 | 0 |
Add a property of the form: String m_ElementTypeName; or (for multiplyoccurring children or multivalued attributes): String[] m_ElementTypeNames; | private void addScalarProperty(XMLName name, boolean multiValued)
throws Exception
{
if (!multiValued)
{
//out.write(",");
out.write(NEWLINE);
out.write(INDENT);
out.write("m_");
out.write(name.getLocalName());
out.write(" VARCHAR(50)");
createAllTablesQuery+=NEWLINE+INDENT+"m_"+name.getLocalName()+" VARCHAR(50)";
}else
{
// out.write(",");
/*out.write(NEWLINE);
out.write(INDENT);
out.write("m_");
out.write(name.getLocalName());
*/
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getElementType()\n {\n return elementType;\n }",
"public void addElement(TLProperty element);",
"@Override\n\tpublic AddAdditionalNameElement Elements() {\n\t\treturn new AddAdditionalNameElement(driver);\n\t}",
"@XmlAttribute(name=\"elementClass\")\n public void setElementType(String elementType)\n {\n this.elementType = elementType;\n }",
"private Element addProperty(String name, Property swagger_property) throws ParserConfigurationException {\n\t\tElement element = document.createElement(ParserConstants.element_prefix.value());\n\t\telement.setAttribute(ParserConstants.name.toString(), name);\n\n\t\tElement simple = element;\n\n\t\tif (swagger_property.getRequired()) {\n\t\t\telement.setAttribute(ParserConstants.minOccurs.toString(), ParserConstants.minOccurs.value());\n\t\t}\n\n\t\tif (swagger_property instanceof IntegerProperty) {\n\t\t\tIntegerProperty integerProperty = (IntegerProperty) swagger_property;\n\t\t\telement.setAttribute(ParserConstants.type.toString(), ParserConstants.integer_prefix.value());\n\t\t\tif (integerProperty.getEnum() != null) {\n\t\t\t\tsimple = addEnum(integerProperty.getEnum());\n\t\t\t\telement.appendChild(simple);\n\t\t\t}\n\t\t} else if (swagger_property instanceof LongProperty) {\n\t\t\telement.setAttribute(ParserConstants.type.toString(), ParserConstants.long_prefix.value());\n\t\t} else if (swagger_property instanceof StringProperty) {\n\t\t\tStringProperty stringProperty = (StringProperty) swagger_property;\n\t\t\telement.setAttribute(ParserConstants.type.toString(), ParserConstants.string_prefix.value());\n\t\t\tif (stringProperty.getEnum() != null) {\n\t\t\t\tsimple = addEnum(stringProperty.getEnum());\n\t\t\t\telement.appendChild(simple);\n\t\t\t}\n\t\t} else if (swagger_property instanceof DateTimeProperty) {\n\t\t\tDateTimeProperty dateTimeProperty = (DateTimeProperty) swagger_property;\n\t\t\telement.setAttribute(ParserConstants.type.toString(), ParserConstants.date_time_prefix.value());\n\t\t\tif (dateTimeProperty.getEnum() != null) {\n\t\t\t\tsimple = addEnum(dateTimeProperty.getEnum());\n\t\t\t\telement.appendChild(simple);\n\t\t\t}\n\t\t} else if (swagger_property instanceof BooleanProperty) {\n\t\t\tBooleanProperty booleanProperty = (BooleanProperty) swagger_property;\n\t\t\telement.setAttribute(ParserConstants.type.toString(), ParserConstants.boolean_prefix.value());\n\t\t} else if (swagger_property instanceof RefProperty) {\n\t\t\tRefProperty refProperty = (RefProperty) swagger_property;\n\t\t\telement.setAttribute(ParserConstants.type.toString(), refProperty.getSimpleRef());\n\t\t} else if (swagger_property instanceof ObjectProperty) {\n\t\t\tObjectProperty objectProperty = (ObjectProperty) swagger_property;\n\t\t\telement.appendChild(js2wadl(name, objectProperty.getProperties()));\n\t\t} else if (swagger_property instanceof ArrayProperty) {\n\t\t\tArrayProperty arrayProperty = (ArrayProperty) swagger_property;\n\t\t\telement.appendChild(addProperty(name, arrayProperty.getItems()));\n\t\t} else {\n\t\t\telement.setAttribute(ParserConstants.type.toString(), swagger_property.getFormat());\n\t\t}\n\n\t\tif (swagger_property.getDescription() != null) {\n\t\t\tElement ann = document.createElement(ParserConstants.annotation_prefix.value());\n\t\t\tElement desc = document.createElement(ParserConstants.documentation_prefix.value());\n\t\t\tdesc.setTextContent(swagger_property.getDescription());\n\t\t\tann.appendChild(desc);\n\t\t\tsimple.appendChild(ann);\n\t\t}\n\n\t\treturn element;\n\t}",
"public void setElementType(QName elementType) {\n this.fieldElementType = elementType;\n }",
"public void addElement(int index, TLProperty element);",
"public String getElementType() {\n\t\treturn (element_type);\n\t}",
"public void setElementType(String element_type) {\n\t\tthis.element_type = element_type;\n\t}",
"@Override\n\tpublic void addProperty(String name) {\n\t}",
"public void setElementType(QName elementType) {\n\t\tmFieldElementType = elementType;\n\t}",
"protected final void addPropNames(String ... theNames) { Collections.addAll(getPropertyNames(), theNames); }",
"public String getPropertyTypeString(String name) {\n\t//initialize();\n\tProperty p = getProperty(name);\n\tif (p == null) {\n\t return null;\n\t} else {\n\t if (name.toLowerCase().contains(\"line\")) {\n\t\treturn \"Line\";\n\t }\n\t String typeString = p.getTypeName();\n\t typeString = typeString.substring(0, 1).toUpperCase() + typeString.substring(1).toLowerCase();\n\t return typeString;\n\t}\n }",
"public QName getElementType() {\n return fieldElementType;\n }",
"public List<QName> getTypeName() {\n if (typeName == null) {\n typeName = new ArrayList<QName>();\n }\n return this.typeName;\n }",
"PropertyType(String propertyType) {\n this.propertyType = propertyType;\n }",
"Type getElementType();",
"@Override\r\n\tpublic String toString() {\r\n\t\treturn name + \" \" + Arrays.toString(types);\r\n\t}",
"public void rbListAddElement() {\n rbProductType.clear();\n rbProductType.add(rbScs);\n rbProductType.add(rbSko);\n rbProductType.add(rbMko);\n rbProductType.add(rbZko);\n }",
"private static Element createExtendedItemListProp(ReportDesigner reportDesigner){\r\n\t\tElement listPropertyNode = doc.createElement(\"list-property\");\r\n\t\tlistPropertyNode.setAttribute(ReportDesigner.ATTRIBUTE_NAME_NAME,\"boundDataColumns\");\r\n\r\n\t\tList<ReportColumn> reportColumns = reportDesigner.getReportColumns();\r\n\r\n\t\tfor(ReportColumn col : reportColumns){\r\n\t\t\tElement structureNode = doc.createElement(ReportDesigner.NODE_NAME_STRUCTURE);\r\n\t\t\tlistPropertyNode.appendChild(structureNode);\r\n\r\n\t\t\tElement propertyNode = doc.createElement(ReportDesigner.NODE_NAME_PROPERTY);\r\n\t\t\tpropertyNode.setAttribute(ReportDesigner.ATTRIBUTE_NAME_NAME,ReportDesigner.ATTRIBUTE_VALUE_NAME);\r\n\t\t\tpropertyNode.appendChild(doc.createTextNode(col.getName()));\r\n\t\t\tstructureNode.appendChild(propertyNode);\r\n\r\n\t\t\tElement expressionNode = doc.createElement(ReportDesigner.NODE_NAME_EXPRESSION);\r\n\t\t\texpressionNode.setAttribute(ReportDesigner.ATTRIBUTE_NAME_NAME,ReportDesigner.ATTRIBUTE_VALUE_EXPRESSION);\r\n\t\t\texpressionNode.appendChild(doc.createTextNode(\"dataSetRow[\\\"\"+col.getName()+\"\\\"]\"));\r\n\t\t\tstructureNode.appendChild(expressionNode);\r\n\r\n\t\t\tpropertyNode = doc.createElement(ReportDesigner.NODE_NAME_PROPERTY);\r\n\t\t\tpropertyNode.setAttribute(ReportDesigner.ATTRIBUTE_NAME_NAME,\"dataType\");\r\n\t\t\tpropertyNode.appendChild(doc.createTextNode(ReportDesigner.fromXsd2ReportType(col.getDataType())));\r\n\t\t\tstructureNode.appendChild(propertyNode);\r\n\t\t}\r\n\r\n\t\treturn listPropertyNode;\r\n\t}",
"com.microsoft.schemas.xrm._2013.metadata.AttributeTypeDisplayName addNewAttributeTypeDisplayName();",
"public void addElement() {\n\t\tXmlNode newNode = new XmlNode(rootNode, this);// make a new default-type field\n\t\taddElement(newNode);\n\t}",
"void defineElement(String elementName, Map<String, String> properties) throws IllegalArgumentException;",
"private void addTableProperty(ElementType elementType, boolean multiValued)\n throws Exception\n {\n if (!multiValued)\n {\n // out.write(\",\");\n out.write(NEWLINE);\n out.write(INDENT);\n out.write(\"m_\");\n out.write(elementType.name.getLocalName());\n out.write(\" VARCHAR(50)\");\n createAllTablesQuery+=NEWLINE+INDENT+\"m_\"+elementType.name.getLocalName()+\" VARCHAR(50)\";\n\n }else\n {\n // out.write(\",\");\n /* out.write(NEWLINE);\n out.write(INDENT);\n out.write(\"m_\");\n out.write(elementType.name.getLocalName());\n */\n }\n \n }",
"public static void addProperty(String [] propertyValues){\r\n Property oneProperty = new Property();\r\n oneProperty = setPropertyAttributes(oneProperty, propertyValues);\r\n propertyLogImpl.add(oneProperty);\r\n }",
"public QName getElementType() {\n\t\treturn mFieldElementType;\n\t}",
"private void processPropertyParentNode(Element node) {\n PropertyDataItem prp = new PropertyDataItem(node.attributeValue(\"name\"));\n\n Iterator childNodes = node.elementIterator();\n\n while (childNodes.hasNext()) {\n\n prp.addChildNode(((Element) childNodes.next()).attributeValue(\"name\"));\n }\n\n properties.add(prp);\n }",
"@Test\n\tpublic void addAttributeMultiple() {\n\t\tXMLTagParser.addNewElement(\"Person\");\n\n\t\tXMLTagParser.editElement(\"Person\", \"name\", \"tony\");\n\t\tassertEquals(XMLTagParser.getTagValueFromElement(\"Person\", \"name\"), \"tony\");\n\t\t\n\t\tXMLTagParser.editElement(\"Person\", \"surname\", \"blaire\");\n\t\tassertEquals(XMLTagParser.getTagValueFromElement(\"Person\", \"surname\"), \"blaire\");\n\t}",
"TypeElement getTypeElement();",
"@Override\r\n \tpublic int getElementType() {\r\n \t\treturn 0; \r\n \t}",
"public JType elementType() {\n throw new IllegalArgumentException(\"Not an array type\");\n }",
"public void addToName_L10N_ARRAY(entity.APDExposure_Name_L10N element);",
"public String[] getTypes() {\n/* 388 */ return getStringArray(\"type\");\n/* */ }",
"public void setElementType(final GraphElementType elementType);",
"ElementSetNameType createElementSetNameType();",
"public void setTypeName(java.lang.String value);",
"public String getElementType()\n {\n return MENU_ELEMENT_TYPE;\n }",
"public String[] getPropertyNames();",
"public void addNames() {}",
"public void addNames() {}",
"protected void addTypePropertyDescriptor(Object object) {\n\t\titemPropertyDescriptors.add(new EdgeTypePropertyDescriptor(\n\t\t\t\t((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),\n\t\t\t\tgetResourceLocator(), getString(\"_UI_Edge_type_feature\"), getString(\n\t\t\t\t\t\t\"_UI_PropertyDescriptor_description\", \"_UI_Edge_type_feature\",\n\t\t\t\t\t\t\"_UI_Edge_type\"), HenshinPackage.Literals.EDGE__TYPE));\n\t}",
"@gw.internal.gosu.parser.ExtendedProperty\n public java.lang.String getTypeName();",
"@Test\n\tpublic void addProperty() {\n\t\tXMLTagParser.addNewElement(\"Person\");\n\t\tXMLTagParser.editElement(\"Person\", \"residence\", \"milan\");\n\n\t\tXMLTagParser.editProperty(\"Person\", \"residence\", \"isRenting\", \"false\");\n\t\tassertEquals(XMLTagParser.getPropertyValueFromTag(\"Person\", \"residence\", \"isRenting\"), \"false\");\n\t\tXMLTagParser.editProperty(\"Person\", \"residence\", \"hasGarage\", \"true\");\n\t\tassertEquals(XMLTagParser.getPropertyValueFromTag(\"Person\", \"residence\", \"hasGarage\"), \"true\");\n\t}",
"public android.renderscript.Element.Builder add(android.renderscript.Element element, java.lang.String name, int arraySize) { throw new RuntimeException(\"Stub!\"); }",
"public entity.APDExposure_Name_L10N getName_L10N_ARRAYByLanguage(com.guidewire.commons.entity.type2.IAssociativeArrayPropertyInfo property);",
"ElementType getElementType();",
"Builder addAdditionalType(String value);",
"public void setNameValueProperty(List<NameValueProperty> nameValueProperty) {\n\t\tthis.nameValuePropertyList = nameValueProperty;\n\t}",
"public ArrayList<String> getTypes(){\n return this.types;\n }",
"protected void addTypePropertyDescriptor(Object object) {\n\t\titemPropertyDescriptors.add\n\t\t\t(createItemPropertyDescriptor\n\t\t\t\t(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),\n\t\t\t\t getResourceLocator(),\n\t\t\t\t getString(\"_UI_Requirement_type_feature\"),\n\t\t\t\t getString(\"_UI_PropertyDescriptor_description\", \"_UI_Requirement_type_feature\", \"_UI_Requirement_type\"),\n\t\t\t\t Y3853992Package.Literals.REQUIREMENT__TYPE,\n\t\t\t\t true,\n\t\t\t\t false,\n\t\t\t\t false,\n\t\t\t\t ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,\n\t\t\t\t null,\n\t\t\t\t null));\n\t}",
"public TypeElement<?>[] getTypeElements() {\n\t\t\treturn (this.TypeElements.size() == 0)\n\t\t\t\t\t?EmptyTypeElements\n\t\t\t\t\t:this.TypeElements.values().toArray(EmptyTypeElements);\n\t\t}",
"List<PropertyType<?>> getPropertyTypes();",
"@Override\n public ImmutableList<String> getTypeParts() {\n return types.toImmutable();\n }",
"void addField(\n JavaSymbolName propertyName,\n JavaType propertyType,\n String columnName,\n String columnType,\n JavaType className\n );",
"public void addType(TypeData type) { types.add(type); }",
"public void addStringListValue(int type, String value);",
"public static PropertyDescriptionBuilder<List<String>> listOfStringsProperty(String name) {\n // Trick to work-around type erasure\n // https://stackoverflow.com/a/30754982/2535153\n @SuppressWarnings(\"unchecked\")\n Class<List<String>> clazz = (Class<List<String>>)(Class<?>)List.class;\n return PropertyDescriptionBuilder.start(name, clazz, Parsers.parseList(Parsers::parseString));\n }",
"@Override\n\tpublic void addInstrumentType(String type) {\n\t\t\n\t}",
"public void setElement(java.lang.String[] element) {\n this.element = element;\n }",
"public void addProperty(String s, Object o) {\n }",
"public void addProperty(String s, Object o) {\n }",
"MediaPackageElement.Type getElementType();",
"protected void addPropNames()\n{\n addPropNames(\"Visible\", \"X\", \"Y\", \"Width\", \"Height\", \"Roll\", \"ScaleX\", \"ScaleY\",\n \"Font\", \"TextColor\", \"FillColor\", \"StrokeColor\", \"URL\");\n}",
"public static PropertyDescriptionBuilder<String[]> arrayOfStringsProperty(String name) {\n return PropertyDescriptionBuilder.start(name, String[].class, Parsers.parseArray(String.class, Parsers::parseString));\n }",
"private String AddToProperty(String property, String propertyAdd)\n {\n \tString ret = \"\";\n \tif(property == null)\n \t\tret = propertyAdd;\n \telse\n \t\tret = property + \",\" + propertyAdd;\n \treturn ret;\n }",
"private PropertyCard createPropertyElement(Element eElement) {\r\n\t\tif ( PropertyCard.PropertyType.valueOf(eElement.getElementsByTagName(\"type\").item(0).getTextContent()) == PropertyCard.PropertyType.UTILITY )\r\n\t\t{\r\n\t\t return new UtilityPropertyCard(\r\n\t\t\t Integer.parseInt(eElement.getAttribute(\"id\"))\r\n\t\t\t ,eElement.getElementsByTagName(\"name\").item(0).getTextContent()\r\n\t\t\t ,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue1\").item(0).getTextContent())\r\n\t\t\t ,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue2\").item(0).getTextContent())\r\n\t\t );\r\n\t\t}\r\n\t\telse if (PropertyCard.PropertyType.valueOf(eElement.getElementsByTagName(\"type\").item(0).getTextContent()) == PropertyCard.PropertyType.RAILING )\r\n\t\t{\r\n\t\t return new RailingPropertyCard(\r\n\t\t\t Integer.parseInt(eElement.getAttribute(\"id\"))\r\n\t\t\t ,eElement.getElementsByTagName(\"name\").item(0).getTextContent()\r\n\t\t\t ,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue1\").item(0).getTextContent())\r\n\t\t\t ,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue2\").item(0).getTextContent())\r\n\t\t\t ,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue3\").item(0).getTextContent())\r\n\t\t\t ,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue4\").item(0).getTextContent())\r\n\t\t\t ,Integer.parseInt(eElement.getElementsByTagName(\"mortgageValue\").item(0).getTextContent())\r\n\t\t );\r\n\t\t}\r\n\t\telse if ( PropertyCard.PropertyType.valueOf(eElement.getElementsByTagName(\"type\").item(0).getTextContent()) == PropertyCard.PropertyType.SIMPLE )\r\n\t\t{\r\n\t\t\treturn new PlotPropertyCard(\r\n\t\t\t\tInteger.parseInt(eElement.getAttribute(\"id\"))\r\n\t\t\t\t,eElement.getElementsByTagName(\"name\").item(0).getTextContent()\r\n\t\t\t\t,PlotPropertyCard.Colour_Type.valueOf(eElement.getElementsByTagName(\"colour\").item(0).getTextContent())\r\n\t\t\t\t,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue0\").item(0).getTextContent())\r\n\t\t\t\t,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue1\").item(0).getTextContent())\r\n\t\t\t\t,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue2\").item(0).getTextContent())\r\n\t\t\t\t,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue3\").item(0).getTextContent())\r\n\t\t\t\t,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue4\").item(0).getTextContent())\r\n\t\t\t\t,Integer.parseInt(eElement.getElementsByTagName(\"rentalValueHotel\").item(0).getTextContent())\r\n\t\t\t\t,Integer.parseInt(eElement.getElementsByTagName(\"mortgageValue\").item(0).getTextContent())\r\n\t\t\t\t,Integer.parseInt(eElement.getElementsByTagName(\"houseCost\").item(0).getTextContent())\r\n\t\t\t\t,Integer.parseInt(eElement.getElementsByTagName(\"hotelCost\").item(0).getTextContent())\r\n\t\t\t);\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"public boolean addType(ElementType type) {\r\n\t\treturn types.add( type );\r\n\t}",
"public ArithmaticExpression add(String propertyName) {\n this.getChildren().add(new PropertyValueExpression(propertyName));\n return this;\n }",
"public void addType(String value) {\n/* 380 */ addStringToBag(\"type\", value);\n/* */ }",
"public static void addProperty(String[] attribs) {\n int mls = Integer.parseInt(attribs[2]); \n int zip = Integer.parseInt(attribs[7]);\n int numBedrooms = Integer.parseInt(attribs[8]);\n double numBathrooms = Double.parseDouble(attribs[9]);\n boolean isSold;\n if(attribs[10].toUpperCase().equals(\"Y\")) {\n isSold = true;\n } else {\n isSold = false;\n }\n double askingPrice = Double.parseDouble(attribs[11]);\n Property property = new Property(mls, attribs[3], attribs[4],\n attribs[5], attribs[6], zip, numBedrooms, numBathrooms, isSold,\n askingPrice);\n String added = propertyLogImpl.add(property) ? \"added\" : \"not added\";\n System.out.println(\"Property \" + added);\n }",
"public StringDt getTypeElement() { \n\t\tif (myType == null) {\n\t\t\tmyType = new StringDt();\n\t\t}\n\t\treturn myType;\n\t}",
"private void processPCDATAContent(ElementType elementType)\n throws Exception\n {\n\n addPCDATAProperty(elementType);\n }",
"public Object prop(String name, String type);",
"@Override\n\tpublic void addProperty(IProperty property) {\n\t\t\n\t}",
"public void addDojoTypes(Collection<String> types) {\n dojoTypes.addAll(types);\n }",
"public void addProperty(Property property)\r\n {\r\n m_values.add(property);\r\n }",
"protected void addTypePropertyDescriptor(Object object) {\n\t\titemPropertyDescriptors.add\n\t\t\t(createItemPropertyDescriptor\n\t\t\t\t(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),\n\t\t\t\t getResourceLocator(),\n\t\t\t\t getString(\"_UI_Bean_type_feature\"),\n\t\t\t\t getString(\"_UI_PropertyDescriptor_description\", \"_UI_Bean_type_feature\", \"_UI_Bean_type\"),\n\t\t\t\t BeansPackage.Literals.BEAN__TYPE,\n\t\t\t\t true,\n\t\t\t\t false,\n\t\t\t\t false,\n\t\t\t\t ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,\n\t\t\t\t null,\n\t\t\t\t null));\n\t}",
"gov.nih.nlm.ncbi.www.MedlineSiDocument.MedlineSi.Type addNewType();",
"private Element js2wadl(String name, final Map<String, Property> properties) throws ParserConfigurationException {\n\n\t\tElement type;\n\t\tElement base;\n\n\t\tif (properties.size() > 1) {\n\t\t\ttype = document.createElement(ParserConstants.complexType_prefix.value());\n\t\t\ttype.setAttribute(ParserConstants.name.toString(), name);\n\t\t\tElement seq = document.createElement(ParserConstants.sequence_prefix.value());\n\t\t\ttype.appendChild(seq);\n\t\t\tbase = seq;\n\t\t} else {\n\t\t\ttype = document.createElement(ParserConstants.simpleType_prefix.value());\n\t\t\ttype.setAttribute(ParserConstants.name.toString(), name);\n\t\t\tbase = type;\n\t\t}\n\t\tfor (Entry<String, Property> prop : properties.entrySet()) {\n\t\t\tbase.appendChild(addProperty(prop.getKey(), prop.getValue()));\n\t\t}\n\t\treturn type;\n\t}",
"Builder addProperty(String name, SchemaOrgType value);",
"public void setTypes(ArrayList<String> types){\n this.types = types;\n }",
"public String getTypeName() {\n return this.typeName;\n }",
"public int getTypeElementCount() {\n\t\t\treturn this.TypeElements.size();\n\t\t}",
"@Override\n public void onRPClassAddAttribute(RPClass rpclass,\n String name, Definition.Type type) {\n }",
"public TLProperty getElement(String elementName);",
"public QName getFieldElementType() {\n return fieldElementType;\n }",
"protected void addElementFormNamePropertyDescriptor(Object object) {\n\t\titemPropertyDescriptors.add\n\t\t\t(createItemPropertyDescriptor\n\t\t\t\t(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),\n\t\t\t\t getResourceLocator(),\n\t\t\t\t getString(\"_UI_Widget_elementFormName_feature\"),\n\t\t\t\t getString(\"_UI_PropertyDescriptor_description\", \"_UI_Widget_elementFormName_feature\", \"_UI_Widget_type\"),\n\t\t\t\t WavePackage.Literals.WIDGET__ELEMENT_FORM_NAME,\n\t\t\t\t true,\n\t\t\t\t false,\n\t\t\t\t false,\n\t\t\t\t ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,\n\t\t\t\t null,\n\t\t\t\t null));\n\t}",
"public String getName(){\n\t\treturn arr.getClass().getSimpleName();\n\t}",
"public String getTypeName()\n {\n return this.typeName;\n }",
"private void serializeXmlElementsArray(ArrayList<?> al, JsonGenerator jgen, SerializerProvider prov,\n Map<Class<?>, QName> nameMap)\n throws JsonGenerationException, IOException {\n for (Object obj : al) {\n Class<?> objClass = obj.getClass();\n QName qn = nameMap.get(objClass);\n if (qn == null) {\n if (org.w3c.dom.Element.class.isAssignableFrom(objClass)) {\n // XmlAnyElement handling\n org.w3c.dom.Element w3ce = (org.w3c.dom.Element) obj;\n jgen.writeFieldName(w3ce.getLocalName());\n JsonSerializer<org.w3c.dom.Element> eleSer = new ZmDomElementJsonSerializer();\n eleSer.serialize(w3ce, jgen, prov);\n } else {\n if (!nameInfo.isMixedAllowed()) {\n LOG.debug(\"Unexpected '\" + objClass.getName() + \"' object in XmlElements(Refs) array - ignored\");\n } else {\n jgen.writeFieldName(JSONElement.A_CONTENT /* \"_content\" */);\n jgen.writeObject(obj);\n }\n }\n } else {\n jgen.writeFieldName(qn.getLocalPart());\n jgen.writeStartArray();\n jgen.writeObject(obj);\n jgen.writeEndArray();\n }\n }\n }",
"static String[] getAllTypeNames()\n\t{\n\t\treturn new String[] {\"String\", \"int\", \"double\", \"long\", \"boolean\", \"String[]\", \"int[]\", \"double[]\", \"long[]\"};\n\t}",
"public abstract void addValue(String str, Type type);",
"private void addElement(PEElement element) {\n\t\tif (currentGroups.size() > 0) {\n\t\t\tcurrentGroups.peek().getElements().add(element);\n\t\t} else if (currentLabeledNodeType != null) {\n\t\t\tcurrentLabeledNodeType.getElements().add(element);\n\t\t} else {\n\t\t\tcurrentNodeType.getElements().add(element);\n\t\t}\n\t}",
"PropertyType createPropertyType();",
"public PathElementIF createElement(String name);",
"@Override\n public String getType() {\n return this.name; \n }",
"@Override\r\n\tpublic ElementKind getElementKind() \r\n\t{\r\n\t\t/* if the Property is just a reference,\r\n\t\t * return the type of the referent */\r\n\t\tif (referent != null) return referent.getElementKind();\r\n\r\n\t\treturn ElementKind.PROPERTY;\r\n\t}",
"protected void addTypePropertyDescriptor(Object object) {\n\t\titemPropertyDescriptors.add\n\t\t\t(createItemPropertyDescriptor\n\t\t\t\t(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),\n\t\t\t\t getResourceLocator(),\n\t\t\t\t getString(\"_UI_SecuritySchema_type_feature\"),\n\t\t\t\t getString(\"_UI_PropertyDescriptor_description\", \"_UI_SecuritySchema_type_feature\", \"_UI_SecuritySchema_type\"),\n\t\t\t\t CorePackage.Literals.SECURITY_SCHEMA__TYPE,\n\t\t\t\t true,\n\t\t\t\t false,\n\t\t\t\t false,\n\t\t\t\t ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,\n\t\t\t\t null,\n\t\t\t\t null));\n\t}",
"protected void addOrmTypePropertyDescriptor(Object object) {\n\t\titemPropertyDescriptors.add\n\t\t\t(createItemPropertyDescriptor\n\t\t\t\t(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),\n\t\t\t\t getResourceLocator(),\n\t\t\t\t getString(\"_UI_EntityAttribute_ormType_feature\"),\n\t\t\t\t getString(\"_UI_PropertyDescriptor_description\", \"_UI_EntityAttribute_ormType_feature\", \"_UI_EntityAttribute_type\"),\n\t\t\t\t PersistencePackage.Literals.ENTITY_ATTRIBUTE__ORM_TYPE,\n\t\t\t\t true,\n\t\t\t\t false,\n\t\t\t\t false,\n\t\t\t\t ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,\n\t\t\t\t getString(\"_UI_OrmPropertyCategory\"),\n\t\t\t\t null));\n\t}",
"public String getJsonTypeAttributeName() {\r\n return _jsonTypeAttributeName;\r\n }",
"public boolean addTypeWithElements(Object pID, TypeWithElements pTypeWithElements) {\n\t\t\tif(!this.verifySecretID(pID)) return false;\n\t\t\t\n\t\t\tif((pTypeWithElements == null) || this.TypeWithElements.containsKey(pTypeWithElements.getTypeName()))\n\t\t\t\treturn false;\n\t\t\t\n\t\t\tthis.TypeWithElements.put(pTypeWithElements.getTypeName(), pTypeWithElements);\n\t\t\treturn true;\n\t\t}"
]
| [
"0.60590845",
"0.5941689",
"0.59006137",
"0.589857",
"0.5709093",
"0.5689852",
"0.5625596",
"0.55849975",
"0.5558217",
"0.5481477",
"0.5448159",
"0.5290447",
"0.5253607",
"0.5125699",
"0.5124345",
"0.5122894",
"0.51101065",
"0.5108987",
"0.51078254",
"0.50979966",
"0.5092325",
"0.5077366",
"0.50711715",
"0.50549924",
"0.5047365",
"0.504106",
"0.5033482",
"0.5015838",
"0.50152373",
"0.4999912",
"0.4981272",
"0.49614826",
"0.49603337",
"0.4956107",
"0.4941193",
"0.49344113",
"0.49277422",
"0.4922903",
"0.48863733",
"0.48863733",
"0.48808768",
"0.4864115",
"0.48589793",
"0.48559147",
"0.48504394",
"0.48432022",
"0.48405424",
"0.48332363",
"0.48226768",
"0.47894546",
"0.47774106",
"0.4771359",
"0.47696945",
"0.47656947",
"0.4763738",
"0.47587496",
"0.47531635",
"0.47362465",
"0.4726154",
"0.4724913",
"0.4724913",
"0.47213405",
"0.4712843",
"0.4711299",
"0.47074696",
"0.47023323",
"0.47007513",
"0.46962857",
"0.46958226",
"0.4695266",
"0.46720377",
"0.46661842",
"0.46657422",
"0.46557906",
"0.46556428",
"0.4653714",
"0.4647978",
"0.46465012",
"0.4641499",
"0.4640503",
"0.4637394",
"0.46363235",
"0.46326533",
"0.46316385",
"0.4618974",
"0.4617152",
"0.46140325",
"0.46140262",
"0.46137816",
"0.4612901",
"0.46064553",
"0.4599617",
"0.45988622",
"0.45931014",
"0.45924535",
"0.45829502",
"0.45801637",
"0.45787987",
"0.45771214",
"0.45763257",
"0.4567684"
]
| 0.0 | -1 |
Add a property of the form: ElementTypeName m_ElementTypeName; or (for multiplyoccurring children): ElementTypeName[] m_ElementTypeNames; | private void addTableProperty(ElementType elementType, boolean multiValued)
throws Exception
{
if (!multiValued)
{
// out.write(",");
out.write(NEWLINE);
out.write(INDENT);
out.write("m_");
out.write(elementType.name.getLocalName());
out.write(" VARCHAR(50)");
createAllTablesQuery+=NEWLINE+INDENT+"m_"+elementType.name.getLocalName()+" VARCHAR(50)";
}else
{
// out.write(",");
/* out.write(NEWLINE);
out.write(INDENT);
out.write("m_");
out.write(elementType.name.getLocalName());
*/
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void addElement(TLProperty element);",
"public void addElement(int index, TLProperty element);",
"private Element addProperty(String name, Property swagger_property) throws ParserConfigurationException {\n\t\tElement element = document.createElement(ParserConstants.element_prefix.value());\n\t\telement.setAttribute(ParserConstants.name.toString(), name);\n\n\t\tElement simple = element;\n\n\t\tif (swagger_property.getRequired()) {\n\t\t\telement.setAttribute(ParserConstants.minOccurs.toString(), ParserConstants.minOccurs.value());\n\t\t}\n\n\t\tif (swagger_property instanceof IntegerProperty) {\n\t\t\tIntegerProperty integerProperty = (IntegerProperty) swagger_property;\n\t\t\telement.setAttribute(ParserConstants.type.toString(), ParserConstants.integer_prefix.value());\n\t\t\tif (integerProperty.getEnum() != null) {\n\t\t\t\tsimple = addEnum(integerProperty.getEnum());\n\t\t\t\telement.appendChild(simple);\n\t\t\t}\n\t\t} else if (swagger_property instanceof LongProperty) {\n\t\t\telement.setAttribute(ParserConstants.type.toString(), ParserConstants.long_prefix.value());\n\t\t} else if (swagger_property instanceof StringProperty) {\n\t\t\tStringProperty stringProperty = (StringProperty) swagger_property;\n\t\t\telement.setAttribute(ParserConstants.type.toString(), ParserConstants.string_prefix.value());\n\t\t\tif (stringProperty.getEnum() != null) {\n\t\t\t\tsimple = addEnum(stringProperty.getEnum());\n\t\t\t\telement.appendChild(simple);\n\t\t\t}\n\t\t} else if (swagger_property instanceof DateTimeProperty) {\n\t\t\tDateTimeProperty dateTimeProperty = (DateTimeProperty) swagger_property;\n\t\t\telement.setAttribute(ParserConstants.type.toString(), ParserConstants.date_time_prefix.value());\n\t\t\tif (dateTimeProperty.getEnum() != null) {\n\t\t\t\tsimple = addEnum(dateTimeProperty.getEnum());\n\t\t\t\telement.appendChild(simple);\n\t\t\t}\n\t\t} else if (swagger_property instanceof BooleanProperty) {\n\t\t\tBooleanProperty booleanProperty = (BooleanProperty) swagger_property;\n\t\t\telement.setAttribute(ParserConstants.type.toString(), ParserConstants.boolean_prefix.value());\n\t\t} else if (swagger_property instanceof RefProperty) {\n\t\t\tRefProperty refProperty = (RefProperty) swagger_property;\n\t\t\telement.setAttribute(ParserConstants.type.toString(), refProperty.getSimpleRef());\n\t\t} else if (swagger_property instanceof ObjectProperty) {\n\t\t\tObjectProperty objectProperty = (ObjectProperty) swagger_property;\n\t\t\telement.appendChild(js2wadl(name, objectProperty.getProperties()));\n\t\t} else if (swagger_property instanceof ArrayProperty) {\n\t\t\tArrayProperty arrayProperty = (ArrayProperty) swagger_property;\n\t\t\telement.appendChild(addProperty(name, arrayProperty.getItems()));\n\t\t} else {\n\t\t\telement.setAttribute(ParserConstants.type.toString(), swagger_property.getFormat());\n\t\t}\n\n\t\tif (swagger_property.getDescription() != null) {\n\t\t\tElement ann = document.createElement(ParserConstants.annotation_prefix.value());\n\t\t\tElement desc = document.createElement(ParserConstants.documentation_prefix.value());\n\t\t\tdesc.setTextContent(swagger_property.getDescription());\n\t\t\tann.appendChild(desc);\n\t\t\tsimple.appendChild(ann);\n\t\t}\n\n\t\treturn element;\n\t}",
"@Override\n\tpublic AddAdditionalNameElement Elements() {\n\t\treturn new AddAdditionalNameElement(driver);\n\t}",
"@Override\n\tpublic void addProperty(String name) {\n\t}",
"public void addElement() {\n\t\tXmlNode newNode = new XmlNode(rootNode, this);// make a new default-type field\n\t\taddElement(newNode);\n\t}",
"public String getElementType()\n {\n return elementType;\n }",
"public void addChild(PDFMetadataProperty property) {\n\t\tif(this.childs==null) {\n\t\t\t//mostly there is only one entry.\n\t\t\tthis.childs = new ArrayList<>(1);\n\t\t}\n\t\tthis.childs.add(property);\n\t}",
"@XmlAttribute(name=\"elementClass\")\n public void setElementType(String elementType)\n {\n this.elementType = elementType;\n }",
"public void setElementType(QName elementType) {\n this.fieldElementType = elementType;\n }",
"private void processPropertyParentNode(Element node) {\n PropertyDataItem prp = new PropertyDataItem(node.attributeValue(\"name\"));\n\n Iterator childNodes = node.elementIterator();\n\n while (childNodes.hasNext()) {\n\n prp.addChildNode(((Element) childNodes.next()).attributeValue(\"name\"));\n }\n\n properties.add(prp);\n }",
"public void setElementType(QName elementType) {\n\t\tmFieldElementType = elementType;\n\t}",
"private void addElement(PEElement element) {\n\t\tif (currentGroups.size() > 0) {\n\t\t\tcurrentGroups.peek().getElements().add(element);\n\t\t} else if (currentLabeledNodeType != null) {\n\t\t\tcurrentLabeledNodeType.getElements().add(element);\n\t\t} else {\n\t\t\tcurrentNodeType.getElements().add(element);\n\t\t}\n\t}",
"protected final void addPropNames(String ... theNames) { Collections.addAll(getPropertyNames(), theNames); }",
"@Override\n\tpublic void addProperty(IProperty property) {\n\t\t\n\t}",
"public void addProperty(Property property)\r\n {\r\n m_values.add(property);\r\n }",
"public static void addProperty(String [] propertyValues){\r\n Property oneProperty = new Property();\r\n oneProperty = setPropertyAttributes(oneProperty, propertyValues);\r\n propertyLogImpl.add(oneProperty);\r\n }",
"public void rbListAddElement() {\n rbProductType.clear();\n rbProductType.add(rbScs);\n rbProductType.add(rbSko);\n rbProductType.add(rbMko);\n rbProductType.add(rbZko);\n }",
"public ArithmaticExpression add(String propertyName) {\n this.getChildren().add(new PropertyValueExpression(propertyName));\n return this;\n }",
"private static Element createExtendedItemListProp(ReportDesigner reportDesigner){\r\n\t\tElement listPropertyNode = doc.createElement(\"list-property\");\r\n\t\tlistPropertyNode.setAttribute(ReportDesigner.ATTRIBUTE_NAME_NAME,\"boundDataColumns\");\r\n\r\n\t\tList<ReportColumn> reportColumns = reportDesigner.getReportColumns();\r\n\r\n\t\tfor(ReportColumn col : reportColumns){\r\n\t\t\tElement structureNode = doc.createElement(ReportDesigner.NODE_NAME_STRUCTURE);\r\n\t\t\tlistPropertyNode.appendChild(structureNode);\r\n\r\n\t\t\tElement propertyNode = doc.createElement(ReportDesigner.NODE_NAME_PROPERTY);\r\n\t\t\tpropertyNode.setAttribute(ReportDesigner.ATTRIBUTE_NAME_NAME,ReportDesigner.ATTRIBUTE_VALUE_NAME);\r\n\t\t\tpropertyNode.appendChild(doc.createTextNode(col.getName()));\r\n\t\t\tstructureNode.appendChild(propertyNode);\r\n\r\n\t\t\tElement expressionNode = doc.createElement(ReportDesigner.NODE_NAME_EXPRESSION);\r\n\t\t\texpressionNode.setAttribute(ReportDesigner.ATTRIBUTE_NAME_NAME,ReportDesigner.ATTRIBUTE_VALUE_EXPRESSION);\r\n\t\t\texpressionNode.appendChild(doc.createTextNode(\"dataSetRow[\\\"\"+col.getName()+\"\\\"]\"));\r\n\t\t\tstructureNode.appendChild(expressionNode);\r\n\r\n\t\t\tpropertyNode = doc.createElement(ReportDesigner.NODE_NAME_PROPERTY);\r\n\t\t\tpropertyNode.setAttribute(ReportDesigner.ATTRIBUTE_NAME_NAME,\"dataType\");\r\n\t\t\tpropertyNode.appendChild(doc.createTextNode(ReportDesigner.fromXsd2ReportType(col.getDataType())));\r\n\t\t\tstructureNode.appendChild(propertyNode);\r\n\t\t}\r\n\r\n\t\treturn listPropertyNode;\r\n\t}",
"void defineElement(String elementName, Map<String, String> properties) throws IllegalArgumentException;",
"public android.renderscript.Element.Builder add(android.renderscript.Element element, java.lang.String name, int arraySize) { throw new RuntimeException(\"Stub!\"); }",
"@Test\n\tpublic void addProperty() {\n\t\tXMLTagParser.addNewElement(\"Person\");\n\t\tXMLTagParser.editElement(\"Person\", \"residence\", \"milan\");\n\n\t\tXMLTagParser.editProperty(\"Person\", \"residence\", \"isRenting\", \"false\");\n\t\tassertEquals(XMLTagParser.getPropertyValueFromTag(\"Person\", \"residence\", \"isRenting\"), \"false\");\n\t\tXMLTagParser.editProperty(\"Person\", \"residence\", \"hasGarage\", \"true\");\n\t\tassertEquals(XMLTagParser.getPropertyValueFromTag(\"Person\", \"residence\", \"hasGarage\"), \"true\");\n\t}",
"public void addProperty(SGFProperty property)\r\n\t{\r\n\t\t_propertyList.add(property);\r\n\t}",
"DefinedProperty nodeAddProperty( long nodeId, int propertyKey, Object value );",
"public void setElementType(final GraphElementType elementType);",
"public void setElementType(String element_type) {\n\t\tthis.element_type = element_type;\n\t}",
"public String getElementType() {\n\t\treturn (element_type);\n\t}",
"@Override\r\n \tpublic int getElementType() {\r\n \t\treturn 0; \r\n \t}",
"public void addElement(ThingNode element)\n\t{\n\t\tsuper.addElement(element);\n\t\telements.add(element);\n\t}",
"PropertyType(String propertyType) {\n this.propertyType = propertyType;\n }",
"Type getElementType();",
"void addField(\n JavaSymbolName propertyName,\n JavaType propertyType,\n String columnName,\n String columnType,\n JavaType className\n );",
"void addElement(String name, Element element) {\n if (elementMap.containsKey(name)) {\n elementMap.get(name).add(element);\n } else {\n List<Element> newList = new ArrayList<Element>();\n newList.add(element);\n elementMap.put(name, newList);\n }\n }",
"protected void addTypePropertyDescriptor(Object object) {\n\t\titemPropertyDescriptors.add(new EdgeTypePropertyDescriptor(\n\t\t\t\t((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),\n\t\t\t\tgetResourceLocator(), getString(\"_UI_Edge_type_feature\"), getString(\n\t\t\t\t\t\t\"_UI_PropertyDescriptor_description\", \"_UI_Edge_type_feature\",\n\t\t\t\t\t\t\"_UI_Edge_type\"), HenshinPackage.Literals.EDGE__TYPE));\n\t}",
"@Override\r\n\tpublic ElementKind getElementKind() \r\n\t{\r\n\t\t/* if the Property is just a reference,\r\n\t\t * return the type of the referent */\r\n\t\tif (referent != null) return referent.getElementKind();\r\n\r\n\t\treturn ElementKind.PROPERTY;\r\n\t}",
"public void addProperty(String name, String property)\n {\n if (name != null && name.trim().length() > 0)\n {\n _propertyEntries.put(name, property);\n }\n }",
"public void addElement(Expression element){\n\t\telements.add(element);\n\t}",
"public void addElement(Object ob) {\r\n\t\tif (ob == null) {\r\n\t\t\telements.add(TObject.nullVal());\r\n\t\t} else if (ob instanceof TObject || ob instanceof ParameterSubstitution || ob instanceof Variable || ob instanceof FunctionDef || ob instanceof Operator || ob instanceof StatementTree || ob instanceof TableSelectExpression) {\r\n\t\t\telements.add(ob);\r\n\t\t} else {\r\n\t\t\tthrow new Error(\"Unknown element type added to expression: \" + ob.getClass());\r\n\t\t}\r\n\t}",
"Property addValue(PropertyValue<?, ?> value);",
"public void addNames() {}",
"public void addNames() {}",
"public JType elementType() {\n throw new IllegalArgumentException(\"Not an array type\");\n }",
"protected <T extends IDElement> void addElementToElementList(String pName, Object pValue, ArrayList<T> pElementList, int pElementType) throws Exception {\r\n\t\tint vID;\r\n\t\tT vAdd;\r\n\t\t\r\n\t\tif (pElementList != null) {\r\n\t\t\tvID = genNewIDFromIDElementList(pElementList);\t\r\n\t\t\t\r\n\t\t\tswitch(pElementType) {\r\n\t\t\tcase 0:\r\n\t\t\t\tif (pValue instanceof Double) vAdd = (T)new ProbElement(vID, pName, (double)pValue);\r\n\t\t\t\telse throw new Exception(\"06a; aEtEL,Edi\");\r\n\t\t\t\tbreak;\r\n\t\t\tcase 1:\r\n\t\t\t\tif (pValue instanceof Integer) vAdd = (T)new PrioElement(vID, pName, (int)pValue);\r\n\t\t\t\telse throw new Exception(\"06b; aEtEL,Edi\");\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tthrow new Exception(\"02b; aEtEL,Edi\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (pElementList.size() != 0) {\r\n\t\t\t\tif (isIDInIDElementList(vID, pElementList)) throw new Exception(\"02a; aEtEL,Edi\");\r\n\t\t\t}else pElementList.add(vAdd);\r\n\t\t\t\r\n\t\t\tpElementList.sort((pObj1, pObj2) -> {\r\n\t\t\t\treturn pObj1.getId() - pObj2.getId();\r\n\t\t\t});\r\n\t\t} else throw new Exception(\"04; aEtEL,Edi\");\r\n\t}",
"public boolean addType(ElementType type) {\r\n\t\treturn types.add( type );\r\n\t}",
"public <E extends Enum<E>> void addEnum(Class<E> enumeration, String propertySubName) {\n Map<Enum<?>, String> properties = new HashMap<>();\n for (E id : enumeration.getEnumConstants()) {\n String propertyName = propertySubName +\n \".\" +\n String.join(\"\", id.name().toLowerCase().split(\"_\"));\n properties.put(id, propertyName);\n }\n classProperties.put(enumeration, properties);\n }",
"private PropertyCard createPropertyElement(Element eElement) {\r\n\t\tif ( PropertyCard.PropertyType.valueOf(eElement.getElementsByTagName(\"type\").item(0).getTextContent()) == PropertyCard.PropertyType.UTILITY )\r\n\t\t{\r\n\t\t return new UtilityPropertyCard(\r\n\t\t\t Integer.parseInt(eElement.getAttribute(\"id\"))\r\n\t\t\t ,eElement.getElementsByTagName(\"name\").item(0).getTextContent()\r\n\t\t\t ,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue1\").item(0).getTextContent())\r\n\t\t\t ,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue2\").item(0).getTextContent())\r\n\t\t );\r\n\t\t}\r\n\t\telse if (PropertyCard.PropertyType.valueOf(eElement.getElementsByTagName(\"type\").item(0).getTextContent()) == PropertyCard.PropertyType.RAILING )\r\n\t\t{\r\n\t\t return new RailingPropertyCard(\r\n\t\t\t Integer.parseInt(eElement.getAttribute(\"id\"))\r\n\t\t\t ,eElement.getElementsByTagName(\"name\").item(0).getTextContent()\r\n\t\t\t ,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue1\").item(0).getTextContent())\r\n\t\t\t ,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue2\").item(0).getTextContent())\r\n\t\t\t ,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue3\").item(0).getTextContent())\r\n\t\t\t ,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue4\").item(0).getTextContent())\r\n\t\t\t ,Integer.parseInt(eElement.getElementsByTagName(\"mortgageValue\").item(0).getTextContent())\r\n\t\t );\r\n\t\t}\r\n\t\telse if ( PropertyCard.PropertyType.valueOf(eElement.getElementsByTagName(\"type\").item(0).getTextContent()) == PropertyCard.PropertyType.SIMPLE )\r\n\t\t{\r\n\t\t\treturn new PlotPropertyCard(\r\n\t\t\t\tInteger.parseInt(eElement.getAttribute(\"id\"))\r\n\t\t\t\t,eElement.getElementsByTagName(\"name\").item(0).getTextContent()\r\n\t\t\t\t,PlotPropertyCard.Colour_Type.valueOf(eElement.getElementsByTagName(\"colour\").item(0).getTextContent())\r\n\t\t\t\t,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue0\").item(0).getTextContent())\r\n\t\t\t\t,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue1\").item(0).getTextContent())\r\n\t\t\t\t,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue2\").item(0).getTextContent())\r\n\t\t\t\t,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue3\").item(0).getTextContent())\r\n\t\t\t\t,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue4\").item(0).getTextContent())\r\n\t\t\t\t,Integer.parseInt(eElement.getElementsByTagName(\"rentalValueHotel\").item(0).getTextContent())\r\n\t\t\t\t,Integer.parseInt(eElement.getElementsByTagName(\"mortgageValue\").item(0).getTextContent())\r\n\t\t\t\t,Integer.parseInt(eElement.getElementsByTagName(\"houseCost\").item(0).getTextContent())\r\n\t\t\t\t,Integer.parseInt(eElement.getElementsByTagName(\"hotelCost\").item(0).getTextContent())\r\n\t\t\t);\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"public QName getElementType() {\n\t\treturn mFieldElementType;\n\t}",
"Builder addProperty(String name, String value);",
"public QName getElementType() {\n return fieldElementType;\n }",
"private void setPivotalElementName(final int index, final String name)\r\n {\r\n this.pivotalElementName[index] = name;\r\n }",
"public void addElement(Object obj);",
"private <V> Definition<V> addPropertyDefinition(String name, Class<V> type,\n String caption, Method getter, Method setter) {\n if (getter == null)\n throw new IllegalArgumentException(\"null getter\");\n return this.addPropertyDefinition(name, type, caption,\n target -> Primitive.wrap(type).cast(ReflectUtil.invoke(getter, target)),\n setter != null ? (target, value) -> ReflectUtil.invoke(setter, target, value) : null);\n }",
"TypeElement getTypeElement();",
"ElementType getElementType();",
"public void addToName_L10N_ARRAY(entity.APDExposure_Name_L10N element);",
"public void addPropertyExpression(Object comp, String propertyName, DataStoreEvaluator expEval) throws NoSuchMethodException, DataStoreException {\r\n\t\tClass c = comp.getClass();\r\n\t\tMethod m[] = c.getMethods();\r\n\t\tMethod exe = null;\r\n\t\tString name = \"set\" + propertyName;\r\n\t\tClass parms[] = null;\r\n\t\tfor (int i = 0; i < m.length; i++) {\r\n\t\t\tif (name.equalsIgnoreCase(m[i].getName())) {\r\n\t\t\t\tparms = m[i].getParameterTypes();\r\n\t\t\t\tif (parms.length == 1) {\r\n\t\t\t\t\texe = m[i];\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (exe == null)\r\n\t\t\tthrow new NoSuchMethodException(\"Couldn't find a set method for property:\" + propertyName);\r\n\t\tThreeObjectContainer t = new ThreeObjectContainer(comp, exe, expEval);\r\n\t\tif (_propertyExpressions == null)\r\n\t\t\t_propertyExpressions = new Vector();\r\n\t\t_propertyExpressions.addElement(t);\r\n\t}",
"public void addProperty(String s, Object o) {\n }",
"public void addProperty(String s, Object o) {\n }",
"public int getTypeElementCount() {\n\t\t\treturn this.TypeElements.size();\n\t\t}",
"private void processPCDATAContent(ElementType elementType)\n throws Exception\n {\n\n addPCDATAProperty(elementType);\n }",
"@Test\n\tpublic void addAttributeMultiple() {\n\t\tXMLTagParser.addNewElement(\"Person\");\n\n\t\tXMLTagParser.editElement(\"Person\", \"name\", \"tony\");\n\t\tassertEquals(XMLTagParser.getTagValueFromElement(\"Person\", \"name\"), \"tony\");\n\t\t\n\t\tXMLTagParser.editElement(\"Person\", \"surname\", \"blaire\");\n\t\tassertEquals(XMLTagParser.getTagValueFromElement(\"Person\", \"surname\"), \"blaire\");\n\t}",
"public void setNameValueProperty(List<NameValueProperty> nameValueProperty) {\n\t\tthis.nameValuePropertyList = nameValueProperty;\n\t}",
"public void addType(TypeData type) { types.add(type); }",
"void addField(\n JavaSymbolName propertyName,\n JavaType propertyType,\n String columnName,\n String columnType,\n JavaType className,\n boolean id,\n boolean oneToOne, boolean oneToMany, boolean manyToOne, boolean manyToMany, String mappedBy);",
"void add(VisualPropertyType calcType, Object value);",
"Builder addProperty(String name, SchemaOrgType value);",
"void addProperty(String index, Object value) {\n if (getProperty(index) == null) {\n properties.addProperty(index, value);\n }\n }",
"public PathElementIF createElement(String name);",
"private void parseProperties()\n {\n List children = rootElement.getChildren(\"property\");\n\n for (Object aChildren : children)\n {\n Element child = (Element) aChildren;\n Property property = new Property(child, properties, this);\n }\n }",
"public boolean addTypeWithElements(Object pID, TypeWithElements pTypeWithElements) {\n\t\t\tif(!this.verifySecretID(pID)) return false;\n\t\t\t\n\t\t\tif((pTypeWithElements == null) || this.TypeWithElements.containsKey(pTypeWithElements.getTypeName()))\n\t\t\t\treturn false;\n\t\t\t\n\t\t\tthis.TypeWithElements.put(pTypeWithElements.getTypeName(), pTypeWithElements);\n\t\t\treturn true;\n\t\t}",
"public void add(String name)\n/* 15: */ {\n/* 16:14 */ this.members.add(name);\n/* 17: */ }",
"public String getPropertyTypeString(String name) {\n\t//initialize();\n\tProperty p = getProperty(name);\n\tif (p == null) {\n\t return null;\n\t} else {\n\t if (name.toLowerCase().contains(\"line\")) {\n\t\treturn \"Line\";\n\t }\n\t String typeString = p.getTypeName();\n\t typeString = typeString.substring(0, 1).toUpperCase() + typeString.substring(1).toLowerCase();\n\t return typeString;\n\t}\n }",
"DefinedProperty graphAddProperty( int propertyKey, Object value );",
"private String AddToProperty(String property, String propertyAdd)\n {\n \tString ret = \"\";\n \tif(property == null)\n \t\tret = propertyAdd;\n \telse\n \t\tret = property + \",\" + propertyAdd;\n \treturn ret;\n }",
"public void push(TYPE element);",
"public static void addProperty(String[] attribs) {\n int mls = Integer.parseInt(attribs[2]); \n int zip = Integer.parseInt(attribs[7]);\n int numBedrooms = Integer.parseInt(attribs[8]);\n double numBathrooms = Double.parseDouble(attribs[9]);\n boolean isSold;\n if(attribs[10].toUpperCase().equals(\"Y\")) {\n isSold = true;\n } else {\n isSold = false;\n }\n double askingPrice = Double.parseDouble(attribs[11]);\n Property property = new Property(mls, attribs[3], attribs[4],\n attribs[5], attribs[6], zip, numBedrooms, numBathrooms, isSold,\n askingPrice);\n String added = propertyLogImpl.add(property) ? \"added\" : \"not added\";\n System.out.println(\"Property \" + added);\n }",
"public void addClassifier(String name, Class classifierType, Properties prop) throws PropertyConfigurationException\n\t{\n\t\tif (m_ClassifierTypes.containsKey(name) || m_Classifiers.containsKey(name))\n\t\t\tthrow new IllegalArgumentException(\"A classifier named \"+name+\" already added.\");\n\t\tm_ClassifierTypes.put(name, classifierType);\n\t\tm_ClassifierProperties.put(name, prop);\n\t}",
"abstract void putXMLProperty(XMLName name, Object value);",
"gov.nih.nlm.ncbi.www.MedlineSiDocument.MedlineSi.Type addNewType();",
"PropertyType createPropertyType();",
"public void addProperty(String name, PropertyObject data) {\n this.properties.put(name, data);\n }",
"public void addNormal(E element) {\n\t\tsuper.add(element);\r\n\t}",
"public void add(Object e)\n {\n if(numElements == maxElements)\n doubleCapacity();\n \n // Add element\n if(!contains(e))\n elements[numElements++] = e;\n }",
"private Node addChild(Node parent, NodeTypes type, String name, String indexName) {\r\n Node child = null;\r\n child = neo.createNode();\r\n child.setProperty(INeoConstants.PROPERTY_TYPE_NAME, type.getId());\r\n // TODO refactor 2 property with same name!\r\n child.setProperty(INeoConstants.PROPERTY_NAME_NAME, name);\r\n child.setProperty(INeoConstants.PROPERTY_SECTOR_NAME, indexName);\r\n luceneInd.index(child, NeoUtils.getLuceneIndexKeyByProperty(getNetworkNode(), INeoConstants.PROPERTY_NAME_NAME, type),\r\n indexName);\r\n if (parent != null) {\r\n parent.createRelationshipTo(child, NetworkRelationshipTypes.CHILD);\r\n debug(\"Added '\" + name + \"' as child of '\" + parent.getProperty(INeoConstants.PROPERTY_NAME_NAME));\r\n }\r\n return child;\r\n }",
"ElementSetNameType createElementSetNameType();",
"void add(Object element);",
"public <T> T prop(String propertyName) {\n\t\treturn PropFunction.prop(this, elements, propertyName);\n\t}",
"public int getTypeWithElementsCount() {\n\t\t\treturn this.TypeWithElements.size();\n\t\t}",
"public PropertyMap createChildPropertyMap(XMLName elementTypeName)\n throws XMLMiddlewareException\n {\n checkState();\n return super.createChildPropertyMap(elementTypeName);\n }",
"public TLProperty getElement(String elementName);",
"public TypeElement<?>[] getTypeElements() {\n\t\t\treturn (this.TypeElements.size() == 0)\n\t\t\t\t\t?EmptyTypeElements\n\t\t\t\t\t:this.TypeElements.values().toArray(EmptyTypeElements);\n\t\t}",
"@Override\n public abstract void addToXmlElement(Element element);",
"public void add(Declarator element) throws ChameleonProgrammerException;",
"public void addMember(Member member) {\r\n\t\tmember.setParentTypeDeclaration(this);\r\n\t\tmemberList.add(member);\r\n\t}",
"ElementDefinition createElementDefinition();",
"private Element js2wadl(String name, final Map<String, Property> properties) throws ParserConfigurationException {\n\n\t\tElement type;\n\t\tElement base;\n\n\t\tif (properties.size() > 1) {\n\t\t\ttype = document.createElement(ParserConstants.complexType_prefix.value());\n\t\t\ttype.setAttribute(ParserConstants.name.toString(), name);\n\t\t\tElement seq = document.createElement(ParserConstants.sequence_prefix.value());\n\t\t\ttype.appendChild(seq);\n\t\t\tbase = seq;\n\t\t} else {\n\t\t\ttype = document.createElement(ParserConstants.simpleType_prefix.value());\n\t\t\ttype.setAttribute(ParserConstants.name.toString(), name);\n\t\t\tbase = type;\n\t\t}\n\t\tfor (Entry<String, Property> prop : properties.entrySet()) {\n\t\t\tbase.appendChild(addProperty(prop.getKey(), prop.getValue()));\n\t\t}\n\t\treturn type;\n\t}",
"protected void addPropNames()\n{\n addPropNames(\"Visible\", \"X\", \"Y\", \"Width\", \"Height\", \"Roll\", \"ScaleX\", \"ScaleY\",\n \"Font\", \"TextColor\", \"FillColor\", \"StrokeColor\", \"URL\");\n}",
"private void addScalarProperty(XMLName name, boolean multiValued)\n throws Exception\n {\n\n if (!multiValued)\n {\n //out.write(\",\");\n out.write(NEWLINE);\n out.write(INDENT);\n out.write(\"m_\");\n out.write(name.getLocalName());\n out.write(\" VARCHAR(50)\");\n createAllTablesQuery+=NEWLINE+INDENT+\"m_\"+name.getLocalName()+\" VARCHAR(50)\";\n\n }else\n {\n // out.write(\",\");\n /*out.write(NEWLINE);\n out.write(INDENT);\n out.write(\"m_\");\n out.write(name.getLocalName());\n */\n }\n }",
"public Type addType() {\n\t\tType newType = new Type();\n\t\tgetType().add(newType);\n\t\treturn newType; \n\t}"
]
| [
"0.6430554",
"0.61630636",
"0.60205436",
"0.5942402",
"0.5891267",
"0.57242626",
"0.56986475",
"0.5578386",
"0.55073005",
"0.5465574",
"0.5452632",
"0.5365746",
"0.53238297",
"0.532211",
"0.5310896",
"0.5281323",
"0.51970834",
"0.51485324",
"0.514193",
"0.51296866",
"0.51276094",
"0.50910604",
"0.50853837",
"0.50666887",
"0.5064181",
"0.50597984",
"0.5052171",
"0.50445133",
"0.5044139",
"0.5009529",
"0.50000536",
"0.49761847",
"0.49631092",
"0.49510044",
"0.4950931",
"0.49431568",
"0.49101448",
"0.49023473",
"0.4902129",
"0.48873115",
"0.48720458",
"0.48720458",
"0.48692206",
"0.48687452",
"0.48545626",
"0.48486814",
"0.48466915",
"0.48434868",
"0.48318148",
"0.48316845",
"0.48209998",
"0.48203522",
"0.481646",
"0.48163393",
"0.47648233",
"0.4764494",
"0.47585908",
"0.47574556",
"0.47574556",
"0.47558418",
"0.47484368",
"0.47465023",
"0.47454527",
"0.47449958",
"0.4743712",
"0.4740467",
"0.47396168",
"0.47348374",
"0.47161508",
"0.47020698",
"0.46991467",
"0.46974647",
"0.46955398",
"0.46944755",
"0.4694166",
"0.46928293",
"0.46877447",
"0.46865347",
"0.4682889",
"0.46818614",
"0.46808344",
"0.46749425",
"0.46733314",
"0.46668985",
"0.46666807",
"0.46587086",
"0.46563917",
"0.46464962",
"0.46409655",
"0.4632141",
"0.46309674",
"0.462695",
"0.46234238",
"0.461248",
"0.46073598",
"0.45978546",
"0.459431",
"0.45878315",
"0.45788607",
"0.45772147"
]
| 0.4986557 | 31 |
This is the special case where the element type has attributes but no child element types. In this case, we create a property in the Table for the PCDATA. (Hence, the argument is false, meaning that the PCDATA is singlevalued.) | private void processPCDATAContent(ElementType elementType)
throws Exception
{
addPCDATAProperty(elementType);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private boolean addAttributeAsProperty(XMPMetadata metadata, XMPSchema schema, Attribute attr) {\n\t\tboolean added = false;\n\t\tString schemaNamespace = schema.getNamespaceValue();\n\t\tString prefix = attr.getPrefix() != null ? attr.getPrefix() : schema.getPrefix();\n\t\tString type = this.nsMap.getSpecifiedPropertyType(schemaNamespace, new QName(schemaNamespace, attr.getLocalName(), prefix));\n\t\tif (type != null) {\n\t\t\tif (type.equals(\"Text\")) {\n\t\t\t\tschema.getContent().addProperty(new TextType(metadata, prefix, attr.getLocalName(), attr.getValue()));\n\t\t\t\tadded = true;\n\t\t\t} else if (type.equals(\"Integer\")) {\n\t\t\t\tschema.getContent().addProperty(new IntegerType(metadata, prefix, attr.getLocalName(), attr.getValue()));\n\t\t\t\tadded = true;\n\t\t\t} else if (type.equals(\"Boolean\")) {\n\t\t\t\tschema.getContent().addProperty(new BooleanType(metadata, prefix, attr.getLocalName(), attr.getValue()));\n\t\t\t\tadded = true;\n\t\t\t} else if (type.equals(\"Real\")) {\n\t\t\t\tschema.getContent().addProperty(new RealType(metadata, prefix, attr.getLocalName(), attr.getValue()));\n\t\t\t\tadded = true;\n\t\t\t} else if (type.equals(\"Date\")) {\n\t\t\t\tschema.getContent().addProperty(new DateType(metadata, prefix, attr.getLocalName(), attr.getValue()));\n\t\t\t\tadded = true;\n\t\t\t} else if (type.equals(\"URI\")) {\n\t\t\t\tschema.getContent().addProperty(new TextType(metadata, prefix, attr.getLocalName(), attr.getValue()));\n\t\t\t\tadded = true;\n\t\t\t} else if (type.equals(\"URL\")) {\n\t\t\t\tschema.getContent().addProperty(new TextType(metadata, prefix, attr.getLocalName(), attr.getValue()));\n\t\t\t\tadded = true;\n\t\t\t}\n\t\t}\n\t\treturn added;\n\t}",
"public boolean isSetDataCustom()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(DATACUSTOM$2) != 0;\n }\n }",
"public boolean isSetDataCustom()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().count_elements(DATACUSTOM$2) != 0;\n }\n }",
"public void _pcdata(Object value) {\n/* 324 */ addChild(new Pcdata(this.document, this.startTag, value));\n/* */ }",
"@Kroll.getProperty @Kroll.method\n\tpublic boolean getSpecified() {\n\t\tif (attr.getOwnerElement() == null) {\n\t\t\treturn true;\n\t\t}\n\t\treturn attr.getSpecified();\n\t}",
"public PropertyMap createPCDATAMap()\n {\n checkState();\n return super.createPCDATAMap();\n }",
"@Override\n\tpublic void cdata() {\n\t\t\n\t}",
"private static void addExtendedItemNonXmlProps(Element extendedItemNode,ReportDesigner reportDesigner){\r\n\t\t//outputFormat\r\n\t\tElement propertyNode = doc.createElement(\"property\");\r\n\t\tpropertyNode.setAttribute(ReportDesigner.ATTRIBUTE_NAME_NAME,\"outputFormat\");\r\n\t\tpropertyNode.appendChild(doc.createTextNode(\"JPG\"));\r\n\t\textendedItemNode.appendChild(propertyNode);\r\n\r\n\t\t//inheritColumns\r\n\t\tpropertyNode = doc.createElement(ReportDesigner.NODE_NAME_PROPERTY);\r\n\t\tpropertyNode.setAttribute(ReportDesigner.ATTRIBUTE_NAME_NAME,\"inheritColumns\");\r\n\t\tpropertyNode.appendChild(doc.createTextNode(\"false\"));\r\n\t\textendedItemNode.appendChild(propertyNode);\r\n\r\n\t\t//Data Set Chart\r\n\t\tpropertyNode = doc.createElement(ReportDesigner.NODE_NAME_PROPERTY);\r\n\t\tpropertyNode.setAttribute(ReportDesigner.ATTRIBUTE_NAME_NAME,\"dataSet\");\r\n\t\tpropertyNode.appendChild(doc.createTextNode(\"Data Set\"));\r\n\t\textendedItemNode.appendChild(propertyNode);\r\n\r\n\t\t//height\r\n\t\tpropertyNode = doc.createElement(ReportDesigner.NODE_NAME_PROPERTY);\r\n\t\tpropertyNode.setAttribute(ReportDesigner.ATTRIBUTE_NAME_NAME,\"height\");\r\n\t\tpropertyNode.appendChild(doc.createTextNode(\"3.7916666666666665in\"));\r\n\t\textendedItemNode.appendChild(propertyNode);\r\n\r\n\t\t//width\r\n\t\tpropertyNode = doc.createElement(ReportDesigner.NODE_NAME_PROPERTY);\r\n\t\tpropertyNode.setAttribute(ReportDesigner.ATTRIBUTE_NAME_NAME,\"width\");\r\n\t\tpropertyNode.appendChild(doc.createTextNode(\"7.875in\"));\r\n\t\textendedItemNode.appendChild(propertyNode);\r\n\r\n\t\textendedItemNode.appendChild(createExtendedItemListProp(reportDesigner));\r\n\t}",
"protected LPDMODOMAttribute() {\n }",
"public PCDataDirectiveIfc createPCDataDirective ();",
"public abstract boolean promulgationDataDefined();",
"@Test\n public void test_TCC() {\n final Attribute attribute = new Attribute(){\n \t\tprivate static final long serialVersionUID = 200L;\n };\n assertTrue(null == attribute.getName());\n assertTrue(attribute.isSpecified());\n }",
"@Override\n\tpublic boolean hasValue(Attribute attribute) {\n\t\treturn false;\n\t}",
"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 M csmiCertifyTypeNull(){if(this.get(\"csmiCertifyTypeNot\")==null)this.put(\"csmiCertifyTypeNot\", \"\");this.put(\"csmiCertifyType\", null);return this;}",
"org.apache.xmlbeans.XmlBoolean xgetIsManaged();",
"void emptyType(ComplexTypeSG type) throws SAXException;",
"private boolean isEmpty(ListItem<PropertyWrapper> attribute) {\n return false;\n }",
"public SchemaAttribute getEmptyTabularColumn()\n {\n SchemaAttribute schemaAttribute = new SchemaAttribute();\n\n ElementType elementType = new ElementType();\n\n elementType.setElementOrigin(ElementOrigin.LOCAL_COHORT);\n elementType.setElementTypeId(SchemaElementMapper.TABULAR_COLUMN_TYPE_GUID);\n elementType.setElementTypeName(SchemaElementMapper.TABULAR_COLUMN_TYPE_NAME);\n\n schemaAttribute.setType(elementType);\n\n return schemaAttribute;\n }",
"private static Element createExtendedItemListProp(ReportDesigner reportDesigner){\r\n\t\tElement listPropertyNode = doc.createElement(\"list-property\");\r\n\t\tlistPropertyNode.setAttribute(ReportDesigner.ATTRIBUTE_NAME_NAME,\"boundDataColumns\");\r\n\r\n\t\tList<ReportColumn> reportColumns = reportDesigner.getReportColumns();\r\n\r\n\t\tfor(ReportColumn col : reportColumns){\r\n\t\t\tElement structureNode = doc.createElement(ReportDesigner.NODE_NAME_STRUCTURE);\r\n\t\t\tlistPropertyNode.appendChild(structureNode);\r\n\r\n\t\t\tElement propertyNode = doc.createElement(ReportDesigner.NODE_NAME_PROPERTY);\r\n\t\t\tpropertyNode.setAttribute(ReportDesigner.ATTRIBUTE_NAME_NAME,ReportDesigner.ATTRIBUTE_VALUE_NAME);\r\n\t\t\tpropertyNode.appendChild(doc.createTextNode(col.getName()));\r\n\t\t\tstructureNode.appendChild(propertyNode);\r\n\r\n\t\t\tElement expressionNode = doc.createElement(ReportDesigner.NODE_NAME_EXPRESSION);\r\n\t\t\texpressionNode.setAttribute(ReportDesigner.ATTRIBUTE_NAME_NAME,ReportDesigner.ATTRIBUTE_VALUE_EXPRESSION);\r\n\t\t\texpressionNode.appendChild(doc.createTextNode(\"dataSetRow[\\\"\"+col.getName()+\"\\\"]\"));\r\n\t\t\tstructureNode.appendChild(expressionNode);\r\n\r\n\t\t\tpropertyNode = doc.createElement(ReportDesigner.NODE_NAME_PROPERTY);\r\n\t\t\tpropertyNode.setAttribute(ReportDesigner.ATTRIBUTE_NAME_NAME,\"dataType\");\r\n\t\t\tpropertyNode.appendChild(doc.createTextNode(ReportDesigner.fromXsd2ReportType(col.getDataType())));\r\n\t\t\tstructureNode.appendChild(propertyNode);\r\n\t\t}\r\n\r\n\t\treturn listPropertyNode;\r\n\t}",
"public DataTypeElements getDataTypeAccess() {\n\t\treturn (pDataType != null) ? pDataType : (pDataType = new DataTypeElements());\n\t}",
"public boolean setProperty(String attName, Object value);",
"public boolean isAttribute() {\n\t\treturn false;\n\t}",
"boolean isNilAttributeTypeDisplayName();",
"@Override\r\n\tpublic boolean isPropertySet(Object id) {\n\t\treturn false;\r\n\t}",
"public StructuredData getStructuredDataAttribute();",
"public BooleanPhenotype() {\n dataValues = new ArrayList<Boolean>();\n }",
"@Override\r\n\t\tpublic boolean hasAttributes()\r\n\t\t\t{\n\t\t\t\treturn false;\r\n\t\t\t}",
"public DPropertyElement() {\n super(null, null);\n }",
"public String getType(String name) {\n/* 164 */ return \"CDATA\";\n/* */ }",
"public PCDataDirectiveIfc createPCDataDirective ( String pcData );",
"boolean hasSetAttribute();",
"public boolean isData() {return true; }",
"public String getType(String uri, String localName) {\n/* 179 */ return \"CDATA\";\n/* */ }",
"public boolean hasDataTypeInIdentityColumn() {\n \t\treturn true;\n \t}",
"@Override\n\tpublic boolean isMetadata() {\n\t\treturn false;\n\t}",
"boolean isSetValueCodeableConcept();",
"DataElement createDataElement();",
"public XMLElement() {\n this(new Properties(), false, true, true);\n }",
"public abstract boolean isAllowCustomProperties();",
"public boolean isAssocProperty();",
"public Value restrictToNonAttributes() {\n Value r = new Value(this);\n r.flags &= ~(PROPERTYDATA | ABSENT | PRESENT_DATA | PRESENT_ACCESSOR);\n return canonicalize(r);\n }",
"boolean hasPropType();",
"public final boolean hasAttribute ()\r\n {\r\n return _value.hasAttribute();\r\n }",
"@Override\n public boolean isLabelProperty(Object element, String property) {\n return false;\n }",
"boolean isAttribute();",
"DOMType() {\n // Constructs an empty type node\n }",
"public boolean hasDynamicAttributes();",
"@Override\n public boolean isLabelProperty(Object element, String property) {\n return false;\n }",
"public boolean isSetType() {\n return (this.type != null ? this.type.isSetValue() : false);\n }",
"private void generateAttribute2PropertyConversion(final JPAStructuredType ownerType, final boolean ownerISRootEntity,\n final JPAMemberAttribute attribute)\n throws ODataJPAModelException,\n IOException {\n final String memberName = qualifiedName2FirstCharacterUppercasedString(attribute.getInternalName());\n final String typeMetaName = TypeMetaAPIWriter.determineTypeMetaName(ownerType.getTypeClass().getSimpleName());\n final String propertyContainerAdd = ownerISRootEntity ? \".getProperties()\" : \"\";\n if (attribute.isCollection()) {\n // special handling for collection attributes\n write(NEWLINE + \"\\t\" + \"\\t\" + \"// collection (\" + (attribute.getType().isEnum() ? \"enum\" : attribute.isComplex()\n ? \"complex\" : \"primitive\") + \") property value\");\n final String methodName = determineConversionAttribute2PropertyValueMethodName(attribute, true);\n write(NEWLINE + \"\\t\" + \"\\t\" + \"final \" + ClientCollectionValue.class.getName() + \"<\" + ClientValue.class.getName()\n + \">\"\n + \" prop\" + memberName + \"Value = \"\n + methodName + \"(\" + \"dto.\" + TypeDtoAPIWriter\n .determinePropertyGetterMethodName(attribute) + \"()\" + \", \" + integer2CodeString(\n attribute.getMaxLength()) + \", \" + integer2CodeString(attribute.getPrecision()) + \", \"\n + integer2CodeString(attribute.getScale()) + \");\");\n write(NEWLINE + \"\\t\" + \"\\t\" + \"final \" + ClientProperty.class.getName() + \" prop\" + memberName\n + \" = factory.newCollectionProperty(\" + typeMetaName + \".\" + TypeMetaAPIWriter\n .determineTypeMetaPropertyNameConstantName(attribute.getProperty()) + \", \" + \" prop\" + memberName\n + \"Value\" + \");\");\n write(NEWLINE + \"\\t\" + \"\\t\" + \"propertyContainer\" + propertyContainerAdd + \".add(\" + \" prop\" + memberName + \");\");\n } else if (attribute.getType().isEnum()) {\n write(NEWLINE + \"\\t\" + \"\\t\" + \"// enum property value\");\n write(NEWLINE + \"\\t\" + \"\\t\" + \"final \" + ClientEnumValue.class.getName() + \" prop\" + memberName\n + \"Value = \" + \"(dto.\" + TypeDtoAPIWriter.determinePropertyGetterMethodName(attribute) + \"()\" + \"!= null) ? \"\n + \"factory.newEnumValue(\\\"\" + attribute.getType().getName() + \"\\\", \" + \"dto.\" + TypeDtoAPIWriter\n .determinePropertyGetterMethodName(attribute) + \"()\" + \".name()\" + \") : null\" + \";\");\n write(NEWLINE + \"\\t\" + \"\\t\" + \"final \" + ClientProperty.class.getName() + \" prop\" + memberName\n + \" = factory.newEnumProperty(\" + typeMetaName + \".\" + TypeMetaAPIWriter\n .determineTypeMetaPropertyNameConstantName(attribute.getProperty()) + \", \" + \" prop\" + memberName\n + \"Value\" + \");\");\n write(NEWLINE + \"\\t\" + \"\\t\" + \"propertyContainer\" + propertyContainerAdd + \".add(\" + \" prop\" + memberName + \");\");\n } else if (attribute.isComplex()) {\n write(NEWLINE + \"\\t\" + \"\\t\" + \"//complex value\");\n final String methodName = determineConversionAttribute2PropertyValueMethodName(attribute, false);\n write(NEWLINE + \"\\t\" + \"\\t\" + \"final \" + ClientComplexValue.class.getName() + \" prop\" + memberName + \"Value\"\n + \" = \"\n + methodName + \"(\" + \"dto.\" + TypeDtoAPIWriter\n .determinePropertyGetterMethodName(attribute) + \"()\" + \");\");\n write(NEWLINE + \"\\t\" + \"\\t\" + \"final \" + ClientProperty.class.getName() + \" prop\" + memberName\n + \" = factory.newComplexProperty(\" + typeMetaName + \".\" + TypeMetaAPIWriter\n .determineTypeMetaPropertyNameConstantName(attribute.getProperty()) + \", \" + \" prop\" + memberName\n + \"Value\" + \");\");\n write(NEWLINE + \"\\t\" + \"\\t\" + \"propertyContainer\" + propertyContainerAdd + \".add(\" + \" prop\" + memberName + \");\");\n } else if (TypeMapping.convertToEdmSimpleType(attribute) == EdmPrimitiveTypeKind.Binary) {\n write(NEWLINE + \"\\t\" + \"\\t\" + \"// binary property value for '\" + attribute.getInternalName() + \"' is ignored\");\n } else {\n write(NEWLINE + \"\\t\" + \"\\t\" + \"// primitive property value\");\n final String methodName = determineConversionAttribute2PropertyValueMethodName(attribute, false);\n write(NEWLINE + \"\\t\" + \"\\t\" + \"final \" + ClientPrimitiveValue.class.getName() + \" prop\" + memberName\n + \"Value = \" + methodName + \"(\" + \"dto.\" + TypeDtoAPIWriter.determinePropertyGetterMethodName(attribute)\n + \"()\" + \")\" + \";\");\n write(NEWLINE + \"\\t\" + \"\\t\" + \"final \" + ClientProperty.class.getName() + \" prop\" + memberName\n + \" = factory.newPrimitiveProperty(\" + typeMetaName + \".\" + TypeMetaAPIWriter\n .determineTypeMetaPropertyNameConstantName(attribute.getProperty()) + \", \" + \" prop\" + memberName\n + \"Value\" + \");\");\n write(NEWLINE + \"\\t\" + \"\\t\" + \"propertyContainer\" + propertyContainerAdd + \".add(\" + \" prop\" + memberName + \");\");\n }\n }",
"@Override\r\n\tprotected Object getValue(Object element) {\r\n\t\treturn true;\r\n\t}",
"public boolean isProperty();",
"@Override\r\n \tpublic int getElementType() {\r\n \t\treturn 0; \r\n \t}",
"@Override\n public boolean isAttribute()\n {\n return attribute;\n }",
"boolean getValueCharacteristicIdNull();",
"void setNilIsManaged();",
"public boolean isSetMembertype() {\n return __isset_bit_vector.get(__MEMBERTYPE_ISSET_ID);\n }",
"@Test\n\tpublic void addProperty() {\n\t\tXMLTagParser.addNewElement(\"Person\");\n\t\tXMLTagParser.editElement(\"Person\", \"residence\", \"milan\");\n\n\t\tXMLTagParser.editProperty(\"Person\", \"residence\", \"isRenting\", \"false\");\n\t\tassertEquals(XMLTagParser.getPropertyValueFromTag(\"Person\", \"residence\", \"isRenting\"), \"false\");\n\t\tXMLTagParser.editProperty(\"Person\", \"residence\", \"hasGarage\", \"true\");\n\t\tassertEquals(XMLTagParser.getPropertyValueFromTag(\"Person\", \"residence\", \"hasGarage\"), \"true\");\n\t}",
"@Override\n\tpublic boolean isScalar() {\n\t\treturn false;\n\t}",
"private PropertyCard createPropertyElement(Element eElement) {\r\n\t\tif ( PropertyCard.PropertyType.valueOf(eElement.getElementsByTagName(\"type\").item(0).getTextContent()) == PropertyCard.PropertyType.UTILITY )\r\n\t\t{\r\n\t\t return new UtilityPropertyCard(\r\n\t\t\t Integer.parseInt(eElement.getAttribute(\"id\"))\r\n\t\t\t ,eElement.getElementsByTagName(\"name\").item(0).getTextContent()\r\n\t\t\t ,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue1\").item(0).getTextContent())\r\n\t\t\t ,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue2\").item(0).getTextContent())\r\n\t\t );\r\n\t\t}\r\n\t\telse if (PropertyCard.PropertyType.valueOf(eElement.getElementsByTagName(\"type\").item(0).getTextContent()) == PropertyCard.PropertyType.RAILING )\r\n\t\t{\r\n\t\t return new RailingPropertyCard(\r\n\t\t\t Integer.parseInt(eElement.getAttribute(\"id\"))\r\n\t\t\t ,eElement.getElementsByTagName(\"name\").item(0).getTextContent()\r\n\t\t\t ,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue1\").item(0).getTextContent())\r\n\t\t\t ,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue2\").item(0).getTextContent())\r\n\t\t\t ,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue3\").item(0).getTextContent())\r\n\t\t\t ,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue4\").item(0).getTextContent())\r\n\t\t\t ,Integer.parseInt(eElement.getElementsByTagName(\"mortgageValue\").item(0).getTextContent())\r\n\t\t );\r\n\t\t}\r\n\t\telse if ( PropertyCard.PropertyType.valueOf(eElement.getElementsByTagName(\"type\").item(0).getTextContent()) == PropertyCard.PropertyType.SIMPLE )\r\n\t\t{\r\n\t\t\treturn new PlotPropertyCard(\r\n\t\t\t\tInteger.parseInt(eElement.getAttribute(\"id\"))\r\n\t\t\t\t,eElement.getElementsByTagName(\"name\").item(0).getTextContent()\r\n\t\t\t\t,PlotPropertyCard.Colour_Type.valueOf(eElement.getElementsByTagName(\"colour\").item(0).getTextContent())\r\n\t\t\t\t,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue0\").item(0).getTextContent())\r\n\t\t\t\t,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue1\").item(0).getTextContent())\r\n\t\t\t\t,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue2\").item(0).getTextContent())\r\n\t\t\t\t,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue3\").item(0).getTextContent())\r\n\t\t\t\t,Integer.parseInt(eElement.getElementsByTagName(\"rentalValue4\").item(0).getTextContent())\r\n\t\t\t\t,Integer.parseInt(eElement.getElementsByTagName(\"rentalValueHotel\").item(0).getTextContent())\r\n\t\t\t\t,Integer.parseInt(eElement.getElementsByTagName(\"mortgageValue\").item(0).getTextContent())\r\n\t\t\t\t,Integer.parseInt(eElement.getElementsByTagName(\"houseCost\").item(0).getTextContent())\r\n\t\t\t\t,Integer.parseInt(eElement.getElementsByTagName(\"hotelCost\").item(0).getTextContent())\r\n\t\t\t);\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"protected abstract boolean populateAttributes();",
"public int getPropertyType() {\n\t\treturn 0;\n\t}",
"public boolean isSpecified(int index)\n {\n return ((Attribute) attributesList.get(index)).specified;\n }",
"public void setNewProperty_descriptionType(int param){\n \n // setting primitive attribute tracker to true\n localNewProperty_descriptionTypeTracker =\n param != java.lang.Integer.MIN_VALUE;\n \n this.localNewProperty_descriptionType=param;\n \n\n }",
"@Test\n\tpublic void testNewOkDefaultNullAndGetValue() {\n\t\tthis.createTestBean();\n\t\tPropertyCollection prop = this\n\t\t\t\t.createCollectionProperty(\"<property name=\\\"test\\\"\" + \" targettype=\\\"TestBean\\\"\" + \" />\");\n\t\tAssert.assertNull(prop.getValue());\n\t}",
"public LPDMODOMAttribute(String name, String value, int type) {\n super(name, value, type);\n }",
"public String getType(int i) {\n/* 138 */ return \"CDATA\";\n/* */ }",
"public boolean isKnownPrimitive() {\r\n return id > 0 && type != null;\r\n }",
"public boolean isSetData() {\n return this.data != null;\n }",
"public boolean isMaybePresentData() {\n checkNotUnknown();\n if (isPolymorphic())\n return (flags & PRESENT_DATA) != 0;\n else\n return (flags & PRIMITIVE) != 0 || num != null || str != null || object_labels != null;\n }",
"@Test(description = \"export interface with one attribute\")\n public void exportWithOneAttribute()\n throws Exception\n {\n final DataCollection data = new DataCollection(this);\n final AttributeStringData attr = data.getAttributeString(\"Attribute\");\n final InterfaceData inter = data.getInterface(\"TestInterface\").addAttribute(attr);\n data.create();\n\n inter.checkExport(inter.export());\n }",
"protected final void verifyWriteCData()\n throws XMLStreamException\n {\n // Not legal outside main element tree:\n if (mCheckStructure) {\n if (inPrologOrEpilog()) {\n reportNwfStructure(ErrorConsts.WERR_PROLOG_CDATA);\n }\n }\n // 08-Dec-2005, TSa: validator-based validation?\n if (mVldContent <= XMLValidator.CONTENT_ALLOW_WS) {\n // there's no ignorable white space CDATA...\n reportInvalidContent(CDATA);\n }\n }",
"@Override\n public final boolean hasSpecialDefenseValueAttribute() {\n return true;\n }",
"public boolean isSetValue()\n {\n synchronized (monitor())\n {\n check_orphaned();\n return get_store().find_attribute_user(VALUE$12) != null;\n }\n }",
"public boolean hasSetAttribute() {\n return ((bitField0_ & 0x08000000) == 0x08000000);\n }",
"public boolean is_set_data() {\n return this.data != null;\n }",
"public boolean is_set_data() {\n return this.data != null;\n }",
"public boolean hasDocumentType() {\n return fieldSetFlags()[11];\n }",
"public boolean hasPrimaryKeyValue() {\r\n return false;\r\n }",
"public boolean hasPrimaryKeyValue() {\r\n return false;\r\n }",
"public boolean hasPrimaryKeyValue() {\r\n return false;\r\n }",
"@Override\r\n public boolean isHasDirectValue() {\r\n return this.hasDirectValue;\r\n }",
"public boolean isData(){\n\t\t\tif (type == MemoryType.DATA) { return true;\n\t\t\t} return false;\n\t\t}",
"public boolean isNodeProp() {\n \t\treturn isNodeProp;\n \t}",
"@Override\n public As getTypeInclusion() { return As.EXISTING_PROPERTY; }",
"public Value setBottomPropertyData() {\n checkNotUnknown();\n Value r = new Value(this);\n r.flags &= ~PROPERTYDATA;\n return canonicalize(r);\n }",
"void setNilAttributeTypeDisplayName();",
"public boolean hasSetAttribute() {\n return ((bitField0_ & 0x08000000) == 0x08000000);\n }",
"@Override\r\n\tpublic boolean isLabelProperty(Object element, String property) {\n\t\treturn false;\r\n\t}",
"@Override\r\n\tpublic boolean isLabelProperty(Object element, String property) {\n\t\treturn false;\r\n\t}",
"@Override\r\n\tpublic boolean isLabelProperty(Object element, String property) {\n\t\treturn false;\r\n\t}",
"@Override\n\tpublic boolean isLabelProperty(Object element, String property) {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean isLabelProperty(Object element, String property) {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean isLabelProperty(Object element, String property) {\n\t\treturn false;\n\t}",
"public BooleanDt getIsExtensibleElement() { \n\t\tif (myIsExtensible == null) {\n\t\t\tmyIsExtensible = new BooleanDt();\n\t\t}\n\t\treturn myIsExtensible;\n\t}",
"@Override\r\n public Object visit(OWLEquivalentDataPropertiesAxiom axiom) {\n return super.visit(axiom);\r\n }",
"@Override\r\n protected void prepareDataObjsProps(XmlSignedPropertiesType xmlProps)\r\n {\n XmlSignedDataObjectPropertiesType xmlSignedDataObjProps = new XmlSignedDataObjectPropertiesType();\r\n xmlProps.setSignedDataObjectProperties(xmlSignedDataObjProps);\r\n }",
"@Override\n\tpublic List<XSOntDataProperty> getSuperProperties() {\n\t\treturn new ArrayList<XSOntDataProperty>();\n\t}",
"public void addPCDATAMap(PropertyMap propMap)\n throws XMLMiddlewareException\n {\n checkState();\n super.addPCDATAMap(propMap);\n }"
]
| [
"0.58821285",
"0.58809614",
"0.58809614",
"0.5764976",
"0.56482995",
"0.5552334",
"0.54538685",
"0.5349405",
"0.5248314",
"0.5220447",
"0.52013",
"0.5189674",
"0.5187799",
"0.51724106",
"0.51500165",
"0.5105601",
"0.5075781",
"0.5069079",
"0.50657827",
"0.5060744",
"0.50324434",
"0.5025148",
"0.50050354",
"0.49958074",
"0.49903008",
"0.49814144",
"0.49762118",
"0.49614456",
"0.49455714",
"0.49352136",
"0.491843",
"0.48915654",
"0.48821324",
"0.48813686",
"0.48798454",
"0.48757005",
"0.4868478",
"0.48657188",
"0.48605454",
"0.48489854",
"0.48472676",
"0.481743",
"0.4809803",
"0.47953793",
"0.47929233",
"0.47845393",
"0.4781508",
"0.4772421",
"0.47635648",
"0.47466546",
"0.47459838",
"0.47436443",
"0.47385696",
"0.47382122",
"0.47249165",
"0.4716827",
"0.47159547",
"0.4699554",
"0.4693396",
"0.46932998",
"0.46904147",
"0.46900463",
"0.4675353",
"0.46743244",
"0.46738923",
"0.4671893",
"0.4659105",
"0.4656425",
"0.4655952",
"0.46523643",
"0.46456495",
"0.4643208",
"0.46412596",
"0.4640701",
"0.46403688",
"0.46365607",
"0.46311572",
"0.46311572",
"0.46270669",
"0.46269315",
"0.46269315",
"0.46269315",
"0.46247426",
"0.4615929",
"0.46131286",
"0.4612298",
"0.46088964",
"0.4608549",
"0.4608327",
"0.46058267",
"0.46058267",
"0.46058267",
"0.4601259",
"0.4601259",
"0.4601259",
"0.46005428",
"0.4598723",
"0.45904973",
"0.4589114",
"0.4580177"
]
| 0.5954131 | 0 |
modificar para em vez de imprimir adicionar ao grafo | private void showTree(EarleyParser.Node root,int level, String previous) {
System.out.print(level);
for(int i = 0; i <= level; i++)
System.out.print(" ");
System.out.println(root.text);
String cur = root.text;
while(graph.containsVertex(cur)) {
cur = cur + " ";
}
graph.addVertex(cur);
if(previous != null) {
graph.addEdge(edgeid++, previous, cur);
}
for(EarleyParser.Node sibling : root.siblings) {
showTree(sibling, level+1, cur);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic boolean adicionar(Veiculo veiculo) {\n\t\treturn false;\n\t}",
"public void modifica(DTOAcreditacionGafetes acreGafete) throws Exception ;",
"private void guardar() {\n\t\t//JFileChooser fglobal = principal.getFglobal();\n\t\tprincipal.getFglobal().setDialogTitle(ic.buscar(38)); // Tag 38\n\n\t\t\tprincipal.getFglobal().setDialogType(JFileChooser.SAVE_DIALOG);\n\n\t\tAccesorio pep = new Accesorio(principal.getFglobal(),t, principal.getIC());\n\t\tprincipal.getFglobal().setAccessory(pep);\n\t\tpep.setProfundidad(true);\n\t\t\n principal.getFglobal().resetChoosableFileFilters();\n \n ExampleFileFilter filtroT = new ExampleFileFilter (\n new String [] {\"tiff\",\n \"tif\",\n },\n ic.buscar(3)); // Tag 3\n \n\n \n\t\t\t\n ExampleFileFilter filtroJ = new ExampleFileFilter (\n new String [] {\"jpeg\",\n \"jpg\"\n },\n ic.buscar(4)); // Tag 4\n principal.getFglobal().addChoosableFileFilter(filtroT);\n principal.getFglobal().addChoosableFileFilter(filtroJ);\n\t\t\n\t\t\n\t\t\n\t\tint retval = principal.getFglobal().showDialog(t, null);\n\t\tif (retval == JFileChooser.APPROVE_OPTION) \n\t\t{\t\t\n\t\t\tFile guardar = principal.getFglobal().getSelectedFile();\n \n\t\t\tif (\tprincipal.getFglobal().getFileFilter().getDescription().equals(filtroJ.getDescription()) )\n\t\t\t{// Guardar como JPEG\n \n\t\t\t\tJAI.create(\"filestore\",imagen_original,guardar.getPath(),\"JPEG\", new JPEGEncodeParam());\n\t\t\t}\n\t\t\telse if (principal.getFglobal().getFileFilter().getDescription().equals(filtroT.getDescription()))\n\t\t\t{// Guardar como TIFF\n\t\t\t\tint profundidad = pep.getEP().getMarcada();\n\t\t\t\t// Cubre todas las posibilidades (¿esto guarda los metadatos?)\n\t\t\t\tTiledImage tiled = null;\n\t\t\t\tif (profundidad != ElegirProfundidad.OCHO)\n\t\t\t\t{\n\t\t\t\t\ttiled = \n ElegirProfundidad.crearProfundidadReducida(\n ipixel_o, \n profundidad, \n imagen_original.getWidth(), \n imagen_original.getHeight());\n\t\t\t\t}\n\n\t\t\t\t//imgGuardar = djai.getSource();\n\t\t\t\tParameterBlock pb = new ParameterBlock();\n\t\t\t\tif (profundidad != ElegirProfundidad.OCHO)\n\t\t\t\t{\n\t\t\t\t\tpb.addSource(tiled);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tpb.addSource(imagen_original);\n\t\t\t\t}\n\t\t\t\tpb.add(guardar);\n\t\t\t\tpb.add(\"TIFF\");\n\t\t\t\tpb.add(false); //UseProperties\n\t\t\t\tpb.add(false); //Transcode\n\t\t\t\tpb.add(true); //VerifyOutput\n\t\t\t\tpb.add(false); //AllowPixelReplacement\n\t\t\t\tpb.add(null); //TileSize\n\t\t\t\tpb.add(streamData);\n\t\t\t\tpb.add(imageData);\n\t \t\t\tJAI.create(\"imagewrite\", pb);\n\t\t\t\t\n\t\t\t\t//JAI.create(\"imagewrite\",tiled,guardar.getPath(),\"TIFF\");\n\t\t\t}\n\t\t\telse\n\t\t\t{// No tiene extensión o es una extensión extraña\n\t\t\t\tJAI.create(\"imagewrite\",imagen_original,guardar.getPath()+\".tif\",\"TIFF\");\n\t\t\t}\n\t\t\t\n\t\t}\t\t\t \n\t\telse \n\t\t{\n\t\t\tdibujarMensajesError(retval);\n\t\t} \n\t\t\n\t\t\n\t}",
"public CntCuentasAdicionarModificarBacking() {\n }",
"public void modificarCompraComic();",
"private void modificarReserva() throws Exception {\r\n\t\tif (mngRes.existeReservaPeriodo(getSitio().getId())) {\r\n\t\t\tif (mayorEdad) {\r\n\t\t\t\tmngRes.modificarReserva(getEstudiante(), periodo.getPrdId(), getSitio(), null);\r\n\t\t\t\tlibres = mngRes.traerLibres(getSitio().getId().getArtId());\r\n\t\t\t} else {\r\n\t\t\t\tmngRes.modificarReserva(getEstudiante(), periodo.getPrdId(), getSitio(),\r\n\t\t\t\t\t\tgetDniRepresentante() + \";\" + getNombreRepresentante());\r\n\t\t\t\tlibres = mngRes.traerLibres(getSitio().getId().getArtId());\r\n\t\t\t}\r\n\t\t\tMensaje.crearMensajeINFO(\"Reserva realizada correctamente, no olvide descargar su contrato.\");\r\n\t\t} else {\r\n\t\t\tMensaje.crearMensajeWARN(\"El sitio seleccionado ya esta copado, favor eliga otro.\");\r\n\t\t}\r\n\t}",
"@Override\n\tpublic void alterar() {\n\t\t\n\t}",
"@Override\n\tpublic void save(CorsoDiLaurea corso) {\n\t\t\n\t}",
"public void guardar() {\r\n\t\t\r\n\t\tmanejadorArchivos.guardar(palabras);\r\n\t\t\r\n\t}",
"public boolean alterar(GrauParentesco grauParentesco) throws Exception;",
"private void aumentarPilha() {\n this.pilhaMovimentos++;\n }",
"private void guardar() {\r\n\t\tif(Gestion.isModificado() && Gestion.getFichero()!=null){\r\n\t\t\ttry {\r\n\t\t\t\tGestion.escribir(Gestion.getFichero());\r\n\t\t\t\tGestion.setModificado(false);\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tJOptionPane.showMessageDialog(null, e.getMessage(), \"Error\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if(Gestion.isModificado() && Gestion.getFichero()==null){\r\n\t\t\tguardarComo();\r\n\t\t}\r\n\t\telse if(frmLigaDeFtbol.getTitle()==\"Liga de Fútbol\" && !Gestion.isModificado())\r\n\t\t\tguardarComo();\r\n\t}",
"public void alterarVencimentoFatura(Fatura fatura) throws ErroRepositorioException ;",
"public void AlterarRegistro(){\n \n\t\tthis.localidadeRepository.AlterarRegistro(this.localidadeModel);\t\n \n\t\tUteis.MensagemInfo(\"Registro alterado com sucesso\");\n\t\t\n\t\tthis.init();\n\t}",
"public void actualizarGrado() {\n \tGrado grado = new Grado();\n \tgrado.setIdGrado(7);\n \tgrado.setDescripcionSeccion(\"Secundaria\");\n \tgrado.setNumGrado(6);\n \tgrado.setDescripcionUltimoGrado(\"SI\");\n \tString respuesta = negocio.actualizarGrado(\"\", grado);\n \tSystem.out.println(respuesta);\n }",
"private void nuevaLiga() {\r\n\t\tif(Gestion.isModificado()){\r\n\t\t\tint opcion = JOptionPane.showOptionDialog(null, \"¿Desea guardar los cambios?\", \"Nueva Liga\", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null,null, null);\r\n\t\t\tswitch(opcion){\r\n\t\t\tcase JOptionPane.YES_OPTION:\r\n\t\t\t\tguardar();\r\n\t\t\t\tbreak;\r\n\t\t\tcase JOptionPane.NO_OPTION:\r\n\t\t\t\tGestion.reset();\r\n\t\t\t\tbreak;\r\n\t\t\tcase JOptionPane.CANCEL_OPTION:\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t\tGestion.reset();\r\n\t\tfrmLigaDeFtbol.setTitle(\"Liga de Fútbol\");\r\n\t}",
"public void verarbeite() {\n\t\t\r\n\t}",
"private void atualizarBotoes() {\r\n\t\tbtIncluir.setDisable(cliente.getId() != null);\r\n\t\tbtAlterar.setDisable(cliente.getId() == null);\r\n\t\tbtExcluir.setDisable(cliente.getId() == null);\r\n\t}",
"@Override\n\tpublic void posSave() {\n\t\tfor(ItemRequisicionEta tmpItm : itemsAgregados) {\n\t\t\ttmpItm.setReqEtapa(instance);\n\t\t\tgetEntityManager().persist(tmpItm);\n\t\t}\n\t\tgetEntityManager().refresh(etapaRepCliHome.getInstance());\n\t}",
"@Override\n\tpublic void imprimir() {\n\t\t\n\t}",
"public void saveExisting() {\r\n Part modifiedPart = null;\r\n for (Part part : Inventory.getAllParts()) {\r\n if (Integer.parseInt(iDfield.getText()) == part.getId()) {\r\n modifiedPart = part;\r\n }\r\n }\r\n if (modifiedPart instanceof Outsourced && inHouseSelected) {\r\n replacePart(modifiedPart);\r\n\r\n } else if (modifiedPart instanceof InHouse && !inHouseSelected) {\r\n replacePart(modifiedPart);\r\n } else {\r\n modifiedPart.setName(nameField.getText());\r\n modifiedPart.setStock(Integer.parseInt(invField.getText()));\r\n modifiedPart.setPrice(Double.parseDouble(priceField.getText()));\r\n modifiedPart.setMax(Integer.parseInt(maxField.getText()));\r\n modifiedPart.setMin(Integer.parseInt(minField.getText()));\r\n if (inHouseSelected) {\r\n ((InHouse) modifiedPart).setMachineId(Integer.parseInt(machineOrCompanyField.getText()));\r\n } else {\r\n ((Outsourced) modifiedPart).setCompanyName(machineOrCompanyField.getText());\r\n }\r\n\r\n Inventory.updatePart(Inventory.getAllParts().indexOf(modifiedPart), modifiedPart);\r\n }\r\n\r\n }",
"public ingresarBiblioteca() {\n initComponents();\n this.nombreUsuario.setText(usuariosID[0].getNombre());\n this.Picture.setFont(new java.awt.Font(\"Dialog\", java.awt.Font.PLAIN,10));\n usuario.insertarInicio(this.nombreUsuario.getText()/*, carpeta*/);\n usuario.obtenerNodo(0).getArchivo().insertarFinal(\"GENERAL\");//carpeta.insertarFinal(\"GENERAL\");\n }",
"private void actualizarMedicamentoExistente() {\n medicamentoSeleccionado.setCodigoMedicamento(codigoMedicamento);\r\n medicamentoSeleccionado.setCodigoCums(codigoCums);\r\n medicamentoSeleccionado.setCodigoCups(codigoCups);\r\n medicamentoSeleccionado.setNombreMedicamento(nombreMedicamento);\r\n medicamentoSeleccionado.setNombreGenerico(nombreGenerico);\r\n medicamentoSeleccionado.setNombreComercial(nombreComercial);\r\n medicamentoSeleccionado.setFormaMedicamento(formaMedicamento);\r\n medicamentoSeleccionado.setPos(pos);\r\n medicamentoSeleccionado.setConcentracion(concentracion);\r\n medicamentoSeleccionado.setUnidadMedida(unidadMedida);\r\n medicamentoSeleccionado.setControlMedico(controlMedico);\r\n medicamentoSeleccionado.setRegistroSanitario(registroSanitario);\r\n medicamentoSeleccionado.setModAdmin(modAdmin);\r\n medicamentoSeleccionado.setValor(valor);\r\n medicamentoFacade.edit(medicamentoSeleccionado);\r\n limpiarFormularioMedicamentos();\r\n RequestContext.getCurrentInstance().update(\"IdFormMedicamentos\");\r\n imprimirMensaje(\"Correcto\", \"El medicamento ha sido actualizado.\", FacesMessage.SEVERITY_INFO);\r\n }",
"@Override\n\tpublic void save(Religiao obj) throws Exception {\n\t\t\n\t}",
"com.soa.SolicitarCreditoDocument.SolicitarCredito addNewSolicitarCredito();",
"@Override\n public void registrarPropiedad(Propiedad nuevaPropiedad, String pIdAgente) {\n int numFinca = nuevaPropiedad.getNumFinca();\n String modalidad = nuevaPropiedad.getModalidad();\n double area = nuevaPropiedad.getAreaTerreno();\n double metro = nuevaPropiedad.getValorMetroCuadrado();\n double fiscal = nuevaPropiedad.getValorFiscal();\n String provincia = nuevaPropiedad.getProvincia();\n String canton = nuevaPropiedad.getCanton();\n String distrito = nuevaPropiedad.getDistrito();\n String dirExacta = nuevaPropiedad.getDirExacta();\n String estado = nuevaPropiedad.getEstado();\n String tipo = nuevaPropiedad.getTipo();\n System.out.println(nuevaPropiedad.getFotografias().size());\n double precio = nuevaPropiedad.getPrecio();\n try {\n bdPropiedad.manipulationQuery(\"INSERT INTO PROPIEDAD (ID_PROPIEDAD, ID_AGENTE, MODALIDAD, \"\n + \"AREA_TERRENO, VALOR_METRO, VALOR_FISCAL, PROVINCIA, CANTON, DISTRITO, DIREXACTA, TIPO, \"\n + \"ESTADO, PRECIO) VALUES (\" + numFinca + \", '\" + pIdAgente + \"' , '\" + modalidad + \"',\" + \n area + \",\" + metro + \",\" + fiscal + \", '\" + provincia + \"' , '\" + canton + \"' , '\" + distrito \n + \"' , '\" + dirExacta + \"' , '\" + tipo + \"' , '\" + estado + \"', \" + precio + \")\");\n bdPropiedad.insertarFotografias(nuevaPropiedad);\n } catch (SQLException ex) {\n Logger.getLogger(Propiedad.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"public void insercionMasiva() {\r\n\t\tif (!precondInsert())\r\n\t\t\treturn;\r\n\t\tUploadItem fileItem = seleccionUtilFormController.crearUploadItem(\r\n\t\t\t\tfName, uFile.length, cType, uFile);\r\n\t\ttry {\r\n\t\t\tlLineasArch = FileUtils.readLines(fileItem.getFile(), \"ISO-8859-1\");\r\n\t\t} catch (IOException e) {\r\n\t\t\tstatusMessages.add(Severity.INFO, \"Error al subir el archivo\");\r\n\t\t}\r\n\r\n\t\tStringBuilder cadenaSalida = new StringBuilder();\r\n\t\tString estado = \"EXITO\";\r\n\t\tcantidadLineas = 0;\r\n\t\t//Ciclo para contar la cantdad de adjudicados o seleccionados que se reciben\r\n\t\tfor (String linea : lLineasArch) {\r\n\t\t\tcantidadLineas++;\r\n\t\t\tif(cantidadLineas > 1){\r\n\t\t\t\tseleccionados++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Condicion para verificar si la cantidad de seleccionados es mayor a la cantidad de vacancias (en cuyo caso se procede a abortar el proceso e imprimir\r\n\t\t//un mensaje de error) o verificar si esta es menor (se imprime el mensaje pero se continua)\r\n\t\t\r\n\t\tif(seleccionados > concursoPuestoAgrNuevo.getCantidadPuestos()){\r\n\t\t\testado = \"FRACASO\";\r\n\t\t\tcadenaSalida.append(estado + \" - CANTIDAD DE AJUDICADOS ES SUPERIOR A LA CANTIDAD DE PUESTOS VACANTES PARA EL GRUPO\");\r\n\t\t\tcadenaSalida.append(System.getProperty(\"line.separator\"));\r\n\t\t}\r\n\t\telse if(seleccionados < concursoPuestoAgrNuevo.getCantidadPuestos()){\r\n\t\t\tcadenaSalida.append(\"ADVERTENCIA - CANTIDAD DE ADJUDICADOS ES INFERIOR A LA CANTIDAD DE PUESTOS VACANTES PARA EL GRUPO\");\r\n\t\t\tcadenaSalida.append(System.getProperty(\"line.separator\"));\r\n\t\t}\r\n\t\tseleccionados = 0;\r\n\t\t\r\n\t\tif(!estado.equals(\"FRACASO\")){\r\n\r\n\t\tcantidadLineas = 0;\r\n\t\tfor (String linea : lLineasArch) {\r\n\r\n\t\t\tcantidadLineas++;\r\n\t\t\testado = \"EXITO\";\r\n\t\t\tString observacion = \"\";\r\n\t\t\tFilaPostulante fp = new FilaPostulante(linea);\r\n\t\t\tList<Persona> lista = null;\r\n\t\t\tif (cantidadLineas > 1 && fp != null && fp.valido) {\r\n\t\t\t\t//Verifica si la persona leida en el registro del archivo CSV existe en la Tabla Persona\r\n\t\t\t\tString sqlPersona = \"select * from general.persona where persona.documento_identidad = '\"+fp.getDocumento()+ \"'\";\r\n\t\t\t\tQuery q1 = em.createNativeQuery(sqlPersona, Persona.class);\r\n\t\t\t\tPersona personaLocal = new Persona();\r\n\t\t\t\tint banderaEncontroPersonas = 0;\r\n\t\t\t\t//Si existe, se almacena el registro de la tabla\r\n\t\t\t\tif(!q1.getResultList().isEmpty()){\r\n\t\t\t\t\tlista = q1.getResultList();\r\n\t\t\t\t\tif (compararNomApe(lista.get(0).getNombres(), removeCadenasEspeciales(fp.getNombres()))\r\n\t\t\t\t\t\t\t&& compararNomApe(lista.get(0).getApellidos(), removeCadenasEspeciales(fp.getApellidos())) ) {\r\n\t\t\t\t\t\t\tbanderaEncontroPersonas = 1;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\testado = \"FRACASO\";\r\n\t\t\t\t\t\t\tobservacion += \" PERSONA NO REGISTRADA EN LA BASE DE DATOS LOCAL\";\r\n\t\t\t\t\t\t}\t\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\testado = \"FRACASO\";\r\n\t\t\t\t\tobservacion += \" PERSONA NO REGITRADA EN LA BASE DE DATOS LOCAL\";\r\n\t\t\t\t}\r\n\t\t\t\t//Verificamos que la persona figure en la lista corta como seleccionado\r\n\t\t\t\tif(!estado.equals(\"FRACASO\")){\r\n\t\t\t\t\tint banderaExisteEnListaCorta = 0;\t\t\t\t\t\r\n\t\t\t\t\tint i=0;\r\n\t\t\t\t\tif (banderaEncontroPersonas == 1) {\r\n\t\t\t\t\t\twhile(i<lista.size()){\r\n\t\t\t\t\t\t\tpersonaLocal = (Persona) lista.get(i);\r\n\t\t\t\t\t\t\tQuery p = em.createQuery(\"select E from EvalReferencialPostulante E \"\r\n\t\t\t\t\t\t\t\t\t+ \"where E.postulacion.personaPostulante.persona.idPersona =:id_persona and E.concursoPuestoAgr.idConcursoPuestoAgr =:id_concurso_puesto_agr and E.listaCorta=:esta_en_lista_corta\");\r\n\t\t\t\t\t\t\t\t\tp.setParameter(\"id_persona\", personaLocal.getIdPersona());\r\n\t\t\t\t\t\t\t\t\tp.setParameter(\"id_concurso_puesto_agr\", this.idConcursoPuestoAgr);\r\n\t\t\t\t\t\t\t\t\tp.setParameter(\"esta_en_lista_corta\", true);\r\n\t\t\t\t\t\t\tList<EvalReferencialPostulante> listaEvalRefPost = p.getResultList();\r\n\t\t\t\t\t\t\tif (!listaEvalRefPost.isEmpty()) {\r\n\t\t\t\t\t\t\t\tbanderaExisteEnListaCorta = 1;\r\n\t\t\t\t\t\t\t\ti = lista.size();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\ti++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (banderaExisteEnListaCorta == 0) {\r\n\t\t\t\t\t\testado = \"FRACASO\";\r\n\t\t\t\t\t\tobservacion += \" NO SELECCIONADO/ELEGIBLE EN LISTA CORTA\";\r\n\t\t\t\t\t} else if (banderaExisteEnListaCorta == 1){\r\n\t\t\t\t\t\tobservacion += \" SELECCIONADO/ELEGIBLE EN LISTA CORTA\";\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tQuery p = em.createQuery(\"select E from EvalReferencialPostulante E \"\r\n\t\t\t\t\t\t\t\t+ \"where E.postulacion.personaPostulante.persona.idPersona =:id_persona and E.concursoPuestoAgr.idConcursoPuestoAgr =:id_concurso_puesto_agr and E.listaCorta=:esta_en_lista_corta\");\r\n\t\t\t\t\t\t\t\tp.setParameter(\"id_persona\", personaLocal.getIdPersona());\r\n\t\t\t\t\t\t\t\tp.setParameter(\"id_concurso_puesto_agr\", this.idConcursoPuestoAgr);\r\n\t\t\t\t\t\t\t\tp.setParameter(\"esta_en_lista_corta\", true);\r\n\t\t\t\t\t\tEvalReferencialPostulante auxEvalReferencialPostulante = (EvalReferencialPostulante) p.getResultList().get(0);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//Validaciones para actualizaciones\r\n\t\t\t\t\t\t//Bandera indicadora de actualizaciones hechas\r\n\t\t\t\t\t\tint bandera = 0;\r\n\t\t\t\t\t\tif(auxEvalReferencialPostulante.getSelAdjudicado() == null){\r\n\t\t\t\t\t\t\testado = \"EXITO\";\r\n\t\t\t\t\t\t\tauxEvalReferencialPostulante.setSelAdjudicado(true);;\r\n\t\t\t\t\t\t\tbandera = 1;\r\n\t\t\t\t\t\t\tem.merge(auxEvalReferencialPostulante);\r\n\t\t\t\t\t\t\tem.flush();\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\tagregarEstadoMotivo(linea, estado, observacion, cadenaSalida);\r\n\t\t\t}\r\n\t\t\tif (cantidadLineas > 1 && !fp.valido) {\r\n\t\t\t\testado = \"FRACASO\";\r\n\t\t\t\tcadenaSalida\r\n\t\t\t\t\t\t.append(estado\r\n\t\t\t\t\t\t\t\t+ \" - ARCHIVO INGRESADO CON MENOS CAMPOS DE LOS NECESARIOS. DATOS INCORRECTOS EN ALGUNA COLUMNA.\");\r\n\t\t\t\tcadenaSalida.append(System.getProperty(\"line.separator\"));\r\n\t\t\t}\r\n\r\n\t\t\t// FIN FOR\r\n\t\t}\r\n\t\t//FIN IF\r\n\t\t}\r\n\t\tif (lLineasArch.isEmpty()) {\r\n\t\t\tstatusMessages.add(Severity.INFO, \"Archivo inválido\");\r\n\t\t\treturn;\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\tSimpleDateFormat sdf2 = new SimpleDateFormat(\"dd_MM_yyyy_HH_mm_ss\");\r\n\t\t\tString nArchivo = sdf2.format(new Date()) + \"_\" + fName;\r\n\t\t\tString direccion = System.getProperty(\"jboss.home.dir\") + System.getProperty(\"file.separator\") + \"temp\" + System.getProperty(\"file.separator\");\r\n\t\t\tFile archSalida = new File(direccion + nArchivo);\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tFileUtils\r\n\t\t\t\t\t\t.writeStringToFile(archSalida, cadenaSalida.toString());\r\n\t\t\t\tif (archSalida.length() > 0) {\r\n\t\t\t\t\tstatusMessages.add(Severity.INFO, \"Insercion Exitosa\");\r\n\t\t\t\t}\r\n\t\t\t\tJasperReportUtils.respondFile(archSalida, nArchivo, false,\r\n\t\t\t\t\t\t\"application/vnd.ms-excel\");\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tstatusMessages.add(Severity.ERROR, \"IOException\");\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private void jb_modificarActionPerformed(java.awt.event.ActionEvent evt) {\n String Arch = JOptionPane.showInputDialog(\"INGRESE LA CARPETA A MODIFICAR\");\n String NEWArch = JOptionPane.showInputDialog(\"INGRESE EL NUEVO NOMBRE DE LA CARPETA\");\n ini.ListaGen.modificarCAR(ListaGen.head, NombreUs, Arch, NEWArch);\n }",
"@Override\r\n\tprotected void agregarObjeto() {\r\n\t\t// opcion 1 es agregar nuevo justificativo\r\n\t\tthis.setTitle(\"PROCESOS - PERMISOS INDIVIDUALES (AGREGANDO)\");\r\n\t\tthis.opcion = 1;\r\n\t\tactivarFormulario();\r\n\t\tlimpiarTabla();\r\n\t\tthis.panelBotones.habilitar();\r\n\t}",
"public void saveORUpdateObra(Obra obra) throws Exception;",
"@Override\n\t\tpublic void update(Metodologia metodologia,String name) {\n\t\t\t\n\t\t}",
"public void salvarNoBanco() {\n\n try {\n ofertaDisciplinaFacade.save(oferta);\n// JsfUtil.addSuccessMessage(\"Pessoa \" + pessoa.getNome() + \" criado com sucesso!\");\n oferta= null;\n// recriarModelo();\n } catch (Exception e) {\n JsfUtil.addErrorMessage(e, \"Ocorreu um erro de persistência\");\n }\n }",
"public void modificar(Long id, G entity, HttpServletRequest httpRequest) throws AppException;",
"@Override\n\tpublic void alterar(Parcela entidade) {\n\n\t}",
"private void saveNewCatalog() {\n\n\t}",
"private void modificarProfesor(){\n \n System.out.println(\"-->> MODIFICAR PROFESOR\");\n int opcion;\n String nif=IO_ES.leerCadena(\"Inserte el nif del profesor\");\n if(ValidarCadenas.validarNIF(nif)){\n Profesor profesor=(Profesor) getPersona(LProfesorado, nif);\n if(profesor!=null){\n do{\n System.out.println(profesor);\n System.out.println(\"\\n1. Nombre\");\n System.out.println(\"2. Dirección\");\n System.out.println(\"3. Código Postal\");\n System.out.println(\"4. Teléfono\");\n System.out.println(\"5. Módulo\");\n System.out.println(\"0. Volver\");\n opcion=IO_ES.leerInteger(\"Inserte una opción: \", 0, 5);\n \n \n switch(opcion){\n \n case 1:\n actualizarNombre(profesor);\n break;\n case 2:\n actualizarDireccion(profesor);\n break;\n case 3:\n actualizarCodigoPostal(profesor);\n break;\n case 4:\n actualizarTelefono(profesor);\n break;\n case 5:\n actualizarModulo(profesor);\n break;\n \n \n }\n \n }while(opcion!=0);\n }\n else{\n System.out.println(\"El profesor no existe\");\n }\n \n }\n else {\n System.out.println(\"El nif no es válido\");\n }\n \n }",
"@Override\n\tpublic void registrarLlegada() {\n\t\t\n\t}",
"public static void registrarAuditoria(Connexion connexion,Long idUsuario,GrupoBodega grupobodega,String sUsuarioPC,String sNamePC,String sIPPC)throws Exception {\n\t\t\r\n\t\ttry {\r\n\t\t\tif(GrupoBodegaConstantesFunciones.ISCONAUDITORIA) {\r\n\t\t\t\tif(grupobodega.getIsNew()) {\r\n\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,GrupoBodegaDataAccess.TABLENAME, grupobodega.getId(), Constantes.SAUDITORIAINSERTAR,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(GrupoBodegaConstantesFunciones.ISCONAUDITORIADETALLE) {\r\n\t\t\t\t\t\t////GrupoBodegaLogic.registrarAuditoriaDetallesGrupoBodega(connexion,grupobodega,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if(grupobodega.getIsDeleted()) {\r\n\t\t\t\t\t/*if(!grupobodega.getIsExpired()) {\r\n\t\t\t\t\t\t////auditoriaLogicAdditional.RegistrarNuevaAuditoria(Constantes.getLOidSistemaActual(),idUsuario,GrupoBodegaDataAccess.TABLENAME, grupobodega.getId(), Constantes.getSAuditoriaEliminarLogicamente(),\"\",sUsuarioPC,sNamePC,sIPPC,Timestamp.valueOf(Funciones.getStringMySqlCurrentDateTime()),\"\");\r\n\t\t\t\t\t\t////GrupoBodegaLogic.registrarAuditoriaDetallesGrupoBodega(connexion,grupobodega,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t} else {*/\r\n\t\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,GrupoBodegaDataAccess.TABLENAME, grupobodega.getId(), Constantes.SAUDITORIAELIMINARFISICAMENTE,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t//}\r\n\t\t\t\t} else if(grupobodega.getIsChanged()) {\r\n\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,GrupoBodegaDataAccess.TABLENAME, grupobodega.getId(), Constantes.SAUDITORIAACTUALIZAR,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(GrupoBodegaConstantesFunciones.ISCONAUDITORIADETALLE) {\r\n\t\t\t\t\t\t////GrupoBodegaLogic.registrarAuditoriaDetallesGrupoBodega(connexion,grupobodega,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch(Exception e) {\r\n\t\t\tFunciones.manageException(logger,e);\r\n\t\t\tthrow e;\r\n\t\t}\t\t\r\n\t}",
"private static void registrarAuditoriaDetallesGrupoBodega(Connexion connexion,GrupoBodega grupobodega)throws Exception {\n\t\t\r\n\t\tString strValorActual=null;\r\n\t\tString strValorNuevo=null;\r\n\t\t\r\n\t\t\t\r\n\t\t\tif(grupobodega.getIsNew()||!grupobodega.getid_empresa().equals(grupobodega.getGrupoBodegaOriginal().getid_empresa()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(grupobodega.getGrupoBodegaOriginal().getid_empresa()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=grupobodega.getGrupoBodegaOriginal().getid_empresa().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(grupobodega.getid_empresa()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=grupobodega.getid_empresa().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),GrupoBodegaConstantesFunciones.IDEMPRESA,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(grupobodega.getIsNew()||!grupobodega.getcodigo().equals(grupobodega.getGrupoBodegaOriginal().getcodigo()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(grupobodega.getGrupoBodegaOriginal().getcodigo()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=grupobodega.getGrupoBodegaOriginal().getcodigo();\r\n\t\t\t\t}\r\n\t\t\t\tif(grupobodega.getcodigo()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=grupobodega.getcodigo() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),GrupoBodegaConstantesFunciones.CODIGO,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(grupobodega.getIsNew()||!grupobodega.getnombre().equals(grupobodega.getGrupoBodegaOriginal().getnombre()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(grupobodega.getGrupoBodegaOriginal().getnombre()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=grupobodega.getGrupoBodegaOriginal().getnombre();\r\n\t\t\t\t}\r\n\t\t\t\tif(grupobodega.getnombre()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=grupobodega.getnombre() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),GrupoBodegaConstantesFunciones.NOMBRE,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(grupobodega.getIsNew()||!grupobodega.getruc().equals(grupobodega.getGrupoBodegaOriginal().getruc()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(grupobodega.getGrupoBodegaOriginal().getruc()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=grupobodega.getGrupoBodegaOriginal().getruc();\r\n\t\t\t\t}\r\n\t\t\t\tif(grupobodega.getruc()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=grupobodega.getruc() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),GrupoBodegaConstantesFunciones.RUC,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(grupobodega.getIsNew()||!grupobodega.getdireccion().equals(grupobodega.getGrupoBodegaOriginal().getdireccion()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(grupobodega.getGrupoBodegaOriginal().getdireccion()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=grupobodega.getGrupoBodegaOriginal().getdireccion();\r\n\t\t\t\t}\r\n\t\t\t\tif(grupobodega.getdireccion()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=grupobodega.getdireccion() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),GrupoBodegaConstantesFunciones.DIRECCION,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(grupobodega.getIsNew()||!grupobodega.gettelefono().equals(grupobodega.getGrupoBodegaOriginal().gettelefono()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(grupobodega.getGrupoBodegaOriginal().gettelefono()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=grupobodega.getGrupoBodegaOriginal().gettelefono();\r\n\t\t\t\t}\r\n\t\t\t\tif(grupobodega.gettelefono()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=grupobodega.gettelefono() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),GrupoBodegaConstantesFunciones.TELEFONO,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(grupobodega.getIsNew()||!grupobodega.getid_pais().equals(grupobodega.getGrupoBodegaOriginal().getid_pais()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(grupobodega.getGrupoBodegaOriginal().getid_pais()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=grupobodega.getGrupoBodegaOriginal().getid_pais().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(grupobodega.getid_pais()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=grupobodega.getid_pais().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),GrupoBodegaConstantesFunciones.IDPAIS,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(grupobodega.getIsNew()||!grupobodega.getid_ciudad().equals(grupobodega.getGrupoBodegaOriginal().getid_ciudad()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(grupobodega.getGrupoBodegaOriginal().getid_ciudad()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=grupobodega.getGrupoBodegaOriginal().getid_ciudad().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(grupobodega.getid_ciudad()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=grupobodega.getid_ciudad().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),GrupoBodegaConstantesFunciones.IDCIUDAD,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(grupobodega.getIsNew()||!grupobodega.getid_centro_costo().equals(grupobodega.getGrupoBodegaOriginal().getid_centro_costo()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(grupobodega.getGrupoBodegaOriginal().getid_centro_costo()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=grupobodega.getGrupoBodegaOriginal().getid_centro_costo().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(grupobodega.getid_centro_costo()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=grupobodega.getid_centro_costo().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),GrupoBodegaConstantesFunciones.IDCENTROCOSTO,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(grupobodega.getIsNew()||!grupobodega.getid_empleado().equals(grupobodega.getGrupoBodegaOriginal().getid_empleado()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(grupobodega.getGrupoBodegaOriginal().getid_empleado()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=grupobodega.getGrupoBodegaOriginal().getid_empleado().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(grupobodega.getid_empleado()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=grupobodega.getid_empleado().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),GrupoBodegaConstantesFunciones.IDEMPLEADO,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(grupobodega.getIsNew()||!grupobodega.getdescripcion().equals(grupobodega.getGrupoBodegaOriginal().getdescripcion()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(grupobodega.getGrupoBodegaOriginal().getdescripcion()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=grupobodega.getGrupoBodegaOriginal().getdescripcion();\r\n\t\t\t\t}\r\n\t\t\t\tif(grupobodega.getdescripcion()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=grupobodega.getdescripcion() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),GrupoBodegaConstantesFunciones.DESCRIPCION,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(grupobodega.getIsNew()||!grupobodega.getid_cuenta_contable_inventario().equals(grupobodega.getGrupoBodegaOriginal().getid_cuenta_contable_inventario()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(grupobodega.getGrupoBodegaOriginal().getid_cuenta_contable_inventario()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=grupobodega.getGrupoBodegaOriginal().getid_cuenta_contable_inventario().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(grupobodega.getid_cuenta_contable_inventario()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=grupobodega.getid_cuenta_contable_inventario().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),GrupoBodegaConstantesFunciones.IDCUENTACONTABLEINVENTARIO,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(grupobodega.getIsNew()||!grupobodega.getid_cuenta_contable_costo().equals(grupobodega.getGrupoBodegaOriginal().getid_cuenta_contable_costo()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(grupobodega.getGrupoBodegaOriginal().getid_cuenta_contable_costo()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=grupobodega.getGrupoBodegaOriginal().getid_cuenta_contable_costo().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(grupobodega.getid_cuenta_contable_costo()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=grupobodega.getid_cuenta_contable_costo().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),GrupoBodegaConstantesFunciones.IDCUENTACONTABLECOSTO,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(grupobodega.getIsNew()||!grupobodega.getid_cuenta_contable_venta().equals(grupobodega.getGrupoBodegaOriginal().getid_cuenta_contable_venta()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(grupobodega.getGrupoBodegaOriginal().getid_cuenta_contable_venta()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=grupobodega.getGrupoBodegaOriginal().getid_cuenta_contable_venta().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(grupobodega.getid_cuenta_contable_venta()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=grupobodega.getid_cuenta_contable_venta().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),GrupoBodegaConstantesFunciones.IDCUENTACONTABLEVENTA,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(grupobodega.getIsNew()||!grupobodega.getid_cuenta_contable_descuento().equals(grupobodega.getGrupoBodegaOriginal().getid_cuenta_contable_descuento()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(grupobodega.getGrupoBodegaOriginal().getid_cuenta_contable_descuento()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=grupobodega.getGrupoBodegaOriginal().getid_cuenta_contable_descuento().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(grupobodega.getid_cuenta_contable_descuento()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=grupobodega.getid_cuenta_contable_descuento().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),GrupoBodegaConstantesFunciones.IDCUENTACONTABLEDESCUENTO,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(grupobodega.getIsNew()||!grupobodega.getid_cuenta_contable_devolucion().equals(grupobodega.getGrupoBodegaOriginal().getid_cuenta_contable_devolucion()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(grupobodega.getGrupoBodegaOriginal().getid_cuenta_contable_devolucion()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=grupobodega.getGrupoBodegaOriginal().getid_cuenta_contable_devolucion().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(grupobodega.getid_cuenta_contable_devolucion()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=grupobodega.getid_cuenta_contable_devolucion().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),GrupoBodegaConstantesFunciones.IDCUENTACONTABLEDEVOLUCION,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(grupobodega.getIsNew()||!grupobodega.getid_cuenta_contable_debito().equals(grupobodega.getGrupoBodegaOriginal().getid_cuenta_contable_debito()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(grupobodega.getGrupoBodegaOriginal().getid_cuenta_contable_debito()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=grupobodega.getGrupoBodegaOriginal().getid_cuenta_contable_debito().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(grupobodega.getid_cuenta_contable_debito()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=grupobodega.getid_cuenta_contable_debito().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),GrupoBodegaConstantesFunciones.IDCUENTACONTABLEDEBITO,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(grupobodega.getIsNew()||!grupobodega.getid_cuenta_contable_credito().equals(grupobodega.getGrupoBodegaOriginal().getid_cuenta_contable_credito()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(grupobodega.getGrupoBodegaOriginal().getid_cuenta_contable_credito()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=grupobodega.getGrupoBodegaOriginal().getid_cuenta_contable_credito().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(grupobodega.getid_cuenta_contable_credito()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=grupobodega.getid_cuenta_contable_credito().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),GrupoBodegaConstantesFunciones.IDCUENTACONTABLECREDITO,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(grupobodega.getIsNew()||!grupobodega.getid_cuenta_contable_produccion().equals(grupobodega.getGrupoBodegaOriginal().getid_cuenta_contable_produccion()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(grupobodega.getGrupoBodegaOriginal().getid_cuenta_contable_produccion()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=grupobodega.getGrupoBodegaOriginal().getid_cuenta_contable_produccion().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(grupobodega.getid_cuenta_contable_produccion()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=grupobodega.getid_cuenta_contable_produccion().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),GrupoBodegaConstantesFunciones.IDCUENTACONTABLEPRODUCCION,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(grupobodega.getIsNew()||!grupobodega.getid_cuenta_contable_bonifica().equals(grupobodega.getGrupoBodegaOriginal().getid_cuenta_contable_bonifica()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(grupobodega.getGrupoBodegaOriginal().getid_cuenta_contable_bonifica()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=grupobodega.getGrupoBodegaOriginal().getid_cuenta_contable_bonifica().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(grupobodega.getid_cuenta_contable_bonifica()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=grupobodega.getid_cuenta_contable_bonifica().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),GrupoBodegaConstantesFunciones.IDCUENTACONTABLEBONIFICA,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(grupobodega.getIsNew()||!grupobodega.getid_cuenta_contable_costo_bonifica().equals(grupobodega.getGrupoBodegaOriginal().getid_cuenta_contable_costo_bonifica()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(grupobodega.getGrupoBodegaOriginal().getid_cuenta_contable_costo_bonifica()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=grupobodega.getGrupoBodegaOriginal().getid_cuenta_contable_costo_bonifica().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(grupobodega.getid_cuenta_contable_costo_bonifica()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=grupobodega.getid_cuenta_contable_costo_bonifica().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),GrupoBodegaConstantesFunciones.IDCUENTACONTABLECOSTOBONIFICA,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t}",
"@Override\n public void actualizarPropiedad(Propiedad nuevaPropiedad) {\n int numFinca = nuevaPropiedad.getNumFinca();\n String modalidad = nuevaPropiedad.getModalidad();\n double area = nuevaPropiedad.getAreaTerreno();\n double metro = nuevaPropiedad.getValorMetroCuadrado();\n double fiscal = nuevaPropiedad.getValorFiscal();\n String provincia = nuevaPropiedad.getProvincia();\n String canton = nuevaPropiedad.getCanton();\n String distrito = nuevaPropiedad.getDistrito();\n String dirExacta = nuevaPropiedad.getDirExacta();\n String estado = nuevaPropiedad.getEstado();\n String tipo = nuevaPropiedad.getTipo();\n System.out.println(nuevaPropiedad.getFotografias().size());\n double precio = nuevaPropiedad.getPrecio();\n try {\n bdPropiedad.manipulationQuery(\"UPDATE PROPIEDAD SET MODALIDAD = '\" + modalidad + \"', AREA_TERRENO \"\n + \"= \" + area + \", VALOR_METRO = \" + metro + \", VALOR_FISCAL = \"+ fiscal + \", PROVINCIA = '\" \n + provincia + \"', CANTON = '\" + canton + \"' , DISTRITO = '\" + distrito + \"', DIREXACTA = '\" \n + dirExacta + \"', ESTADO = '\" + estado + \"', PRECIO = \" + precio + \" WHERE ID_PROPIEDAD = \" \n + numFinca);\n bdPropiedad.manipulationQuery(\"DELETE FROM FOTOGRAFIA_PROPIEDAD WHERE ID_PROPIEDAD = \" + numFinca);\n bdPropiedad.insertarFotografias(nuevaPropiedad);\n } catch (SQLException ex) {\n Logger.getLogger(Propiedad.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"public void insertaprofesor(Profesor newprof, String nombrefichero) throws IOException {\r\n \r\n PrintWriter salida = new PrintWriter(new FileWriter(nombrefichero, true));\r\n \r\n salida.println(newprof.getID());\r\n salida.println(newprof.getPerfil());\r\n salida.println(newprof.getNombre());\r\n salida.println(newprof.getApellidos());\r\n salida.println(newprof.getFechaDeNacimiento());\r\n salida.println(newprof.getCatlaboral());\r\n salida.println(newprof.getDepartamento());\r\n salida.println(newprof.getDedicacionlaboral());\r\n if (newprof.gruposimpartidos.isEmpty()) {\r\n salida.println(\"\");\r\n } else {\r\n Grupo grupowriting = newprof.gruposimpartidos.get(0);\r\n salida.print(grupowriting.getIdasign() + \" \" + grupowriting.getTeoprac() + \" \" + grupowriting.getIdgrupo());\r\n for (int x = 1; x < newprof.gruposimpartidos.size(); x++) {\r\n grupowriting = newprof.gruposimpartidos.get(x);\r\n salida.print(grupowriting.getIdasign() + \" \" + grupowriting.getTeoprac() + \" \" + grupowriting.getIdgrupo());\r\n }\r\n salida.println(\"\");\r\n } \r\n \r\n salida.println(\"*\");\r\n salida.close();\r\n }",
"public void editarPrograma(Programa prog) throws Exception {\r\n\t\tEntityManager em = AdministradorEntityManager.getEntityManager();\r\n\t\tem.getTransaction().begin();\r\n\t\tem.merge(prog);\r\n\t\tem.getTransaction().commit();\t\t\r\n\t}",
"public void save() { \n /*\n * Iterate over registry to pull box values\n * Creating new IOLoader for instance \n */\n for(UUID id : giftRegistry.keySet()) {\n GiftBox box = giftRegistry.get(id);\n\n String sId = id.toString();\n IOLoader<SecretSanta> config = new IOLoader<SecretSanta>(SecretSanta._this(), sId + \".yml\", \"Gifts\");\n\n FileConfiguration fCon = config.getCustomConfig();\n fCon.createSection(\"SecretSanta\");\n fCon.set(\"SecretSanta\", box.getConfig());\n\n try{\n fCon.save(config.getFile());\n } catch(IOException ex) {\n SecretSanta._this().logSevere(\"[GiftManager] Failed to save: \" + sId + \".yml\");\n continue;\n }\n }\n //SecretSanta._this().logDebug(\"[GiftManager] Gift Registry save successful.\");\n\n IOLoader<SecretSanta> pairedConfig = new IOLoader<SecretSanta>(SecretSanta._this(), \"PairedRegistry.yml\", \"Data\");\n FileConfiguration fPaired = pairedConfig.getCustomConfig();\n fPaired.createSection(\"paired\");\n fPaired.set(\"paired\", savePairs());\n\n try{\n fPaired.save(pairedConfig.getFile());\n //SecretSanta._this().logDebug(\"[GiftManager] PairedRegistry.yml save successful.\");\n } catch(IOException ex) {\n SecretSanta._this().logSevere(\"[GiftManager] Failed to save: PairedRegistry.yml\");\n }\n\n IOLoader<SecretSanta> playerConfig = new IOLoader<SecretSanta>(SecretSanta._this(), \"PlayerRegistry.yml\", \"Data\");\n FileConfiguration fPlayer = playerConfig.getCustomConfig();\n fPlayer.createSection(\"registered\");\n fPlayer.set(\"registered\", savePlayers());\n\n try{\n fPlayer.save(playerConfig.getFile());\n //SecretSanta._this().logDebug(\"[GiftManager] PlayerRegistry.yml save successful.\");\n } catch(IOException ex) {\n SecretSanta._this().logSevere(\"[GiftManager] Failed to save: PlayerRegistry.yml\");\n }\n\n IOLoader<SecretSanta> givenConfig = new IOLoader<SecretSanta>(SecretSanta._this(), \"GivenEmptyRegistry.yml\", \"Data\");\n FileConfiguration fGiven = givenConfig.getCustomConfig();\n fGiven.createSection(\"given\");\n fGiven.set(\"given\", saveGivens());\n\n try{\n fGiven.save(givenConfig.getFile());\n } catch(IOException ex) {\n SecretSanta._this().logSevere(\"[GiftManager] Failed to save: GivenEmptyRegistry.yml\");\n }\n\n SecretSanta._this().logDebug(\"[GiftManager] Saving complete.\");\n }",
"ParqueaderoEntidad agregar(ParqueaderoEntidad parqueadero);",
"@Transactional\n\tpublic void saveNewGeneric(FlowObjCreator foc) {\n\t\tTree folderT = readDocT(foc.getIdf());\n\t\tTree newGenericT = setNewDocT(\"drug\",folderT);\n\t\tDrug newGenericO = makeNewDrug(newGenericT, foc.getGenericName());\n\t\tnewGenericO.setGeneric(newGenericO);\n\t\tem.persist(newGenericT);\n\t\tem.persist(newGenericO);\n\t}",
"@Override\n\tpublic void cargarInformacion_paciente() {\n\t\tinfoPacientes.cargarInformacion(admision, this,\n\t\t\t\tnew InformacionPacienteIMG() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void ejecutarProceso() {\n\t\t\t\t\t\tif (tbxAccion.getValue().equalsIgnoreCase(\"registrar\")) {\n\n\t\t\t\t\t\t\t// Map<String, Object> parametros = new\n\t\t\t\t\t\t\t// HashMap<String, Object>();\n\t\t\t\t\t\t\t// parametros.put(\"codigo_empresa\", codigo_empresa);\n\t\t\t\t\t\t\t// parametros.put(\"codigo_sucursal\",\n\t\t\t\t\t\t\t// codigo_sucursal);\n\t\t\t\t\t\t\t// parametros.put(\"identificacion\",\n\t\t\t\t\t\t\t// admision.getNro_identificacion());\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\ttoolbarbuttonTipo_historia\n\t\t\t\t\t\t\t\t\t.setLabel(\"Creando historia de Urgencia Odontologica\");\n\t\t\t\t\t\t\tadmision.setPrimera_vez(\"S\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t}",
"@SuppressWarnings(\"unchecked\")\r\n private void newMap() throws IOException, ClassNotFoundException {\r\n this.music_map.clear();\r\n if (needNewMap()) {\r\n if (!save_file.exists()) {\r\n System.out.println(\"DIZIONARIO NON PRESENTE\");\r\n System.out.println(\"CREAZIONE NUOVO DIZIONARIO IN CORSO...\");\r\n\r\n this.setTarget();\r\n\r\n this.recoursiveMapCreation(this.music_root);\r\n this.saveMap();\r\n } else {\r\n System.out.println(\"DIZIONARIO NON AGGIORNATO\");\r\n if (!UtilFunctions.newDictionaryRequest(this.save_file, this.music_root)) {\r\n System.out.println(\"AGGIORNAMENTO DIZIONARIO RIFIUTATO\");\r\n FileInputStream f = new FileInputStream(this.save_file);\r\n ObjectInputStream o = new ObjectInputStream(f);\r\n this.music_map.putAll((Map<String, String[]>) o.readObject());\r\n current.set(ProgressDialog.TOTAL.get());\r\n } else {\r\n System.out.println(\"CREAZIONE NUOVO DIZIONARIO IN CORSO...\");\r\n this.setTarget();\r\n this.recoursiveMapCreation(this.music_root);\r\n this.saveMap();\r\n }\r\n }\r\n } else {\r\n System.out.println(\"DIZIONARIO GIA' PRESENTE\");\r\n FileInputStream f = new FileInputStream(this.save_file);\r\n ObjectInputStream o = new ObjectInputStream(f);\r\n this.music_map.putAll((Map<String, String[]>) o.readObject());\r\n current.set(ProgressDialog.TOTAL.get());\r\n }\r\n }",
"@Override\r\n\tprotected void editarObjeto() throws ClassNotFoundException {\n\t\tif (tbJustificaciones.getSelectedRow() != -1\r\n\t\t\t\t&& tbJustificaciones.getValueAt(tbJustificaciones.getSelectedRow(), 0) != null) {\r\n\t\t\tthis.setTitle(\"PROCESOS - PERMISOS INDIVIDUALES (MODIFICANDO)\");\r\n\t\t\tthis.opcion = 2;\r\n\t\t\tactivarFormulario();\r\n\t\t\tcargarDatosModificar();\r\n\t\t\ttxtCedula.setEnabled(false);\r\n\t\t\tlimpiarTabla();\r\n\t\t\tthis.panelBotones.habilitar();\r\n\t\t} else {\r\n\t\t\tJOptionPane.showMessageDialog(null, GlobalUtil.MSG_ITEM_NO_SELECCIONADO, \"ATENCION\",\r\n\t\t\t\t\tJOptionPane.ERROR_MESSAGE);\r\n\t\t}\r\n\t}",
"void adicionaComentario(Comentario comentario);",
"@Override\n\tpublic void recreo() {\n\n\t}",
"@Override\r\n\tpublic boolean alterar(Empresa empresa) {\n\t\treturn false;\r\n\t}",
"public void imprimirHijos(){\n\t\tmodCons.imprimirHijos();\n\t}",
"@Override\n\tpublic int save(CursoAsignatura ca) {\n\t\treturn 0;\n\t}",
"@Override\n\t\tpublic void guardar() {\n\t\t\t\n\t\t\tif (tab_presupuesto.guardar()){\n\t\t\t\tif (tab_asociacion_presupuestaria.guardar()) {\n\t\t\t\t\tguardarPantalla();\n\t\t\t\t\t//Actualizar el arbol\n\t\t\t\t\tarb_clasificador.ejecutarSql();\n\t\t\t\t\tutilitario.addUpdate(\"arb_clasificador\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\n\t\t}",
"private void salir(){\r\n\t\tif(Gestion.isModificado()){\r\n\t\t\tint opcion = JOptionPane.showOptionDialog(null, \"¿Desea guardar los cambios?\", \"Salir\", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null,null, null);\r\n\t\t\tswitch(opcion){\r\n\t\t\tcase JOptionPane.YES_OPTION:\r\n\t\t\t\tguardar();\r\n\t\t\t\tSystem.exit(0);\r\n\t\t\t\tbreak;\r\n\t\t\tcase JOptionPane.NO_OPTION:\r\n\t\t\t\tSystem.exit(0);\r\n\t\t\t\tbreak;\r\n\t\t\tcase JOptionPane.CANCEL_OPTION:\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t\tSystem.exit(0);\r\n\t}",
"public static void anyadirRaco(Imagen imagen){\n HashSet<Imagen> imagenes;\n HashSet<Usuario> usuarios;\n Usuario usuario;\n\n usuario = buscarUsuario(imagen.getUidUser());\n imagenes = baseDatos.get(Tablas.Racons.name());\n usuarios = baseDatos.get(Tablas.Usuarios.name());\n imagenes.add(imagen);\n usuarios.add(usuario);\n baseDatos.put(Tablas.Racons.name(),imagenes);\n baseDatos.put(Tablas.Usuarios.name(),usuarios);\n }",
"public void incluirAtorNoFilme(Filme filme, Ator ator) {\n EntityManager gerenciador = JPAUtil.getGerenciador();\r\n\r\n //Iniciar a transação\r\n gerenciador.getTransaction().begin();\r\n\r\n //sincronizar com o BD para tornar o status managed\r\n filme = gerenciador.merge(filme);\r\n \r\n //Adicionar o ator\r\n filme.getAtores().add(ator);\r\n\r\n //Commit na transação\r\n gerenciador.getTransaction().commit();\r\n \r\n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"protected void agregarUbicacion(){\n\n\n\n }",
"@Override\n\tpublic void registrarLlegada() {\n\t}",
"public static void registrarAuditoria(Connexion connexion,Long idUsuario,PresuTipoProyecto presutipoproyecto,String sUsuarioPC,String sNamePC,String sIPPC)throws Exception {\n\t\t\r\n\t\ttry {\r\n\t\t\tif(PresuTipoProyectoConstantesFunciones.ISCONAUDITORIA) {\r\n\t\t\t\tif(presutipoproyecto.getIsNew()) {\r\n\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,PresuTipoProyectoDataAccess.TABLENAME, presutipoproyecto.getId(), Constantes.SAUDITORIAINSERTAR,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(PresuTipoProyectoConstantesFunciones.ISCONAUDITORIADETALLE) {\r\n\t\t\t\t\t\t////PresuTipoProyectoLogic.registrarAuditoriaDetallesPresuTipoProyecto(connexion,presutipoproyecto,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if(presutipoproyecto.getIsDeleted()) {\r\n\t\t\t\t\t/*if(!presutipoproyecto.getIsExpired()) {\r\n\t\t\t\t\t\t////auditoriaLogicAdditional.RegistrarNuevaAuditoria(Constantes.getLOidSistemaActual(),idUsuario,PresuTipoProyectoDataAccess.TABLENAME, presutipoproyecto.getId(), Constantes.getSAuditoriaEliminarLogicamente(),\"\",sUsuarioPC,sNamePC,sIPPC,Timestamp.valueOf(Funciones.getStringMySqlCurrentDateTime()),\"\");\r\n\t\t\t\t\t\t////PresuTipoProyectoLogic.registrarAuditoriaDetallesPresuTipoProyecto(connexion,presutipoproyecto,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t} else {*/\r\n\t\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,PresuTipoProyectoDataAccess.TABLENAME, presutipoproyecto.getId(), Constantes.SAUDITORIAELIMINARFISICAMENTE,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t//}\r\n\t\t\t\t} else if(presutipoproyecto.getIsChanged()) {\r\n\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,PresuTipoProyectoDataAccess.TABLENAME, presutipoproyecto.getId(), Constantes.SAUDITORIAACTUALIZAR,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(PresuTipoProyectoConstantesFunciones.ISCONAUDITORIADETALLE) {\r\n\t\t\t\t\t\t////PresuTipoProyectoLogic.registrarAuditoriaDetallesPresuTipoProyecto(connexion,presutipoproyecto,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch(Exception e) {\r\n\t\t\tFunciones.manageException(logger,e);\r\n\t\t\tthrow e;\r\n\t\t}\t\t\r\n\t}",
"private void addInstituicao() {\n\n if (txtNome.getText().equals(\"\")) {\n JOptionPane.showMessageDialog(null, \"Campo Nome Invalido\");\n txtNome.grabFocus();\n return;\n } else if (txtNatureza.getText().equals(\"\")) {\n JOptionPane.showMessageDialog(null, \"Campo Natureza Invalido\");\n txtNatureza.grabFocus();\n return;\n }\n if ((instituicao == null) || (instituicaoController == null)) {\n instituicao = new Instituicao();\n instituicaoController = new InstituicaoController();\n }\n instituicao.setNome(txtNome.getText());\n instituicao.setNatureza_administrativa(txtNatureza.getText());\n if (instituicaoController.insereInstituicao(instituicao)) {\n limpaCampos();\n JOptionPane.showMessageDialog(null, \"Instituicao Cadastrada com Sucesso\");\n }\n }",
"private void guardarFoto() {\n if (foto != null && is != null) {\n\n Image foto_Nueva;\n foto_Nueva = foto.getScaledInstance(frmPersona.getLblFoto().getWidth(), frmPersona.getLblFoto().getHeight(), Image.SCALE_SMOOTH);\n frmPersona.getLblFoto().setIcon(new ImageIcon(foto_Nueva));\n cancelarFoto();\n ctrFrmPersona.pasarFoto(is);\n } else {\n JOptionPane.showMessageDialog(vtnWebCam, \"Aun no se a tomado una foto.\");\n }\n\n }",
"private void gravarPromocao() {\n\t\tString nome = textFieldNome.getText();\n\t\tString descricao = textFieldDescricao.getText();\n\t\tboolean ativo = true;\n\n\t\tPromocao promocao = null;\n\n\t\tif (modoEditar) {\n\t\t\tpromocao = promocaoAntiga;\n\n\t\t\tpromocao.setNome(nome);\n\t\t\tpromocao.setDescricao(descricao);\t\t\t\n\t\t\tpromocao.setAtiva(ativo);\n\n\t\t} else {\n\t\t\tpromocao = new Promocao( nome, descricao, ativo);\n\t\t}\n\n\t\ttry {\n\t\t\tif (modoEditar) {\n\t\t\t\tGestorDeDAO.getGestorDeDAO().editarPromocao(promocao);\n\n\t\t\t\tpromocaoPesquisaApp.refreshPromocaoTable();\n\t\t\t\tJOptionPane.showMessageDialog(promocaoPesquisaApp,\n\t\t\t\t\t\t\"Promoção editada com sucesso!\", \"Promoção Editada\",\n\t\t\t\t\t\tJOptionPane.INFORMATION_MESSAGE);\n\t\t\t} else {\n\t\t\t\tGestorDeDAO.getGestorDeDAO().criarPromocao(promocao);\n\t\t\t\tpromocaoPesquisaApp.refreshPromocaoTable();\n\t\t\t\tJOptionPane.showMessageDialog(promocaoPesquisaApp,\n\t\t\t\t\t\t\"Promoção criada com sucesso!\", \"Promoção Criada\",\n\t\t\t\t\t\tJOptionPane.INFORMATION_MESSAGE);\n\t\t\t}\n\n\t\t\tsetVisible(false);\n\t\t\tdispose();\n\n\n\t\t} catch (Exception exc) {\n\t\t\tJOptionPane.showMessageDialog(promocaoPesquisaApp,\n\t\t\t\t\t\"Error a criar a Promoção \" + exc.getMessage(), \"Error\",\n\t\t\t\t\tJOptionPane.ERROR_MESSAGE);\n\t\t}\n\n\t}",
"public void modificar() {\n try {\n if(!fecha.equals(null)){\n Dr_siseg_usuarioBean usuario = new Dr_siseg_usuarioBean();\n FacesContext facesContext = FacesContext.getCurrentInstance();\n usuario = (Dr_siseg_usuarioBean) facesContext.getExternalContext().getSessionMap().get(\"usuario\");\n \n calendar.setTime((Date) this.fecha);\n this.Selected.setApel_fecha_sesion(calendar.getTime());\n\n ApelacionesDao apelacionesDao = new ApelacionesDao();\n apelacionesDao.IME_APELACIONES(2, Selected); \n\n BitacoraSolicitudDao bitacoraSolicitudDao = new BitacoraSolicitudDao();//INSERTA EL MOVIMIENTO EN LA BITACORA\n BitacoraSolicitudBean bitacoraSolicitudBean = new BitacoraSolicitudBean();\n bitacoraSolicitudBean.setBit_sol_id(this.Selected.getApel_sol_numero());\n bitacoraSolicitudBean.setUsuarioBean(usuario);\n bitacoraSolicitudBean.setBit_tipo_movimiento(\"1\");\n bitacoraSolicitudBean.setBit_detalle(\"Fue modificada la apelacion\");\n bitacoraSolicitudDao.dmlDr_regt_bitacora_solicitud(bitacoraSolicitudBean);\n\n this.Listar();\n this.Selected = new ApelacionesBean();\n addMessage(\"Guadado Exitosamente\", 1);\n }else\n {\n addMessage(\"Es requerida la fecha\",1 );\n }\n } catch (ExceptionConnection ex) {\n Logger.getLogger(ApelacionController.class.getName()).log(Level.SEVERE, null, ex);\n addMessage(\"Se produjo un error al insertar el registro, contacte al administrador del sistema\", 1);\n }\n }",
"private void almacenarFallos() {\n BaseDatos bd = new BaseDatos(this);\n// Log.i(\"FALLOS\",\"Nmero de fallos final: \"+fallos);\n bd.updatePalabra(palabraActual.getId(),fallos);\n\n bd.close();\n }",
"private void guardarComo() {\r\n\t\tJFileChooser guardar = new JFileChooser();\r\n\t\tFileNameExtensionFilter filtro = new FileNameExtensionFilter(\"obj\",\"obj\");\r\n\t\tguardar.setFileFilter(filtro);\r\n\t\tif(guardar.showSaveDialog(guardar) == JFileChooser.APPROVE_OPTION){\r\n\t\t\tGestion.setFichero(Gestion.extensionValida(guardar.getSelectedFile()));\r\n\t\t\ttry {\r\n\t\t\t\tif(!Gestion.existe(Gestion.getFichero())){\r\n\t\t\t\t\tGestion.escribir(Gestion.getFichero());\r\n\t\t\t\t\tGestion.setModificado(false);\r\n\t\t\t\t\tfrmLigaDeFtbol.setTitle(Gestion.getFichero().getName());\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tswitch(JOptionPane.showConfirmDialog(null, \"El archivo existe. Desea sobreescribirlo?\", \"Aviso\", JOptionPane.WARNING_MESSAGE)){\r\n\t\t\t\t\tcase JOptionPane.OK_OPTION:\r\n\t\t\t\t\t\tGestion.escribir(Gestion.getFichero());\r\n\t\t\t\t\t\tGestion.setModificado(false);\r\n\t\t\t\t\t\t\t\tfrmLigaDeFtbol.setTitle(Gestion.getFichero().getName());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\t\t\t\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tJOptionPane.showMessageDialog(null, e.getMessage(), \"Error\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void cargarGrafo(Grafo g) {\r\n\t\tg.setAristasCien(aristasCien);\r\n\t\tfor(int i =0;i<aristas.size();i++)\r\n\t\t\tg.addArista(aristas.get(i));\r\n\t\tfor(int i =0;i<cantNodos;i++)\r\n\t\t\tg.addNodo(nodos.get(i));\r\n\t}",
"private void caricaRegistrazione() {\n\t\tfor(MovimentoEP movimentoEP : primaNota.getListaMovimentiEP()){\n\t\t\t\n\t\t\tif(movimentoEP.getRegistrazioneMovFin() == null) { //caso di prime note libere.\n\t\t\t\tthrow new BusinessException(ErroreCore.OPERAZIONE_NON_CONSENTITA.getErrore(\"La prima nota non e' associata ad una registrazione.\"));\n\t\t\t}\n\t\t\t\n\t\t\tthis.registrazioneMovFinDiPartenza = registrazioneMovFinDad.findRegistrazioneMovFinById(movimentoEP.getRegistrazioneMovFin().getUid());\n\t\t\t\n\t\t}\n\t\t\n\t\tif(this.registrazioneMovFinDiPartenza.getMovimento() == null){\n\t\t\tthrow new BusinessException(\"Movimento non caricato.\");\n\t\t}\n\t\t\n\t}",
"public static void registrarAuditoria(Connexion connexion,Long idUsuario,PlantillaFactura plantillafactura,String sUsuarioPC,String sNamePC,String sIPPC)throws Exception {\n\t\t\r\n\t\ttry {\r\n\t\t\tif(PlantillaFacturaConstantesFunciones.ISCONAUDITORIA) {\r\n\t\t\t\tif(plantillafactura.getIsNew()) {\r\n\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,PlantillaFacturaDataAccess.TABLENAME, plantillafactura.getId(), Constantes.SAUDITORIAINSERTAR,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(PlantillaFacturaConstantesFunciones.ISCONAUDITORIADETALLE) {\r\n\t\t\t\t\t\t////PlantillaFacturaLogic.registrarAuditoriaDetallesPlantillaFactura(connexion,plantillafactura,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if(plantillafactura.getIsDeleted()) {\r\n\t\t\t\t\t/*if(!plantillafactura.getIsExpired()) {\r\n\t\t\t\t\t\t////auditoriaLogicAdditional.RegistrarNuevaAuditoria(Constantes.getLOidSistemaActual(),idUsuario,PlantillaFacturaDataAccess.TABLENAME, plantillafactura.getId(), Constantes.getSAuditoriaEliminarLogicamente(),\"\",sUsuarioPC,sNamePC,sIPPC,Timestamp.valueOf(Funciones.getStringMySqlCurrentDateTime()),\"\");\r\n\t\t\t\t\t\t////PlantillaFacturaLogic.registrarAuditoriaDetallesPlantillaFactura(connexion,plantillafactura,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t} else {*/\r\n\t\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,PlantillaFacturaDataAccess.TABLENAME, plantillafactura.getId(), Constantes.SAUDITORIAELIMINARFISICAMENTE,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t//}\r\n\t\t\t\t} else if(plantillafactura.getIsChanged()) {\r\n\t\t\t\t\t////auditoriaLogicAdditional.registrarNuevaAuditoria(Constantes.LIDSISTEMAACTUAL,idUsuario,PlantillaFacturaDataAccess.TABLENAME, plantillafactura.getId(), Constantes.SAUDITORIAACTUALIZAR,\"\",sUsuarioPC,sNamePC,sIPPC,new Date(),\"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(PlantillaFacturaConstantesFunciones.ISCONAUDITORIADETALLE) {\r\n\t\t\t\t\t\t////PlantillaFacturaLogic.registrarAuditoriaDetallesPlantillaFactura(connexion,plantillafactura,auditoriaLogicAdditional.getAuditoria());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch(Exception e) {\r\n\t\t\tFunciones.manageException(logger,e);\r\n\t\t\tthrow e;\r\n\t\t}\t\t\r\n\t}",
"public void HordaHardcodeada() {\n\t\t\n\t\tObjetoDelJuego c = mapa.AgregarEnemigo();\n\t\tlistaDeEnemigos.add( (Enemigo) c );\n\t\t\n\t}",
"public boolean ModificarProducto(int id,String nom,String fab,int cant,int precio,String desc,int sucursal) {\n boolean status=false;\n int res =0;\n try {\n conectar(); \n res=state.executeUpdate(\"update producto set nombreproducto='\"+nom+\"', fabricante='\"+fab+\"',cantidad=\"+cant+\",precio=\"+precio+\",descripcion='\"+desc+\"',idsucursal=\"+sucursal+\" where idproducto=\"+id+\";\");\n if(res>=1)\n {\n status=true;\n }\n con.close();\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n return status;\n }",
"private static void registrarAuditoriaDetallesPresuTipoProyecto(Connexion connexion,PresuTipoProyecto presutipoproyecto)throws Exception {\n\t\t\r\n\t\tString strValorActual=null;\r\n\t\tString strValorNuevo=null;\r\n\t\t\r\n\t\t\t\r\n\t\t\tif(presutipoproyecto.getIsNew()||!presutipoproyecto.getid_empresa().equals(presutipoproyecto.getPresuTipoProyectoOriginal().getid_empresa()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(presutipoproyecto.getPresuTipoProyectoOriginal().getid_empresa()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=presutipoproyecto.getPresuTipoProyectoOriginal().getid_empresa().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(presutipoproyecto.getid_empresa()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=presutipoproyecto.getid_empresa().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),PresuTipoProyectoConstantesFunciones.IDEMPRESA,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(presutipoproyecto.getIsNew()||!presutipoproyecto.getcodigo().equals(presutipoproyecto.getPresuTipoProyectoOriginal().getcodigo()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(presutipoproyecto.getPresuTipoProyectoOriginal().getcodigo()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=presutipoproyecto.getPresuTipoProyectoOriginal().getcodigo();\r\n\t\t\t\t}\r\n\t\t\t\tif(presutipoproyecto.getcodigo()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=presutipoproyecto.getcodigo() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),PresuTipoProyectoConstantesFunciones.CODIGO,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(presutipoproyecto.getIsNew()||!presutipoproyecto.getnombre().equals(presutipoproyecto.getPresuTipoProyectoOriginal().getnombre()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(presutipoproyecto.getPresuTipoProyectoOriginal().getnombre()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=presutipoproyecto.getPresuTipoProyectoOriginal().getnombre();\r\n\t\t\t\t}\r\n\t\t\t\tif(presutipoproyecto.getnombre()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=presutipoproyecto.getnombre() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),PresuTipoProyectoConstantesFunciones.NOMBRE,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t}",
"@Override\n\tpublic void registrarSalida() {\n\t\t\n\t}",
"@Override\n\tpublic void registrarSalida() {\n\t\t\n\t}",
"public void agregarAlFinal(int edad){\n if(!estaVacia()){\n fin.siguiente = new Nodo(edad);\n fin=fin.siguiente;\n }else{\n fin=inicio = new Nodo(edad);\n }\n }",
"private void pruebaGuardado() {\n try {\n BufferedImage img = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB);\n Graphics2D g2d = img.createGraphics();\n g2d.setColor(Color.RED);\n g2d.fillRect(25, 25, 50, 50);\n g2d.dispose();\n ImageIO.write(img, \"JPEG\", new File(\"D:\\\\LeapMotion\\\\foo.jpg\"));\n } catch (IOException ex) {\n Logger.getLogger(Nodo.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"public void uploadPhotoProfile(FileEntryEvent ev){\n\tArrayList<Photo> listePhotos=new ArrayList<Photo>();\r\n\tlistePhotos=mbb.getMembre().getListePhotos();\r\n\tint idPhotoProfile=0;\r\n\t\r\n\tfor(Photo photo : listePhotos)\r\n\t{\r\n\t\tif(photo.getIsProfil())\r\n\t\t\tidPhotoProfile=photo.getId();\r\n\t}\r\n\t\r\n\tint photoProfileSupprime=PhotoManager.deletePhoto(idPhotoProfile);\r\n\tSystem.out.println(photoProfileSupprime);\r\n\tif(photoProfileSupprime>0)\r\n\t{\r\n\t\t\r\n\t//mettre la main sur le fileEntry\r\n\tFileEntry fiE = (FileEntry)ev.getSource();\r\n\t//récupérer ses results\r\n\tFileEntryResults fr = fiE.getResults();\r\n\t\r\n\t// Create an instance of SimpleDateFormat used for formatting \r\n\t\t\t// the string representation of date (month/day/year)\r\n\t\t\tDateFormat df = new SimpleDateFormat(\"ddMMyyyyHHmmss\");\r\n\r\n\t\t\t// Get the date today using Calendar object.\r\n\t\t\tDate today = Calendar.getInstance().getTime(); \r\n\t\t\t// Using DateFormat format method we can create a string \r\n\t\t\t// representation of a date with the defined format.\r\n\t\t\tString reportDate = df.format(today);\r\n\t\t\t\r\n\t\r\n\t//boucler sur les FileInfo\r\n\tfor(FileEntryResults.FileInfo fi: fr.getFiles()){\r\n\t\t//s'assurer que le fichier est enregistrer\r\n\t\tif(fi.isSaved()){\r\n\t\t\tSystem.out.println(\"le nom ========= \"+reportDate+fi.getFileName());\r\n\t\t\t//recu le fichier\r\n\t\t\tFile f = fi.getFile();\r\n\t\t\t\r\n\t\t\t//TODO verifier que c'est le bon type de fichier\r\n\t\t\t//renommer\r\n\t\t\ttry {\r\n\t\t\t\tString cheminApp=FacesContext.getCurrentInstance().getExternalContext().getRealPath(\"/\");\r\n\t\t\t\tString newch=cheminApp;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tboolean ren=f.renameTo(new File(newch+\"photos/\"+reportDate+fi.getFileName()));\r\n\t\t\t\t\r\n\t\t\t\tif (ren) {\r\n\t\t\t\t\tthis.chemin=\"photos/\"+reportDate+fi.getFileName();\r\n\t\t\t\t\tSystem.out.println(newch);\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tSystem.out.println(\"pas possible. \"+newch);\r\n\t\t\t\t}\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\t// TODO: handle exception\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//ajouter un message \r\n\t\t\tFacesContext.getCurrentInstance().addMessage(fiE.getClientId(),new FacesMessage(\"le fichier a été uploadé\"));\r\n\t\t\r\n\t\t\tPhoto photo= new Photo();\r\n\t\t\tphoto.setMemberID(mbb.getMembre().getMembreId());\r\n\t\t\tphoto.setChemin(chemin);\r\n\t\t\tphoto.setIsProfil(true);\r\n\r\n\t\t\tint ajoute=PhotoManager.addPhoto(photo);\r\n\t\t\tSystem.out.println(\"photo profile ajoute\");\r\n\t\t\tif(ajoute>0){\r\n\t\t\t\tmbb.getMembre().setListePhotos(PhotoManager.getPhotosByMemberId(mbb.getMembre().getMembreId()));//maj liste photos\r\n\t\t\t\tArrayList<Photo> photos=new ArrayList<Photo>();\r\n\t\t\t\tphotos=PhotoManager.getProfilPhotosByMemberId(mbb.getMembre().getMembreId());\r\n\t\t\t\tmbb.getMembre().setProfilImagePath(photos.get(0).getChemin()); //maj chemin photo profil\r\n\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t}\t\r\n\t}",
"@Override\n\tpublic void save() {\n\t\t\n\t}",
"@Override\n\tpublic void save() {\n\t\t\n\t}",
"private void createUpdateImage(Item item) throws Exception {\r\n //cria a imagem\r\n new Image().saveImage(item.getImagem(), item.getNome());\r\n \t}",
"private void aggiornamento()\n {\n\t gestoreTasti.aggiornamento();\n\t \n\t /*Se lo stato di gioco esiste eseguiamo il suo aggiornamento.*/\n if(Stato.getStato() != null)\n {\n \t Stato.getStato().aggiornamento();\n }\n }",
"@Override\n\tpublic void registrarSalida() {\n\n\t}",
"private static void registrarAuditoriaDetallesPlantillaFactura(Connexion connexion,PlantillaFactura plantillafactura)throws Exception {\n\t\t\r\n\t\tString strValorActual=null;\r\n\t\tString strValorNuevo=null;\r\n\t\t\r\n\t\t\t\r\n\t\t\tif(plantillafactura.getIsNew()||!plantillafactura.getid_empresa().equals(plantillafactura.getPlantillaFacturaOriginal().getid_empresa()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(plantillafactura.getPlantillaFacturaOriginal().getid_empresa()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=plantillafactura.getPlantillaFacturaOriginal().getid_empresa().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(plantillafactura.getid_empresa()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=plantillafactura.getid_empresa().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),PlantillaFacturaConstantesFunciones.IDEMPRESA,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(plantillafactura.getIsNew()||!plantillafactura.getcodigo().equals(plantillafactura.getPlantillaFacturaOriginal().getcodigo()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(plantillafactura.getPlantillaFacturaOriginal().getcodigo()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=plantillafactura.getPlantillaFacturaOriginal().getcodigo();\r\n\t\t\t\t}\r\n\t\t\t\tif(plantillafactura.getcodigo()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=plantillafactura.getcodigo() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),PlantillaFacturaConstantesFunciones.CODIGO,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(plantillafactura.getIsNew()||!plantillafactura.getnombre().equals(plantillafactura.getPlantillaFacturaOriginal().getnombre()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(plantillafactura.getPlantillaFacturaOriginal().getnombre()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=plantillafactura.getPlantillaFacturaOriginal().getnombre();\r\n\t\t\t\t}\r\n\t\t\t\tif(plantillafactura.getnombre()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=plantillafactura.getnombre() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),PlantillaFacturaConstantesFunciones.NOMBRE,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(plantillafactura.getIsNew()||!plantillafactura.getdescripcion().equals(plantillafactura.getPlantillaFacturaOriginal().getdescripcion()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(plantillafactura.getPlantillaFacturaOriginal().getdescripcion()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=plantillafactura.getPlantillaFacturaOriginal().getdescripcion();\r\n\t\t\t\t}\r\n\t\t\t\tif(plantillafactura.getdescripcion()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=plantillafactura.getdescripcion() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),PlantillaFacturaConstantesFunciones.DESCRIPCION,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(plantillafactura.getIsNew()||!plantillafactura.getes_proveedor().equals(plantillafactura.getPlantillaFacturaOriginal().getes_proveedor()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(plantillafactura.getPlantillaFacturaOriginal().getes_proveedor()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=plantillafactura.getPlantillaFacturaOriginal().getes_proveedor().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(plantillafactura.getes_proveedor()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=plantillafactura.getes_proveedor().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),PlantillaFacturaConstantesFunciones.ESPROVEEDOR,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(plantillafactura.getIsNew()||!plantillafactura.getid_cuenta_contable_aplicada().equals(plantillafactura.getPlantillaFacturaOriginal().getid_cuenta_contable_aplicada()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(plantillafactura.getPlantillaFacturaOriginal().getid_cuenta_contable_aplicada()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=plantillafactura.getPlantillaFacturaOriginal().getid_cuenta_contable_aplicada().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(plantillafactura.getid_cuenta_contable_aplicada()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=plantillafactura.getid_cuenta_contable_aplicada().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),PlantillaFacturaConstantesFunciones.IDCUENTACONTABLEAPLICADA,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(plantillafactura.getIsNew()||!plantillafactura.getid_cuenta_contable_credito_bien().equals(plantillafactura.getPlantillaFacturaOriginal().getid_cuenta_contable_credito_bien()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(plantillafactura.getPlantillaFacturaOriginal().getid_cuenta_contable_credito_bien()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=plantillafactura.getPlantillaFacturaOriginal().getid_cuenta_contable_credito_bien().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(plantillafactura.getid_cuenta_contable_credito_bien()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=plantillafactura.getid_cuenta_contable_credito_bien().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),PlantillaFacturaConstantesFunciones.IDCUENTACONTABLECREDITOBIEN,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(plantillafactura.getIsNew()||!plantillafactura.getid_cuenta_contable_credito_servicio().equals(plantillafactura.getPlantillaFacturaOriginal().getid_cuenta_contable_credito_servicio()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(plantillafactura.getPlantillaFacturaOriginal().getid_cuenta_contable_credito_servicio()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=plantillafactura.getPlantillaFacturaOriginal().getid_cuenta_contable_credito_servicio().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(plantillafactura.getid_cuenta_contable_credito_servicio()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=plantillafactura.getid_cuenta_contable_credito_servicio().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),PlantillaFacturaConstantesFunciones.IDCUENTACONTABLECREDITOSERVICIO,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(plantillafactura.getIsNew()||!plantillafactura.getid_tipo_retencion_fuente_bien().equals(plantillafactura.getPlantillaFacturaOriginal().getid_tipo_retencion_fuente_bien()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(plantillafactura.getPlantillaFacturaOriginal().getid_tipo_retencion_fuente_bien()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=plantillafactura.getPlantillaFacturaOriginal().getid_tipo_retencion_fuente_bien().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(plantillafactura.getid_tipo_retencion_fuente_bien()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=plantillafactura.getid_tipo_retencion_fuente_bien().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),PlantillaFacturaConstantesFunciones.IDTIPORETENCIONFUENTEBIEN,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(plantillafactura.getIsNew()||!plantillafactura.getid_tipo_retencion_fuente_servicio().equals(plantillafactura.getPlantillaFacturaOriginal().getid_tipo_retencion_fuente_servicio()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(plantillafactura.getPlantillaFacturaOriginal().getid_tipo_retencion_fuente_servicio()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=plantillafactura.getPlantillaFacturaOriginal().getid_tipo_retencion_fuente_servicio().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(plantillafactura.getid_tipo_retencion_fuente_servicio()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=plantillafactura.getid_tipo_retencion_fuente_servicio().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),PlantillaFacturaConstantesFunciones.IDTIPORETENCIONFUENTESERVICIO,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(plantillafactura.getIsNew()||!plantillafactura.getid_tipo_retencion_iva_bien().equals(plantillafactura.getPlantillaFacturaOriginal().getid_tipo_retencion_iva_bien()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(plantillafactura.getPlantillaFacturaOriginal().getid_tipo_retencion_iva_bien()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=plantillafactura.getPlantillaFacturaOriginal().getid_tipo_retencion_iva_bien().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(plantillafactura.getid_tipo_retencion_iva_bien()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=plantillafactura.getid_tipo_retencion_iva_bien().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),PlantillaFacturaConstantesFunciones.IDTIPORETENCIONIVABIEN,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(plantillafactura.getIsNew()||!plantillafactura.getid_tipo_retencion_iva_servicio().equals(plantillafactura.getPlantillaFacturaOriginal().getid_tipo_retencion_iva_servicio()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(plantillafactura.getPlantillaFacturaOriginal().getid_tipo_retencion_iva_servicio()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=plantillafactura.getPlantillaFacturaOriginal().getid_tipo_retencion_iva_servicio().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(plantillafactura.getid_tipo_retencion_iva_servicio()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=plantillafactura.getid_tipo_retencion_iva_servicio().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),PlantillaFacturaConstantesFunciones.IDTIPORETENCIONIVASERVICIO,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tif(plantillafactura.getIsNew()||!plantillafactura.getid_cuenta_contable_gasto().equals(plantillafactura.getPlantillaFacturaOriginal().getid_cuenta_contable_gasto()))\r\n\t\t\t{\r\n\t\t\t\tstrValorActual=null;\r\n\t\t\t\tstrValorNuevo=null;\r\n\r\n\t\t\t\tif(plantillafactura.getPlantillaFacturaOriginal().getid_cuenta_contable_gasto()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorActual=plantillafactura.getPlantillaFacturaOriginal().getid_cuenta_contable_gasto().toString();\r\n\t\t\t\t}\r\n\t\t\t\tif(plantillafactura.getid_cuenta_contable_gasto()!=null)\r\n\t\t\t\t{\r\n\t\t\t\t\tstrValorNuevo=plantillafactura.getid_cuenta_contable_gasto().toString() ;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t////auditoriaDetalleLogicAdditional.registrarNuevaAuditoriaDetalle(auditoriaObj.getId(),PlantillaFacturaConstantesFunciones.IDCUENTACONTABLEGASTO,strValorActual,strValorNuevo);\r\n\t\t\t}\t\r\n\t}",
"private void agregarFantasma(Fantasma fantasma) {\n // TODO implement here\n }",
"@Override\n public void save() {\n \n }",
"private void modi() { \n try {\n cvo.getId_cliente();\n cvo.setNombre_cliente(vista.txtNombre.getText());\n cvo.setApellido_cliente(vista.txtApellido.getText());\n cvo.setDireccion_cliente(vista.txtDireccion.getText());\n cvo.setCorreo_cliente(vista.txtCorreo.getText());\n cvo.setClave_cliente(vista.txtClave.getText());\n cdao.actualizar(cvo);\n vista.txtNombre.setText(\"\");\n vista.txtApellido.setText(\"\");\n vista.txtDireccion.setText(\"\");\n vista.txtCorreo.setText(\"\");\n vista.txtClave.setText(\"\");\n JOptionPane.showMessageDialog(null, \"Registro Modificado\");\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"Debe ingresar Datos para Modificar registro!\");\n }\n }",
"void actualizar(Espacio espacio);",
"public void salvaAula()\n { \n JFileChooser fileChooser = new JFileChooser();\n String strFilePlan = \"out/\" + this.myAula.getNome()+ \"_plan\"+ \".png\";\n System.out.println(\"scrivo su file \"+ strFilePlan);\n File fp = new File(strFilePlan);\n String strFileDati = \"out/\" + this.myAula.getNome()+ \"_dati\"+ \".png\";\n File fd = new File(strFileDati);\n fileChooser.setSelectedFile(fd);\n try\n { \n ImageIO.write(this.getPlan(), \"png\", fp);\n ImageIO.write(this.getDati(), \"png\", fd);\n }\n catch (Exception ex)\n {\n System.out.println(\"errore in Salvataggio aula su file\");\n }\n \n JOptionPane.showMessageDialog(this, \"file salvati correttamente sotto cartella /out\",\"Info\", JOptionPane.INFORMATION_MESSAGE);\n }",
"@Override\r\n\tpublic void atualizar(Aluno pAluno) {\r\n\t}",
"void alterar(Entidade entidade);",
"@Override\r\n\tpublic void save() {\n\r\n\t}",
"@Override\r\n\tpublic void save() {\n\r\n\t}",
"private void remplirFabricantData() {\n\t}",
"@Override\r\n\tpublic boolean update(Amigo amigo) {\n\t\treturn false;\r\n\t}",
"@Override\n public void edit(ReporteAccidente rep) {\n repr.save(rep);\n }",
"public void incluirImovel() {\n\r\n\t\t@SuppressWarnings(\"resource\")\r\n\t\tScanner insere = new Scanner(System.in);\r\n\r\n\t\tSystem.out.println(\"Insira o endereço:(EX:Rua tal, 49)\");\r\n\t\tsetEndereco(insere.next());\r\n\r\n\t\tSystem.out.println(\"Insira a AREA do Imovel:(EX:M²)\");\r\n\t\tsetTamanhoImovel(insere.next());\r\n\r\n\t\tSystem.out.println(\"Insira o numero de comodos do Imovel:(EX:4)\");\r\n\t\tsetNumeroDeComodos(insere.next());\r\n\r\n\t\tSystem.out.println(\"Insira o valor do Imovel:(EX:10000)\");\r\n\t\tsetValorImovel(insere.nextInt());\r\n\r\n\t\tSystem.out.println(\"Insira o tipo de Imovel:(EX:casa,apartamento..)\");\r\n\t\tsetTipo(insere.next());\r\n\r\n\t\tSystem.out.println(\"Insira o status do Imovel:(EX:vender,alugar)\");\r\n\t\tsetStatus(insere.next());\r\n\r\n\t\tSystem.out.println(\"++++++++++++++++++++++++++++++++++++++++++\");\r\n\t\tSystem.out.println(\" Sucesso! Seu cadastro esta completo.\");\r\n\t\tSystem.out.println(\"++++++++++++++++++++++++++++++++++++++++++\");\r\n\t\t\r\n\t\tLerBanco ler = new LerBanco();\r\n\t\tMap<Integer, Imovel> listaImovel = new HashMap<Integer, Imovel>();\r\n\t\tList<Imovel>lImovel = new ArrayList<Imovel>();\r\n\t\t\r\n\t\tler.leituraImovel(listaImovel);\r\n\t\tsetCod(lImovel.size());\r\n\t\t\r\n\n\r\n\t\tGravaTxt gravaArq = new GravaTxt();\r\n\r\n\t\tgravaArq.grava(\"Imoveis.txt\", toString());\r\n\r\n\t}",
"@Override\n public void save()\n {\n \n }",
"public void addDicas(){\n\t\tMetaDica metaDicaOac = new MetaDica(oac, \"user1\", \"Não falte as aulas, toda aula tem ponto extra!\");\n\t\tmetaDicaOac.setConcordancias(5);\n\t\tdao.persist(metaDicaOac);\n\n\t\tdicaExerciciosOac = new DicaConselho(\"Os exercicios extras valem muitos pontos, nao deixe de fazer\");\n\t\tdicaExerciciosOac.setTema(temaOacExercicios);\n\t\ttemaOacExercicios.setDisciplina(oac);\n\t\tdicaExerciciosOac.setUser(\"user5\");\n\t\tdicaExerciciosOac.addUsuarioQueVotou(\"user1\");\n\t\tdicaExerciciosOac.addUsuarioQueVotou(\"user2\");\n\n\t\t//adiciona pontos a dica\n\t\tfor (int i = 0; i < 20;i++){\n\t\t\tdicaExerciciosOac.incrementaConcordancias();\n\t\t}\n\t\tfor (int i = 0; i < 5;i++){\n\t\t\tdicaExerciciosOac.incrementaDiscordancias();\n\t\t}\n\n\t\t//adiciona pontos a dica\n\t\tfor (int i = 0; i < 5;i++){\n\t\t\tdicaExerciciosOac.incrementaConcordancias();\n\t\t}\n\t\tfor (int i = 0; i < 25;i++){\n\t\t\tdicaExerciciosOac.incrementaDiscordancias();\n\t\t}\n\t\tdao.persist(dicaExerciciosOac);\n\n\t\tdicaRevisaoIcOac = new DicaAssunto(\"Antes das aulas faça uma boa revisao de IC\");\n\t\ttemaOacRevisaoIC.setDisciplina(oac);\n\t\tdicaRevisaoIcOac.setTema(temaOacRevisaoIC);\n\t\tdicaRevisaoIcOac.setUser(\"user4\");\n\t\tdicaRevisaoIcOac.addUsuarioQueVotou(\"user5\");\n\t\tdicaRevisaoIcOac.addUsuarioQueVotou(\"user1\");\n\t\tdicaRevisaoIcOac.incrementaConcordancias();\n\t\tdicaRevisaoIcOac.incrementaConcordancias();\n\n\t\t//cria meta dica em si\n\t\tMetaDica metaDicaSi1 = new MetaDica(si1, \"user2\", \"Seja autodidata! Procure por cursos online\");\n\t\tdao.persist(metaDicaSi1);\n\n\t\tdicaLabSi = new DicaConselho(\"Faça todo os labs, não deixe acumular\");\n\t\ttemaMinitestesSi.setDisciplina(si1);\n\t\tdicaLabSi.setTema(temaMinitestesSi);\n\t\tdicaLabSi.setUser(\"user1\");\n\t\tdicaLabSi.addUsuarioQueVotou(\"user2\");\n\t\tdicaLabSi.addUsuarioQueVotou(\"user3\");\n\t\tdicaLabSi.incrementaConcordancias();\n\t\tdicaLabSi.incrementaConcordancias();\n\t\tdao.persist(dicaLabSi);\n\n\t\tdicaPlaySi = new DicaConselho(\"Comece a configurar o Play no primeiro dia de aula, pois dá muuuito trabalho\");\n\t\ttemaPlaySi.setDisciplina(si1);\n\t\tdicaPlaySi.setTema(temaPlaySi);\n\t\tdicaPlaySi.setUser(\"user2\");\n\t\tdicaPlaySi.addUsuarioQueVotou(\"user5\");\n\t\tdicaPlaySi.addUsuarioQueVotou(\"user4\");\n\t\tdicaPlaySi.incrementaConcordancias();\n\t\tdicaPlaySi.incrementaConcordancias();\n\t\tdao.persist(dicaPlaySi);\n\n\t\tdicaMaterialSi = new DicaMaterial(\"http://www.wthreex.com/rup/process/workflow/ana_desi/co_swarch.htm\");\n\t\ttemaMaterialSi.setDisciplina(si1);\n\t\tdicaMaterialSi.setTema(temaMaterialSi);\n\t\tdicaMaterialSi.setUser(\"user2\");\n\t\tdicaMaterialSi.addUsuarioQueVotou(\"user5\");\n\t\tdicaMaterialSi.addUsuarioQueVotou(\"user4\");\n\t\tdicaMaterialSi.incrementaConcordancias();\n\t\tdicaMaterialSi.incrementaConcordancias();\n\t\tdao.persist(dicaMaterialSi);\n\n\n\t\t//cria meta dica logica\n\t\tMetaDica metaDicaLogica = new MetaDica(logica, \"user3\", \"Copie para o seu caderno tudo que o professor copiar no quadro, TUDO!\");\n\t\tdao.persist(metaDicaLogica);\n\n\t\tdicaListasLogica = new DicaConselho(\"Faça todas as listas possíveis\");\n\t\ttemaListasLogica.setDisciplina(logica);\n\t\tdicaListasLogica.setTema(temaListasLogica);\n\t\tdicaListasLogica.setTema(temaListasLogica);\n\t\tdicaListasLogica.setUser(\"user6\");\n\t\tdicaListasLogica.addUsuarioQueVotou(\"user3\");\n\t\tdicaListasLogica.addUsuarioQueVotou(\"user5\");\n\t\tdicaListasLogica.incrementaConcordancias();\n\t\tdicaListasLogica.incrementaConcordancias();\n\t\tdao.persist(dicaListasLogica);\n\n\t\tdicaProjetoLogica = new DicaAssunto(\"Peça ajuda ao monitor responsável por seu grupo, começe o projeto assim que for lançado!\");\n\t\ttemaProjetoLogica.setDisciplina(logica);\n\t\tdicaProjetoLogica.setTema(temaProjetoLogica);\n\t\tdicaProjetoLogica.setTema(temaProjetoLogica);\n\t\tdicaProjetoLogica.setUser(\"user4\");\n\t\tdicaProjetoLogica.addUsuarioQueVotou(\"user1\");\n\t\tdicaProjetoLogica.addUsuarioQueVotou(\"user2\");\n\t\tdicaProjetoLogica.incrementaConcordancias();\n\t\tdicaProjetoLogica.incrementaConcordancias();\n\t\tdao.persist(dicaProjetoLogica);\n\n\t\tdao.flush();\n\n\t}",
"public void save() {\t\n\t\n\t\n\t}",
"public void adicionarServicos() {\n int i;\n if (hospedesCadastrados.isEmpty()) {\n System.err.println(\"Não existem hospedes cadastrados!\\n\");\n } else {\n\n System.err.println(\"Digite o cpf do hospede que deseja adicionar servicos:\");\n listarHospedes();\n int cpf = verifica();\n for (i = 0; i < hospedesCadastrados.size(); i++) {\n if (hospedesCadastrados.get(i).getCpf() == cpf) {//pega o indice i do objeo pessoa, pega o id da pessoa e compara com o id da pessoa digitada\n if (hospedesCadastrados.get(i).getContrato().isSituacao()) {//verifica se a situaçao do contrato ainda está aberta para esse hospede\n\n System.err.println(\"O que deseja editar do contrato\\n\");\n //adicionar carro, trocar de quarto, adicionar conta de restaurante,\n //encerrar contrato\n\n System.err.println(\"Adicionar carro (1):\\nAdicionar restaurante (2):\\n\"\n + \"Adicionar horas de BabySitter (3):\\nAdicionar quarto(4):\\n\");\n int caso = verifica();\n switch (caso) {\n case 1://carro\n if (carrosCadastrados.isEmpty()) {\n System.err.println(\"Nao existem carros cadastrados!\\n\");\n } else {\n listarCarros();\n System.err.println(\"Digite o id do carro que deseja contratar:\\n\");\n int idCarro = verifica();\n\n for (int j = 0; j < carrosCadastrados.size(); j++) {\n if (carrosCadastrados.get(j).getId() == idCarro) {\n if (carrosCadastrados.get(j).isEstado()) {\n System.err.println(\"Esse carro já está cadastrado.\\n\");\n } else {\n hospedesCadastrados.get(i).getContrato().setCarros(carrosCadastrados.get(j));\n carrosCadastrados.get(j).setEstado(true);\n }\n }\n }\n }\n break;\n\n case 2://restaurante\n System.err.println(\"Digite o quanto deseja gastar no restaurente\\n\");\n double valorRestaurante = ler.nextDouble();\n// idd();\n// int idRestaurante = id;\n// Restaurante restaurante = new Restaurante(idRestaurante, valorRestaurante);\n hospedesCadastrados.get(i).getContrato().setValorRestaurante(valorRestaurante);\n break;\n case 3://babysitter\n System.err.println(\"Digite o tempo gasto no BabySytter em horas\\n\");\n double tempoBaby = ler.nextDouble();\n hospedesCadastrados.get(i).getContrato().setHorasBaby(tempoBaby);\n break;\n case 4://quartos\n\n if (quartosCadastrados.isEmpty()) {\n\n } else {\n System.err.println(\"Digite o numero do quarto que deseja contratar:\\n\");\n listarQuartos();\n int num = verifica();\n System.err.println(\"Digite a quantidade de dis que pretente alugar o quarto:\\n\");\n int dias = verifica();\n for (int j = 0; j < quartosCadastrados.size(); j++) {\n if (num == quartosCadastrados.get(j).getNumero()) {//verifica se o numero digitado é igual ao numero do quarto do laco\n if (quartosCadastrados.get(j).getEstado()) {//verifica se o estado do quarto está como true\n System.err.println(\"Este quarto já está cadastrado em um contrato\");\n } else {//se o estado tiver em true é porque o quarto ja está cadastrado\n\n hospedesCadastrados.get(i).getContrato().setQuartos(quartosCadastrados.get(j));\n hospedesCadastrados.get(i).getContrato().getQuartosCadastrados().get(j).setDias(dias);\n hospedesCadastrados.get(i).getContrato().getQuartosCadastrados().get(j).setEstado(true);//seta o estado do quarto como ocupado\n System.err.println(\"Quarto cadastrado!\\n\");\n }\n\n }\n\n }\n\n//remove all remove todas as pessoas com tal nome\t\n }\n break;\n\n }\n } else {\n System.err.println(\"O contrato deste Hospede encontra-se encerrado\");\n break;\n }\n }\n }\n }\n }"
]
| [
"0.6281077",
"0.61700016",
"0.59413916",
"0.58737177",
"0.58518046",
"0.57698643",
"0.5760024",
"0.5756049",
"0.57515836",
"0.5729564",
"0.57272905",
"0.56994873",
"0.56740624",
"0.5673557",
"0.5671709",
"0.5622439",
"0.5588696",
"0.5584258",
"0.5581134",
"0.5569549",
"0.55676526",
"0.5556232",
"0.5547739",
"0.5547545",
"0.55396605",
"0.55385244",
"0.55325985",
"0.553245",
"0.5530054",
"0.5507799",
"0.55040634",
"0.5503352",
"0.5502891",
"0.5487446",
"0.5485352",
"0.54789597",
"0.5477728",
"0.5474874",
"0.5470928",
"0.5469618",
"0.5467988",
"0.5462008",
"0.5457401",
"0.54483485",
"0.544494",
"0.5425513",
"0.5421669",
"0.5418577",
"0.5409661",
"0.53997916",
"0.5391627",
"0.5390624",
"0.5387259",
"0.53859824",
"0.53849804",
"0.538433",
"0.53805816",
"0.53754425",
"0.5371583",
"0.5371063",
"0.5363596",
"0.5362157",
"0.53608084",
"0.5360062",
"0.5342925",
"0.53406835",
"0.5336558",
"0.53352535",
"0.5321832",
"0.5320693",
"0.53173435",
"0.5316533",
"0.5314753",
"0.53125733",
"0.53125733",
"0.53123266",
"0.5311364",
"0.53088725",
"0.53031236",
"0.53031236",
"0.53024405",
"0.529737",
"0.529139",
"0.5276087",
"0.52751297",
"0.52530587",
"0.52506804",
"0.52474487",
"0.52452487",
"0.5242549",
"0.52391654",
"0.52385205",
"0.52385205",
"0.5232363",
"0.52321404",
"0.5231789",
"0.5231658",
"0.52289355",
"0.5223745",
"0.5222948",
"0.5222084"
]
| 0.0 | -1 |
Insertion: You are given two 32bit numbers, N and M, and two bit positions, i and j. Write a method to insert M into N such that M starts at bit j and ends at bit i. You can assume that the bits j through i have enough space to fit all of M. That is, if M = 10011, you can assume that there are at least 5 bits between j and i. You would not, for example, have j = 3 and i = 2, because M could not fully fit between bit 3 and bit 2. EXAMPLE Input: N = 10000000000j M = 10011, i = 2, j = 6 Output: N = 10001001100 | public int insertion(int M, int N, int i, int j) {
for (int k = 0; k < j - i; k++) {
M &= ~(1 << k + i);
}
N = N << i;
return M | N;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static int insert(int M, int N, int i, int j) {\n\t\tint a = (-1) << j;\n\t\tint b = (-1) >>> (32 - i);\n\t\tint mask = a | b;\n\t\tN = N & mask;\n\t\tM = M << i;\n\t\treturn N | M;\n\t}",
"public static int updateBits(int n, int m, int i, int j) {\n\t\tint allOnes = ~0;\r\n\t\tSystem.out.println(\"allOnes: \" +AssortedMethods.toFullBinaryString( allOnes));\r\n\t\t//shift left allOnes j+1 times make all ones from j+1 to the end\r\n\t\t// if the time shift equals 32 result will be 32 bits 0s;\r\n\t\tint left = j < 31 ? allOnes << (j + 1) : 0;\r\n\t\tSystem.out.println(\"left: \" + AssortedMethods.toFullBinaryString(left));\r\n\t\t// shift 1 i times left make 1000000000, then minus 1 make first bit to i-1 bit to be 1111111;\r\n\t\tint right = ((1 << i) - 1);\r\n\t\tSystem.out.println(\"right: \" + AssortedMethods.toFullBinaryString(right));\r\n\t\t// combine left and right to be 1111110000000111111111\r\n\t\tint mask = left | right;\r\n\t\tSystem.out.println(\"mask: \" + AssortedMethods.toFullBinaryString(mask));\r\n\t\t// make int n from i to j to be 0s by and then together to make the mask\r\n\t\tint nWith0s = n & mask;\r\n\t\tSystem.out.println(\"nWith0s: \" + AssortedMethods.toFullBinaryString(nWith0s));\t\r\n\t\t// left shift m j times to make it match with the j to i empty position\r\n\t\tint mShifted = m << i;\r\n\t\tSystem.out.println(\"mShifted: \" + AssortedMethods.toFullBinaryString(mShifted));\r\n\t\t// insert m into n by or them together\r\n\t\treturn mShifted | nWith0s;\r\n\t}",
"public static void main(String[] args) {\n\t\t//create test data\n\t\tint n = ~23423;\n\t\tSystem.out.println(\"N: \"+toFullBinaryString(n));\n\t\tint m = 5;\n\t\tSystem.out.println(\"M: \"+Integer.toBinaryString(m));\n\t\tint i = 1;\n\t\tint j = 3;\t\n\t\tSystem.out.println(\"i:\"+i+\" j:\"+j);\n\t\tint c = insertBits(n, m, i, j);\n\t\t//output results\n\t\tSystem.out.println(\"Result: \"+toFullBinaryString(c));\n\t}",
"public static int updateBits(int n, int m, int i, int j) {\n int max = ~0; /* All 1’s */\n\n // 1’s through position j, then 0’s\n int left = max - ((1 << j) - 1);\n\n // 1’s after position i\n int right = ((1 << i) - 1);\n\n // 1’s, with 0s between i and j\n int mask = left | right;\n\n // Clear i through j, then put m in there\n return (n & mask) | (m << i);\n }",
"void insert(int insertSize);",
"private static void insertion(int[] a){\n int size = a.length;\n int key = 0;\n \n for(int i = 1; i < size; i++){\n key = a[i];\n for(int j = i-1; j >= 0 && key < a[j]; j--){\n a[j+1] = a[j];\n a[j] = key;\n }\n }\n }",
"public static int updateBits(int n, int m, int i, int j){\n\n\t\t// all '1's\n\t\tint max = ~0;\n\n\t\t// left with '1'\n\t\tint left = max - ((1<<j) -1);\n\n\t\t// right with '1'\n\t\tint right = ((1<<i) - 1);\n\n\t\t// left with '1', middle '0', and right '1'\n\t\tint mask = left | right;\n\n\t\t// clear up the middle\n\t\treturn (n & mask) | (m << i);\n\t}",
"public static void merge(int[] nums1, int m, int[] nums2, int n) {\n for (int i = 0; i < m; i++) {\n nums1[m + n - 1 - i] = nums1[m - 1 - i];\n }\n\n int index = 0;\n int indexNum1 = n;\n int indexNum2 = 0;\n\n while (indexNum2 < n) {\n // if empty num1, insert all num2\n if (indexNum1 == m + n) {\n while (indexNum2 < n) {\n nums1[index++] = nums2[indexNum2++];\n }\n\n return;\n }\n\n if (nums1[indexNum1] <= nums2[indexNum2]) {\n nums1[index] = nums1[indexNum1++];\n } else {\n nums1[index] = nums2[indexNum2++];\n\n }\n index++;\n }\n }",
"public void insert( int x) \r\n {\r\n h[++N] = x;\r\n siftUp( N);\r\n }",
"public static void insertion()\r\n\t{\n\t\tLinkedList<Integer> list = new LinkedList<Integer>();\r\n\t\tint temp, j;\r\n\t\tlist.add(numbers[0]);\r\n\t\tfor(int i = 1; i < n; i++)\r\n\t\t{\r\n\t\t\ttemp = numbers[i];\r\n\t\t\tj = i - 1;\r\n\t\t\twhile(j > -1 && temp < list.get(j))\r\n\t\t\t{\r\n\t\t\t\tj--;\r\n\t\t\t}\r\n\t\t\tlist.add(j + 1, temp);\r\n\t\t}\r\n\t\tprint(list.stream().mapToInt(i->i).toArray());\r\n\t}",
"public boolean insert(int val) {\n if(!map.containsKey(val)){\n if(validLength == set.size()){\n set.add(val);\n map.put(val, validLength++);\n }\n else{\n map.put(val, validLength);\n set.set(validLength++, val);\n }\n return true;\n }\n else{\n return false;\n }\n }",
"static int[][] packD(int n, int[] from, int[] to, int max) {\n /* This part of code is picked up from \"uwi\" previous submission */\n int[][] g = new int[n][];\n int[] p = new int[n];\n for (int i = 0; i < max; i++) p[from[i]]++;\n for (int i = 0; i < n; i++)\n g[i] = new int[p[i]];\n for (int i = 0; i < max; i++) {\n g[from[i]][--p[from[i]]] = to[i];\n }\n return g;\n }",
"public int insert(int data, int a1, int b1, int a2, int b2)\n {\n\n boolean inserted = false;\n int position;\n int currentValue;\n int moves = 0;\n resized = false;\n currentHash = 1;\n\n if(data == 0)\n return -1; // invalid value\n\n if(contains(data))\n return -1;\n\n // Check if threshold would be reached\n if((numElements+1.0)/(2.0*n) >= threshold)\n {\n resize(a1,b1,a2,b2);\n resized = true;\n }\n\n elements.add(data);\n\n while(!inserted)\n {\n position = doHash(data);\n currentValue = getArrayValue(position);\n if(currentValue == 0)\n {\n setArrayValue(position, data);\n inserted = true;\n numElements++;\n }\n else\n {\n setArrayValue(position,data);\n data = currentValue;\n switchHashAndArray();\n moves += 1;\n }\n if(moves >= chainLength)\n {\n resize(a1, b1, a2, b2);\n resized = true;\n moves = 0;\n }\n \n }\n return data;\n\n }",
"public void merge(int[] nums1, int m, int[] nums2, int n) {\n\n\n int i = m-1,j=n-1;\n int k=m+n-1;\n\n while(i>=0 && j>=0){\n if(nums1[i]>nums2[j]){\n nums1[k] = nums1[i];\n i--;\n } else{\n nums1[k]=nums2[j];\n j--;\n }\n k--;\n }\n while(j>=0){\n nums1[k]=nums2[j];\n k--;\n j--;\n }\n }",
"public int updateBits(int n, int m, int i, int j) {\n int clearMask = 0;\n if(j < 31){\n int allones = ~0;\n int left = allones << (j+1);\n int right = (1 << i) -1;\n clearMask = left | right;\n }else{\n clearMask = (1 << i)-1;\n }\n \n int clearedn = clearMask&n;\n int longerM = m << i;\n return clearedn | longerM;\n }",
"public void merge(int[] nums1, int m, int[] nums2, int n) {\n int p1 = m-1;\n\tint p2 = n-1;\n\tint p = m+n-1;\n\n\twhile(p >= 0){\n\t\tint v1 = p1 >= 0 ? nums1[p1] : Integer.MIN_VALUE;\n\t\tint v2 = p2 >= 0 ? nums2[p2] : Integer.MIN_VALUE;\n\n\t\tif(v1 >= v2){\n\t\t\tnums1[p] = v1;\n\t\t\tp1--;\n\t\t}else{\n\t\t\tnums1[p] = v2;\n\t\t\tp2--;\n\t\t}\n\t\tp--;\n\t}\n }",
"public int rangeBitwiseAnd2(int m, int n) {\n if (m == n){\n return m;\n }\n //The highest bit of 1 in diff is the highest changed bit.\n int diff = m ^ n;\n //Index is the index of the highest changed bit. Starting at 1.\n int index = (int)(Math.log(diff) / Math.log(2)) + 1;\n //Eliminate the changed part.\n m = m & (0xffffffff<<index);\n return m;\n }",
"public void insertLeft( long j ) {\n if ( start == 0 ) {\n start = max;\n }\n Array[--start] = j;\n nItems++;\n }",
"void insert(int idx, int val);",
"public static void main(String[] args) {\n\t\tint x = ~0;\r\n\t\tSystem.out.println(Integer.toBinaryString(x));\r\n\t\tint y = x>>>8;\r\n\t\tSystem.out.println(Integer.toBinaryString(y));\r\n\t\tSystem.out.println(x+\" \"+y);\r\n\t\t\r\n\t\tint N = 1<<31;\r\n\t\tint M = 0b11;\r\n\t\tint j=2;\r\n\t\tint i=1;\r\n\t\tSystem.out.println(Integer.toBinaryString(N));\r\n\t\tSystem.out.println(Integer.toBinaryString(M));\r\n\t\tSystem.out.println(Integer.toBinaryString(insertMIntoNFromJtoI(M, N, j, i)));\r\n\t\t\r\n\t}",
"private static void insertionSort(int[] array, int n) {\n \t\n \tfor (int index = 1; index < n; index++) {\n \t\tint temp = array[index];\n \t\tint j = index;\n\n\t\t\tint finalPosition = binarySearch(array, temp, 0, j - 1);\n\n \t\twhile (j > finalPosition) {\n \t\t\tarray[j] = array[j - 1];\n \t\t\tj -= 1;\n \t\t}\n \t\tarray[j] = temp;\n \t}\n }",
"public void merge2(int[] nums1, int m, int[] nums2, int n) {\n int p1 = m - 1;\n int p2 = n - 1;\n // set pointer for nums1\n int p = m + n - 1;\n\n // while there are still elements to compare\n while ((p1 >= 0) && (p2 >= 0))\n // compare two elements from nums1 and nums2\n // and add the largest one in nums1\n nums1[p--] = (nums1[p1] < nums2[p2]) ? nums2[p2--] : nums1[p1--];\n\n // add missing elements from nums2\n System.arraycopy(nums2, 0, nums1, 0, p2 + 1);\n\n }",
"public void insertRight( long j ) {\n if ( end == max - 1 ) {\n end = -1;\n }\n Array[++end] = j;\n nItems++;\n }",
"public static void insertSort(int[] a, int n){\n // 插入排序,把数组分为已排序区和未排序区,依次把未排序中的元素插入的已排序中\n\n for (int i = 1; i < n ; ++i){\n // 遍历已排序区,找到已排序中符合要求的位置\n // value 待插入的数据\n int value = a[i];\n // j = 已排序的区间索引前一位\n int j = i-1;\n for (;j>=0;--j){\n\n // System.out.printf(\"\\n[%s : %s]\", Arrays.stream(a).boxed().collect(Collectors.toList()).subList(0,i).toString(),Arrays.stream(a).boxed().collect(Collectors.toList()).subList(i,n).toString());\n if (a[j] > value){\n // 大于待插入的数据的都自觉往后移动一位\n a[j+1] = a[j];\n move++;\n }else {\n // 中止 当前j为目标位置\n break;\n }\n }\n a[j+1] = value;\n }\n }",
"public void insert(int i) {\n\t\tif (top > -2 && top < size - 1) {\n\t\t\ttop += 1;\n\t\t\tarr[top] = i;\n\t\t} else if (top == size - 1) {\n\t\t\tsize *= 2;\n\t\t\ttop += 1;\n\t\t\tarr = Arrays.copyOf(arr, size);\n\t\t\tarr[top] = i;\n\t\t}\n\t}",
"public boolean insert(int val) {\n if (realSet.contains(val)) return false;\n if (size == allSet.length) {\n Integer[] tmpSet = new Integer[size * 2];\n int not = 0;\n for (int i = 0; i < size; i ++) {\n if (allSet[i] == null) {\n not ++;\n continue;\n }\n tmpSet[i - not] = allSet[i];\n }\n size -= not;\n allSet = tmpSet;\n }\n realSet.add(val);\n allSet[size] = val;\n size ++;\n return true;\n\n }",
"public int insert(int data)\n {\n boolean inserted = false;\n int position;\n int currentValue;\n int moves = 0;\n resized = false;\n currentHash = 1;\n\n if(data == 0)\n return -1; // invalid value\n\n if(contains(data))\n return -1;\n\n // Check if threshold would be reached\n if((numElements+1.0)/(2.0*n) >= threshold)\n {\n resize();\n resized = true;\n }\n\n elements.add(data);\n\n while(!inserted)\n {\n position = doHash(data);\n currentValue = getArrayValue(position);\n if(currentValue == 0)\n {\n setArrayValue(position, data);\n inserted = true;\n numElements++;\n }\n else\n {\n setArrayValue(position,data);\n data = currentValue;\n switchHashAndArray();\n moves += 1;\n }\n if(moves >= chainLength)\n {\n resize();\n resized = true;\n moves = 0;\n }\n\n }\n\n return data;\n\n }",
"void InsertionSort(int a[])\n {\n int i,j;\n\n for( j=1;j<a.length;j++)\n {\n int key =a[j];\n i=j-1;\n\n\n while(i>=0 && a[i]>key)\n {\n a[i+1]=a[i];\n i=i-1;\n }\n a[i+1]=key;\n\n }\n\n }",
"public static String updateBits(String n, String m, int i, int j) {\n\t\tint max = ~0;\n\t\tint nDeci = Integer.parseInt(n, 2);\n\t\tint mDeci = Integer.parseInt(m, 2);\n\t\tif (n.length() <= j || j < 0 || i < 0) {\n\t\t\t// Invalid i or j.\n\t\t\treturn \"0\";\n\t\t}\n\t\tint left = max - ((1 << j) - 1);\n\t\tint right = ((1 << i) - 1);\n\t\tint mask = left | right; // 111111100000011.\n\t\tSystem.out.println(String.format(\"left: %s\\nright: %s\\nmast: %s\", \n\t\t\t\t\t\t Integer.toBinaryString(max - ((1 << j) - 1)),\n\t\t\t\t\t\t Integer.toBinaryString((1 << i) - 1),\n\t\t\t\t\t\t Integer.toBinaryString(mask)));\n\t\treturn Integer.toBinaryString((nDeci & mask) | (mDeci << i));\n\t}",
"private boolean insertSort(Process processToInsert, int leftBound, int rightBound)\n {\n\n int midpoint = (rightBound+leftBound)/2;\n Process processAtMidpoint = readyQueue.get(midpoint);\n\n int compareResult = compare(processToInsert, processAtMidpoint);\n if(compareResult < 0)\n {\n if(leftBound == rightBound) {\n readyQueue.add(leftBound, processToInsert);\n return true;\n }\n return insertSort(processToInsert, leftBound, midpoint);\n }\n else if(compareResult > 0)\n {\n if(leftBound == rightBound) {\n readyQueue.add(leftBound+1, processToInsert);\n return true;\n }\n return insertSort(processToInsert, midpoint+1, rightBound);\n }\n else\n {\n readyQueue.add(midpoint+1, processToInsert);\n return true;\n }\n\n }",
"private static int setBits(int n) {\r\n int highestBitValue = 1;\r\n int c = 0;\r\n\r\n while (highestBitValue < n) {\r\n highestBitValue = highestBitValue * 2;\r\n }\r\n\r\n \r\n int currentBitValue = highestBitValue;\r\n while (currentBitValue > 0) {\r\n if (currentBitValue <= n) {\r\n\r\n n -= currentBitValue;\r\n c++;\r\n }\r\n currentBitValue = currentBitValue / 2;\r\n }\r\n\r\n return c;\r\n }",
"public boolean insert(int val) {\n boolean alreadyExist = num2Index.containsKey(val);\n num2Index.putIfAbsent(val, new LinkedHashSet<>());\n num2Index.get(val).add(nums.size());\n nums.add(val);\n \n return !alreadyExist;\n }",
"public void insertElement(int element) {\n // if within min and max and doesnt haveElement then add the int\n if (element < MAXSETVALUE && element > MINSETVALUE && hasElement(element) != true && get != null) {\n // replacement array\n int[] arr = new int[get.length + 1];\n // copying values up to last\n for (int j = 0; j < get.length; j++)\n arr[j] = get[j];\n // inserts element\n arr[get.length] = element;\n get = arr;\n // avoiding errors\n } else if (get == null) {\n get = new int[1];\n get[0] = element;\n }\n\n }",
"public boolean insert(int val) {\n boolean contains = map.containsKey(val);\n if (contains) return false;\n map.put(val, nums.size()); // insert O(1) in map(with no collision) (linkedlist)\n nums.add(val); // linkedlist add one element in the end, O(1)\n return true;\n }",
"public void merge(int[] nums1, int m, int[] nums2, int n) {\n int p=m+n-1;\n int l=m-1;\n int r=n-1;\n while((r>=0)&&(l>=0)){\n if(nums1[l]>=nums2[r]){\n nums1[p]=nums1[l];\n l--;\n p--;\n }else{\n nums1[p]=nums2[r];\n r--;\n p--;\n }\n }\n if(r<0){\n while(l>=0){\n nums1[p]=nums1[l];\n l--;\n p--;\n }\n }\n if(l<0){\n while(r>=0){\n nums1[p]=nums2[r];\n r--;\n p--;\n }\n \n }\n \n }",
"int equalPairOfBits(int n, int m) {\n return ((BinaryOperator<Integer>) (a, b) -> {\n String one = Integer.toBinaryString(a);\n String two = Integer.toBinaryString(b);\n //FUCK YO SHIT, THIS IS STUPID\n int max = Math.max(one.length(), two.length());\n if (max != one.length())\n one = IntStream.range(0, max - one.length())\n .mapToObj(aq -> \"0\")\n .reduce(\"\", (r, c) -> r + c) + one;\n if (max != two.length())\n two = IntStream.range(0, max - two.length())\n .mapToObj(aq -> \"0\")\n .reduce(\"\", (r, c) -> r + c) + two;\n for (int i = max - 1, j = 0; i > -1; --i, j++) {\n if (one.charAt(i) == two.charAt(i))\n return (int) Math.pow(2, j);\n }\n return 0;\n }).apply(n, m);\n }",
"public int getFileIndexToInsert()\r\n\t{\r\n\t\tif(n1<n2 || algo==1)\r\n\t\t\treturn 0;\r\n\t\telse \r\n\t\t\treturn 1;\r\n\t}",
"public void insert(int n) {\n\n // Fill in the blank here.\n\tif(!contains(n)){\n\t\telements[size] = n;\n\t\tsize++;\n\t}\n System.out.println(\"Inserting \" + n + \"...\");\n }",
"public void testInsert02() {\r\n\t\tBTree<String, Integer> bt = new BTree<String, Integer>(10);\r\n\t\tList<String> words = TestUtils.randomWords(5000, 31);\r\n\r\n\t\tfor (int i = 0; i < words.size(); i++) {\r\n\t\t\tbt.set(words.get(i), i);\r\n\t\t}\r\n\r\n\t\tfor (int i = 0; i < words.size(); i++) {\r\n\t\t\tassertEquals(bt.get(words.get(i)), Integer.valueOf(i));\r\n\t\t}\r\n\t}",
"private static void setBitAtGivenPositions(int pos1, int pos2) {\n\t\tlong temp1 = 1l << pos1;\n\t\tlong temp2 = 1l << pos2;\n\t\tlong result = temp1 | temp2;\n\t\tSystem.out.println(result);\n\t}",
"public int insert(int newKey){\n int i=n-1;\n int x =0;\n if (isLeaf){\n while ((i>=0)&& (newKey<=key[i])) {\n if(newKey==key[i]) \n return -1;//duplicate return withoiut doinganything\n key[i+1] = key[i];\n i--;\n \n }\n if(x>=0){\n n++;\n key[i+1]=newKey;\n }\n }\n else{\n while ((i>=0)&& (newKey<=key[i])) {\n if(newKey==key[i])\n return -1;// find duplictte return without doing anithing \n \n else\n i--;\n }\n if(x>=0){\n \n int insertChild = i+1; // Subtree where new key must be inserted\n if (c[insertChild].isFull()){\n x++;// one more node.\n // The root of the subtree where new key will be inserted has to be split\n // We promote the mediand of that root to the current node and\n // update keys and references accordingly\n \n //System.out.println(\"This is the full node we're going to break \");// Debugging code\n //c[insertChild].printNodes();\n //System.out.println(\"going to promote \" + c[insertChild].key[T-1]);\n n++;\n c[n]=c[n-1];\n for(int j = n-1;j>insertChild;j--){\n c[j] =c[j-1];\n key[j] = key[j-1];\n }\n key[insertChild]= c[insertChild].key[T-1];\n c[insertChild].n = T-1;\n \n BTreeNode newNode = new BTreeNode(T);\n for(int k=0;k<T-1;k++){\n newNode.c[k] = c[insertChild].c[k+T];\n newNode.key[k] = c[insertChild].key[k+T];\n }\n \n newNode.c[T-1] = c[insertChild].c[2*T-1];\n newNode.n=T-1;\n newNode.isLeaf = c[insertChild].isLeaf;\n c[insertChild+1]=newNode;\n \n //System.out.println(\"This is the left side \");\n //c[insertChild].printNodes(); \n //System.out.println(\"This is the right side \");\n //c[insertChild+1].printNodes();\n //c[insertChild+1].printNodes();\n \n if (newKey <key[insertChild]){\n c[insertChild].insert(newKey); }\n else{\n c[insertChild+1].insert(newKey); }\n }\n else\n c[insertChild].insert(newKey);\n }\n \n \n }\n return x ;\n }",
"private void generateOdd(int size, int min, int max, Point start, Point end)\n\t{\n\t\tint currentRow = start.x;\n\t\tint currentCol = start.y + ((end.y-start.y)/2);\n\t\tint counter = min;\n\t\tthis.matrix[currentRow][currentCol] = counter;\n\t\tcounter++;\t//Move to next number\n\t\t\n\t\t//one up, one right\n\t\tint newRow = -1;\n\t\tint newCol = -1;\n\t\twhile(counter <= max)\n\t\t{\n\t\t\t//Update pos\n\t\t\tnewRow = currentRow - 1;\t//-1 means go up\n\t\t\tnewCol = currentCol + 1;\n\t\t\t//Check if it's outside the box\n\t\t\tif (newRow < start.x)\n\t\t\t{\n\t\t\t\tnewRow = end.x;\n\t\t\t}\n\t\t\tif (newCol > end.y)\n\t\t\t{\n\t\t\t\tnewCol = start.y;\n\t\t\t}\n\t\t\t\n\t\t\t//Check if it's filled and update pos\n\t\t\tif (this.matrix[newRow][newCol] == 0)\n\t\t\t{\n\t\t\t\tcurrentRow = newRow;\n\t\t\t\tcurrentCol = newCol;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//Move to box directly under it\n\t\t\t\tcurrentRow = currentRow + 1; //+1 means under it\n\t\t\t\tif (currentRow > end.x)\n\t\t\t\t{\n\t\t\t\t\tcurrentRow = start.x;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Place next number\n\t\t\tthis.matrix[currentRow][currentCol] = counter;\n\t\t\tcounter++;\t//Increment counter by 1\n\t\t}\n\t}",
"public void insert(Limit limit);",
"void insertDigit(int digit);",
"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 }",
"private static void insert(int[] array, int rightIndex, int value) {\n int index = 0;\n for (index = rightIndex; index >= 0 && value < array[index]; index--) {\n array[index + 1] = array[index];\n }\n array[index + 1] = value;\n }",
"private static int setKthBit(int num,int k){\n int p=0;\n int m =1;\n while(p<k){\n p++;\n m =m<<1;\n }\n return num|m;\n }",
"static int setBit(int n, int pos){\n return n | (1<<pos);\n }",
"private static void task01111(int nUMS, SplayTree<Integer> j, GenerateInt generateInt) {\n\t\t\n\t\t long start = System.nanoTime();\n\t\t System.out.println( \"Fill in the table...Splay Tree\" );\n\t\t int count=1;\n\t\t\tfor( int i = 1; i <= nUMS; i++)\n\t\t\t{\n\t\t\t\t \t\t \n\t\t\t\tj.insert(GenerateInt.generateNumber());\n//\t\t\t\tSystem.out.println(GenerateInt.generateNumber());\n\t\t\t\tcount = i;\n\n\t\t\t}\n\t\t\tSystem.out.println(\"Total Size \" + count);\n\t\t\tlong end = System.nanoTime();;\n\t\t\tlong elapsedTime = end - start;\n\t\t\tSystem.out.println(elapsedTime + \" NanoSeconds\");\n\t\t\tSystem.out.println(\"Average Time \" + elapsedTime/nUMS);\n\n\n\t\t\n\t}",
"public void Hannoi(int n,int src,int dest){\n //TODO\n if(n==1){\n //把盘子从src移到dest\n }else {\n Hannoi(n-1,src,3-src-dest);\n }\n }",
"private void binInsert(Country c) {\n\t\tint left, right, mid = 0, n;\n\t\tCountry temp = null;\n\t\t\n\t\tn = this.nextAvailable;\n\t\tif (n == 0) {\t// empty list, just add and return\n\t\t\tthis.countries.add(c);\n\t\t\tthis.nextAvailable++;\n\t\t\treturn;\n\t\t}\n\t\tleft = 0;\n\t\tright = n - 1;\n\t\ttemp = this.countries.get(left);\n\t\tif (c.compareTo(temp) < 0) {\n\t\t\tthis.countries.add(left, c);\n\t\t\tthis.nextAvailable++;\n\t\t\treturn;\n\t\t}\n\t\ttemp = this.countries.get(right);\n\t\tif (c.compareTo(temp) > 0) {\n\t\t\tthis.countries.add(n, c);\n\t\t\tthis.nextAvailable++;\n\t\t\treturn;\n\t\t}\n\n\t\t// first time through left < right\n\t\twhile (left <= right) {\n\t\t\tmid = (left + right) / 2;\n\t\t\ttemp = this.countries.get(mid);\n\t\t\tint cv = c.compareTo(temp);\n\t\t\tif (cv < 0)\n\t\t\t\tright = mid - 1;\n\t\t\telse if (cv > 0)\n\t\t\t\tleft = mid + 1;\n\t\t\telse {\t\t\t// Country already in list\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tthis.countries.add(left, c);\n\t\tthis.nextAvailable++;\n\t}",
"void insert(int ele){\n if(heapLen>=A.length)\n {\n System.out.println(\"Heap is full\");\n }\n else\n {\n A[heapLen] = 1<< 31;\n heapLen++;\n increaseKey(heapLen, ele);\n \n \n }\n }",
"public int[] InsertionSort(int[] A) {\n int n = A.length;\n for(int k = 0; k < n; k++) {\n if(k == minimum) {\n int temp = A[k];\n A[k] = A[0];\n A[0] = temp;\n }\n }\n for(int i = 1; i < n; ++i) {\n int key = A[i];\n int j = i - 1;\n while(j >= minimum && A[j] > key) {\n A[j + 1] = A[j];\n j = j - 1;\n } \n A[j + 1] = key; \n }\n return A;\n }",
"public int insert( byte[] space, int size )\n {\n caller = \"insert\";\n int position = findMemory( size );\n\n // If position = -1, then there is no available freeBlock large enough\n // to\n // Accommodate the space.\n if ( !( position == -1 ) )\n {\n // insert record at position\n for ( int i = 0; i < size; i++ )\n {\n memoryPool[position + i] = space[i];\n }\n\n // update the freeBlockList to match the updated memoryPool.\n updateFreeBlockList( position, size );\n }\n return position;\n }",
"public boolean insert(int val) {\n if (lookup.containsKey(val)) return false;\n\n nums[size] = val;\n lookup.put(val, size);\n size++;\n\n return true;\n }",
"public static int mergeStones(int[] stones, int K) {\n int N = stones.length;\n if ((N-1)%(K-1)!=0) return -1;\n\n // dp[i][j] stores from i to j if can merge, what is the min cost, if (Len(j, i)-1)%(K-1) == 0 that means it can merge to 1 pile, otherwise, we only calculate\n // (from i(start point) to the farest point which can finally merge to 1 pile)'s merge cost\n int[][] dp = new int[N][N];\n\n int[] sum = new int[N+1];\n for (int i=0; i<N; i++) sum[i+1] = sum[i]+stones[i];\n\n for (int L=K; L<=N; L++) { // L is the length of small range\n // i is the subPiles is start point\n for (int i=0; i<=N-L; i++) {\n // j is the end point, L 不一定是K的倍数\n int j=i+L-1;\n dp[i][j]=Integer.MAX_VALUE;\n\n // each time we need keep from i to m is a \"can-merge-to-one-pile\" piles set, so m step is K-1; because each time besides i, we add(K-1) to the piles\n // [i, i+K-1] length is K\n // 把区间[i, j] split to [i, m] and [m+1,j], the left range must be merged to one pile, the right one maybe can or can not\n for (int m=i; m<j; m+=K-1) {\n dp[i][j]=Math.min(dp[i][j], dp[i][m] + dp[m+1][j]);\n }\n if ((j-i)%(K-1)==0) {\n dp[i][j]+=sum[j+1] - sum[i]; // if [i, j] can merge to 1 pile, we need finally add each elem from i to j\n System.out.println(dp[i][j]);\n }\n }\n }\n\n return dp[0][N-1];\n }",
"public int rangeBitwiseAnd(int m, int n) {\n\t \tint ans = 0;\n\t for (int i = 0; i < 32; ++ i) {\n \t\tif (1 == ((m >> i) & 1)) {\n \t\t\tif (((m & ~0 << (i + 1)) | (~0 >>> (31 - i))) >= n) {\n \t\t\t\tans |= 1 << i;\n \t\t\t}\n \t\t}\n\t }\n\t System.out.println(ans);\n\t return ans;\n\t }",
"public void insert(int index,int value)\n {\n System.out.println(\"data size\"+data.length);\n if(size==initialCapacity){\n resize();\n }\n \n \n \n for(int j=size-1;j>=index;j--){\n //j initial position is last element\n // j needs to move till\n //start from last element and change to next position\n \n data[j+1]=data[j]; \n }\n// // Copy up\n// for (int j = size; j > index; j--) {\n// data[j] = data[j-1];\n// }\n data[index]=value;\n size++;\n }",
"public static native int InsertAt(long lpjFbxArrayVector2, int pIndex, long pElement);",
"public boolean insert(int val) {\n if(hm.containsKey(val)){\n return false;\n }\n else{\n sub.add(val);\n hm.put(val,sub.size()-1);\n return true;\n }\n\n\n\n }",
"public int insertBoard(Board b) {\n\t\treturn 0;\n\t}",
"public boolean insert(int val) {\n if (!map.containsKey(val)) {\n map.put(val, lst.size());\n lst.add(val);\n return true;\n }\n return false;\n }",
"public void insert(Integer x) {\n pq[++N] = x;\n swim(N);\n }",
"public static int pack(int v1, int s1, int v2, int s2) {\r\n // Checks that start and size form a valid bit range and that a value\r\n // doesn't take up more bits than its given size\r\n checkArgument(\r\n verify(v1, s1) && verify(v2, s2) && s1 + s2 <= Integer.SIZE);\r\n return packGeneral(v1, s1, v2, s2);\r\n }",
"void fhInsert(Nodefh in)\n\t{\n\t\tin.ChildCut = false;\n\t\tif(isEmpty()){\n\t\t\tmin=in;\n\t\t\tmin.Left = min;\n\t\t\tmin.Right = min;\n\t\t\tminindex = min.index;\n\t\t\tcurrent = min;\n\t\t\tlast = min;\n\t\t}\t\n\t\telse\n\t\t\tif(in.dist < min.dist){\n\t\t\t\tin.Right = min;\n\t\t\t\tin.Left = min.Left;\n\t\t\t\tmin.Left.Right = in;\n\t\t\t\tmin.Left = in;\n\t\t\t\tmin = in;\n\t\t\t\tminindex = in.index;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tin.Right = min;\n\t\t\t\tin.Left = min.Left;\n\t\t\t\tmin.Left.Right = in;\n\t\t\t\tmin.Left = in;\n\t\t\t}\n\t\tlast = min.Left;\n\t}",
"public void insertionSort(int[] nums) {\n for (int i = 1; i < nums.length; i++) {\n // Hold the current element which is processed\n int current = nums[i];\n int j = i;\n\n // Trace backwards and find a place to insert current by shifting elements\n // towards the right\n while (j - 1 >= 0 && nums[j - 1] > current) {\n nums[j] = nums[j - 1];\n j--;\n }\n\n // j is the right place to insert current\n nums[j] = current;\n }\n\n }",
"public long insert();",
"public Point2D insertPoint(int i, double x, double y);",
"public boolean insert(int val) {\n if (valToIndex.containsKey(val)) {\n return false;\n }\n \n valToIndex.put(val, A.size());\n A.add(val);\n return true;\n }",
"public static List<Integer> solution2(int n) {\n List<Integer> rs=new ArrayList<Integer>();\n rs.add(0);\n for(int i=0;i<n;i++){\n int size=rs.size();\n for(int k=size-1;k>=0;k--)\n rs.add(rs.get(k) | 1<<i);\n }\n return rs;\n }",
"public void insert(int n) {\n\n\t\tif (pos == size)\n\t\t\tresize();\n\n\t\theap[pos] = n;\n\t\tpos++;\n\t\tcurrentSize++;\n\n\t\tint child = pos - 1;\n\t\tint parent = child / 2;\n\n\t\twhile (heap[parent] < heap[child] && parent > 0) {\n\t\t\tint temp = heap[parent];\n\t\t\theap[parent] = heap[child];\n\t\t\theap[child] = temp;\n\n\t\t\tchild = parent;\n\t\t\tparent = child / 2;\n\t\t}\n\n\t}",
"private static void task1111(int nUMS, SplayTree<Integer> j, GenerateInt generateInt) {\n\t\tlong start = System.nanoTime();\n\t System.out.println( \"Fill in the table...SPLAY TREE\" );\n\t int count=0;\n\t\tfor( int z = 1; z <= nUMS; z++)\n\t\t{\n\t\t\t \t\t \n\t\t\tj.insert(z);\n\t\t\tcount = z;\n//\t\t\tSystem.out.println(GenerateInt.generateNumber());\n\n\t\t}\n\t\tSystem.out.println(\"Total Size \" + count);\n\t\tlong end = System.nanoTime();;\n\t\tlong elapsedTime = end - start;\n\t\tSystem.out.println(elapsedTime + \" NanoSeconds\");\n\t\tSystem.out.println(\"Average Time \" + elapsedTime/nUMS);\n\n\t}",
"public static int insertionSort(int[] array)\n {\n int totalShifts = 0;\n int nSorted = 1; // the first n items are sorted\n int n = array.length; // total number of items in the array\n while (nSorted < n)\n {\n // get the next item\n int newInt = array[nSorted];\n int i = 0;\n // locate its position in smaller array\n // equivalent to for (int i)\n // thus can't use i for a different loop\n for (i = 0; i < nSorted; i++){\n\n // if you find a smaller item in there, exchange the two\n if (array[i] > newInt){\n array[nSorted] = array[i];\n array[i] = newInt; \n // make sure exchanging the two didnt make a new imbalance, continue searching through\n newInt = array[nSorted];\n totalShifts++;\n }\n \tnSorted++;\n \t}\n }\n // print total number of shifts\n System.out.print(totalShifts);\n return totalShifts;\n }",
"public boolean insert(int val) {\n if (map.containsKey(val)) {\n return false;\n }\n map.put(val, val);\n return true;\n }",
"protected int insertionIndex(int key) {\r\n\t\tint hash = key & 0x7fffffff;\r\n\t\tint index = this.hashFunc1(hash) * FREE.length;\r\n\t\t// int stepSize = hashFunc2(hash);\r\n\t\tbyte[] cur = new byte[4];\r\n\t\tkeys.position(index);\r\n\t\tkeys.get(cur);\r\n int storehash=(cur[0] << 24)+ ((cur[1] & 0xFF) << 16)+ ((cur[2] & 0xFF) << 8)+ (cur[3] & 0xFF);\r\n\r\n\t\tif (Arrays.equals(cur, FREE)) {\r\n\t\t\treturn index; // empty, all done\r\n\t\t} else if (storehash==key) {\r\n\t\t\treturn -index - 1; // already stored\r\n\t\t} else { // already FULL or REMOVED, must probe\r\n\t\t\t// compute the double hash\r\n\t\t\tfinal int probe = (1 + (hash % (size - 2))) * FREE.length;\r\n\r\n\t\t\t// if the slot we landed on is FULL (but not removed), probe\r\n\t\t\t// until we find an empty slot, a REMOVED slot, or an element\r\n\t\t\t// equal to the one we are trying to insert.\r\n\t\t\t// finding an empty slot means that the value is not present\r\n\t\t\t// and that we should use that slot as the insertion point;\r\n\t\t\t// finding a REMOVED slot means that we need to keep searching,\r\n\t\t\t// however we want to remember the offset of that REMOVED slot\r\n\t\t\t// so we can reuse it in case a \"new\" insertion (i.e. not an update)\r\n\t\t\t// is possible.\r\n\t\t\t// finding a matching value means that we've found that our desired\r\n\t\t\t// key is already in the table\r\n\t\t\tif (!Arrays.equals(cur, REMOVED)) {\r\n\t\t\t\t// starting at the natural offset, probe until we find an\r\n\t\t\t\t// offset that isn't full.\r\n\t\t\t\tdo {\r\n\t\t\t\t\tindex += (probe); // add the step\r\n\t\t\t\t\tindex %= (size * FREE.length); // for wraparound\r\n\t\t\t\t\tcur = new byte[FREE.length];\r\n\t\t\t\t\tkeys.position(index);\r\n\t\t\t\t\tkeys.get(cur);\r\n\t\t\t\t} while (!Arrays.equals(cur, FREE)\r\n\t\t\t\t\t\t&& !Arrays.equals(cur, REMOVED)\r\n\t\t\t\t\t\t&& storehash!=hash);\r\n\t\t\t}\r\n\r\n\t\t\t// if the index we found was removed: continue probing until we\r\n\t\t\t// locate a free location or an element which equal()s the\r\n\t\t\t// one we have.\r\n\t\t\tif (Arrays.equals(cur, REMOVED)) {\r\n\t\t\t\tint firstRemoved = index;\r\n\t\t\t\twhile (!Arrays.equals(cur, FREE)\r\n\t\t\t\t\t\t&& (Arrays.equals(cur, REMOVED) || storehash!=hash)) {\r\n\t\t\t\t\tindex += (probe); // add the step\r\n\t\t\t\t\tindex %= (size * FREE.length); // for wraparound\r\n\t\t\t\t\tcur = new byte[FREE.length];\r\n\t\t\t\t\tkeys.position(index);\r\n\t\t\t\t\tkeys.get(cur);\r\n\t\t\t\t}\r\n\t\t\t\t// NOTE: cur cannot == REMOVED in this block\r\n\t\t\t\treturn (!Arrays.equals(cur, FREE)) ? -index - 1 : firstRemoved;\r\n\t\t\t}\r\n\t\t\t// if it's full, the key is already stored\r\n\t\t\t// NOTE: cur cannot equal REMOVE here (would have retuned already\r\n\t\t\t// (see above)\r\n\t\t\treturn storehash!=hash ? -index - 1 : index;\r\n\t\t}\r\n\t}",
"int insertSelective(Destinations record);",
"protected static <T extends Comparable<? super T>> void insertionSort(List<T> a, int low, int high){\n // Example of insertion sort\n // 4 1 3 2 5\n // 1 4 3 2 5\n // 1 3 4 2 5\n // 1 2 3 4 5\n\n // index low is already sorted\n // move from left to right inserting in correct position \n // list is always sorted from low to i\n for (int i = low + 1; i <= high; i++){\n // store object at index i\n T tmp = a.get(i);\n\n // start at i if j - 1 is greater then tmp move index j - 1 to j\n int j;\n for(j = i; j > 0; j--){\n // tmp < j - 1 -> compareTo < 0\n // tmp > j - 1 -> compareTo > 0\n if(tmp.compareTo(a.get(j - 1)) < 0){\n a.set(j, a.get(j-1));\n } else {\n // break if tmp is bigger than j - 1\n \n break;\n }\n }\n \n // tmp should be inserted into position j\n a.set(j, tmp);\n }\n }",
"public static void insert(Comparable[] arr, int n) \n\t{\n\t\tif (arr != null && n > 1)\n\t\t {\n\t\t\tif (n > arr.length)\n\t\t\t\tn = arr.length;\n\t\t}\n\t\tfor (int i = 1; i < n; i++) \n\t\t{ //complexity is n in the best case, complexity is n squared in the worst case\n\t\t\tfor (int j = i; j > 0 && arr[j].compareTo(arr[j-1]) < 0; j--) //complexity of 1 in the best case, complexity of i in the worst case\n\t\t\t\tswap(arr, j, j-1);\t//complexity of 1\n\t\t}\n\t}",
"public static int[][] packU(int n, int[] from, int[] to, int max) {\n int[][] g = new int[n][];\n int[] p = new int[n];\n for (int i = 0; i < max; i++) p[from[i]]++;\n for (int i = 0; i < max; i++) p[to[i]]++;\n for (int i = 0; i < n; i++) g[i] = new int[p[i]];\n for (int i = 0; i < max; 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 int rangeBitwiseAnd(int m, int n) {\n int i = 0;\n while (m != n) {\n m >>= 1;\n n >>= 1;\n i++;\n }\n return (n << i);\n }",
"public void insert(long in) {\n\n int i = front;\n while (i >= 0 && arr[i] > in) {\n arr[i + 1] = arr[i];\n\n i--;\n }\n arr[++i] = in;\n\n front++;\n\n }",
"int insertSelective(Ttoken record);",
"public boolean insert(int val) {\n boolean res=!map.containsKey(val);\n if(res)\n map.put(val,new HashSet());\n map.get(val).add(li.size());\n li.add(val);\n return res;\n }",
"public boolean insert (IInterval interval) {\n\t\tcheckInterval (interval);\n\t\t\n\t\tint begin = interval.getLeft();\n\t\tint end = interval.getRight();\n\t\t\n\t\tboolean modified = false;\n\t\t\n\t\t// Matching both? \n\t\tif (begin <= left && right <= end) {\n\t\t\tcount++;\n\t\t\t\n\t\t\t// now allow for update (overridden by subclasses)\n\t\t\tupdate(interval);\n\t\t\t\n\t\t\tmodified = true;\n\t\t} else {\n\t\t\tint mid = (left+right)/2;\n\n\t\t\tif (begin < mid) { modified |= lson.insert (interval); }\n\t\t\tif (mid < end) { modified |= rson.insert (interval); }\n\t\t}\n\t\t\n\t\treturn modified;\n\t}",
"public boolean insert(int val) {\n if(map.containsKey(val))\n {\t\n \tmap.get(val).add(list.size());\n \tlist.add(val);\n \treturn false;\n }else{\n \tmap.put(val, new HashSet<Integer>());\n \tmap.get(val).add(list.size()); \t\n \tlist.add(val);\n \treturn true;\n }\n }",
"public static int subBits(int n, int m, int i, int j) {\n\n\tif (i<0 || j<0 || i>31 || j>31) {\n\t\tthrow new IndexOutOfBoundsException(\"Indices out of bounds\");\n\t}\n\n\t// internally, i is always the smaller index\n\tif (i>j) {\n\t\tint s = i;\n\t\ti = j;\n\t\tj = s;\n\t}\n\t\n\tfor (int x = i; x<=j; x++) {\n\t\tint mask = 0x1 << x;\n\t\tint v = m & mask;\n\t\tif (v==0x0) {\t// m bit is set to zero\n\t\t\tn &= ~(mask);\n\t\t} else {\t\t// m bit is set to one\n\t\t\tn |= mask;\n\t\t}\n\t}\n\n\treturn n;\n}",
"public int searchInsert(int[] A, int target) {\n if (A.length == 0 || A == null) {\n return -1;\n }\n if (target < A[0]) {\n return 0;\n }\n\n int start = 0;\n int end = A.length - 1;\n int mid;\n\n // Binary search:\n while ((start + 1) < end) {\n mid = start + (end - start) / 2;\n if (A[mid] == target) {\n return mid;\n } else if (A[mid] < target) {\n start = mid;\n } else if (A[mid] > target) {\n end = mid;\n }\n }\n\n // Now that target should be\n // 1.equals start or end. Then the index of start/end should be returned\n if (A[start] == target) {\n return start;\n }\n if (A[end] == target) {\n return end;\n }\n // 2. larger than end. Then it should be inserted after end. So index is end + 1.\n if (A[end] < target) {\n return end + 1;\n }\n // 3. larger than start but smaller than end. Should be inserted after start. So index is start + 1.\n return start + 1;\n }",
"public boolean insert(int val) {\n boolean contain = _map.containsKey(val);\n if ( contain ) return false;\n _map.put( val, _list.size());\n _list.add(val);\n return true;\n }",
"public boolean insert(int val) {\n if(map.containsKey(val)){\n map.get(val).add(nums.size());\n nums.add(val);\n return false;\n }\n map.put(val,new ArrayList<>());\n map.get(val).add(nums.size());\n nums.add(val);\n return true;\n }",
"public void insert(int val)\n {\n try\n {\n a[index++] = val;\n n=index;\n }\n catch(Exception e)\n {\n System.out.println(�e.getMessage�);\n }\n }",
"public static int[] insert(int x, int[] a) {\n Arrays.sort(a);\n a = Arrays.copyOf(a, a.length + 1);\n if (a[a.length - 2] <= x) {\n a[a.length - 1] = x;\n } else {\n int i = a.length - 2;\n while ((i + 1 > 0) && (x < a[i])) {\n a[i+1] = a[i];\n i--;\n }\n a[i+1] = x;\n }\n return a;\n}",
"private static void InsertionSort(RandomVector v) {\n\t\tfor(int i = 1; i < v.size(); i++) {\n\t\t\t\n\t\t\t\n\t\t\tint j = 0, //start looking through sorted section from beginning\n\t\t\t\t\ttemp = v.get(i); //stash our current unsorted element\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tfor(j=0; j < i && v.get(j) <= v.get(i); j++){}\n\t\t\t\n\t\t\t//walk from one element to the left of i through to j to the left\n\t\t\tfor(int k = i-1; k >= j; k--){\n\t\t\t\t//move element at k one step to the right\n\t\t\t\tv.set(k+1, v.get(k));\n\t\t\t}\n\t\t//copy temp into element j\t\n\t\t\tv.set(j, temp);\n\t\t\tSystem.out.println(v);\n\t\t}\n\t\t\n\t}",
"public void insert(int i, K k, P p) {\n\t\tfor (int j = keyCount; j > i; j--) {\n\t\t\tkeys[j] = keys[j - 1];\n\t\t\tpointers[j] = pointers[j - 1];\n\t\t}\n\t\tkeys[i] = k;\n\t\tpointers[i] = p;\n\t\tkeyCount++;\n\t}",
"private void insertZeros(int zerosToInsert)\n\t{\n\t\t/* Difficulty is defined(read from one wikipedia article):\n\t\t\tEasy: 32+ clues (49 or fewer zeros)\n\t\t\tMedium: 27-31 clues (50-54 zeros)\n\t\t\tHard: 26 or fewer clues (54+ zeros)\n\t\t */\n\t\tdouble remainingSquares = 81;\n\t\tdouble remainingZeros = (double)zerosToInsert;\n\n\t\tfor(int i=0;i<9;i++)\n\t\t\tfor(int j=0;j<9;j++)\n\t\t\t{\n\t\t\t\tdouble zeroChance = remainingZeros/remainingSquares;\n\t\t\t\tif(Math.random() <= zeroChance)\n\t\t\t\t{\n\t\t\t\t\tsudokuMatrix[i][j] = 0;\n\t\t\t\t\tremainingZeros--;\n\t\t\t\t}\n\t\t\t\tremainingSquares--;\n\t\t\t}\n\t}",
"public void insert (int input) \r\n\t{\r\n\t\tif(debug)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Debug - Starting insert\");\r\n\t\t\tSystem.out.println(\"Debug - input = \" + input);\r\n\t\t}\r\n\t\t\r\n\t\tif(count == numArray.length) \r\n\t\t\tgrow();\r\n\t\t\r\n\t\tif(count == 0)\r\n\t\t{\r\n\t\t\tnumArray[0]= input;\r\n\t\t\tcount++;\r\n\t\t}\r\n\t\t\r\n\t\telse \r\n\t\t{\r\n\t\t\tint index = 0;\r\n\t\t\tint lastElement = 0;\r\n\t\t\tboolean found = false;\r\n\t\t\t\r\n\t\t\twhile(!found && index < count)\r\n\t\t\t{\r\n\t\t\t\tif(input < numArray[index])\r\n\t\t\t\t{\r\n\t\t\t\t\tfound = true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(found == false)\r\n\t\t\t\t{\r\n\t\t\t\t\tindex++;\r\n\t\t\t\t\tlastElement++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor (index = count; index > lastElement; index--) \r\n\t\t\t{\r\n\t\t\t\tnumArray[index] = numArray[index-1];\r\n\t\t\t\t\r\n\t\t\t\tif(debug)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.println(\"Debug - numArray[index] = \" + numArray[index]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tnumArray[lastElement] = input; \r\n\t\t\tcount++;\r\n\t\t}\r\n\t\t\r\n\t\tif(debug)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Debug - ending insert\");\r\n\t\t}\r\n\t}",
"public void insertToNodeLists(long[] input) {\r\n\r\n\t\tfor (int i = 0; i < input.length; i++) {\r\n\t\t\t// calculate the index according to the digit at specified position\r\n\t\t\tunsigned int index = (unsigned int) getIndex(input[i]);\r\n\t\t\t// calls insert method of that nodelist\r\n\t\t\tmyArray[index].insert(input[i]);\r\n\t\t}\r\n\r\n\t}",
"public static void insertElement(int numToInsert) {\n\n\t\t// Use hash function to find index\n\t\tint index = hashFunction(numToInsert);\n\t\tnodeAtIndex = hashTable[index];\n\n\t\tNode newNode = bst.new Node(numToInsert, null, null, null);\n\n\t\t// If there is no collision\n\t\tif (hashTable[index] == null) {\n\t\t\thashTable[index] = newNode;\n\t\t} \n\t\t// If there is a collision, use the nodeAtIndex as root to insert the node into the binary search tree\n\t\telse {\n\t\t\tbst.insertNode(newNode, nodeAtIndex);\n\t\t}\n\t}",
"private void insert(int N, TrieNode root) {\n\n TrieNode curr = root;\n for (int i = 30; i >= 0; i--) {\n int bit = ((N & (1 << i)) > 0) ? 1 : 0;\n\n if (curr.children[bit] == null) {\n curr.children[bit] = new TrieNode();\n } else {\n curr.children[bit].freq++;\n }\n curr = curr.children[bit];\n }\n }",
"Integer insertByMap(Map mapParams);",
"public boolean insert(int val) {\n if(map.containsKey(val)) return false;\n map.put(val, list.size());\n list.add(val);\n return true;\n }"
]
| [
"0.76970273",
"0.65135294",
"0.60880303",
"0.5764146",
"0.5594541",
"0.5549489",
"0.5493189",
"0.5359292",
"0.530456",
"0.5294992",
"0.521341",
"0.51782507",
"0.51756305",
"0.5169947",
"0.51431555",
"0.5133718",
"0.5131948",
"0.5123969",
"0.5101219",
"0.5097166",
"0.5088846",
"0.5085266",
"0.5082698",
"0.50813484",
"0.50473607",
"0.50229764",
"0.4958458",
"0.4956421",
"0.49448457",
"0.49317744",
"0.49167192",
"0.49153918",
"0.49116856",
"0.490815",
"0.49059424",
"0.4895851",
"0.4894229",
"0.48880523",
"0.48798186",
"0.4872989",
"0.48713616",
"0.4857502",
"0.4849394",
"0.48480773",
"0.48404244",
"0.48403242",
"0.48387367",
"0.48309928",
"0.48307368",
"0.482943",
"0.48283747",
"0.48274228",
"0.4821364",
"0.48200744",
"0.48184094",
"0.48126894",
"0.48087138",
"0.4805972",
"0.48045382",
"0.48038095",
"0.4795531",
"0.4793953",
"0.47870222",
"0.47832882",
"0.47781566",
"0.47778344",
"0.47777152",
"0.47681168",
"0.47678232",
"0.4764588",
"0.4763419",
"0.47489372",
"0.47443566",
"0.47432038",
"0.47370324",
"0.47345832",
"0.47345454",
"0.47324145",
"0.4731559",
"0.4726648",
"0.47257724",
"0.4722914",
"0.47184074",
"0.47153947",
"0.47083798",
"0.4698302",
"0.4697865",
"0.46966243",
"0.46887484",
"0.46754575",
"0.46745077",
"0.46743733",
"0.46653116",
"0.46645814",
"0.46528625",
"0.4649643",
"0.46426046",
"0.4642517",
"0.4636361",
"0.46338236"
]
| 0.76378953 | 1 |
final DataWrapper dataWrapper = copyDataWrapper(); | void setDynamicLauncherShortcutsFromMainThread()
{
final Context appContext = context;
//PPApplication.startHandlerThread(/*"DataWrapper.setDynamicLauncherShortcutsFromMainThread"*/);
//final Handler __handler = new Handler(PPApplication.handlerThread.getLooper());
//__handler.post(new PPHandlerThreadRunnable(
// context, dataWrapper, null, null) {
//__handler.post(() -> {
Runnable runnable = () -> {
// PPApplicationStatic.logE("[IN_EXECUTOR] PPApplication.startHandlerThread", "START run - from=DataWrapper.setDynamicLauncherShortcutsFromMainThread");
//Context appContext= appContextWeakRef.get();
//DataWrapper dataWrapper = dataWrapperWeakRef.get();
//Profile profile = profileWeakRef.get();
//Activity activity = activityWeakRef.get();
//if ((appContext != null) && (dataWrapper != null) /*&& (profile != null) && (activity != null)*/) {
PowerManager powerManager = (PowerManager) appContext.getSystemService(Context.POWER_SERVICE);
PowerManager.WakeLock wakeLock = null;
try {
if (powerManager != null) {
wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, PPApplication.PACKAGE_NAME + ":DataWrapper_setDynamicLauncherShortcutsFromMainThread");
wakeLock.acquire(10 * 60 * 1000);
}
DataWrapperStatic.setDynamicLauncherShortcuts(context);
} catch (Exception e) {
// PPApplicationStatic.logE("[IN_EXECUTOR] PPApplication.startHandlerThread", Log.getStackTraceString(e));
PPApplicationStatic.recordException(e);
} finally {
if ((wakeLock != null) && wakeLock.isHeld()) {
try {
wakeLock.release();
} catch (Exception ignored) {
}
}
}
//}
}; //);
PPApplicationStatic.createBasicExecutorPool();
PPApplication.basicExecutorPool.submit(runnable);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void copy(DataRequest original){\n\t\t//potential problems with object sharing\n\t\tfilters = \toriginal.get_filters();\n\t\tsort_by = \toriginal.get_sort_by();\n\t\tcount = \toriginal.get_count();\n\t\tstart = \toriginal.get_start();\n\t\tsource = \toriginal.get_source();\n\t\tfieldset =\toriginal.get_fieldset();\n\t\trelation = \toriginal.get_relation();\n\t}",
"IDataRow getCopy();",
"@Override\n public Data clone() {\n final Data data = new Data(name, code, numeric, symbol, fractionSymbol, fractionsPerUnit, rounding, formatString,\n triangulated.clone());\n return data;\n }",
"void setData (Object newData) { /* package access */ \n\t\tdata = newData;\n\t}",
"public void copy() {\n\n\t}",
"static void setCopying(){isCopying=true;}",
"public ProcessedDynamicData deepCopy( ) {\r\n\r\n ProcessedDynamicData copy = new ProcessedDynamicData( this.channelId );\r\n\r\n copy.channelId = this.channelId;\r\n copy.dateTimeStamp = new java.util.Date( this.dateTimeStamp.getTime() );\r\n copy.samplingRate = this.samplingRate;\r\n copy.eu = this.eu;\r\n\r\n copy.min = this.min;\r\n copy.max = this.max;\r\n\r\n copy.measurementType = this.measurementType;\r\n copy.measurementUnit = this.measurementUnit;\r\n\r\n // data and labels\r\n List<Double> dataCopy = new Vector<Double>();\r\n for( int i = 0; i < this.data.size(); i++ ) {\r\n dataCopy.add( new Double( this.data.get( i ) ) );\r\n }\r\n copy.setData( dataCopy );\r\n\r\n List<Double> dataLabels = new Vector<Double>();\r\n for( int i = 0; i < this.dataLabels.size(); i++ ) {\r\n dataLabels.add( new Double( this.dataLabels.get( i ) ) );\r\n }\r\n copy.setDataLabels( dataLabels );\r\n\r\n // create a deep copy of overalls\r\n if( overalls != null ) {\r\n copy.overalls = new OverallLevels( this.overalls.getChannelId() );\r\n copy.overalls.setDateTimeStampMillis( this.getDateTimeStampMillis() );\r\n Vector<String> overallKeys = this.overalls.getKeys();\r\n for( int i = 0; i < overallKeys.size(); i++ ) {\r\n copy.overalls.addOverall( new String( overallKeys.elementAt( i ) ),\r\n new Double( this.overalls.getOverall( overallKeys.elementAt( i ) ) ) );\r\n }\r\n }\r\n\r\n copy.xEUnit = this.xEUnit;\r\n copy.yEUnit = this.yEUnit;\r\n\r\n copy.xSymbol = this.xSymbol;\r\n copy.ySymbol = this.ySymbol;\r\n copy.xPhysDomain = this.xPhysDomain;\r\n copy.yPhysDomain = this.yPhysDomain;\r\n \r\n copy.noOfAppendedZeros = this.noOfAppendedZeros;\r\n\r\n return copy;\r\n }",
"public void copyData(TrianaType source) { // not needed\n }",
"Object getData() { /* package access */\n\t\treturn data;\n\t}",
"public synchronized static <T extends Data> T clone(T value) {\n Object obj = null;\n if (value instanceof Data) {\n Constructor constructor = null;\n try {\n constructor = value.getClass().getDeclaredConstructor(Parcel.class);\n constructor.setAccessible(true);\n } catch (NoSuchMethodException e) {\n new CloneNotSupportedException(\"Make sure the 'protected \" + value.getClass().getSimpleName() + \"(Parcel in, int flag)'\" + \"constructor has been implemented:\" + value.getClass().getName()).printStackTrace();\n }\n\n if (null != constructor) {\n try {\n obj = constructor.newInstance((Parcel) null);\n if (obj instanceof Data) {\n ((T) obj).mThisDataName = (value).mThisDataName;\n ((T) obj).copy(value);\n }\n } catch (InstantiationException e) {\n e.printStackTrace();\n } catch (IllegalAccessException e) {\n e.printStackTrace();\n } catch (InvocationTargetException e) {\n e.printStackTrace();\n }\n }\n }\n return ((T) obj);\n }",
"public DatasetHelper(DatasetHelper another){\n id= another.id;\n hash = another.hash;\n catalogueId = another.catalogueId;\n sourceType = another.sourceType;\n sourceLang = another.sourceLang;\n model = ModelFactory.createDefaultModel().add(another.model);\n uriSchema = another.uriSchema;\n }",
"@Test\n public void testCloning() throws CloneNotSupportedException {\n DefaultPieDataset d1 = new DefaultPieDataset();\n d1.setValue(\"V1\", new Integer(1));\n d1.setValue(\"V2\", null);\n d1.setValue(\"V3\", new Integer(3));\n DefaultPieDataset d2 = (DefaultPieDataset) d1.clone();\n\n assertTrue(d1 != d2);\n assertTrue(d1.getClass() == d2.getClass());\n assertTrue(d1.equals(d2));\n }",
"public CompoundTag getCopy() {\n return data.copy();\n }",
"public Object getData() \n {\n return data;\n }",
"public void setDataUnsafe(Serializable data) { this.data = data; }",
"T getData() {\n\t\treturn data;\n\t}",
"final void getData() {\n\t\t//The final method can't be overriden\n\t}",
"@Override\n public Object clone() {\n return super.clone();\n }",
"public T getData() {\n return mData;\n }",
"static void setNotCopying(){isCopying=false;}",
"public IData getData() {\n return data;\n }",
"public synchronized Object getData() {\n return data;\n }",
"DataContext copy();",
"Object getData();",
"Object getData();",
"protected abstract D createData();",
"final public Object getDataObject() {\n return this.dataObject;\n }",
"T getData() {\n return this.data;\n }",
"public InternalData createInternalData2() {\r\n return new InternalData(); // returns data which is not exported from Module modb\r\n }",
"public node_data copyNode(node_data node) {\n NodeData nodeUpCasted = (NodeData) node;\n return new NodeData(nodeUpCasted);\n }",
"public Object detachCopy(Object po)\n{\n\treturn po;\n}",
"public Object clone(){\r\n\t\tSampleData obj = new SampleData(letter,getWidth(),getHeight());\r\n\t\tfor ( int y=0;y<getHeight();y++ )\r\n\t\t\tfor ( int x=0;x<getWidth();x++ )\r\n\t\t\t\tobj.setData(x,y,getData(x,y));\r\n\t\treturn obj;\r\n\t}",
"public Data copy(Object value) {\n if (mValue instanceof Data) {\n ((Data) mValue).copy(value);\n } else {\n mValue = value;\n }\n return this;\n }",
"@Override\n public FieldEntity copy()\n {\n return state.copy();\n }",
"@Override\r\n\tprotected Object getData() {\n\t\treturn null;\r\n\t}",
"T copy();",
"@Override\r\n\tpublic Buffer copy() {\n\t\t\r\n\t\treturn null;\r\n\t}",
"public abstract Object getData();",
"public DTO(DTO other) {\n if (other.isSetDatas()) {\n Map<String,String> __this__datas = new HashMap<String,String>(other.datas);\n this.datas = __this__datas;\n }\n }",
"public DataFrame copy() {\n return new DataFrame(data.values, header.values, index.values);\n }",
"public abstract DataTableDefinition clone();",
"public Object clone() throws CloneNotSupportedException {\n/* 354 */ SlidingCategoryDataset clone = (SlidingCategoryDataset)super.clone();\n/* 355 */ if (this.underlying instanceof PublicCloneable) {\n/* 356 */ PublicCloneable pc = (PublicCloneable)this.underlying;\n/* 357 */ clone.underlying = (CategoryDataset)pc.clone();\n/* */ } \n/* 359 */ return clone;\n/* */ }",
"@Override\n protected Currency clone() {\n final Currency currency = new Currency();\n if (data != null) {\n currency.data = data.clone();\n }\n return currency;\n\n }",
"@Override\n public RawStore copy() {\n return new RawStore(this.toRawCopy2D(), myNumberOfColumns);\n }",
"public Object getDataObject() {\n return dataObject;\n }",
"public void setRowDataWrapper(final IWrapper < Object, RowData > theRowDataWrapper) {\r\n this.rowDataWrapper = theRowDataWrapper;\r\n }",
"PersistentDataHolder getDataHolder();",
"public DataWrapProxy(boolean data) {\n this.data = data;\n }",
"public T getData() {\r\n return data;\r\n }",
"public abstract INodo copy();",
"public T getData(){\n return this.data;\n }",
"@Override\r\n\tprotected Object clone() throws CloneNotSupportedException { // semi-copy\r\n\t\tthrow new CloneNotSupportedException();\r\n\t}",
"public final DataValueDescriptor cloneHolder() {\n if (stream == null && _blobValue == null) {\n return cloneValue(false);\n } else {\n // Cast to SQLBinary to avoid having to catch StandardException.\n SQLBinary self = (SQLBinary)getNewNull();\n if (stream != null) {\n // Just reference the same stream in the cloned holder.\n self.setValue(stream, streamValueLength);\n } else if (_blobValue != null) {\n // Just reference the same BLOB value in the cloned holder.\n self.setValue(_blobValue);\n } else {\n throw new IllegalStateException(\"unknown BLOB value repr\");\n }\n return self;\n }\n\t}",
"public Object clone() {\n return this.copy();\n }",
"public DataWrapProxy(int data) {\n this.data = data;\n }",
"public synchronized Object setData(Object newData) {\n Object old = data;\n data = newData;\n return old;\n }",
"DataSource clone();",
"public T getData()\n\t{ \treturn this.data; }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"@Override\n\tpublic void getData() {\n\t\t\n\t}",
"Object clone();",
"Object clone();",
"public T getData() {\n return null;\n }",
"public void setData(Object oData) { m_oData = oData; }",
"Prototype makeCopy();",
"public ScopeRenewalAwareWrapper (@Nonnull final IReadonlyWrapper <DATATYPE> rhs)\n {\n super (rhs);\n }",
"Field getCopy();",
"public void copyDataFrom(ParamUnit other)\r\n\t{\r\n\t\tif (this.data.row != other.data.row || this.data.col != other.data.col)\r\n\t\t\tthrow new DeepException(\"Cannot copy data from a different dimension.\");\r\n\t\tthis.data.copyFrom(other.data);\r\n\t}",
"public void tukarData() {\n this.temp = this.data1;\n this.data1 = this.data2;\n this.data2 = this.temp;\n }",
"public IData getStoreddata();",
"private void freshTheData() {\n mData.clear();\n mData.addAll(mDataOrg);\n }",
"public Data assign(Data other) {\r\n this.setDimension(other.dimension);\r\n this.distanz = other.distanz;\r\n //for (int i = 0; i < this.dimension; ++i)\r\n for (int i = 0; i < this.dimension * 2; ++i) {\r\n this.data[i] = other.data[i];\r\n }\r\n this.id = other.id;\r\n return this;\r\n }",
"public Object clone()\n/* */ {\n/* 835 */ return super.clone();\n/* */ }",
"public void testCloning() throws CloneNotSupportedException {\n XIntervalDataItem item1 = new XIntervalDataItem(1.0, 2.0, 3.0, 4.0);\n XIntervalDataItem item2 = (XIntervalDataItem) item1.clone();\n }",
"@Override\n\tprotected void copy(Object source, Object dest) {\n\t\t\n\t}",
"public static DataParameter getCopy(DataParameter dataparameter) {\n\t\tDataParameter copydataparameter = (DataParameter) EcoreUtil.copy(dataparameter);\t\n\t\treturn copydataparameter;\n\t}",
"public SoPickedPoint \ncopy() \n//\n////////////////////////////////////////////////////////////////////////\n{\n SoPickedPoint newCopy = new SoPickedPoint(this);\n return newCopy;\n}",
"DataList createDataList();",
"public Object clone() {\n // No problems cloning here since private variables are immutable\n return super.clone();\n }",
"private void merge(ComicDataWrapper comicDataWrapper) {\n mComicDataWrapper.getData().getResults().addAll(comicDataWrapper.getData().getResults());\n mComicDataWrapper.getData().setOffset(comicDataWrapper.getData().getOffset());\n mComicDataWrapper.getData().setCount(mComicDataWrapper.getData().getCount() + comicDataWrapper.getData().getCount());\n }",
"T getData() {\n return null;\n }",
"DataTypeInstance getDataInstance();",
"@Override\r\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\r\n\t}",
"@Override\r\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\r\n\t}",
"@Override\r\n\tprotected Object clone() throws CloneNotSupportedException {\n\t\treturn super.clone();\r\n\t}",
"Object getCurrentData();",
"public Object getData() { return funcData; }",
"public O copy() {\n return value();\n }",
"public Object clone();",
"public Object clone();",
"public Object clone();",
"public Object clone();",
"public DataWrapProxy(String data) {\n this.data = data;\n }",
"public Object getData();",
"@Override\n\tpublic DataType copy(DataTypeManager dtm) {\n\t\tStructureDataType struct =\n\t\t\tnew StructureDataType(getCategoryPath(), getName(), getLength(), dtm);\n\t\tstruct.setDescription(getDescription());\n\t\tstruct.replaceWith(this);\n\t\treturn struct;\n\t}",
"public A getData()\n\t{\n\t\treturn data;\n\t}",
"public HttpParams copy() {\n/* 268 */ return (HttpParams)this;\n/* */ }",
"public boolean otherWrite(IDataHolder dc, Object data);",
"@Override\n\tpublic Expression copy() {\n\t\treturn null;\n\t}",
"public Object clone()\n {\n Object o = null;\n try\n {\n o = super.clone();\n }\n catch (CloneNotSupportedException e)\n {\n e.printStackTrace();\n }\n return o;\n}",
"@Override\n\tpublic Object clone() {\n\t\treturn null;\n\t}"
]
| [
"0.6627495",
"0.6455771",
"0.61646116",
"0.6129573",
"0.6114492",
"0.6087847",
"0.6022886",
"0.59779376",
"0.59696335",
"0.5920673",
"0.5906255",
"0.58915776",
"0.5883465",
"0.5840354",
"0.582968",
"0.5789824",
"0.57837075",
"0.5768076",
"0.5760382",
"0.5759263",
"0.5739778",
"0.5737902",
"0.5732374",
"0.57219154",
"0.57219154",
"0.57169753",
"0.5712879",
"0.57024753",
"0.56832606",
"0.5674607",
"0.5673592",
"0.5672552",
"0.5672252",
"0.5657359",
"0.56547123",
"0.56498986",
"0.56444925",
"0.56360924",
"0.5626183",
"0.56235456",
"0.56230044",
"0.56229943",
"0.5617439",
"0.56151956",
"0.56103665",
"0.56099546",
"0.559477",
"0.55894977",
"0.5587956",
"0.55773056",
"0.55658853",
"0.5564547",
"0.55578",
"0.55411816",
"0.55328584",
"0.5526591",
"0.55181354",
"0.5513187",
"0.55106133",
"0.5501003",
"0.54990995",
"0.54990995",
"0.5492715",
"0.549015",
"0.5478544",
"0.5463115",
"0.54613185",
"0.5449339",
"0.5435986",
"0.54313827",
"0.5431081",
"0.54304093",
"0.54302156",
"0.54232866",
"0.5421196",
"0.54065746",
"0.5403234",
"0.5402741",
"0.539937",
"0.53988355",
"0.53979105",
"0.5392985",
"0.5390517",
"0.5390517",
"0.5390517",
"0.53888357",
"0.53755534",
"0.5374974",
"0.53736717",
"0.53736717",
"0.53736717",
"0.53736717",
"0.53696376",
"0.53644526",
"0.53621066",
"0.53613365",
"0.53594565",
"0.5355733",
"0.5354753",
"0.5344878",
"0.5343057"
]
| 0.0 | -1 |
stops all events associated with profile | private void stopEventsForProfile(Profile profile, boolean alsoUnlink/*, boolean saveEventStatus*/)
{
synchronized (PPApplication.eventsHandlerMutex) {
getEventTimelineList(true);
synchronized (eventList) {
fillEventList();
//noinspection ForLoopReplaceableByForEach
for (Iterator<Event> it = eventList.iterator(); it.hasNext(); ) {
Event event = it.next();
//if ((event.getStatusFromDB(this) == Event.ESTATUS_RUNNING) &&
// (event._fkProfileStart == profile._id))
if (event._fkProfileStart == profile._id)
event.stopEvent(this, false, true, true/*saveEventStatus*/, false, true);
}
if (alsoUnlink) {
unlinkEventsFromProfile(profile);
DatabaseHandler.getInstance(context).unlinkEventsFromProfile(profile);
}
}
}
//restartEvents(false, true, true, true, true);
restartEventsWithRescan(true, false, true, false, true, false);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void stop( String profileId );",
"public void stop(String event) {\n Long start = started.get(event);\n if (start != null && start != NOT_STARTED) {\n profile.add(event, System.currentTimeMillis() - start);\n started.put(event, NOT_STARTED);\n }\n }",
"void stopPumpingEvents();",
"@Override\n public void stop() {\n\n for (FermatEventListener fermatEventListener : listenersAdded) {\n eventManager.removeListener(fermatEventListener);\n }\n\n listenersAdded.clear();\n }",
"public void stop() {\r\n endGif();\r\n final StringBuilder s = new StringBuilder();\r\n for(String event : replay.notableEvents) {\r\n s.append(\";\");\r\n s.append(event);\r\n }\r\n settings.setProperty(\"events\", s.substring(1));\r\n }",
"public void stopAll() {\n List<String> startedEvents = new ArrayList<>(started.keySet());\n for (String event : startedEvents) {\n stop(event);\n }\n started.clear();\n }",
"public synchronized void stop() {\n isStopped = true;\n generators.forEach(EventGenerator::stop);\n EventSimulatorDataHolder.getSimulatorMap().remove(uuid);\n if (log.isDebugEnabled()) {\n log.debug(\"Stop event simulation for uuid : \" + uuid);\n }\n }",
"@Stop(priority = 99)\n void stop() {\n for (List<ListenerInvocation> list : listenersMap.values()) {\n if (list != null) list.clear();\n }\n\n if (syncProcessor != null) syncProcessor.shutdownNow();\n }",
"private void stopCallBack() {\r\n\t\tfor (RecordingEventHandler oberserver : recordingEventHandlers) {\r\n\t\t\toberserver.stopCallBack();\r\n\t\t}\r\n\t}",
"public void endProfiling(){\r\n\t\tworld.profiler.endSection();\r\n\t}",
"public void stop() {\n enemyTimeline.stop();\n }",
"public final void stopEventGeneration() throws LDAPException {\n if (Debug.LDAP_DEBUG) {\n Debug.trace(Debug.EventsCalls, \"Closing EventGeneration\");\n }\n\n isrunning = false;\n ldapconnection.abandon(searchqueue);\n }",
"@Override\n protected void onCurrentProfileChanged(Profile profile, Profile profile2) {\n Intent appPrincipal = new Intent(MainActivity.this,ActividadPrincipal.class);\n //appPrincipal.putExtra(\"NOMBRE\", nombre);\n mProfileTracker.stopTracking();\n startActivity(appPrincipal);\n finish();\n }",
"protected void end() {\n\t\tnotifier.stop();\n\n\t\tleftTalon.clearMotionProfileTrajectories();\n\t\trightTalon.clearMotionProfileTrajectories();\n\n\t\tleftTalon.set(ControlMode.MotionProfile, SetValueMotionProfile.Disable.value);\n\t\trightTalon.set(ControlMode.MotionProfile, SetValueMotionProfile.Disable.value);\n\n\t}",
"public void stopListener(){\r\n\t\tcontinueExecuting = false;\r\n\t\tglobalConsoleListener.interrupt();\r\n\t}",
"@Override\n\tpublic void stop(){\n\t\tif(this.keyboardListenerIsActive){\n\t\t\tthis.keyboardListener.unregisterNativeHook();\n\t\t\tthis.keyboardListenerIsActive = false;\n\t\t}\n\t\t//If the mouse listener is active\n\t\tif(this.mouseListenerIsActive){\n\t\t\tthis.mouseListener.unregisterNativeHook();\n\t\t\tthis.mouseListenerIsActive = false;\n\t\t}\n\t\t//If the mouse motion listener is active\n\t\tif(this.mouseMotionListenerIsActive){\n\t\t\tthis.mouseMotionListener.unregisterNativeHook();\n\t\t\tthis.mouseMotionListenerIsActive = false;\n\t\t}\n\t\t//If the mouse wheel listener is active\n\t\tif(this.mouseWheelListenerIsActive){\n\t\t\tthis.mouseWheelListener.unregisterNativeHook();\n\t\t\tthis.mouseWheelListenerIsActive = false;\n\t\t}\n\t}",
"public void stop() {\n activePickups = new ArrayList<Pickup>();\n\n fogLightsTimer.cancel();\n fogLightsTimer.purge();\n\n slowMotionTimer.cancel();\n slowMotionTimer.purge();\n\n invincibilityTimer.cancel();\n invincibilityTimer.purge();\n\n coinTimer.cancel();\n coinTimer.purge();\n }",
"public void stop_all(){\n\t\tfor(Event_Process p:processes){\r\n\t\t\tp.stop();\r\n\t\t}\r\n\t}",
"public void stop() {\n if (haveSensor && haveSensor2){ // acc & mag sensors used\n mSensorManager.unregisterListener(this, mAccelerometer);\n mSensorManager.unregisterListener(this, mMagnetometer);\n } else if (haveSensor){ // only rotation used\n mSensorManager.unregisterListener(this, mRotationV);\n }\n }",
"public void stop() {\n enable = false;\n }",
"private void stop() {\n\t\t/*\n if (this.status != PedoListener.STOPPED) {\n this.sensorManager.unregisterListener(this);\n }\n this.setStatus(PedoListener.STOPPED);\n\t\t*/\t\t\t\t\n\t\t\t\n\t\tif (status != PedoListener.STOPPED) {\n\t\t uninitSensor();\n\t\t}\n\n\t\tDatabase db = Database.getInstance(getActivity());\n\t\tdb.setConfig(\"status_service\", \"stop\");\n\t\t//db.clear(); // delete all datas on table\n\t\tdb.close();\t\t\n\n\t\tgetActivity().stopService(new Intent(getActivity(), StepsService.class));\n\t\tstatus = PedoListener.STOPPED;\n\n\t\tcallbackContext.success();\n }",
"public void stopIntake(){\n\t\tintake.set(0);\n }",
"@Override\n public void stop() {}",
"@Override\n public void stop() {\n }",
"public void stop() {\n\t\tthis.stopper = true;\n\t}",
"public void stop() {}",
"@Override\r\n public void stop() {\r\n }",
"@Override\r\n public void stop() {\r\n }",
"public void onStop() {\n this.eventDelegate.onStop();\n super.onStop();\n }",
"private void stopAllListeners() {\n if (unitReg != null && unitListener != null) {\n unitReg.remove();\n }\n }",
"public void stop()\n throws Exception\n {\n for(int i = 0; i < this.monitoredObjectsCache.size(); i++) {\n \n ObjectName target = null;\n \n try {\n target = (ObjectName) this.monitoredObjectsCache.get(i);\n \n this.server.removeNotificationListener(target, listener);\n \n if (log.isDebugEnabled())\n log.debug(\"Unsubscribed from \\\"\" + target + \"\\\"\");\n }\n catch(Exception e) {\n log.error(\"Unsubscribing from \\\"\" + target + \"\\\"\", e);\n }\n }\n }",
"public void stopTracking() {\n mContext.unregisterReceiver(this);\n }",
"void stopAll();",
"@Override\n public void stop() {\n }",
"@Override\n public void stop() {\n }",
"@Override\n public void stop() {\n }",
"@Override\n public void stop() {\n }",
"@Override\n public void stop() {\n }",
"@Override\n public void stop() {\n }",
"@Override\n public void stop() {\n }",
"@Override\n public void stop() {\n }",
"@Override\n public void stop() {\n }",
"@Override\n public void stop() {\n }",
"@Override\n public void stop() {\n }",
"public void Stop()\r\n {\r\n super.Stop();\r\n\r\n if (getIsLocal())\r\n {\r\n // stop listening to PropertyChanged events\r\n RemoveEvents();\r\n }\r\n }",
"public void stopUnit(){\n\t\t\n\t\tstopTest(getUnitKey());\n\t}",
"@Override public void stop() {\n }",
"@Override\n protected void end() {\n System.out.println(\"end() on DriveMotionProfile\");\n drivetrain.cancelMotionProfile();\n drivetrain.clearOldMotionProfiles();\n }",
"@Override\r\n public void stop() {\r\n\r\n }",
"public void stop() {\n stop = true;\n }",
"private void stop() {\r\n\t\t\tstopped = true;\r\n\t\t}",
"@Override public void stop() {\n\t\t_active = false;\n\t}",
"@Override\n public void stop() {\n detector.disable();\n }",
"void stopStatisticsMonitor();",
"public void stop() {\n\t\tthis.flag = false;\n\t\t\n\t\t\n\t}",
"@Override\n public void stop() {\n }",
"@Override\n protected void interrupted() {\n drivetrain.cancelMotionProfile();\n drivetrain.clearOldMotionProfiles();\n }",
"@Override\n\t\tpublic void stop() {\n\t\t\t// Nothing to do for now\n\t\t}",
"void discardProfile( String profileId );",
"public void deactivate() {\n log.info(\"Stopped\");\n }",
"@Override\r\n\tpublic void stop() {\n\t\t\r\n\t}",
"@Override public void stop () {\n }",
"public void stop() {\n\t\t\n\t\trunning = false;\n//\t\tSystem.out.println(dateFormat.format(new Date()) + \"\\tElevator \" + elevatorNum + \" total passenger count: \" + currentOccup);\n\t\tthis.setState(STOPPED);\n\t\tsynchronized (this) {\n\t\t\tthis.notifyAll();\n\t\t}\n\t}",
"@Override\n public void stop() {\n GameManager.getInstance().stopTimer();\n }",
"@Override\n protected void onStop() {\n super.onStop();\n Log.d(TAG, \"onStop\");\n// Auth.signOut();\n mNest.removeAllListeners();\n Auth.removeAuthListener();\n }",
"public void onStop(LoadScenarioInfo loadScenarioInfo){\n }",
"public void stopped();",
"private static void stopCleanUp() {\n\n if (isEventTrackerRunning && timer != null) {\n timer.cancel();\n timer.purge();\n debugLogger.info(\"Timer stopped: {}\", new Date());\n } else {\n debugLogger.info(\"Timer was already stopped : {}\", new Date());\n\n }\n isEventTrackerRunning = false;\n\n }",
"@Override\n public void stop() {\n\n }",
"@Override\n\tpublic void stop() {\n\t\tsuper.stop();\n\t}",
"@Override\n\tpublic void stop() {\n\t\tsuper.stop();\n\t}",
"public void stop(){\n stop = true;\n }",
"public void stop(){\n\t\t\n\t}",
"public void stop() {\r\n _keepGoing = false;\r\n }",
"public void stopGame() {\n\t\t\tif (extended)\n\t\t\t\textendTimer.stop();//stops the extend timer\n\t\t\tpause=true;//waits for other stimuli to unpause.\n\t\t\tstopped = true;//set the stopped flag to true\n\t\t\trepaint();//repaint once to indicate user said to pause\n\t\t\t\n\t\t}",
"public void stop() {\n\t\trunning = false;\n\t\tfor (ArionumHasher hasher : hashers) {\n\t\t\thasher.setForceStop(true);\n\t\t}\n\n\t\tthreadCollection.clear();\n\t\thashers.clear();\n\t}",
"void unsetEvent();",
"protected void stopAll() {\n\t\tif (this.udpServer!=null)\n\t\t\tthis.udpServer.interrupt();\n\t\tif (this.connectionServer!=null)\n\t\t\tthis.connectionServer.interrupt();\n\t\tthis.connectionServer=null; // supprime le TCPServer et les Sockets associés\n\t\tthis.udpServer=null; // supprime l'UDPServer et les Sockets associés\n\t\tif (this.agent.getUserStatusManager()!=null)\n\t\t\tfor (String u : this.agent.getUserStatusManager().getActiveUsers())\n\t\t\t\tthis.removeSocket(u);; // interrompt tous les UserSockets\n\t\tthis.mapSockets.clear();\n\t}",
"public void stop() {\n\t\tmAudioManager.abandonAudioFocus(mOuterEventsListener);\n\t\tinternalStop();\n\t}",
"public void stop() {\n }",
"public void stop() {\n }",
"public void stop();",
"public void stop();",
"public void stop();",
"public void stop();",
"public void stop();",
"public void stop();",
"public void stop();",
"public void stop();",
"public void stop();",
"public void stop();",
"public void stop();",
"public void stop();",
"public void stop();",
"public void stop();",
"public void stop();",
"public void onStop();",
"public void onStop() {\n\t }",
"public void stop() {\n cancelCallback();\n mStartTimeMillis = 0;\n mCurrentLoopNumber = -1;\n mListener.get().onStop();\n }",
"@Override\n public void doStop() {\n loc = null;\n sensors().set(SERVICE_STATE, Lifecycle.STOPPING);\n sensors().set(SERVICE_UP, false);\n sensors().set(SERVICE_STATE, Lifecycle.STOPPED);\n }"
]
| [
"0.75790054",
"0.66796225",
"0.6381564",
"0.6327239",
"0.6257245",
"0.62519455",
"0.60860765",
"0.6070709",
"0.60631853",
"0.6061183",
"0.60108024",
"0.5973038",
"0.59717447",
"0.5933108",
"0.5921164",
"0.5882776",
"0.5880526",
"0.5873831",
"0.5833227",
"0.58130175",
"0.5803048",
"0.57927257",
"0.5788824",
"0.5777046",
"0.57734287",
"0.57662994",
"0.57642716",
"0.57642716",
"0.57569134",
"0.57489574",
"0.5743423",
"0.5736486",
"0.5722697",
"0.5718809",
"0.5718809",
"0.5718809",
"0.5718809",
"0.5718809",
"0.5718809",
"0.5718809",
"0.5718809",
"0.5718809",
"0.5718809",
"0.5718809",
"0.57122743",
"0.5710171",
"0.5708786",
"0.57065356",
"0.56945956",
"0.56892174",
"0.566925",
"0.56680965",
"0.5659774",
"0.565143",
"0.565082",
"0.5649758",
"0.5646978",
"0.5646683",
"0.56463706",
"0.5646286",
"0.5621693",
"0.5617227",
"0.5611971",
"0.5610564",
"0.5608821",
"0.5601995",
"0.5601791",
"0.55984664",
"0.5591977",
"0.55882174",
"0.55882174",
"0.5585041",
"0.55800253",
"0.55679315",
"0.5566561",
"0.55655235",
"0.5553091",
"0.55497",
"0.55488265",
"0.55465615",
"0.55465615",
"0.55438435",
"0.55438435",
"0.55438435",
"0.55438435",
"0.55438435",
"0.55438435",
"0.55438435",
"0.55438435",
"0.55438435",
"0.55438435",
"0.55438435",
"0.55438435",
"0.55438435",
"0.55438435",
"0.55438435",
"0.5539174",
"0.5533183",
"0.5530803",
"0.5529833"
]
| 0.76882344 | 0 |
this is called in boot or first start application | void firstStartEvents(boolean startedFromService, boolean useHandler)
{
PPApplicationStatic.logE("DataWrapper.firstStartEvents", "startedFromService="+startedFromService);
//if (startedFromService)
//invalidateEventList(); // force load form db
if (!startedFromService) {
EventStatic.setEventsBlocked(context, false);
synchronized (eventList) {
//noinspection ForLoopReplaceableByForEach
for (Iterator<Event> it = eventList.iterator(); it.hasNext(); ) {
Event event = it.next();
if (event != null)
event._blocked = false;
}
}
DatabaseHandler.getInstance(context).unblockAllEvents();
EventStatic.setForceRunEventRunning(context, false);
}
synchronized (eventList) {
//noinspection ForLoopReplaceableByForEach
for (Iterator<Event> it = eventList.iterator(); it.hasNext(); ) {
Event event = it.next();
if (event != null) {
event.setSensorsWaiting();
DatabaseHandler.getInstance(context).updateAllEventSensorsPassed(event);
}
}
}
resetAllEventsInDelayStart(true);
resetAllEventsInDelayEnd(true);
if (!DataWrapperStatic.getIsManualProfileActivation(false, context)) {
PPApplicationStatic.logE("DataWrapper.firstStartEvents", "no manual profile activation, restart events");
}
else
{
PPApplicationStatic.logE("DataWrapper.firstStartEvents", "manual profile activation, activate profile");
activateProfileAtFirstStart();
}
startEventsAtFirstStart(startedFromService, useHandler);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void onFirstUse() {}",
"@Override\n public void startup() {\n }",
"@Override\n\tpublic void earlyStartup() {\n\t}",
"@Override\n public void postBootSetup() {\n }",
"@Override\n protected void startUp() {\n }",
"@Override\n protected void appStart() {\n }",
"public void startup(){}",
"@Override\n public void firstApplicationStartup()\n {\n System.out.println(\"firstApplicationStartup\");\n \n }",
"public void initialize() {\n\n getStartUp();\n }",
"public void autonomousInit() {\n \n }",
"@Override\n public void autonomousInit() {\n \n }",
"@Override\n public void autonomousInit() {\n }",
"@Override\n public void autonomousInit() {\n }",
"protected void onPreCreateApplication() {\n\n\t}",
"protected void onAfterCreateApplication() {\n\n\t}",
"@Override\n public void beforeStart() {\n \n }",
"protected void onFirstTimeLaunched() {\n }",
"public void autonomousInit() {\n }",
"public void autonomousInit() {\n }",
"@Override\n\tpublic void autonomousInit() {\n\t}",
"public void autonomousInit() {\n\t\t\n\t}",
"public abstract void startup();",
"public void start()\n/* 354: */ {\n/* 355:434 */ onStartup();\n/* 356: */ }",
"public static void init() {\n\n\t\tsnapshot = new SnapshotService();\n\t\tlog.info(\"App init...\");\n\t}",
"@Override\n\tpublic void init() throws Exception {\n //the code present in this method is executed as soon as the application loads that is even before it starts\n\t\tsuper.init(); //super keyword invokes the init methods as per the definition in the Application class\n \n\t}",
"@Override\n\t\t\t\tpublic void onStart() {\n\t\t\t\t}",
"@Override\r\n\t\t\tpublic void autInitProcess() {\n\t\t\t\t\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic void autInitProcess() {\n\t\t\t\t\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic void autInitProcess() {\n\t\t\t\t\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic void autInitProcess() {\n\t\t\t\t\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic void autInitProcess() {\n\t\t\t\t\r\n\t\t\t}",
"@Override\n public void onStart() {\n \n }",
"@Override\n public void onStart() {\n \n }",
"public void startup() {\n neutral();\n }",
"@Override\n\tpublic void onStartup(ServletContext servletContext)\n\t\t\tthrows ServletException {\n\t\tsuper.onStartup(servletContext);//master line where whole framework works\n\t\t//configure global objects/tasks if required\n\t}",
"private void appInitialization(){\n openRom();\n openGuide();\n setOffset(0);\n addressChanged();\n }",
"@Override\n\tpublic void afterInit() {\n\t\t\n\t}",
"@Override\n\tpublic void afterInit() {\n\t\t\n\t}",
"@Override\r\n\t\t\t\tpublic void autInitProcess() {\n\t\t\t\t\t\r\n\t\t\t\t}",
"@Override\r\n\t\t\t\tpublic void autInitProcess() {\n\t\t\t\t\t\r\n\t\t\t\t}",
"public void startup() {\n\t\tstart();\n }",
"@Override\n protected void onStart() {\n Log.i(\"G53MDP\", \"Main onStart\");\n super.onStart();\n }",
"public void startup()\n\t{\n\t\t; // do nothing\n\t}",
"protected void applicationInitalize() throws OwConfigurationException, OwServerException\r\n {\n OwConfiguration.applicationInitalize(this);\r\n }",
"@Override\n\t\t\t\t\tpublic void onStart() {\n\n\t\t\t\t\t}",
"@Override\r\n\tprotected void processInit() {\n\t\t\r\n\t}",
"public void onStart() {\n\t\t\n\t}",
"protected void onInit() {\n\t}",
"@Override\n\t\t\t\tpublic void onStart() {\n\t\t\t\t\tsuper.onStart();\n\t\t\t\t}",
"@Override\n\t\t\t\tpublic void onStart() {\n\t\t\t\t\tsuper.onStart();\n\t\t\t\t}",
"@Override\r\n\t\t\tpublic void autInitProcess() {\n\t\t\t}",
"public void doMyStartupStuff() {\n System.out.println(\"init method\");\n }",
"public void init()\n {\n _appContext = SubAppContext.createOMM(System.out);\n _serviceName = CommandLine.variable(\"serviceName\");\n initGUI();\n }",
"void onStart(@Observes Startup event, ApplicationLifecycle app) {\n\n\t\tif (!newstore)\n\t\t\tapp.markAsRestart();\n\t\t\n\t}",
"@Override public void postInit()\n\t\t{\n\t\t}",
"public void startApp()\r\n\t{\n\t}",
"@Override\n\t\tprotected void onStart() {\n\t\t\tsuper.onStart();\n\t\t}",
"private void initializeStartup()\n {\n /* Turn off Limelight LED when first started up so it doesn't blind drive team. */\n m_limelight.turnOffLED();\n\n /* Start ultrasonics. */\n m_chamber.startUltrasonics();\n }",
"@Override\n public void onCreate() {\n super.onCreate();\n //是不是第一次打开此app\n// initSplashed();\n //缓存文件\n// initCache();\n\n// initUser();\n\n// initAccessToken();\n }",
"@Override\n public void onStart() {\n }",
"@Override\n public void onStart() {\n }",
"@Override\n public void onStart() {\n }",
"@Override\n public void onStart() {\n }",
"@Override\n public void onStart() {\n }",
"@Override\n public void onStart() {\n }",
"@Override\n public void onStart() {\n }",
"@Override\n public void onStart() {\n }",
"@Override\n public void onStart() {\n }",
"private void initService() {\r\n\t}",
"public void postInit() {\n }",
"@Override\r\n\tprotected void processInit() {\n\r\n\t}",
"@Override\n public void preRun() {\n super.preRun();\n }",
"public void onStart() {\n }",
"@Override\n public void prepare() {\n applicationDeployer.initialize();\n this.initialize();\n }",
"@Override\n public void onStart()\n {\n }",
"@Override\n\t\t\tpublic void onStart()\n\t\t\t{\n\t\t\t\tsuper.onStart();\n\t\t\t}",
"@PostConstruct\r\n\tpublic void doMyStartUpStuff() {\r\n\t\t\r\n\t\tSystem.out.println(\"TennisCoach : -> Inside of doMyStartUpStuff()\");\r\n\t}",
"@Override\n public void onPostInit()\n {\n\n }",
"@Override\r\n\tprotected void onStart() {\n\t\tsuper.onStart();\r\n\t}",
"@Override\r\n\tprotected void onStart() {\n\t\tsuper.onStart();\r\n\t}",
"@Override\r\n\tprotected void onStart() {\n\t\tsuper.onStart();\r\n\t}",
"@Override\r\n\tprotected void onStart() {\n\t\tsuper.onStart();\r\n\t}",
"@Override\r\n\tprotected void onStart() {\n\t\tsuper.onStart();\r\n\t}",
"private void initialize() {\n\t}",
"public void onStart() {\n /* do nothing - stub */\n }",
"protected void init() {\n try {\n updateDevice();\n } catch (Exception e) {\n RemoteHomeManager.log.error(42,e);\n }\n }",
"public static void setApplicationInitialized() {\n applicationInitialized = true;\n }",
"@Override\r\n\tpublic void onStart() {\n\t\tsuper.onStart();\r\n\t}",
"@Override\r\n\tpublic void onStart() {\n\t\tsuper.onStart();\r\n\t}",
"@Override\n\tpublic void onStart() {\n\n\t}",
"@Override\n\tpublic void onStart() {\n\n\t}",
"@Override\n\tpublic void postInit() {\n\t\t\n\t}",
"@Override\r\n public void onStart() {\n super.onStart();\r\n }",
"private void initialize() {\n\t\t\n\t}",
"public void Initialse() {\n\t\tappSettings = ctx.getSharedPreferences(APP_SETTINGS, 0);\n\t\tSharedPreferences.Editor prefEditor = appSettings.edit();\n\t\tprefEditor.putBoolean(BLOCK, true); // master switch\n\t\tprefEditor.putBoolean(NOTIFY, true); // controls whether a notification appears in status bar ans notifications lit\n\t\tprefEditor.putBoolean(REMOVE_CALLS, false); // determines whether calls are removed form the call log\n\t\t// add INIT to prevent this code from being called again\n\t\tprefEditor.putBoolean(INIT, true); // flag to allow subsequent loads to recognise that defaults are set\n\t\tprefEditor.putString(TEST, ctx.getString(R.string.test_number));\n\t\tprefEditor.putBoolean(RULES_EXIST, false); // added to control whether app kicks off commshandler\n\t\t\n\t\tprefEditor.commit();\n \n\t}",
"private void initThings() {\n\t\tmyApp = (MyApp) getApplicationContext();\n\t\tnextIntent = new Intent(this, AnimActivity2.class);\n\t\t// nextIntent = new Intent(this, SelectEventActivity.class);\n\t\tnextIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK\n\t\t\t\t| Intent.FLAG_ACTIVITY_CLEAR_TASK);\n\t\tuserDAO = new UserDAO(this);\n\t\tdialog = new CreateDialog(this);\n\t\tprogressDialog = dialog.createProgressDialog(null, \"Logging In\", false,\n\t\t\t\tnull, false);\n\t\ttypeface = myApp.getTypefaceRegular();\n\n\t\t// <<<<<<< HEAD\n\t\t//\n\t\t// GsonBuilder builder = new GsonBuilder();\n\t\t// gson = builder.create();\n\t\t//\n\t\t// queue = Volley.newRequestQueue(this);\n\t\t// =======\n\t\t// >>>>>>> parent of 48afbfc... setup android again\n\t}",
"@PostConstruct\n\tpublic void doMyStartupStfff() {\n\t\tSystem.out.println(\">> TennisCoach: inside of doMyStartupStuff\");\n\t}",
"@PostConstruct // bcoz of java 9 and higher version i need to download jar file\r\n\tpublic void doMyStartupStuff() {\r\n\t\tSystem.out.println(\">> TennisCoach: inside of doMyStrtupStuff()\");\r\n\t}",
"void preInit();",
"void preInit();",
"@Override\r\n\tpublic void startup() {\n\t\t\r\n\t\tString wechatID = \"gh_f49bb9a333b3\";\r\n\t\tString Token = \"spotlight-wechat\";\r\n\t\t\r\n\t\tNoIOClient client = new NoIOClient(\"mg.protel.com.hk\",5010);\r\n\t\tclient.addCRouter(wechatID, Token,null,null);\r\n\t\t\r\n\t\tclient.startup();\r\n\r\n\t}"
]
| [
"0.7586142",
"0.7566819",
"0.7379315",
"0.7367875",
"0.73603606",
"0.7310929",
"0.729706",
"0.7164006",
"0.71561253",
"0.7112844",
"0.70887417",
"0.70586026",
"0.70586026",
"0.70439386",
"0.7031794",
"0.6941161",
"0.69030786",
"0.6831732",
"0.6831732",
"0.6784808",
"0.67747384",
"0.67620593",
"0.6729627",
"0.67248183",
"0.66931933",
"0.6665371",
"0.6649892",
"0.6649892",
"0.6649892",
"0.6649892",
"0.6649892",
"0.6648934",
"0.6648934",
"0.6638175",
"0.663694",
"0.6619838",
"0.6612631",
"0.6612631",
"0.6610993",
"0.6610993",
"0.65926456",
"0.65925944",
"0.65884125",
"0.65817136",
"0.65754604",
"0.65554076",
"0.6550583",
"0.6548964",
"0.6542214",
"0.6542214",
"0.65272164",
"0.65190554",
"0.6516982",
"0.64964813",
"0.64862376",
"0.6481074",
"0.6471714",
"0.64582896",
"0.64505863",
"0.6442069",
"0.6442069",
"0.6442069",
"0.6442069",
"0.6442069",
"0.6442069",
"0.6442069",
"0.6442069",
"0.6442069",
"0.64410216",
"0.643476",
"0.6421034",
"0.6420025",
"0.6419886",
"0.64187515",
"0.64182377",
"0.64111376",
"0.6410306",
"0.639036",
"0.63867915",
"0.63867915",
"0.63867915",
"0.63867915",
"0.63867915",
"0.63867444",
"0.63847476",
"0.6375021",
"0.6372705",
"0.6359999",
"0.6359999",
"0.6359414",
"0.6359414",
"0.6358619",
"0.6356363",
"0.6342208",
"0.63412297",
"0.63397443",
"0.6339049",
"0.63322985",
"0.63304615",
"0.63304615",
"0.63245946"
]
| 0.0 | -1 |
boolean fullyStarted = false; if (PhoneProfilesService.getInstance() != null) fullyStarted = PhoneProfilesService.getInstance().getApplicationFullyStarted(); boolean fullyStarted = PPApplication.applicationFullyStarted; fullyStarted = fullyStarted && (!PPApplication.applicationPackageReplaced); if (!fullyStarted) return; | private void showToastAfterActivation(Profile profile)
{
try {
String profileName = DataWrapperStatic.getProfileNameWithManualIndicatorAsString(profile, true, "", false, false, false, this);
PPApplication.showToast(context.getApplicationContext(),
context.getString(R.string.toast_profile_activated_0) + ": " + profileName + " " +
context.getString(R.string.toast_profile_activated_1),
Toast.LENGTH_SHORT);
}
catch (Exception e) {
PPApplicationStatic.recordException(e);
}
//Log.d("DataWrapper.showToastAfterActivation", "-- end");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static public boolean isLaunched()\n\t{\n\t\tif (g_currentLaunch == null)\n\t\t return false;\n\t\telse\n\t\t return true;\n\t}",
"public void start()\n/* 354: */ {\n/* 355:434 */ onStartup();\n/* 356: */ }",
"Boolean isSuspendOnStart();",
"public boolean isLaunched();",
"boolean isStartup();",
"public void onCheckAppFirstStart() {\n HwAPPStateInfo curAppInfo = getCurStreamAppInfo();\n if (curAppInfo != null && 100501 == curAppInfo.mScenceId && true == curAppInfo.mIsAppFirstStart && !curAppInfo.mIsVideoStart) {\n boolean isPoorNetwork = false;\n int curRxPackets = this.mHwHiStreamQoeMonitor.getCurTcpRxPackets(curAppInfo.mAppUID);\n if (!(-1 == this.mStartTcpRxPackets || -1 == curRxPackets || curRxPackets - this.mStartTcpRxPackets >= 300)) {\n isPoorNetwork = true;\n }\n HwHiStreamUtils.logD(\"onCheckAppFirstStart: isPoorNetwork = \" + isPoorNetwork);\n if (isPoorNetwork) {\n IHwAPPQoECallback brainCallback = getArbitrationCallback();\n if (brainCallback != null) {\n brainCallback.onAPPQualityCallBack(curAppInfo, 107);\n }\n this.mHwHiStreamCHRManager.onStallDetect(curAppInfo.mScenceId, 107, this.mQoeCallback);\n }\n }\n }",
"public void startApp() {\n if (midletPaused) {\n resumeMIDlet();\n } else {\n initialize();\n startMIDlet();\n }\n midletPaused = false;\n }",
"private boolean checkServiceIsRunning(){\r\n if (CurrentLocationUtil.isRunning()){\r\n doBindService();\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n }",
"@Override\n public void preloadRecentApps() {\n if (!isUserSetup()) {\n return;\n }\n\n mImpl.preloadRecentApps();\n }",
"public void startApp() {\n if (midletPaused) {\n resumeMIDlet ();\n } else {\n initialize ();\n startMIDlet ();\n }\n midletPaused = false;\n }",
"public void startApp() {\n if (midletPaused) {\n resumeMIDlet ();\n } else {\n initialize ();\n startMIDlet ();\n }\n midletPaused = false;\n }",
"@Override\n protected void appStart() {\n }",
"@Override\n protected void onResume() {\n Log.d(TAG, \"MyTracks.onResume\");\n serviceConnection.bindIfRunning();\n super.onResume();\n }",
"boolean initializeStart() {\n if (state != PlatformState.STOPPED) {\n return false;\n }\n state = PlatformState.STARTING;\n return true;\n }",
"public void startApp()\r\n\t{\n\t}",
"@Override\n public void firstApplicationStartup()\n {\n System.out.println(\"firstApplicationStartup\");\n \n }",
"private void startup() {\n Intent intent = getIntent();\n \n // Log intent for debug purposes\n Log.v(\"CadPageActivity.startup()\");\n ContentQuery.dumpIntent(intent);\n \n // We have an occasional problem when an old intent is sent with the\n // intent of restoring the Cadpage display. But has several unfortunate\n // side effects like immediately cancelling the wake lock\n // Solution - when were were started with the intent of displaying a new\n // message, ignore all extraneous intents until we find the one that\n // displays the new page\n int msgId = intent.getIntExtra(EXTRA_MSG_ID, -1);\n if (msgId > 0 && msgId != lockMsgId) {\n Log.v(\"Discarding spurious intent\");\n return;\n }\n lockMsgId = -1;\n\n // See if this request is going to pop up an alert window\n SmsMmsMessage msg;\n boolean force = ManagePreferences.forcePopup();\n if (force) ManagePreferences.setForcePopup(false);\n if (!force &&\n Intent.ACTION_MAIN.equals(intent.getAction()) &&\n intent.hasCategory(Intent.CATEGORY_LAUNCHER)) {\n msg = null;\n } else if (msgId >= 0) {\n msg = SmsMessageQueue.getInstance().getMessage(msgId);\n } else {\n if (!force) force = intent.getBooleanExtra(EXTRA_POPUP, false);\n msg = SmsMessageQueue.getInstance().getDisplayMessage(force);\n }\n\n // If there is no message popup display and we were started by some kind of\n // user interaction, go through the startup special processing checks\n if (msg == null && (intent.getFlags() & Intent.FLAG_FROM_BACKGROUND) == 0) {\n\n // First clear any pending notification\n ClearAllReceiver.clearAll(this);\n\n // The rest of this involves possible interactions with the user, which might conflict\n // with the initial permission checking logic. So rather than do it immediately, we stuff\n // it in a Runnable object to be executed when the initial permission checking is complete\n final boolean init = initializing;\n ManagePreferences.checkInitialPermissions(new Runnable(){\n @Override\n public void run() {\n needSupportApp = SmsPopupUtils.checkMsgSupport(CadPageActivity.this) > 0;\n if (needSupportApp) return;\n\n // If user upgraded to the release that implements improved email account security, and\n // we suspect that really need to give us that email account access, let them know now.\n DonateScreenEvent event;\n if ((event = NeedAcctPermissionUpgradeEvent.instance()).isEnabled()) {\n DonateActivity.launchActivity(CadPageActivity.this, event, null);\n return;\n }\n\n // If Cadpage is not functional with current settings, start up the new user sequence\n if ((event = HelpWelcomeEvent.instance()).isEnabled()) {\n ((HelpWelcomeEvent)event).setIntializing(init);\n DonateActivity.launchActivity(CadPageActivity.this, event, null);\n return;\n }\n\n // If a new Active911 client may be highjacking alerts, warn user\n if ((event = Active911WarnEvent.instance()).isEnabled()) {\n DonateActivity.launchActivity(CadPageActivity.this, event, null);\n return;\n }\n\n // Otherwise, launch the release info dialog if it hasn't already been displayed\n String oldRelease = ManagePreferences.release();\n String release = CadPageApplication.getVersion();\n if (!release.equals(oldRelease)) {\n ManagePreferences.setRelease(release);\n if (!trimRelease(release).equals(trimRelease(oldRelease))) {\n showDialog(RELEASE_DIALOG);\n }\n }\n\n // If not, see if we have discovered a direct page vendor sending us text pages\n else {\n event = VendorEvent.instance(1);\n if (event.isEnabled()) DonateActivity.launchActivity(CadPageActivity.this, event, null);\n }\n }\n });\n }\n \n // Otherwise, if we should automatically display a call, do it now\n else if (msg != null) {\n\n // But first to the initial permission check\n ManagePreferences.checkInitialPermissions(null);\n\n // Before we open the call display window, see if notifications were requested\n // And if they were, see if we should launch the Scanner channel open.\n // We can't do this in the Broadcast Receiver because this window obscures it\n // completely, so their Activity won't launch.\n\n if (intent.getBooleanExtra(EXTRA_NOTIFY, false)) {\n ManageNotification.show(this, msg);\n SmsService.launchScanner(this);\n }\n\n // OK, go ahead and open the call display window\n // Delay by 100 msecs in attempt to avoid a nasty badtokenException.\n final Activity context = this;\n msgId = msg.getMsgId();\n if (!context.isFinishing()) {\n if (Log.DEBUG) Log.v(\"CadPageActivity Auto launch SmsPopup for \" + msgId);\n SmsPopupActivity.launchActivity(context, msgId);\n }\n }\n\n initializing = false;\n }",
"public Boolean isProfileRunning() {\n return this.isProfileRunning;\n }",
"boolean hasStartingInfo();",
"@Override\n\tpublic void earlyStartup() {\n\t}",
"public void pauseApp() {\n theIsRunning = false;\n }",
"private void m6589F() {\n C1413m.f5712j = 1;\n this.f5402V = new Intent(this, RecordService.class);\n this.f5402V.putExtra(\"record_activity_type\", 101);\n this.f5403W = new C1291e(this, (C1296Ua) null);\n C0938a.m5002a(\"SR/SoundRecorder\", \"<initService> isAppForeground: \");\n try {\n if (Build.VERSION.SDK_INT >= 28) {\n startForegroundService(this.f5402V);\n } else {\n startService(this.f5402V);\n }\n } catch (Exception e) {\n C0938a.m5004b(\"SR/SoundRecorder\", \"initService\" + e);\n }\n bindService(this.f5402V, this.f5403W, 1);\n this.f5429m = true;\n m6600Q();\n m6599P();\n }",
"private void CheckIfServiceIsRunning() {\n\t\tLog.i(\"Convert\", \"At isRunning?.\");\n\t\tif (eidService.isRunning()) {\n//\t\t\tLog.i(\"Convert\", \"is.\");\n\t\t\tdoBindService();\n\t\t} else {\n\t\t\tLog.i(\"Convert\", \"is not, start it\");\n\t\t\tstartService(new Intent(IDManagement.this, eidService.class));\n\t\t\tdoBindService();\n\t\t}\n\t\tLog.i(\"Convert\", \"Done isRunning.\");\n\t}",
"@Override\n public void success() {\n XSPSystem.getInstance().installApp(PjjApplication.App_Path + appName);\n }",
"protected void onFirstTimeLaunched() {\n }",
"public void notifyStartup();",
"public static void handleApplicationLaunch(Context context) {\n SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);\n\n boolean doNotRemindAgain = sharedPrefs.getBoolean(PREF_KEY_DO_NOT_REMIND_AGAIN, false);\n if (!doNotRemindAgain) {\n // Increment launch counter\n long launchCount = sharedPrefs.getLong(PREF_KEY_LAUNCH_COUNT, 0);\n launchCount++;\n Log.d(TAG, \"The application has been launched \" + launchCount + \" times.\");\n sharedPrefs.edit().putLong(PREF_KEY_LAUNCH_COUNT, launchCount).commit();\n\n // Get date of first launch\n long now = System.currentTimeMillis();\n Long dateOfFirstLaunch = sharedPrefs.getLong(PREF_KEY_DATE_OF_FIRST_LAUNCH, now);\n if (dateOfFirstLaunch == now) {\n sharedPrefs.edit().putLong(PREF_KEY_DATE_OF_FIRST_LAUNCH, now).commit();\n }\n long numberOfDaysSinceFirstLaunch = convertMillisToDays(now - dateOfFirstLaunch);\n Log.d(TAG, \"It has been \" + numberOfDaysSinceFirstLaunch + \" days since first launch\");\n\n if (numberOfDaysSinceFirstLaunch >= NUMBER_OF_DAYS_TIL_PROMPT &&\n launchCount >= NUMBER_OF_LAUNCHES_TIL_PROMPT) {\n // It's time. Ask the user to rate the app.\n showRateApplicationDialog(context, sharedPrefs);\n }\n }\n }",
"public static void setApplicationInitialized() {\n applicationInitialized = true;\n }",
"public boolean start() {\n\t\treturn true;\n\t}",
"public boolean isNotFirstInstallation(){\n return mSharedPreferences.contains(SharedPrefContract.PREF_INSTALLED) && mSharedPreferences.getBoolean(SharedPrefContract.PREF_INSTALLED, false);\n }",
"private static boolean isFirstLaunch() {\n if (new File(\"couchbase-sync.state\").exists()) {\n return false;\n }\n return true;\n }",
"@Override\r\n public boolean isRunning()\r\n {\n return initialized;\r\n }",
"private boolean checkPhoneStatusOK() {\n return true;\n }",
"public static boolean initApp(final Activity activity) {\n\t\tLog.i(\"FEEDHENRY\", \"In initApp\");\n\t\tif (FHAgent.isOnline()) {\n\t\t\tif (activity == null) {\n\t\t\t\tinitFH(activity);\n\t\t\t} else {\n\t\t\t\tactivity.runOnUiThread(new Runnable() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tinitFH(activity);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\tisInitialised = true;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"boolean isRunning( String profileId );",
"public final void onResume() {\n ApplicationInfo applicationInfo;\n f31972d.mo25412b(\"onResume\", new Object[0]);\n super.onResume();\n try {\n xxa xxa = this.f31973e;\n if (xxa == null) {\n xxq xxq = this.f31974f;\n if (xxq == null) {\n f31972d.mo25418e(\"No FIDO API call to resume, and a new request is being processed.\", new Object[0]);\n RequestParams requestParams = (RequestParams) getIntent().getParcelableExtra(\"RequestExtra\");\n this.f31976h = requestParams;\n String str = this.f31975g;\n if (requestParams instanceof BrowserRequestParams) {\n str = ((BrowserRequestParams) requestParams).mo18804e().getAuthority();\n } else {\n PackageManager packageManager = getApplicationContext().getPackageManager();\n try {\n applicationInfo = packageManager.getApplicationInfo(str, 0);\n } catch (PackageManager.NameNotFoundException e) {\n f31972d.mo25418e(\"Application info cannot be retrieved\", new Object[0]);\n applicationInfo = null;\n }\n if (applicationInfo == null || packageManager.getApplicationLabel(applicationInfo) == null) {\n f31972d.mo25418e(\"Cannot retrieve application name and package name is used instead\", new Object[0]);\n } else {\n str = packageManager.getApplicationLabel(applicationInfo).toString();\n }\n }\n sdo.m34971a(!str.trim().isEmpty(), (Object) \"App name or authority from request params cannot be empty after trimming.\");\n this.f52327b = new ycc(this, str, false);\n ybu ybu = new ybu(this);\n ybv ybv = new ybv(this);\n Context applicationContext = getApplicationContext();\n try {\n if (!(this.f31976h instanceof BrowserRequestParams)) {\n xxq xxq2 = new xxq(this.f31977i);\n this.f31974f = xxq2;\n RequestParams requestParams2 = this.f31976h;\n if (requestParams2 instanceof RegisterRequestParams) {\n xwj xwj = this.f31978j;\n RegisterRequestParams registerRequestParams = (RegisterRequestParams) requestParams2;\n new xbd(applicationContext);\n String str2 = this.f31975g;\n sek sek = xxq.f53341c;\n String valueOf = String.valueOf(str2);\n sek.mo25414c(valueOf.length() == 0 ? new String(\"headfulRegister is called by \") : \"headfulRegister is called by \".concat(valueOf), new Object[0]);\n xbc a = xbd.m42595a(str2);\n if (a != null) {\n xxq2.f53343b = true;\n xxs xxs = xxq2.f53342a;\n xyy a2 = xxq2.mo30231a(applicationContext);\n xxs.f53345g.mo25414c(\"doRegister for apps is called\", new Object[0]);\n xxs.f53346b = applicationContext;\n xxs.f53347c = ybv;\n xxs.f53348d = a2;\n xxs.f53349e = new xxg(registerRequestParams);\n xxs.f53350f.mo30201a(xwj, str2, registerRequestParams, a2.mo30279a());\n if (a2.mo30279a().isEmpty()) {\n xxs.f53345g.mo25418e(\"No enabled transport found on the platform\", new Object[0]);\n xxs.mo30235a(xwj, ErrorCode.CONFIGURATION_UNSUPPORTED);\n return;\n }\n xxs.mo30237a(xwj, a);\n return;\n }\n throw new SecurityException(\"Calling app is unknown; facetId should not be null!\");\n } else if (requestParams2 instanceof SignRequestParams) {\n xwj xwj2 = this.f31978j;\n SignRequestParams signRequestParams = (SignRequestParams) requestParams2;\n new xbd(applicationContext);\n String str3 = this.f31975g;\n sek sek2 = xxq.f53341c;\n String valueOf2 = String.valueOf(str3);\n sek2.mo25414c(valueOf2.length() == 0 ? new String(\"headfulSign is called by \") : \"headfulSign is called by \".concat(valueOf2), new Object[0]);\n xbc a3 = xbd.m42595a(str3);\n if (a3 != null) {\n xxq2.f53343b = true;\n xxs xxs2 = xxq2.f53342a;\n xyy a4 = xxq2.mo30231a(applicationContext);\n xxs.f53345g.mo25414c(\"doSign for apps is called\", new Object[0]);\n xxs2.f53346b = applicationContext;\n xxs2.f53347c = ybu;\n xxs2.f53348d = a4;\n xxs2.f53349e = new xxl(signRequestParams);\n xxs2.f53350f.mo30202a(xwj2, str3, signRequestParams, xxs2.f53348d.mo30279a());\n if (a4.mo30279a().isEmpty()) {\n xxs.f53345g.mo25418e(\"No enabled transport found on the platform\", new Object[0]);\n xxs2.mo30235a(xwj2, ErrorCode.CONFIGURATION_UNSUPPORTED);\n return;\n }\n xxs2.mo30237a(xwj2, a3);\n return;\n }\n throw new SecurityException(\"Calling app is unknown; facetId should not be null!\");\n } else {\n f31972d.mo25418e(\"Unsupported RequestParams type!\", new Object[0]);\n }\n } else {\n xxa xxa2 = new xxa(this.f31977i);\n this.f31973e = xxa2;\n RequestParams requestParams3 = this.f31976h;\n if (requestParams3 instanceof BrowserRegisterRequestParams) {\n xwj xwj3 = this.f31978j;\n BrowserRegisterRequestParams browserRegisterRequestParams = (BrowserRegisterRequestParams) requestParams3;\n xbd xbd = new xbd(applicationContext);\n String str4 = this.f31975g;\n sek sek3 = xxa.f53319c;\n String valueOf3 = String.valueOf(str4);\n sek3.mo25414c(valueOf3.length() == 0 ? new String(\"headfulRegister is called by \") : \"headfulRegister is called by \".concat(valueOf3), new Object[0]);\n xxa2.f53321b = true;\n if (xbd.mo29604a(browserRegisterRequestParams.f31888b.toString(), str4) != null) {\n xxa2.f53320a.mo30233a(applicationContext, xwj3, browserRegisterRequestParams, ybv, xxa2.mo30208a(applicationContext), str4);\n return;\n }\n throw new SecurityException(\"Calling app is not a legitimate browser!\");\n } else if (requestParams3 instanceof BrowserSignRequestParams) {\n xwj xwj4 = this.f31978j;\n BrowserSignRequestParams browserSignRequestParams = (BrowserSignRequestParams) requestParams3;\n xbd xbd2 = new xbd(applicationContext);\n String str5 = this.f31975g;\n sek sek4 = xxa.f53319c;\n String valueOf4 = String.valueOf(str5);\n sek4.mo25414c(valueOf4.length() == 0 ? new String(\"headfulSign is called by \") : \"headfulSign is called by \".concat(valueOf4), new Object[0]);\n xxa2.f53321b = true;\n if (xbd2.mo29604a(browserSignRequestParams.f31890b.toString(), str5) != null) {\n xxa2.f53320a.mo30234a(applicationContext, xwj4, browserSignRequestParams, ybu, xxa2.mo30208a(applicationContext), str5);\n return;\n }\n throw new SecurityException(\"Calling app is not a legitimate browser!\");\n } else {\n f31972d.mo25418e(\"Unsupported BrowserRequestParams type!\", new Object[0]);\n }\n }\n } catch (SecurityException e2) {\n this.f31977i.mo30184a(this.f31978j, e2);\n mo18877a(new ErrorResponseData(ErrorCode.BAD_REQUEST, \"SecurityException\"));\n } catch (Exception e3) {\n this.f31977i.mo30184a(this.f31978j, e3);\n mo18877a(new ErrorResponseData(ErrorCode.OTHER_ERROR));\n }\n } else {\n xxq.mo30232a(StateUpdate.f31873c);\n }\n } else {\n xxa.mo30209a(StateUpdate.f31873c);\n }\n } catch (SecurityException e4) {\n this.f31977i.mo30184a(this.f31978j, e4);\n mo18877a(new ErrorResponseData(ErrorCode.BAD_REQUEST, \"SecurityException\"));\n } catch (Exception e5) {\n this.f31977i.mo30184a(this.f31978j, e5);\n mo18877a(new ErrorResponseData(ErrorCode.OTHER_ERROR));\n }\n }",
"boolean isStarted();",
"boolean isStarted();",
"@Override\r\n\tprotected void onResume() {\n\t\tsuper.onResume();\r\n\t\tmNtApi.start();\r\n\t}",
"private OwnedState calculateIsRunningOnManagedProfile(Context context) {\n long startTime = SystemClock.elapsedRealtime();\n boolean hasProfileOwnerApp = false;\n boolean hasDeviceOwnerApp = false;\n PackageManager packageManager = context.getPackageManager();\n DevicePolicyManager devicePolicyManager =\n (DevicePolicyManager) context.getSystemService(\n Context.DEVICE_POLICY_SERVICE);\n\n for (PackageInfo pkg : packageManager.getInstalledPackages(/* flags= */ 0)) {\n assert devicePolicyManager != null;\n if (devicePolicyManager.isProfileOwnerApp(pkg.packageName)) {\n hasProfileOwnerApp = true;\n }\n if (devicePolicyManager.isDeviceOwnerApp(pkg.packageName)) {\n hasDeviceOwnerApp = true;\n }\n if (hasProfileOwnerApp && hasDeviceOwnerApp) break;\n }\n\n long endTime = SystemClock.elapsedRealtime();\n RecordHistogram.recordTimesHistogram(\n \"EnterpriseCheck.IsRunningOnManagedProfileDuration\",\n endTime - startTime);\n\n return new OwnedState(hasDeviceOwnerApp, hasProfileOwnerApp);\n }",
"private boolean checkFirstRun(Context context) {\n\n final String PREFS_NAME = \"com.zgsoft.prefs\";\n final String PREF_VERSION_CODE_KEY = \"version_code\";\n final int DOESNT_EXIST = -1;\n // String packageName=null;\n\n\n // Get current version code\n int currentVersionCode = 0;\n try {\n PackageInfo packageInfo =context.getPackageManager().getPackageInfo(context.getPackageName(), 0);\n currentVersionCode =packageInfo.versionCode;\n //packageName = packageInfo.packageName;\n\n } catch (android.content.pm.PackageManager.NameNotFoundException e) {\n // handle exception\n e.printStackTrace();\n return false;\n }\n\n\n // Get saved version code\n SharedPreferences prefs = context.getSharedPreferences(PREFS_NAME, android.content.Context.MODE_PRIVATE);\n int savedVersionCode = prefs.getInt(PREF_VERSION_CODE_KEY, DOESNT_EXIST);\n\n // Check for first run or upgrade\n if (currentVersionCode == savedVersionCode) {\n\n // This is just a normal run\n return false;\n\n } else {\n // Update the shared preferences with the current version code\n prefs.edit().putInt(PREF_VERSION_CODE_KEY, currentVersionCode).commit();\n return true;\n }\n\n }",
"public boolean showPIPUpgrade(){\n if (!Preferences.hasUpgrade && Tools.deviceSupportsPIPMode(this)) {\n SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);\n\n //dont show on first launch of app\n boolean firstLaunch = prefs.getBoolean(\"firstlaunch\",true);\n if (!firstLaunch) {\n\n //Only show popup max once per day\n\n int dayLastShown = prefs.getInt(\"lastdayshownupgrade\", -1);\n\n Calendar calendar = Calendar.getInstance();\n int day = calendar.get(Calendar.DAY_OF_MONTH);\n\n if (dayLastShown!= day){\n prefs.edit().putInt(\"lastdayshownupgrade\", day).apply();\n Intent pipUpgradeIntent = new Intent(VideoPlayActivity.this,PictureInPictureUpgradeActivity.class);\n startActivityForResult(pipUpgradeIntent, REQUEST_UPGRADE);\n return true;\n }\n\n }else {\n prefs.edit().putBoolean(\"firstlaunch\",false).apply();\n }\n }\n return false;\n\n }",
"public boolean isFirstLaunchCalled() {\n return this.f51;\n }",
"boolean hasStarted() {\n return hasStarted;\n }",
"public boolean isStartSetupwizard() {\n\t\treturn sp.getBoolean(\"firstTimePowerOn\", true);\n\t}",
"public Boolean getStartOnStartup() {\n\t\treturn this.startOnStartup;\n\t}",
"boolean hasStartingConfig() {\n return startCfg_ != null;\n }",
"@Test\r\n\tpublic void startapp() {\n\t\tdriver.get(\"http://q.door.fund/\");\r\n\t\tdriver.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS);\r\n\t\tString currentURL = driver.getCurrentUrl();\r\n\t\tAssert.assertTrue(currentURL.contains(\"q.door.fund\"));\r\n\t\tSystem.out.println(\"Application loaded\");\r\n\t}",
"public boolean isActive() {\n/* 134 */ if (this.stub != null) {\n/* 135 */ return this.stub.isActive();\n/* */ }\n/* 137 */ return false;\n/* */ }",
"private void startStep3() {\n\n //And it will be keep running until you close the entire application from task manager.\n //This method will executed only once.\n\n if (!mAlreadyStartedService && mMsgView != null) {\n mMsgView.setText(R.string.msg_location_service_started);\n //Start location sharing service to app server.........\n Intent intent = new Intent(this, LocationMonitoringService.class);\n startService(intent);\n mAlreadyStartedService = true;\n //Ends................................................\n }\n }",
"@Override\n public void startup() {\n }",
"private void checkFirstRun() {\r\n\r\n\t final String PREFS_NAME = \"MyPrefsFile\";\r\n\t final String PREF_VERSION_CODE_KEY = \"version_code\";\r\n\t final int DOESNT_EXIST = -1;\r\n\r\n\r\n\t // Get current version code\r\n\t int currentVersionCode = 0;\r\n\t try {\r\n\t currentVersionCode = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode;\r\n\t } catch (android.content.pm.PackageManager.NameNotFoundException e) {\r\n\t // handle exception\r\n\t Log.e(\"PackageMissing\", \"Package Not Found\");\r\n\t return;\r\n\t }\r\n\r\n\t // Get saved version code\r\n\t SharedPreferences prefs = getSharedPreferences(PREFS_NAME, MODE_PRIVATE);\r\n\t int savedVersionCode = prefs.getInt(PREF_VERSION_CODE_KEY, DOESNT_EXIST);\r\n\r\n\t // Check for first run or upgrade\r\n\t if (currentVersionCode == savedVersionCode) {\r\n\t \t// This is just a normal run\r\n\t return;\r\n\t } else {\r\n\t \tstartActivity(new Intent(DisplayBin.this, DisplayBinHelp.class));\r\n\t }\r\n\t // Update the shared preferences with the current version code\r\n\t prefs.edit().putInt(PREF_VERSION_CODE_KEY, currentVersionCode).commit();\r\n\t}",
"public boolean init() {\n if (!controller.initiateApp()) return false;\n System.out.println(\"App initialized\");\n\n //2. Warming palette table for initial state\n ViewInfo view = controller.getCurrentView();\n if (view == null) return false;\n\n return true;\n }",
"public boolean isStartingUp() {\r\n\t\treturn isStartingUp;\r\n\t}",
"public void setFirstLaunchCalled() {\n this.f51 = true;\n }",
"boolean launch();",
"protected void onResume() {\n super.onResume();\n startServices();\n }",
"@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\t\tSalinlahiFour.getBgm().start();\n\t}",
"boolean hasApplicationProcessInstance();",
"public boolean iAmRunning();",
"public static boolean inactivateStartGuide(){\n long inactivationTime = 1494536399000L;\r\n long currentTime = System.currentTimeMillis();\r\n boolean inactive = currentTime > inactivationTime;\r\n Log.i(StartPrefsHelper.class.getName(), \"Start Guide inactive: \" + inactive + \", inactivationTime: \" + new Date(inactivationTime) + \", currentTime: \" + new Date(currentTime));\r\n return inactive;\r\n }",
"@Override\n protected void onResume() {\n super.onResume();\n registerReceiver(mReceiver, mIntentFilter);\n registerLocalService();\n }",
"public void initialize() {\n\n getStartUp();\n }",
"private void showOrLoadApplications() {\n //nocache!!\n GetAppList getAppList = new GetAppList();\n if (plsWait == null && (getAppList.getStatus() == AsyncTask.Status.PENDING || getAppList.getStatus() == AsyncTask.Status.FINISHED)) {\n getAppList.setContext(this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);\n }\n }",
"private final boolean m878a() {\n try {\n ApplicationInfo applicationInfo = this.f1350b.getPackageManager().getApplicationInfo(this.f1350b.getPackageName(), 128);\n return (applicationInfo == null || applicationInfo.metaData == null || !Boolean.TRUE.equals(applicationInfo.metaData.get(\"com.android.vending.splits.required\"))) ? false : true;\n } catch (PackageManager.NameNotFoundException e) {\n f1349a.mo44091d(\"App '%s' is not found in the PackageManager\", this.f1350b.getPackageName());\n return false;\n }\n }",
"private boolean checkExecution() {\n if (!checkPhoneStatusOK()) {\n return false;\n }\n if (!checkBatteryLevelOK()) {\n return false;\n }\n return true;\n }",
"void onStart(@Observes Startup event, ApplicationLifecycle app) {\n\n\t\tif (!newstore)\n\t\t\tapp.markAsRestart();\n\t\t\n\t}",
"@Override\n public boolean isRunning() {\n if (lumenClient == null || spine == null || !spine.isRunning()) {\n return false;\n } else {\n return true;\n }\n }",
"public boolean isStarted(){\n \treturn started;\n }",
"public void onResume(){\r\n\t\t//necessary if bluetooth-enabling-dialog appears \r\n\t\taddPairedDevices();\r\n\t\tsuper.onResume();\r\n\t}",
"@Override\n public void onResume() {\n super.onResume();\n Utility.setupForegroundDispatch(this);\n Utility.startConnectivityCheck(this);\n }",
"@Override\n protected void onResume() {\n super.onResume();\n if (!isAppInBackground) {\n // app 从后台唤醒,进入前台\n isAppInBackground = false;\n }\n }",
"@PostConstruct\r\n\t public void initApplication() {\r\n\t log.info(\"Running with Spring profile(s) : {}\", Arrays.toString(env.getActiveProfiles()));\r\n\t Collection<String> activeProfiles = Arrays.asList(env.getActiveProfiles());\r\n\t if (activeProfiles.contains(Constants.SPRING_PROFILE_DEVELOPMENT) && activeProfiles.contains(Constants.SPRING_PROFILE_PRODUCTION)) {\r\n\t log.error(\"You have misconfigured your application! It should not run \" +\r\n\t \"with both the 'dev' and 'prod' profiles at the same time.\");\r\n\t }\r\n\t if (activeProfiles.contains(Constants.SPRING_PROFILE_DEVELOPMENT) && activeProfiles.contains(Constants.SPRING_PROFILE_CLOUD)) {\r\n\t log.error(\"You have misconfigured your application! It should not\" +\r\n\t \"run with both the 'dev' and 'cloud' profiles at the same time.\");\r\n\t }\r\n\t }",
"public boolean isSuspended();",
"public static boolean vu0IsRunning() { return false; }",
"private void checkFirstLaunch(){\n SharedPreferencesEditor editor = new SharedPreferencesEditor(this);\n boolean test = editor.GetBoolean(\"firstLaunch\");\n if(test){\n loadData();\n return;\n }\n startActivity(new Intent(MainActivity.this, FirstLaunch.class));\n editor.WriteBoolean(\"firstLaunch\", true);\n }",
"public boolean isFirstRun() {\n int currentVersionCode = 0;\n boolean firstRun = false;\n\n try {\n currentVersionCode = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionCode;\n } catch (android.content.pm.PackageManager.NameNotFoundException e) {\n // handle exception\n //e.printStackTrace();\n }\n\n // Get saved version code\n SharedPreferences prefs = context.getSharedPreferences(VERSION_PREFS_NAME, Context.MODE_PRIVATE);\n int savedVersionCode = prefs.getInt(PREF_VERSION_CODE_KEY, DOESNT_EXIST);\n\n // Check for first run or upgrade\n if (currentVersionCode == savedVersionCode) {\n\n // This is just a normal run\n\n } else if (savedVersionCode == DOESNT_EXIST) {\n\n // TODO This is a new install (or the user cleared the shared preferences)\n firstRun = true;\n\n } else if (currentVersionCode > savedVersionCode) {\n\n // TODO This is an upgrade\n\n }\n\n // Update the shared preferences with the current version code\n prefs.edit().putInt(PREF_VERSION_CODE_KEY, currentVersionCode).commit();\n\n return firstRun;\n\n }",
"public boolean isServiceRunning();",
"public boolean isSuspended() {\n return suspended != 0;\n }",
"void enterSipAppHa(boolean startCacheActivity);",
"public abstract void startup();",
"private synchronized boolean waitResume() {\n return true;\n }",
"public boolean isStarted() {\n \t\treturn isStarted;\n \t}",
"boolean hasPlayready();",
"public boolean isServiceReady();",
"private boolean isBundleActive(final Bundle b) {\n if ( BundleUtil.isBundleActive(b) ) {\n return true;\n }\n final BundleStartLevel startLevelService = b.adapt(BundleStartLevel.class);\n return startLevelService.isPersistentlyStarted();\n }",
"public boolean isSuspended() { return suspended; }",
"public PSFUDApplication()\n {\n loadSnapshot();\n }",
"public synchronized static boolean isServiceRunning(){\n return prefs.getBoolean(IS_SERVICE_RUNNING, false);\n }",
"@Override\n\t@Ignore\n\t@Test\n\tpublic void testLaunchThenResume() throws Throwable {\n\t}",
"private void doWiperAvailabiltiyCheck()\n {\n // Hardcode for now to make sure WPS is not triggered\n bWiperAvailable = true;\n\n mWifi = (WifiManager)getSystemService(mContext.WIFI_SERVICE);\n\n if ((mWifi == null) || ( (locationManager == null)|| ((locationProvider = locationManager.getProvider(LocationManager.NETWORK_PROVIDER )) == null)))\n {\n Log.e(TAG,\" Disable wiper : No object for WPS / Wifi Scans \");\n bWiperAvailable = false;\n }\n\n\n // call native function to trigger RPC from A11-> A9\n // informing about WPS capability\n //\n native_notify_wiper_available(bWiperAvailable);\n\n if (Config.LOGV)\n {\n Log.v(TAG, \"Wiper: Availability Check \"+ bWiperAvailable);\n }\n }",
"@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\t\t\n\t\tcom.facebook.AppEventsLogger.activateApp(HomeActivity.this, \"312401348947190\");\n\t}",
"public boolean isRunning();",
"public boolean isRunning();",
"public boolean isRunning();",
"public boolean isRunning();",
"public boolean isRunning();",
"public boolean isRunning();",
"boolean isRunning();",
"boolean isRunning();",
"boolean isRunning();"
]
| [
"0.6352449",
"0.6203401",
"0.6178434",
"0.6171898",
"0.61025953",
"0.6074741",
"0.59975463",
"0.59882075",
"0.59746027",
"0.5963654",
"0.5963654",
"0.5959562",
"0.59397745",
"0.5937864",
"0.59244",
"0.59206015",
"0.5902124",
"0.588532",
"0.58659554",
"0.5833258",
"0.5831266",
"0.58244604",
"0.5821199",
"0.5806238",
"0.5805579",
"0.57959354",
"0.57806367",
"0.5771333",
"0.5765008",
"0.5727544",
"0.57224786",
"0.57154435",
"0.5682193",
"0.56680965",
"0.56549984",
"0.56529725",
"0.56453866",
"0.56453866",
"0.56400687",
"0.56369525",
"0.56266487",
"0.561508",
"0.56103814",
"0.5606266",
"0.5595809",
"0.55802506",
"0.5576904",
"0.5571656",
"0.5559893",
"0.55542237",
"0.55507845",
"0.55502254",
"0.55398506",
"0.5525966",
"0.552032",
"0.5514465",
"0.5508177",
"0.55080426",
"0.5501527",
"0.5492705",
"0.54864776",
"0.5474206",
"0.5473839",
"0.5465995",
"0.54565215",
"0.54534227",
"0.54506487",
"0.5446379",
"0.54454195",
"0.5439156",
"0.5432838",
"0.54323536",
"0.54316765",
"0.54217196",
"0.5417085",
"0.54169554",
"0.54162025",
"0.54106724",
"0.5409027",
"0.54036987",
"0.5398339",
"0.53974783",
"0.5393431",
"0.5385705",
"0.5384067",
"0.5382789",
"0.5379826",
"0.5379083",
"0.53690237",
"0.5360055",
"0.53590083",
"0.5356752",
"0.5354403",
"0.5354403",
"0.5354403",
"0.5354403",
"0.5354403",
"0.5354403",
"0.5348813",
"0.5348813",
"0.5348813"
]
| 0.0 | -1 |
delay is in seconds | void restartEventsWithDelay(final boolean longDelay, final boolean alsoRescan, final boolean unblockEventsRun,
final int logType)
{
if (longDelay) {
Data workData = new Data.Builder()
.putBoolean(PhoneProfilesService.EXTRA_ALSO_RESCAN, alsoRescan)
.putBoolean(PhoneProfilesService.EXTRA_UNBLOCK_EVENTS_RUN, unblockEventsRun)
.putInt(PhoneProfilesService.EXTRA_LOG_TYPE, logType)
.build();
OneTimeWorkRequest restartEventsWithDelayWorker;
restartEventsWithDelayWorker =
new OneTimeWorkRequest.Builder(RestartEventsWithDelayWorker.class)
.addTag(RestartEventsWithDelayWorker.WORK_TAG_2)
.setInputData(workData)
.setInitialDelay(15, TimeUnit.SECONDS)
.build();
try {
if (PPApplicationStatic.getApplicationStarted(true, true)) {
WorkManager workManager = PPApplication.getWorkManagerInstance();
if (workManager != null) {
// //if (PPApplicationStatic.logEnabled()) {
// ListenableFuture<List<WorkInfo>> statuses;
// statuses = workManager.getWorkInfosForUniqueWork(RestartEventsWithDelayWorker.WORK_TAG);
// try {
// List<WorkInfo> workInfoList = statuses.get();
// } catch (Exception ignored) {
// }
// //}
// PPApplicationStatic.logE("[WORKER_CALL] DataWrapper.restartEventsWithDelay", "xxx");
//workManager.enqueue(restartEventsWithDelayWorker);
//if (replace)
workManager.enqueueUniqueWork(RestartEventsWithDelayWorker.WORK_TAG_2, ExistingWorkPolicy.REPLACE, restartEventsWithDelayWorker);
//else
// workManager.enqueueUniqueWork(RestartEventsWithDelayWorker.WORK_TAG_APPEND, ExistingWorkPolicy.APPEND_OR_REPLACE, restartEventsWithDelayWorker);
}
}
} catch (Exception e) {
PPApplicationStatic.recordException(e);
}
} else {
// PPApplicationStatic.logE("[EXECUTOR_CALL] ***** DataWrapper.restartEventsWithDelay", "schedule");
final Context appContext = context.getApplicationContext();
//final ScheduledExecutorService worker = Executors.newSingleThreadScheduledExecutor();
Runnable runnable = () -> {
// long start = System.currentTimeMillis();
// PPApplicationStatic.logE("[IN_EXECUTOR] ***** DataWrapper.restartEventsWithDelay", "--------------- START");
PowerManager powerManager = (PowerManager) appContext.getSystemService(Context.POWER_SERVICE);
PowerManager.WakeLock wakeLock = null;
try {
if (powerManager != null) {
wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, PPApplication.PACKAGE_NAME + ":DataWrapper_restartEventsWithDelay");
wakeLock.acquire(10 * 60 * 1000);
}
//PPExecutors.doRestartEventsWithDelay(alsoRescan, unblockEventsRun, logType, context);
DataWrapper dataWrapper = new DataWrapper(appContext, false, 0, false, 0, 0, 0f);
if (logType != PPApplication.ALTYPE_UNDEFINED)
PPApplicationStatic.addActivityLog(appContext, logType, null, null, "");
//dataWrapper.restartEvents(unblockEventsRun, true, true, false);
dataWrapper.restartEventsWithRescan(alsoRescan, unblockEventsRun, false, false, true, false);
//dataWrapper.invalidateDataWrapper();
// long finish = System.currentTimeMillis();
// long timeElapsed = finish - start;
// PPApplicationStatic.logE("[IN_EXECUTOR] ***** DataWrapper.restartEventsWithDelay", "--------------- END - timeElapsed="+timeElapsed);
} catch (Exception e) {
// PPApplicationStatic.logE("[IN_EXECUTOR] PPApplication.startHandlerThread", Log.getStackTraceString(e));
PPApplicationStatic.recordException(e);
} finally {
if ((wakeLock != null) && wakeLock.isHeld()) {
try {
wakeLock.release();
} catch (Exception ignored) {
}
}
//worker.shutdown();
}
};
PPApplicationStatic.createDelayedEventsHandlerExecutor();
PPApplication.delayedEventsHandlerExecutor.schedule(runnable, 5, TimeUnit.SECONDS);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setDelay(long d){delay = d;}",
"private void delay() {\n\t\tDelay.msDelay(1000);\n\t}",
"private void delay() {\n\ttry {\n\t\tThread.sleep(500);\n\t} catch (InterruptedException e) {\n\t\t// TODO Auto-generated catch block\n\t\te.printStackTrace();\n\t}\t\n\t}",
"public void setDelay(long delay) {\n this.delay = delay;\n }",
"public void setDelay(int delay)\n {\n this.delay = delay;\n }",
"public void setDelay(int delay) {\n this.delay = delay;\n }",
"public double getDelay();",
"public void setDelay(double clock);",
"public long getDelay();",
"public abstract int delay();",
"public void moveDelay ( )\r\n\t{\r\n\t\ttry {\r\n\t\t\tThread.sleep( 1000 );\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"public static void delay() {\n\n long ONE_SECOND = 1_000;\n\n try {\n Thread.sleep(ONE_SECOND);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }",
"private static void addDelay() {\n try {\n Thread.sleep(4000);\n } catch (InterruptedException ignored) {\n }\n }",
"private void emulateDelay() {\n try {\n Thread.sleep(700);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }",
"public static void sleep(int delay) {\n try {\n \t// int delay = (int)(Math.random()*maxDelay);\n Thread.sleep(delay);\n } catch (InterruptedException e) {}\n\t}",
"public void setDelay(BigDecimal delay) {\r\n this.delay = delay;\r\n }",
"public Delay(int sd){\n super(\"delay\");\n delay = sd;\n\n }",
"public void setDelaytime(Long delaytime) {\n this.delaytime = delaytime;\n }",
"public int getDelay()\r\n {\r\n return this.delay;\r\n }",
"public void setDelay(org.apache.axis.types.UnsignedInt delay) {\n this.delay = delay;\n }",
"public long getDelay()\n {\n return delay;\n }",
"private void delay (int milliSec)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tThread.sleep (milliSec);\r\n\t\t}\r\n\t\tcatch (InterruptedException e)\r\n\t\t{\r\n\t\t}\r\n\t}",
"public long getDelay() {\n return this.delay;\n }",
"private void changeDelay() {\n delay = ((int) (Math.random() * 10000) + 1000) / MAX_FRAMES;\n }",
"public void crawlDelay()\n\t{\n//\t\tint delay = robot.getCrawlDelay(best_match);\n//\t\tif (delay!=-1)\n//\t\t{\n//\t\t\ttry \n//\t\t\t{\n//\t\t\t\tTimeUnit.SECONDS.sleep(robot.getCrawlDelay(best_match));\n//\t\t\t} \n//\t\t\tcatch (InterruptedException e) \n//\t\t\t{\n//\t\t\t\treturn;\n//\t\t\t}\n//\t\t}\n\t}",
"public void delay(){\n try {\n Thread.sleep((long) ((samplingTime * simulationSpeed.factor)* 1000));\n } catch (InterruptedException e) {\n started = false;\n }\n }",
"public Integer threadDelay();",
"public int getDelay() {\r\n return delay;\r\n }",
"public static void sleep(int delay) {\n try {\n Thread.sleep(delay);\n } catch (InterruptedException e) {\n }\n }",
"@Test\n public void testDelay() {\n long future = System.currentTimeMillis() + (rc.getRetryDelay() * 1000L);\n\n rc.delay();\n\n assertTrue(System.currentTimeMillis() >= future);\n }",
"public static void randomDelay() {\n\n Random random = new Random();\n int delay = 500 + random.nextInt(2000);\n try {\n sleep(delay);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }",
"@Override\n public native void delay(int ms);",
"public void setDelay(int delay) {\n\t\t if (delay != this.delay) logger.info(\"New delay is: \"+getElapsedTimeHoursMinutesSecondsString(delay)); \n\t\t if (delay < this.delay) {\n\t\t\t scheduledFuture.cancel(true);\n\t\t\t reset(delay); \n\t\t }\n\t\t this.delay = delay;\n\t }",
"public void setDelayMove(float delay_)\n\t{\n\t\tdelayMove=delayMove+delay_;\n\t}",
"public int getDelay()\n {\n return delay;\n }",
"public int getDelay() {\r\n\t\treturn delay;\r\n\t}",
"public int getDelay() {\n return delay;\n }",
"public void setDroneDelay(int delay)\r\n {\r\n droneDelay=delay;\r\n }",
"public void setDelayedTimeout(int seconds);",
"public void setDelay(float time)\n\t{\n\t\tdelayMax=time;\n\t}",
"public static void delay(int ms){\r\n\t\t\r\n\t\ttry {\r\n\t\t\tThread.sleep(ms);\r\n\t\t} catch (InterruptedException e1) {\r\n\t\t\te1.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t}",
"public void setDelay(int delay) {\n\t\ttimer.setInitialDelay(delay);\n\t}",
"public void delay(long waitAmount){\r\n long time = System.currentTimeMillis();\r\n while ((time+waitAmount)>=System.currentTimeMillis()){ \r\n //nothing\r\n }\r\n }",
"public Delay(float delay)\n\t{\n\t\tthis(delay,0);\n\t}",
"private void pause() {\n pause(myDelay);\n }",
"public int getDelay() {\n\t\treturn delay;\n\t}",
"long getInitialDelayInSeconds();",
"private void delayStart() {\n try {\n Thread.sleep(3000);\n } catch (InterruptedException e) {\n LOGGER.error(\"Could not sleep\", e);\n }\n }",
"public float getDelay()\n\t{\n\t\treturn delay;\n\t}",
"void delayForDesiredFPS(){\n delayMs=(int)Math.round(desiredPeriodMs-(float)getLastDtNs()/1000000);\n if(delayMs<0) delayMs=1;\n try {Thread.currentThread().sleep(delayMs);} catch (java.lang.InterruptedException e) {}\n }",
"public void setStartDelay(long delay){\n if(delay < 0){\n delay = 0;\n }\n this.mStartDelay = delay;\n }",
"private static void delay() throws InterruptedException {\n\t\tTimeUnit.MILLISECONDS.sleep((long) (minDelay + (long)(Math.random() * ((maxDelay - minDelay) + 1))));\n\t}",
"@Override\n protected void sleep(int milliseconds) {\n super.sleep(milliseconds);\n }",
"public AutonDelay(double timeout) {\n super(\"autonDelay\");\n setTimeout(timeout);\n }",
"private void simulateDelay(long millis) {\n try {\n Thread.sleep(millis);\n } catch (InterruptedException ignored) {\n }\n }",
"@JsonProperty(\"delay\")\n public void setDelay(Double delay) {\n this.delay = delay;\n }",
"private Flusher(final int delay) {\r\n\t\t\tthis.delay = Checks.assertPositive(delay) * MILLISECONDS_PER_SECOND;\r\n\t\t}",
"private void delayedHide(int delayMillis) {\n\n }",
"public int getDelayedTimeout();",
"private int get_delay() {\n double exp = slider1.getValue() / 100.0 - 9; // Range -9, 1\n exp = Math.min(0, exp); // Range -9, 0\n return (int) (Math.pow(10.0, exp) * 100000000.0);\n }",
"int delay(Player player);",
"public Long getDelaytime() {\n return delaytime;\n }",
"public int getDelayTime()\n\t{\n\t\treturn delayTime;\n\t}",
"public void warte( int ms )\n {\n try\n {\n Thread.sleep( ms );\n }\n catch ( InterruptedException e )\n {\n e.printStackTrace();\n }\n }",
"public long getDelay() {\n return mDelay;\n }",
"public void delay(long millisec) {\n try {\n Thread.sleep(millisec);\n } catch (InterruptedException e) {\n LOGGER.info(e.getMessage());\n }\n }",
"public static void createDelay(int duration) {\r\n\t\ttry {\r\n\t\t\tThread.sleep(duration);\r\n\t\t} catch(Exception e) {\r\n\t\t\t//do nothing\r\n\t\t}\r\n\t}",
"public void processDelay() {\n if (errorCounter > 0) {\n if (delayCounter >= AppyAdService.getInstance().maxDelay()) {\n setAdProcessing(true);\n errorCounter = AppyAdService.getInstance().maxErrors() - 1;\n delayCounter = 0;\n }\n else delayCounter++;\n }\n }",
"private void sleep() {\n try {\n Thread.sleep(500);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }",
"public BigDecimal getDelay() {\r\n return delay;\r\n }",
"public void autoStopForwardDelayTime(int delay) throws JposException;",
"public void incrementDelayCounter() {\n\t\tthis.delayCounter++;\n\t}",
"void sleep()\r\n\t{\r\n\t\t\r\n\t}",
"public T setDelay(float delay)\n\t{\n\t\tthis.delay = delay;\n\t\treturn (T) this;\n\t}",
"@Override\n public native void setAutoDelay(int ms);",
"public native void setDelay(int delay) throws MagickException;",
"public void setDelay(int delay, String message){\r\n\t\tcal.add(Calendar.MINUTE, delay);\r\n\t\tdelayTime = new AlarmTime(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH), \r\n\t\t\t\tcal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE), message);\r\n\r\n\t\tSystem.out.println(delayTime.getHour());\r\n\t\tSystem.out.println(delayTime.getMinute());\r\n\r\n\t\talarmList.add(delayTime);\r\n\t\txmanager.write(delayTime);\r\n\t}",
"public void setDelay(int delayValue)\r\n {\r\n\t timer.setDelay(delayValue);\r\n }",
"@Override\n\tpublic void sleep() {\n\t\t\n\t}",
"protected void pause() {\n sleep(300);\n }",
"@WithName(\"schedule.delay\")\n @WithDefault(\"5s\")\n Duration scheduleDelay();",
"public DraggableBehavior setDelay(int delay)\n\t{\n\t\tthis.options.put(\"delay\", delay);\n\t\treturn this;\n\t}",
"void threadDelay() {\n saveState();\n if (pauseSimulator) {\n halt();\n }\n try {\n Thread.sleep(Algorithm_Simulator.timeGap);\n\n } catch (InterruptedException ex) {\n Logger.getLogger(RunBFS.class.getName()).log(Level.SEVERE, null, ex);\n }\n if (pauseSimulator) {\n halt();\n }\n }",
"private static void attendre (int tms) {\n try {Thread.currentThread().sleep(tms);} \r\n catch(InterruptedException e){ }\r\n }",
"private static void attendre (int tms) {\n try {Thread.currentThread().sleep(tms);} \r\n catch(InterruptedException e){ }\r\n }",
"private Sleep(Duration duration) {\n this.duration = duration;\n }",
"private void magneSpinnerDelay(int index) {\n\t\tif (toggleServiceButton.isChecked()) {\n\t\t\tswitch (index) {\n\t\t\tcase 0:\n\t\t\t\tmagneSpinnerDelay = DELAY_FAST;\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tmagneSpinnerDelay = DELAY_GAME;\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tmagneSpinnerDelay = DELAY_UI;\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tmagneSpinnerDelay = DELAY_NORMAL;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tstopMagneService();\n\t\t\tstartMagneService();\n\t\t\tdoMagneBindService();\n\t\t\tstartMagne();\n\t\t} else {\n\t\t\tif (magneService != null) {\n\t\t\t\tstopMagneService();\n\t\t\t}\n\t\t}\n\t\tmagneSpinnerDelay = index;\n\t\tSPE = SP.edit();\n\t\tSPE.putInt(\"magneSpinnerDelay\", magneSpinnerDelay);\n\t\tSPE.commit();\n\t}",
"public void timeDelay(int a) {\n try {\n Thread.sleep(a*1000);\n System.out.println(\". . .\");\n } catch(InterruptedException ex) {\n Thread.currentThread().interrupt();\n }\n }",
"private void delay(int delayTime){\n\t\ttry{\n\t\t\tThread.sleep(delayTime);\n\t\t}catch(InterruptedException e){\n\t\t\t// TODO Auto-generated catch block\n\t\t\tSystem.err.println(e.toString());\n\t\t}\n\t}",
"private void sleep()\n {\n try {\n Thread.sleep(Driver.sleepTimeMs);\n }\n catch (InterruptedException ex)\n {\n\n }\n }",
"public static void delay(){\n System.out.print(\"\");\r\n System.out.print(\"\");\r\n }",
"int getChronicDelayTime();",
"@Override\n public long getDelay(TimeUnit unit) {\n return unit.convert( delayOffset + delayPerElement - System.currentTimeMillis(), TimeUnit.MILLISECONDS );\n }",
"private int blockingDialogDelay()\r\n/* */ {\r\n/* 313 */ Integer delay = null;\r\n/* 314 */ String key = \"BlockingDialogTimer.delay\";\r\n/* 315 */ ApplicationAction action = getAction();\r\n/* 316 */ if (action != null) {\r\n/* 317 */ ResourceMap actionResourceMap = action.getResourceMap();\r\n/* 318 */ String actionName = action.getName();\r\n/* 319 */ delay = actionResourceMap.getInteger(actionName + \".\" + key);\r\n/* */ }\r\n/* 321 */ ResourceMap taskResourceMap = getTask().getResourceMap();\r\n/* 322 */ if ((delay == null) && (taskResourceMap != null)) {\r\n/* 323 */ delay = taskResourceMap.getInteger(key);\r\n/* */ }\r\n/* 325 */ return delay == null ? 0 : delay.intValue();\r\n/* */ }",
"public void wait(final int delay) {\n try {\n Thread.sleep(delay);\n } catch (InterruptedException e) {\n LOGGER.error(\"Wait interrupted: \" + e.getMessage(), e);\n }\n }",
"@Override\n\tpublic void sleeps() {\n\t\t\n\t}",
"private void sleep() {\n try {\n Thread.sleep(3000L);\n }\n catch (Exception ignored) {\n Log.trace(\"Sleep got interrupted.\");\n }\n }",
"public void delayNext()\n {\n\tif (toDo.size() > 1)\n\t {\n\t\tTask t = toDo.get(0);\n\t\ttoDo.set(0, toDo.get(1));\n\t\ttoDo.set(1, t);\n\t }\n }",
"public void addDelay(int delay) {\n lastNeuron().addDelay(delay);\n }",
"private void delaySpinnerStateChanged() {//GEN-FIRST:event_delaySpinnerStateChanged\r\n controller.OnTimeChange(Integer.parseInt((delaySpinner.getValue().toString().trim())));\r\n }",
"public static void delay() throws InterruptedException {\n // This is the sleep thread method that makes the program sleep\n // for a program amount of milliseconds to slow down the program\n Thread.sleep(1500);\n }"
]
| [
"0.8070528",
"0.7980967",
"0.7929627",
"0.78971756",
"0.78373533",
"0.77429044",
"0.7527179",
"0.751989",
"0.75186175",
"0.7474782",
"0.7419411",
"0.7392564",
"0.7290762",
"0.7268825",
"0.72080183",
"0.71911716",
"0.7120583",
"0.7106793",
"0.70950544",
"0.7080644",
"0.70799744",
"0.7053041",
"0.7050972",
"0.703777",
"0.7033887",
"0.7025098",
"0.702189",
"0.70008427",
"0.7000263",
"0.6942179",
"0.6931536",
"0.6924109",
"0.69165146",
"0.6912982",
"0.69073504",
"0.6901645",
"0.6892168",
"0.68738025",
"0.6862735",
"0.68593866",
"0.6857335",
"0.6833373",
"0.6811059",
"0.67921555",
"0.67827624",
"0.6770166",
"0.67698705",
"0.6738393",
"0.6723911",
"0.6689256",
"0.6667687",
"0.66647136",
"0.66565025",
"0.6655516",
"0.66321456",
"0.6624846",
"0.66206455",
"0.6614492",
"0.6603317",
"0.6602198",
"0.6593281",
"0.6564238",
"0.6548478",
"0.6546144",
"0.65328956",
"0.6528228",
"0.6518484",
"0.6506329",
"0.6504583",
"0.6502829",
"0.6499287",
"0.64745367",
"0.64674705",
"0.64460486",
"0.6439596",
"0.64320725",
"0.64291835",
"0.642766",
"0.6414358",
"0.64134943",
"0.64026445",
"0.6401506",
"0.6399975",
"0.6375466",
"0.6375466",
"0.6348179",
"0.6335782",
"0.6328963",
"0.6326784",
"0.62941253",
"0.6293342",
"0.62904775",
"0.62818754",
"0.6277771",
"0.62380207",
"0.62199414",
"0.6218843",
"0.62096626",
"0.6198055",
"0.61918616",
"0.6189722"
]
| 0.0 | -1 |
Devuelve el dato que tiene guardado | public int getDato() {
return dato;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean guardarDatos2(Object dato) {\r\n\t\t\r\n\t\tEntityTransaction transaccion = em.getTransaction();\r\n\t\ttransaccion.begin();\r\n\r\n\t\ttry {\r\n\t\t\tem.persist(dato);\r\n\t\t\tem.flush();\r\n\t\t\ttransaccion.commit();\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tif(transaccion.isActive()){\r\n\t\t\t\ttransaccion.rollback();\r\n\t }\r\n\t\t\treturn false;\r\n\t\t} finally {\r\n\t\t\t//cerrar();\r\n\t\t}\t\t\r\n\t\treturn true;\t\t\r\n\t}",
"private void guardarEstadoObjetosUsados() {\n }",
"public void guardar() {\n String msj = \"\";\n int idpagoanulado = daoPagoCuotaAnulado.nuevoID();\n Date SYSDATE = new Date();\n java.sql.Timestamp fechaPagoCuotaAnuladoSQL = new java.sql.Timestamp(SYSDATE.getTime());\n String observacion = txtObservacion.getText();\n int idmotivo = Integer.parseInt(txtCodigoMotivo.getText());\n int idusuario = appLogin.IDUSUARIO;\n int idpago =Integer.parseInt(txtNumeroPago.getText());\n Date fechapago = daoCotizacion.parseFecha(txtFechaPago.getText());\n java.sql.Date fechapagoSQL = new java.sql.Date(fechapago.getTime());\n double mPago = montoPago;\n String numerocomprobante = txtComprobante.getText();\n String numerorecibo = txtRecibo.getText();\n //VALIDACIONES\n if (idmotivo == 0) {\n msj += \"CODIGO DEL MOTIVO DE ANULACION ESTA VACIO.\\n\";\n }\n if (idpago == 0) {\n msj += \"NO HA SELECCIONADO NINGUN PAGO PARA LA ANULACIÓN.\\n\";\n }\n if (msj.isEmpty()) {\n cpca.setIdpagoanulado(idpagoanulado);\n cpca.setFechahoranulado(fechaPagoCuotaAnuladoSQL);\n cpca.setObservacion(observacion);\n cpca.setIdmotivo(idmotivo);\n cpca.setIdusuario(idusuario);\n cpca.setIdpago(idpago);\n cpca.setFechapago(fechapagoSQL);\n cpca.setMonto(mPago);\n cpca.setNumerocomprobante(numerocomprobante);\n cpca.setNumerorecibo(numerorecibo);\n daoPagoCuotaAnulado.agregar(cpca);\n } else {\n JOptionPane.showMessageDialog(null, msj, \"ERRORES\", JOptionPane.ERROR_MESSAGE);\n }\n }",
"private void guardaRecord() {\n // Guardamos el record\n SharedPreferences datos = PreferenceManager.getDefaultSharedPreferences(this);\n SharedPreferences.Editor miEditor = datos.edit();\n miEditor.putInt(\"RECORD\", record);\n miEditor.apply();\n }",
"private void saveData() {\n }",
"public void almacenoDatos(){\n BaseDatosSecundaria administrador= new BaseDatosSecundaria(this);\n SQLiteDatabase bdsecunadaria= administrador.getWritableDatabase();\n _valuesPedido.put(\"Producto\", this._productoNombre);\n _valuesPedido.put(\"Precio\",this._productoPrecio);\n _valuesPedido.put(\"Cantidad\",this._etAdquirir.getText().toString());\n _valuesPedido.put(\"Vendedor\",this.username);\n _valuesPedido.put(\"Id_Producto\",this._productoId);\n bdsecunadaria.insert(\"DATOS\",null,this._valuesPedido);\n bdsecunadaria.close();\n }",
"public void saveData(){\n SerializableManager.saveSerializable(this,user,\"userInfo.data\");\n SerializableManager.saveSerializable(this,todayCollectedID,\"todayCollectedCoinID.data\");\n SerializableManager.saveSerializable(this,CollectedCoins,\"collectedCoin.data\");\n uploadUserData uploadUserData = new uploadUserData(this);\n uploadUserData.execute(this.Uid);\n System.out.println(Uid);\n\n }",
"public PerfilTO guardarOActualizar(PerfilTO perfil);",
"public void GuardarSerologia(RecepcionSero obj)throws Exception{\n Session session = sessionFactory.getCurrentSession();\n session.saveOrUpdate(obj);\n }",
"@Override\r\n\tpublic void guardar() {\n\t\ttab_cuenta.guardar();\r\n\t\tguardarPantalla();\r\n\t\t\r\n\t}",
"@Override\n\t\tpublic void guardar() {\n\t\t\t\n\t\t\tif (tab_presupuesto.guardar()){\n\t\t\t\tif (tab_asociacion_presupuestaria.guardar()) {\n\t\t\t\t\tguardarPantalla();\n\t\t\t\t\t//Actualizar el arbol\n\t\t\t\t\tarb_clasificador.ejecutarSql();\n\t\t\t\t\tutilitario.addUpdate(\"arb_clasificador\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\n\t\t}",
"@Override\n\tpublic void guardar() {\n\t\tLOG.info(\"El usuario fue guardado \"+ usuario.getApellido()+\", \"+ usuario.getNombre());\n\t}",
"public void guardarDatos() throws Exception {\r\n\t\ttry {\r\n\t\t\tsetUpperCase();\r\n\t\t\tif (validarForm()) {\r\n\t\t\t\t// Cargamos los componentes //\r\n\r\n\t\t\t\tMap datos = new HashMap();\r\n\r\n\t\t\t\tHis_parto his_parto = new His_parto();\r\n\t\t\t\this_parto.setCodigo_empresa(empresa.getCodigo_empresa());\r\n\t\t\t\this_parto.setCodigo_sucursal(sucursal.getCodigo_sucursal());\r\n\t\t\t\this_parto.setCodigo_historia(tbxCodigo_historia.getValue());\r\n\t\t\t\this_parto.setIdentificacion(tbxIdentificacion.getValue());\r\n\t\t\t\this_parto.setFecha_inicial(new Timestamp(dtbxFecha_inicial\r\n\t\t\t\t\t\t.getValue().getTime()));\r\n\t\t\t\this_parto.setConyugue(tbxConyugue.getValue());\r\n\t\t\t\this_parto.setId_conyugue(tbxId_conyugue.getValue());\r\n\t\t\t\this_parto.setEdad_conyugue(tbxEdad_conyugue.getValue());\r\n\t\t\t\this_parto.setEscolaridad_conyugue(tbxEscolaridad_conyugue\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_parto.setMotivo(tbxMotivo.getValue());\r\n\t\t\t\this_parto.setEnfermedad_actual(tbxEnfermedad_actual.getValue());\r\n\t\t\t\this_parto.setAntecedentes_familiares(tbxAntecedentes_familiares\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_parto.setPreeclampsia(rdbPreeclampsia.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setHipertension(rdbHipertension.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setEclampsia(rdbEclampsia.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setH1(rdbH1.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setH2(rdbH2.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setPostimadurez(rdbPostimadurez.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setRot_pre(rdbRot_pre.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setPolihidramnios(rdbPolihidramnios.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setRcui(rdbRcui.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setPelvis(rdbPelvis.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setFeto_macrosonico(rdbFeto_macrosonico\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setIsoinmunizacion(rdbIsoinmunizacion\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setAo(rdbAo.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setCirc_cordon(rdbCirc_cordon.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setPostparto(rdbPostparto.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setDiabetes(rdbDiabetes.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setCardiopatia(rdbCardiopatia.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setAnemias(rdbAnemias.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setEnf_autoinmunes(rdbEnf_autoinmunes\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setEnf_renales(rdbEnf_renales.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setInf_urinaria(rdbInf_urinaria.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setEpilepsia(rdbEpilepsia.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto\r\n\t\t\t\t\t\t.setTbc(rdbTbc.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setMiomas(rdbMiomas.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setHb(rdbHb.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setFumadora(rdbFumadora.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setInf_puerperal(rdbInf_puerperal.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setInfertilidad(rdbInfertilidad.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setMenarquia(tbxMenarquia.getValue());\r\n\t\t\t\this_parto.setCiclos(tbxCiclos.getValue());\r\n\t\t\t\this_parto.setVida_marital(tbxVida_marital.getValue());\r\n\t\t\t\this_parto.setVida_obstetrica(tbxVida_obstetrica.getValue());\r\n\t\t\t\this_parto.setNo_gestaciones(lbxNo_gestaciones.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setParto(lbxParto.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setAborto(lbxAborto.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setCesarias(lbxCesarias.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setFecha_um(new Timestamp(dtbxFecha_um.getValue()\r\n\t\t\t\t\t\t.getTime()));\r\n\t\t\t\this_parto.setUm(tbxUm.getValue());\r\n\t\t\t\this_parto.setFep(tbxFep.getValue());\r\n\t\t\t\this_parto.setGemerales(lbxGemerales.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setMalformados(lbxMalformados.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setNacidos_vivos(lbxNacidos_vivos.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setNacidos_muertos(lbxNacidos_muertos\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setPreterminos(lbxPreterminos.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setMedico(chbMedico.isChecked());\r\n\t\t\t\this_parto.setEnfermera(chbEnfermera.isChecked());\r\n\t\t\t\this_parto.setAuxiliar(chbAuxiliar.isChecked());\r\n\t\t\t\this_parto.setPartera(chbPartera.isChecked());\r\n\t\t\t\this_parto.setOtros(chbOtros.isChecked());\r\n\t\t\t\this_parto.setControlado(rdbControlado.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setLugar_consulta(rdbLugar_consulta.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setNo_consultas(lbxNo_consultas.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setEspecialistas(chbEspecialistas.isChecked());\r\n\t\t\t\this_parto.setGeneral(chbGeneral.isChecked());\r\n\t\t\t\this_parto.setPartera_consulta(chbPartera_consulta.isChecked());\r\n\t\t\t\this_parto.setSangrado_vaginal(rdbSangrado_vaginal\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setCefalias(rdbCefalias.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setEdema(rdbEdema.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setEpigastralgia(rdbEpigastralgia.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setVomitos(rdbVomitos.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setTinutus(rdbTinutus.getSelectedItem().getValue()\r\n\t\t\t\t\t\t.toString());\r\n\t\t\t\this_parto.setEscotomas(rdbEscotomas.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setInfeccion_urinaria(rdbInfeccion_urinaria\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setInfeccion_vaginal(rdbInfeccion_vaginal\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setOtros_embarazo(tbxOtros_embarazo.getValue());\r\n\t\t\t\this_parto.setCardiaca(tbxCardiaca.getValue());\r\n\t\t\t\this_parto.setRespiratoria(tbxRespiratoria.getValue());\r\n\t\t\t\this_parto.setPeso(tbxPeso.getValue());\r\n\t\t\t\this_parto.setTalla(tbxTalla.getValue());\r\n\t\t\t\this_parto.setTempo(tbxTempo.getValue());\r\n\t\t\t\this_parto.setPresion(tbxPresion.getValue());\r\n\t\t\t\this_parto.setPresion2(tbxPresion2.getValue());\r\n\t\t\t\this_parto.setInd_masa(tbxInd_masa.getValue());\r\n\t\t\t\this_parto.setSus_masa(tbxSus_masa.getValue());\r\n\t\t\t\this_parto.setCabeza_cuello(tbxCabeza_cuello.getValue());\r\n\t\t\t\this_parto.setCardiovascular(tbxCardiovascular.getValue());\r\n\t\t\t\this_parto.setMamas(tbxMamas.getValue());\r\n\t\t\t\this_parto.setPulmones(tbxPulmones.getValue());\r\n\t\t\t\this_parto.setAbdomen(tbxAbdomen.getValue());\r\n\t\t\t\this_parto.setUterina(tbxUterina.getValue());\r\n\t\t\t\this_parto.setSituacion(tbxSituacion.getValue());\r\n\t\t\t\this_parto.setPresentacion(tbxPresentacion.getValue());\r\n\t\t\t\this_parto.setV_presentacion(tbxV_presentacion.getValue());\r\n\t\t\t\this_parto.setPosicion(tbxPosicion.getValue());\r\n\t\t\t\this_parto.setV_posicion(tbxV_posicion.getValue());\r\n\t\t\t\this_parto.setC_uterina(tbxC_uterina.getValue());\r\n\t\t\t\this_parto.setTono(tbxTono.getValue());\r\n\t\t\t\this_parto.setFcf(tbxFcf.getValue());\r\n\t\t\t\this_parto.setGenitales(tbxGenitales.getValue());\r\n\t\t\t\this_parto.setDilatacion(tbxDilatacion.getValue());\r\n\t\t\t\this_parto.setBorramiento(tbxBorramiento.getValue());\r\n\t\t\t\this_parto.setEstacion(tbxEstacion.getValue());\r\n\t\t\t\this_parto.setMembranas(tbxMembranas.getValue());\r\n\t\t\t\this_parto.setExtremidades(tbxExtremidades.getValue());\r\n\t\t\t\this_parto.setSnc(tbxSnc.getValue());\r\n\t\t\t\this_parto.setObservacion(tbxObservacion.getValue());\r\n\t\t\t\this_parto.setCodigo_consulta_pyp(lbxCodigo_consulta_pyp\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setFinalidad_cons(lbxFinalidad_cons.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_parto.setCausas_externas(lbxCausas_externas\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setTipo_disnostico(lbxTipo_disnostico\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_parto.setTipo_principal(tbxTipo_principal.getValue());\r\n\t\t\t\this_parto.setTipo_relacionado_1(tbxTipo_relacionado_1\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_parto.setTipo_relacionado_2(tbxTipo_relacionado_2\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_parto.setTipo_relacionado_3(tbxTipo_relacionado_3\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_parto.setTratamiento(tbxTratamiento.getValue());\r\n\r\n\t\t\t\tdatos.put(\"codigo_historia\", his_parto);\r\n\t\t\t\tdatos.put(\"accion\", tbxAccion.getText());\r\n\r\n\t\t\t\this_parto = getServiceLocator().getHis_partoService().guardar(\r\n\t\t\t\t\t\tdatos);\r\n\r\n\t\t\t\tif (tbxAccion.getText().equalsIgnoreCase(\"registrar\")) {\r\n\t\t\t\t\taccionForm(true, \"modificar\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tMessagebox.show(\"Los datos se guardaron satisfactoriamente\",\r\n\t\t\t\t\t\t\"Informacion ..\", Messagebox.OK,\r\n\t\t\t\t\t\tMessagebox.INFORMATION);\r\n\r\n\t\t\t}\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\t\r\n\t\t\tlog.error(e.getMessage(), e);\r\n\t\t\tMessagebox.show(e.getMessage(), \"Mensaje de Error !!\",\r\n\t\t\t\t\tMessagebox.OK, Messagebox.ERROR);\r\n\t\t}\r\n\r\n\t}",
"public void guardar(Dia dia) {\n Session session = sessionFactory.openSession();\n //la transaccion a relizar\n Transaction tx = null;\n try {\n tx = session.beginTransaction();\n //guardamos el Dia\n session.persist(dia);\n \n tx.commit();\n }\n catch (Exception e) {\n //Se regresa a un estado consistente \n if (tx!=null){ \n tx.rollback();\n }\n e.printStackTrace(); \n } finally {\n //cerramos simpre la sesion\n session.close();\n }\n }",
"@Override\r\n\tpublic void guardar() {\n\t\tLOG.info(\"El equipo \"+equipo.getNombre()+\" y el Estadio \"+equipo.getEstadio().getNombre()+\" fueron guardados con exito\");\r\n\t}",
"public String guardar()\r\n/* 69: */ {\r\n/* 70: */ try\r\n/* 71: */ {\r\n/* 72: 85 */ this.motivoLlamadoAtencion.setIdOrganizacion(AppUtil.getOrganizacion().getIdOrganizacion());\r\n/* 73: 86 */ this.motivoLlamadoAtencion.setIdSucursal(AppUtil.getSucursal().getIdSucursal());\r\n/* 74: 87 */ this.servicioMotivoLlamadoAtencion.guardar(this.motivoLlamadoAtencion);\r\n/* 75: 88 */ addInfoMessage(getLanguageController().getMensaje(\"msg_info_guardar\"));\r\n/* 76: 89 */ setEditado(false);\r\n/* 77: 90 */ limpiar();\r\n/* 78: */ }\r\n/* 79: */ catch (Exception e)\r\n/* 80: */ {\r\n/* 81: 92 */ addErrorMessage(getLanguageController().getMensaje(\"msg_error_guardar\"));\r\n/* 82: 93 */ LOG.error(\"ERROR AL GUARDAR DATOS\", e);\r\n/* 83: */ }\r\n/* 84: 95 */ return \"\";\r\n/* 85: */ }",
"private void procurarData() {\n if (jDateIni.getDate() != null && jDateFim.getDate() != null) {\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n String data = sdf.format(jDateIni.getDate());\n String data2 = sdf.format(jDateFim.getDate());\n carregaTable(id, data, data2);\n JBreg.setEnabled(false);\n }\n }",
"public void guardar(Empleado e){\r\n \r\n //Para serializar el primer paso es generar el archivo fisico donde\r\n //estara nuestro objto de tipo usuario\r\n\r\n File file=new File(\"Empleados.yo\");\r\n \r\n //Despues lo abrimos para escribir sobre el \r\n if(file.exists()){\r\n empleado=buscarTodos();\r\n }\r\n try{\r\n FileOutputStream fos=new FileOutputStream(file);\r\n \r\n //Luego serializamos\r\n ObjectOutputStream oos=new ObjectOutputStream(fos);\r\n \r\n //Guardamos nuestro usuario\r\n empleado.add(e);\r\n oos.writeObject(empleado);\r\n \r\n //Ponemos un mensaje\r\n System.out.println(\"Objeto guardado con exito\");\r\n \r\n }catch (Exception e){\r\n System.out.println(e.getMessage());\r\n }\r\n }",
"public void guardar4(View view){\n bdboletas admin= new bdboletas(this, \"Boleta de Transito\", null, 1);\n SQLiteDatabase BaseDeDatos= admin.getWritableDatabase();\n\n placa= etplaca.getText ().toString ();\n modelo= etmodelo.getText ().toString ();\n marca= etmarca.getText ().toString ();\n color= etmodelo.getText ().toString ();\n\n año_string= etaño.getText ().toString ();\n\n int año_int=Integer.parseInt (año_string);\n\n serial= etserial.getText ().toString ();\n\n String seleccion=spinner_vehiculo.getSelectedItem ().toString ();\n\n if (!placa.isEmpty () && !modelo.isEmpty () && !marca.isEmpty ()\n && !color.isEmpty () && !año_string.isEmpty () && !serial.isEmpty ()\n && !seleccion.isEmpty ()){\n\n ContentValues registro= new ContentValues ();\n\n registro.put (\"placa\",placa);\n registro.put (\"marca\",marca);\n registro.put (\"modelo\",modelo);\n registro.put (\"tipo_vehiculo\",seleccion);\n registro.put (\"color\",color);\n registro.put (\"año\",año_int);\n registro.put (\"s_carroceria\",serial);\n\n BaseDeDatos.insert(\"boletas\",null , registro);\n\n BaseDeDatos.close();\n\n Toast.makeText(this,\"registo exitoso\",Toast.LENGTH_SHORT).show();\n // metodo boton siguiente\n Intent siguiente = new Intent (this, Remolque.class);\n startActivity (siguiente);\n }else{\n Toast.makeText(this,\"debe llenar todos los campos para poder continuar\",Toast.LENGTH_SHORT).show();\n }\n }",
"public void guardarDestruccion() {\n try {\n produccion.setIdMarca(opcionMarca);\n produccion.setIdPlantaProd(opcionPlanta);\n produccion.setIdPaisOrigen(opcionOrigen);\n produccion.setIdTipoRetro(opcionTipo);\n produccion.setFechProduccion(new Date());\n produccion.setDescPaisOrigen(desperdiciosHelper.getNombrePais());\n\n if (!habilitarBtnValidarProd()) {\n if (produccion != null) {\n produccion = produccionService.guardaDestruccion(produccion);\n super.msgInfo(MSGEXITOVALIDAPROD);\n desperdiciosHelper.setDeshabilitaBtnValidarProd(true);\n desperdiciosHelper.setDeshabilitaCargaArchivo(false);\n } else {\n super.msgError(MSGERRORVALIDARPROD);\n }\n }\n } catch (ProduccionServiceException e) {\n LOGGER.error(\"ERROR: Al guardar los datos de produccion\" + e.getMessage(), e);\n }\n }",
"void persiste(UsuarioDetalle usuarioDetalle);",
"public static void guardar()\n {\n File fileUsuario,fileDocente;\n ObjectOutputStream entradaUsuario,entradaDocente;\n \n fileDocente = new File(\"docentes\"); \n fileUsuario = new File(\"usuarios\");\n \n try \n {\n \n entradaDocente = new ObjectOutputStream(new FileOutputStream(fileDocente));\n entradaUsuario = new ObjectOutputStream(new FileOutputStream(fileUsuario));\n \n entradaDocente.writeObject(docentes);\n entradaUsuario.writeObject(usuarios);\n \n entradaDocente.close();\n entradaUsuario.close();\n } \n catch (Exception e) \n {\n e.printStackTrace();\n }\n }",
"public static void guardarEstudianteBD(Estudiante estudiante) {\r\n //metimos este metodo dentro de la base de datos \r\n try {\r\n Class.forName(\"com.mysql.jdbc.Driver\");\r\n //ingresamos la direccion donde se encuntra la base de datos \r\n Connection conexion = DriverManager.getConnection(\"jdbc:mysql://localhost/registrolaboratorios\", \"root\", \"admin\");\r\n System.out.println(\"Conexion establecida!\");\r\n Statement sentencia = (Statement) conexion.createStatement();\r\n int insert = sentencia.executeUpdate(\"insert into estudiante values(\"\r\n + \"'\" + estudiante.getNro_de_ID()\r\n + \"','\" + estudiante.getNombres()\r\n + \"','\" + estudiante.getApellidos()\r\n + \"','\" + estudiante.getLaboratorio()\r\n + \"','\" + estudiante.getCarrera()\r\n + \"','\" + estudiante.getModulo()\r\n + \"','\" + estudiante.getMateria()\r\n + \"','\" + estudiante.getFecha()\r\n + \"','\" + estudiante.getHora_Ingreso()\r\n + \"','\" + estudiante.getHora_Salida()\r\n + \"')\");\r\n\r\n sentencia.close();\r\n conexion.close();\r\n\r\n } catch (Exception ex) {\r\n System.out.println(\"Error en la conexion\" + ex);\r\n }\r\n }",
"public void guardarDatos() throws Exception {\r\n\t\ttry {\r\n\t\t\tsetUpperCase();\r\n\t\t\tif (validarForm()) {\r\n\t\t\t\t// Cargamos los componentes //\r\n\r\n\t\t\t\tMap datos = new HashMap();\r\n\r\n\t\t\t\tHis_atencion_embarazada his_atencion_embarazada = new His_atencion_embarazada();\r\n\t\t\t\this_atencion_embarazada.setCodigo_empresa(empresa\r\n\t\t\t\t\t\t.getCodigo_empresa());\r\n\t\t\t\this_atencion_embarazada.setCodigo_sucursal(sucursal\r\n\t\t\t\t\t\t.getCodigo_sucursal());\r\n\t\t\t\this_atencion_embarazada.setCodigo_historia(tbxCodigo_historia\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setFecha_inicial(new Timestamp(\r\n\t\t\t\t\t\tdtbxFecha_inicial.getValue().getTime()));\r\n\t\t\t\this_atencion_embarazada.setCodigo_eps(tbxCodigo_eps.getValue());\r\n\t\t\t\this_atencion_embarazada.setCodigo_dpto(lbxCodigo_dpto\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setCodigo_municipio(lbxCodigo_municipio\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setIdentificacion(tbxIdentificacion\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setDireccion(tbxMotivo.getValue());\r\n\t\t\t\this_atencion_embarazada.setTelefono(tbxTelefono.getValue());\r\n\t\t\t\this_atencion_embarazada.setSeleccion(rdbSeleccion\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setGestaciones(lbxGestaciones\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setPartos(lbxPartos.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setCesarias(lbxCesarias\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setAbortos(lbxAbortos.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setEspontaneo(lbxEspontaneo\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setProvocado(lbxProvocado\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setNacido_muerto(lbxNacido_muerto\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setPrematuro(lbxPrematuro\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setHijos_menos(lbxHijos_menos\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setHijos_mayor(lbxHijos_mayor\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setMalformado(lbxMalformado\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setHipertension(lbxHipertension\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setFecha_ultimo_parto(new Timestamp(\r\n\t\t\t\t\t\tdtbxFecha_ultimo_parto.getValue().getTime()));\r\n\t\t\t\this_atencion_embarazada.setCirugia(lbxCirugia.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setOtro_antecedente(tbxOtro_antecedente\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setHemoclasificacion(lbxHemoclasificacion\r\n\t\t\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setRh(lbxRh.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setPeso(tbxPeso.getValue());\r\n\t\t\t\this_atencion_embarazada.setTalla(tbxTalla.getValue());\r\n\t\t\t\this_atencion_embarazada.setImc(tbxImc.getValue());\r\n\t\t\t\this_atencion_embarazada.setTa(tbxTa.getValue());\r\n\t\t\t\this_atencion_embarazada.setFc(tbxFc.getValue());\r\n\t\t\t\this_atencion_embarazada.setFr(tbxFr.getValue());\r\n\t\t\t\this_atencion_embarazada.setTemperatura(tbxTemperatura\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setCroomb(tbxCroomb.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setFecha_ultima_mestruacion(new Timestamp(\r\n\t\t\t\t\t\t\t\tdtbxFecha_ultima_mestruacion.getValue()\r\n\t\t\t\t\t\t\t\t\t\t.getTime()));\r\n\t\t\t\this_atencion_embarazada.setFecha_probable_parto(new Timestamp(\r\n\t\t\t\t\t\tdtbxFecha_probable_parto.getValue().getTime()));\r\n\t\t\t\this_atencion_embarazada.setEdad_gestacional(tbxEdad_gestacional\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setControl(lbxControl.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setNum_control(tbxNum_control\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setFetales(lbxFetales.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setFiebre(lbxFiebre.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setLiquido(lbxLiquido.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setFlujo(lbxFlujo.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setEnfermedad(lbxEnfermedad\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setCual_enfermedad(tbxCual_enfermedad\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setCigarrillo(lbxCigarrillo\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setAlcohol(lbxAlcohol.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setCual_alcohol(tbxCual_alcohol\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setDroga(lbxDroga.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setCual_droga(tbxCual_droga.getValue());\r\n\t\t\t\this_atencion_embarazada.setViolencia(lbxViolencia\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setCual_violencia(tbxCual_violencia\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setToxoide(lbxToxoide.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setDosis(lbxDosis.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setObservaciones_gestion(tbxObservaciones_gestion\r\n\t\t\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setAltura_uterina(tbxAltura_uterina\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setCorelacion(chbCorelacion.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setEmbarazo_multiple(chbEmbarazo_multiple.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setTrasmision_sexual(chbTrasmision_sexual.isChecked());\r\n\t\t\t\this_atencion_embarazada.setAnomalia(rdbAnomalia\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setEdema_gestion(rdbEdema_gestion\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setPalidez(rdbPalidez.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setConvulciones(rdbConvulciones\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setConciencia(rdbConciencia\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setCavidad_bucal(rdbCavidad_bucal\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setHto(tbxHto.getValue());\r\n\t\t\t\this_atencion_embarazada.setHb(tbxHb.getValue());\r\n\t\t\t\this_atencion_embarazada.setToxoplasma(tbxToxoplasma.getValue());\r\n\t\t\t\this_atencion_embarazada.setVdrl1(tbxVdrl1.getValue());\r\n\t\t\t\this_atencion_embarazada.setVdrl2(tbxVdrl2.getValue());\r\n\t\t\t\this_atencion_embarazada.setVih1(tbxVih1.getValue());\r\n\t\t\t\this_atencion_embarazada.setVih2(tbxVih2.getValue());\r\n\t\t\t\this_atencion_embarazada.setHepb(tbxHepb.getValue());\r\n\t\t\t\this_atencion_embarazada.setOtro(tbxOtro.getValue());\r\n\t\t\t\this_atencion_embarazada.setEcografia(tbxEcografia.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setClasificacion_gestion(rdbClasificacion_gestion\r\n\t\t\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setContracciones(lbxContracciones\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setNum_contracciones(lbxNum_contracciones\r\n\t\t\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setHemorragia(lbxHemorragia\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setLiquido_vaginal(lbxLiquido_vaginal\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setColor_liquido(tbxColor_liquido\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setDolor_cabeza(lbxDolor_cabeza\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setVision(lbxVision.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setConvulcion(lbxConvulcion\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setObservaciones_parto(tbxObservaciones_parto\r\n\t\t\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setContracciones_min(tbxContracciones_min.getValue());\r\n\t\t\t\this_atencion_embarazada.setFc_fera(tbxFc_fera.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setDilatacion_cervical(tbxDilatacion_cervical\r\n\t\t\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setPreentacion(rdbPreentacion\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setOtra_presentacion(tbxOtra_presentacion.getValue());\r\n\t\t\t\this_atencion_embarazada.setEdema(rdbEdema.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setHemorragia_vaginal(lbxHemorragia_vaginal\r\n\t\t\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setHto_parto(tbxHto_parto.getValue());\r\n\t\t\t\this_atencion_embarazada.setHb_parto(tbxHb_parto.getValue());\r\n\t\t\t\this_atencion_embarazada.setHepb_parto(tbxHepb_parto.getValue());\r\n\t\t\t\this_atencion_embarazada.setVdrl_parto(tbxVdrl_parto.getValue());\r\n\t\t\t\this_atencion_embarazada.setVih_parto(tbxVih_parto.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setClasificacion_parto(rdbClasificacion_parto\r\n\t\t\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setFecha_nac(new Timestamp(\r\n\t\t\t\t\t\tdtbxFecha_nac.getValue().getTime()));\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setIdentificacion_nac(tbxIdentificacion_nac.getValue());\r\n\t\t\t\this_atencion_embarazada.setSexo(lbxSexo.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setPeso_nac(tbxPeso_nac.getValue());\r\n\t\t\t\this_atencion_embarazada.setTalla_nac(tbxTalla_nac.getValue());\r\n\t\t\t\this_atencion_embarazada.setPc_nac(tbxPc_nac.getValue());\r\n\t\t\t\this_atencion_embarazada.setFc_nac(tbxFc_nac.getValue());\r\n\t\t\t\this_atencion_embarazada.setTemper_nac(tbxTemper_nac.getValue());\r\n\t\t\t\this_atencion_embarazada.setEdad(tbxEdad.getValue());\r\n\t\t\t\this_atencion_embarazada.setAdgar1(tbxAdgar1.getValue());\r\n\t\t\t\this_atencion_embarazada.setAdgar5(tbxAdgar5.getValue());\r\n\t\t\t\this_atencion_embarazada.setAdgar10(tbxAdgar10.getValue());\r\n\t\t\t\this_atencion_embarazada.setAdgar20(tbxAdgar20.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setObservaciones_nac(tbxObservaciones_nac.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setClasificacion_nac(rdbClasificacion_nac\r\n\t\t\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setReani_prematuro(chbReani_prematuro\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada.setReani_meconio(chbReani_meconio\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setReani_respiracion(chbReani_respiracion.isChecked());\r\n\t\t\t\this_atencion_embarazada.setReani_hipotonico(chbReani_hipotonico\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada.setReani_apnea(chbReani_apnea\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada.setReani_jadeo(chbReani_jadeo\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setReani_deficultosa(chbReani_deficultosa.isChecked());\r\n\t\t\t\this_atencion_embarazada.setReani_gianosis(chbReani_gianosis\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setReani_bradicardia(chbReani_bradicardia.isChecked());\r\n\t\t\t\this_atencion_embarazada.setReani_hipoxemia(chbReani_hipoxemia\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setReani_estimulacion(chbReani_estimulacion\r\n\t\t\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setReani_ventilacion(chbReani_ventilacion.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setReani_comprensiones(chbReani_comprensiones\r\n\t\t\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada.setReani_intubacion(chbReani_intubacion\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada.setMedicina(tbxMedicina.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setClasificacion_reani(rdbClasificacion_reani\r\n\t\t\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setRuptura(lbxRuptura.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setTiempo_ruptura(lbxTiempo_ruptura\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setLiquido_neo(tbxLiquido_neo\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setFiebre_neo(lbxFiebre_neo\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setTiempo_neo(lbxTiempo_neo\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setCoricamniotis(tbxCoricamniotis\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setIntrauterina(rdbIntrauterina\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setMadre20(lbxMadre20.getSelectedItem()\r\n\t\t\t\t\t\t.getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setAlcohol_neo(chbAlcohol_neo\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setDrogas_neo(chbDrogas_neo.isChecked());\r\n\t\t\t\this_atencion_embarazada.setCigarrillo_neo(chbCigarrillo_neo\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada.setRespiracion_neo(rdbRespiracion_neo\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setLlanto_neo(rdbLlanto_neo\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setVetalidad_neo(rdbVetalidad_neo\r\n\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setTaquicardia_neo(chbTaquicardia_neo\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada.setBradicardia_neo(chbBradicardia_neo\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada.setPalidez_neo(chbPalidez_neo\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada.setCianosis_neo(chbCianosis_neo\r\n\t\t\t\t\t\t.isChecked());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setAnomalias_congenitas(lbxAnomalias_congenitas\r\n\t\t\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setCual_anomalias(tbxCual_anomalias\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setLesiones(tbxLesiones.getValue());\r\n\t\t\t\this_atencion_embarazada.setOtras_alter(tbxOtras_alter\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setClasificacion_neo(rdbClasificacion_neo\r\n\t\t\t\t\t\t\t\t.getSelectedItem().getValue().toString());\r\n\t\t\t\this_atencion_embarazada.setAlarma(tbxAlarma.getValue());\r\n\t\t\t\this_atencion_embarazada.setConsulta_control(tbxConsulta_control\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setMedidas_preventiva(tbxMedidas_preventiva.getValue());\r\n\t\t\t\this_atencion_embarazada.setRecomendaciones(tbxRecomendaciones\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada.setDiagnostico(tbxDiagnostico\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setCodigo_diagnostico(tbxCodigo_diagnostico.getValue());\r\n\t\t\t\this_atencion_embarazada.setTratamiento(tbxTratamiento\r\n\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setRecomendacion_alimentacion(tbxRecomendacion_alimentacion\r\n\t\t\t\t\t\t\t\t.getValue());\r\n\t\t\t\this_atencion_embarazada\r\n\t\t\t\t\t\t.setEvolucion_servicio(tbxEvolucion_servicio.getValue());\r\n\r\n\t\t\t\tdatos.put(\"codigo_historia\", his_atencion_embarazada);\r\n\t\t\t\tdatos.put(\"accion\", tbxAccion.getText());\r\n\r\n\t\t\t\this_atencion_embarazada = getServiceLocator()\r\n\t\t\t\t\t\t.getHis_atencion_embarazadaService().guardar(datos);\r\n\r\n\t\t\t\tif (tbxAccion.getText().equalsIgnoreCase(\"registrar\")) {\r\n\t\t\t\t\taccionForm(true, \"modificar\");\r\n\t\t\t\t}\r\n\t\t\t\t/*\r\n\t\t\t\t * else{ int result =\r\n\t\t\t\t * getServiceLocator().getHis_atencion_embarazadaService\r\n\t\t\t\t * ().actualizar(his_atencion_embarazada); if(result==0){ throw\r\n\t\t\t\t * new Exception(\r\n\t\t\t\t * \"Lo sentimos pero los datos a modificar no se encuentran en base de datos\"\r\n\t\t\t\t * ); } }\r\n\t\t\t\t */\r\n\r\n//\t\t\t\tcodigo_historia = his_atencion_embarazada.getCodigo_historia();\r\n\r\n\t\t\t\tMessagebox.show(\"Los datos se guardaron satisfactoriamente\",\r\n\t\t\t\t\t\t\"Informacion ..\", Messagebox.OK,\r\n\t\t\t\t\t\tMessagebox.INFORMATION);\r\n\r\n\t\t\t}\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\t\r\n\t\t\tlog.error(e.getMessage(), e);\r\n\t\t\tMessagebox.show(e.getMessage(), \"Mensaje de Error !!\",\r\n\t\t\t\t\tMessagebox.OK, Messagebox.ERROR);\r\n\t\t}\r\n\r\n\t}",
"private void saveData() {\n\t\tdataSaver.save(data);\n\t}",
"public void guardarProductosVendidos() {\n try {\n //Si hay datos los guardamos...\n if (!productosVendidos.isEmpty()) {\n /****** Serialización de los objetos ******/\n //Serialización de los productosVendidos\n FileOutputStream archivo = new FileOutputStream(\"productosVendidos\"+this.getCorreo()+\".dat\");\n ObjectOutputStream guardar= new ObjectOutputStream(archivo);\n //guardamos el array de personas\n guardar.writeObject(productosVendidos);\n archivo.close();\n } else {\n System.out.println(\"Error: No hay datos...\");\n }\n\n } catch (IOException ioe) {\n System.out.println(\"ERROR: \" + ioe.getMessage());\n } catch (Exception e) {\n System.out.println(\"ERROR: \" + e.getMessage());\n }\n }",
"public String guardar()\r\n/* 104: */ {\r\n/* 105: */ try\r\n/* 106: */ {\r\n/* 107:132 */ this.servicioDimensionContable.guardar(this.dimensionContable);\r\n/* 108:133 */ addInfoMessage(getLanguageController().getMensaje(\"msg_info_guardar\"));\r\n/* 109:134 */ setEditado(false);\r\n/* 110:135 */ cargarDatos();\r\n/* 111: */ }\r\n/* 112: */ catch (Exception e)\r\n/* 113: */ {\r\n/* 114:137 */ addErrorMessage(getLanguageController().getMensaje(\"msg_error_guardar\"));\r\n/* 115:138 */ LOG.error(\"ERROR AL GUARDAR DATOS\", e);\r\n/* 116: */ }\r\n/* 117:140 */ return \"\";\r\n/* 118: */ }",
"Lancamento persistir(Lancamento lancamento);",
"private void insertData() \n {\n for (int i = 0; i < 3; i++) {\n TarjetaPrepagoEntity entity = factory.manufacturePojo(TarjetaPrepagoEntity.class);\n em.persist(entity);\n data.add(entity);\n }\n for(int i = 0; i < 3; i++)\n {\n PagoEntity pagos = factory.manufacturePojo(PagoEntity.class);\n em.persist(pagos);\n pagosData.add(pagos);\n\n }\n \n data.get(2).setSaldo(0.0);\n data.get(2).setPuntos(0.0);\n \n double valor = (Math.random()+1) *100;\n data.get(0).setSaldo(valor);\n data.get(0).setPuntos(valor); \n data.get(1).setSaldo(valor);\n data.get(1).setPuntos(valor);\n \n }",
"private void insertData() {\r\n PodamFactory factory = new PodamFactoryImpl();\r\n for (int i = 0; i < 3; i++) {\r\n UsuarioEntity entity = factory.manufacturePojo(UsuarioEntity.class);\r\n em.persist(entity);\r\n dataUsuario.add(entity);\r\n }\r\n for (int i = 0; i < 3; i++) {\r\n CarritoDeComprasEntity entity = factory.manufacturePojo(CarritoDeComprasEntity.class);\r\n if (i == 0 ){\r\n entity.setUsuario(dataUsuario.get(0));\r\n }\r\n em.persist(entity);\r\n data.add(entity);\r\n }\r\n }",
"public void setDataSituacao(DateTimeDB dataSituacao) {\n this.dataSituacao = dataSituacao;\n }",
"public void guardarBloqueSeleccionado(){\n\t\tif(bloqueSeleccionadoEditar.getIdbloques() == 0){\n\t\t\tbloquesFacade.create(bloqueSeleccionadoEditar);\n\t\t}else{\n\t\t\tbloquesFacade.edit(bloqueSeleccionadoEditar);\n\t\t}\n\t\tdataListBloques = bloquesFacade.findByLike(\"SELECT B FROM Bloques B ORDER BY B.nombre\");\n\t}",
"public void guardarSolicitud() {\n Map<String, String> paramMap = getParametrosSesion();\n String cadenaFirmada;\n try {\n if (paramMap != null) {\n cadenaFirmada = paramMap.get(firmaFormHelper.FIRMA_DIGITAL);\n firmaFormHelper.setSelloDigital(paramMap.get(FirmaFormHelper.FIRMA_DIGITAL));\n\n SimpleDateFormat formato = new SimpleDateFormat(\"dd/MM/yyyy\");\n produccion.setFechProduccion(new Date());\n desperdiciosHelper.setFechaAcuse(formato.format(produccion.getFechProduccion()));\n\n if (cadenaFirmada.length() > 0) {\n guardarRangosFolios();\n Acuse acuse = new Acuse();\n acuse.setSerieAcuse(TipoAcuse.DESPERDICIO);\n acuse.setIdProveedor(produccionCigarrosHelper.getProveedor().getIdProveedor());\n acuse.setSelloDigital(firmaFormHelper.getSelloDigital());\n acuse.setCadenaOriginal(firmaFormHelper.getCadenaOriginal());\n acuse.setFecCaptura(new Date());\n desperdiciosHelper.setIdAcuseRecibo(commonService.crearAcuse(acuse));\n habilitarPnlAcuse();\n registroMovimientoBitacora(getSession(), IdentificadorProcesoEnum.CONTRIBUYENTE_TRAMITES, new Date(), new Date(), MovimientosBitacoraEnum.DESPERDICIOS_DESTRUCCION);\n } else {\n habilitarPnlPrincipal();\n }\n }\n } catch (CommonServiceException e) {\n LOGGER.error(e.getMessage(), e);\n addErrorMessage(ERROR, \"No se pudo generar el acuse\");\n } catch (Exception ex) {\n LOGGER.error(ex.getMessage());\n }\n }",
"public long save(Registro r) {\n\n long id = r.getCodigo();\n SQLiteDatabase db = banco.getWritableDatabase();\n try {\n\n\n ContentValues values = new ContentValues();\n\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-M-d\");\n String dateString = sdf.format(r.getData());\n values.put(\"data\", dateString);\n values.put(\"distancia\", r.getDistancia());\n values.put(\"consumo\", r.getConsumo());\n values.put(\"mediaAceleracao\", r.getMediaAberturaBorboleta());\n values.put(\"mediaConsumo\", r.getMediaConsumo());\n values.put(\"codTipoCombustivel\", r.getTipoCombustivel().getCodigo());\n values.put(\"codCarro\", r.getCarro().getCodigo());\n values.put(\"codUsuario\", r.getUsuario().getCodigo());\n\n if (id != 0) {//SE O ID É DIFERENTE DE 0 ATUALIZA,\n\n System.out.println(\"Entrou !!\");\n String _id = String.valueOf(r.getCodigo());\n String[] whereArgs = new String[]{_id};\n\n // update registro set values = ... where _id=?\n int count = db.update(TABELA, values, \"codigo=?\", whereArgs);\n\n return count;\n } else {\n\n id = db.insert(TABELA, \"\", values);\n System.out.println(\"Deu certo !! \\n \" + values);\n return id;\n }\n } finally {\n db.close();\n }\n }",
"Persistencia() {\n\t}",
"public String guardarComentario(){\r\n\t\tcomDao.save(com);\r\n\t\tinit();\r\n\t\treturn null;\r\n\t}",
"private void guardar() {\r\n\t\tif(Gestion.isModificado() && Gestion.getFichero()!=null){\r\n\t\t\ttry {\r\n\t\t\t\tGestion.escribir(Gestion.getFichero());\r\n\t\t\t\tGestion.setModificado(false);\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tJOptionPane.showMessageDialog(null, e.getMessage(), \"Error\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if(Gestion.isModificado() && Gestion.getFichero()==null){\r\n\t\t\tguardarComo();\r\n\t\t}\r\n\t\telse if(frmLigaDeFtbol.getTitle()==\"Liga de Fútbol\" && !Gestion.isModificado())\r\n\t\t\tguardarComo();\r\n\t}",
"public void guardarDatos() throws Exception {\r\n try {\r\n FormularioUtil.setUpperCase(groupboxEditar);\r\n if (validarForm()) {\r\n\r\n Admision admision = ((Admision) lbxNro_ingreso\r\n .getSelectedItem().getValue());\r\n\r\n Hospitalizacion hospitalizacion = new Hospitalizacion();\r\n hospitalizacion.setCodigo_empresa(empresa.getCodigo_empresa());\r\n hospitalizacion.setCodigo_sucursal(sucursal\r\n .getCodigo_sucursal());\r\n hospitalizacion.setNro_factura(tbxNro_factura.getValue());\r\n hospitalizacion = getServiceLocator()\r\n .getHospitalizacionService().consultar(hospitalizacion);\r\n if (hospitalizacion == null) {\r\n hospitalizacion = new Hospitalizacion();\r\n hospitalizacion.setCodigo_empresa(empresa\r\n .getCodigo_empresa());\r\n hospitalizacion.setCodigo_sucursal(sucursal\r\n .getCodigo_sucursal());\r\n hospitalizacion.setNro_factura(tbxNro_factura.getValue());\r\n }\r\n hospitalizacion.setTipo_identificacion((String) datos_seleccion\r\n .get(\"tipo_identificacion\"));\r\n hospitalizacion.setNro_identificacion(tbxNro_identificacion\r\n .getValue());\r\n hospitalizacion\r\n .setCodigo_administradora((String) datos_seleccion\r\n .get(\"codigo_administradora\"));\r\n hospitalizacion.setId_plan((String) datos_seleccion\r\n .get(\"id_plan\"));\r\n hospitalizacion.setNro_ingreso(admision.getNro_ingreso());\r\n hospitalizacion.setCodigo_prestador(tbxCodigo_prestador\r\n .getValue());\r\n hospitalizacion.setVia_ingreso(lbxVia_ingreso.getSelectedItem()\r\n .getValue().toString());\r\n hospitalizacion.setFecha_ingreso(new Timestamp(\r\n dtbxFecha_ingreso.getValue().getTime()));\r\n hospitalizacion.setNumero_autorizacion(tbxNumero_autorizacion\r\n .getValue());\r\n hospitalizacion.setCausa_externa((String) lbxCausa_externa\r\n .getSelectedItem().getValue().toString());\r\n hospitalizacion.setEstado_salida((String) lbxEstado_salida\r\n .getSelectedItem().getValue().toString());\r\n hospitalizacion.setFecha_egreso(new Timestamp(dtbxFecha_egreso\r\n .getValue().getTime()));\r\n hospitalizacion\r\n .setCodigo_diagnostico_principal(tbxCodigo_diagnostico_principal\r\n .getValue());\r\n hospitalizacion.setCodigo_diagnostico1(tbxCodigo_diagnostico1\r\n .getValue());\r\n hospitalizacion.setCodigo_diagnostico2(tbxCodigo_diagnostico2\r\n .getValue());\r\n hospitalizacion.setCodigo_diagnostico3(tbxCodigo_diagnostico3\r\n .getValue());\r\n hospitalizacion.setComplicacion(tbxComplicacion.getValue());\r\n hospitalizacion.setCausa_muerte(tbxCausa_muerte.getValue());\r\n\r\n hospitalizacion.setCreacion_date(new Timestamp(\r\n new GregorianCalendar().getTimeInMillis()));\r\n hospitalizacion.setUltimo_update(new Timestamp(\r\n new GregorianCalendar().getTimeInMillis()));\r\n hospitalizacion.setCreacion_user(usuarios.getCodigo()\r\n .toString());\r\n hospitalizacion.setUltimo_user(usuarios.getCodigo().toString());\r\n\r\n String complemento = \"\";\r\n\r\n if (tbxAccion.getText().equalsIgnoreCase(\"registrar\")) {\r\n getServiceLocator().getHospitalizacionService().crear(\r\n hospitalizacion);\r\n if (FACTURACION_RIPS != null) {\r\n this.detach();\r\n } else {\r\n accionForm(true, \"registrar\");\r\n }\r\n } else {\r\n int result = getServiceLocator()\r\n .getHospitalizacionService().actualizar(\r\n hospitalizacion);\r\n if (result == 0) {\r\n throw new Exception(\r\n \"Lo sentimos pero los datos a modificar no se encuentran en base de datos\");\r\n }\r\n }\r\n\r\n if (ionGuardar != null) {\r\n ionGuardar.guardar();\r\n } else {\r\n Messagebox.show(\r\n \"Los datos se guardaron satisfactoriamente.\"\r\n + complemento, \"Informacion? ..\",\r\n Messagebox.OK, Messagebox.INFORMATION);\r\n tbxNro_factura.setValue(hospitalizacion.getNro_factura());\r\n tbxAccion.setValue(\"modificar\");\r\n }\r\n\r\n if (this.getParent() instanceof Facturacion_ripsAction) {\r\n this.detach();\r\n }\r\n\r\n }\r\n } catch (Exception e) {\r\n MensajesUtil.mensajeError(e, \"\", this);\r\n }\r\n }",
"public void guardarProductosEnVenta() {\n try {\n //Si hay datos los guardamos...\n \n /****** Serialización de los objetos ******/\n //Serialización de las productosEnVenta\n FileOutputStream archivo = new FileOutputStream(\"productosVentaCliente\"+this.getCorreo()+\".dat\");\n ObjectOutputStream guardar= new ObjectOutputStream(archivo);\n //guardamos el array de productosEnVenta\n guardar.writeObject(productosEnVenta);\n archivo.close();\n \n\n } catch (IOException ioe) {\n System.out.println(\"ERROR: \" + ioe.getMessage());\n } catch (Exception e) {\n System.out.println(\"ERROR: \" + e.getMessage());\n }\n }",
"@Override\n\tpublic void guardar() {\n\t\t\n\t}",
"public void guardar() {\r\n\t\t\r\n\t\tmanejadorArchivos.guardar(palabras);\r\n\t\t\r\n\t}",
"private void saveData() {\n // Actualiza la información\n client.setName(nameTextField.getText());\n client.setLastName(lastNameTextField.getText());\n client.setDni(dniTextField.getText());\n client.setAddress(addressTextField.getText());\n client.setTelephone(telephoneTextField.getText());\n\n // Guarda la información\n DBManager.getInstance().saveData(client);\n }",
"public void insertarOrden(Object dato) {\n Nodo nuevo = new Nodo(dato);\n int res = 0;\n // System.out.println(\"esxa\"+res);\n if (primero == null) {\n nuevo.setReferencia(primero);\n primero = nuevo;\n // System.out.println(\"Es nulo\");\n// System.out.println(\"sss\"+primero.getDato());\n } else {\n res = comp.evaluar(dato, primero.getDato());\n // System.out.println(\"\"+res);\n if (res == -1) {\n nuevo.setReferencia(primero);\n primero = nuevo;\n } else {\n int auxres = 0;\n Nodo anterior, actual;\n anterior = actual = primero;\n auxres = comp.evaluar(dato, actual.getDato());\n while ((actual.getReferencia() != null) && (auxres == 1)) {\n anterior = actual;\n actual = actual.getReferencia();\n auxres = comp.evaluar(dato, actual.getDato());\n }\n if (auxres == 1) {\n anterior = actual;\n }\n nuevo.setReferencia(anterior.getReferencia());\n anterior.setReferencia(nuevo);\n\n }\n }\n\n }",
"public void guardar() {\n try {\n objConec.conectar();\n objConec.Sql = objConec.con.prepareStatement(\"insert into contacto values(null,?,?,?,?,?)\");\n objConec.Sql.setString(1, getNom_con());\n objConec.Sql.setInt(2, getTel_con()); \n objConec.Sql.setString(3, getEma_con());\n objConec.Sql.setString(4, getAsu_con());\n objConec.Sql.setString(5, getMen_con());\n objConec.Sql.executeUpdate();\n objConec.cerrar();\n JOptionPane.showMessageDialog(null, \"Mensaje enviado correctamente\");\n } catch (Exception ex) {\n JOptionPane.showMessageDialog(null, \"Error al enviar el mensaje\");\n\n }\n\n }",
"public void save() {\n super.storageSave(listPedidosAssistencia.toArray());\n }",
"public void verifyData() {\n\n saveDay();\n\n }",
"public abstract void leerPersistencia();",
"private void saveData() {\n readViews();\n final BookEntry bookEntry = new BookEntry(mNameString, mQuantityString, mPriceString, mSupplier, mPhoneString);\n AppExecutors.getInstance().diskIO().execute(new Runnable() {\n @Override\n public void run() {\n // Insert the book only if mBookId matches DEFAULT_BOOK_ID\n // Otherwise update it\n // call finish in any case\n if (mBookId == DEFAULT_BOOK_ID) {\n mDb.bookDao().insertBook(bookEntry);\n } else {\n //update book\n bookEntry.setId(mBookId);\n mDb.bookDao().updateBook(bookEntry);\n }\n finish();\n }\n });\n }",
"private Boolean persistRecords() {\n\t\t//Declarations\n\t\tBoolean persisted = false;\n\t\t\n\t\ttry{\t\t\t\t\t\n\t\t\t//Create the DB Handler\n\t\t\tDBHandler dbHandler = new DBHandler();\t\t\t\n\t\t\tDate date = new Date();\n\t\t\t\t\t\t\n\t\t\t//Set the updated time\n\t\t\t_medicalData.setUpdatedOn(date.toString());\n\t\t\t\n\t\t\t//Store the data to data store\n\t\t\tpersisted = dbHandler.storeData(_medicalData);\t\t\t\t\t\t\n\t\t}catch(Exception ex){\n\t\t\tpersisted = false;\n\t\t}\n\t\t\n\t\treturn persisted;\t\t\n\t}",
"public T getDato() {\n\t\treturn dato;\n\t}",
"public void guardarDatos() throws Exception {\n\t\ttry {\n\t\t\tFormularioUtil.setUpperCase(groupboxEditar);\n\t\t\tif (validarForm()) {\n\t\t\t\t// Cargamos los componentes //\n\n\t\t\t\tHisc_urgencia_odontologico hisc_urgencia_odontologico = getBean();\n\n\t\t\t\tMap<String, Object> datos = new HashMap<String, Object>();\n\t\t\t\tdatos.put(\"hisc_urgencia_odontologico\",\n\t\t\t\t\t\thisc_urgencia_odontologico);\n\t\t\t\t// datos.put(\"sigvitales\", mcSignosVitales.obtenerSigvitales());\n\t\t\t\tdatos.put(\"accion\", tbxAccion.getValue());\n\t\t\t\tdatos.put(\"admision\", admision);\n\t\t\t\tdatos.put(\"datos_procedimiento\", getProcedimientos());\n\n\t\t\t\tImpresion_diagnostica impresion_diagnostica = macroImpresion_diagnostica\n\t\t\t\t\t\t.obtenerImpresionDiagnostica();\n\t\t\t\tdatos.put(\"impresion_diagnostica\", impresion_diagnostica);\n\n\t\t\t\tgetServiceLocator().getHisc_urgencia_odontologicoService()\n\t\t\t\t\t\t.guardarDatos(datos);\n\n\t\t\t\ttbxAccion.setValue(\"modificar\");\n\t\t\t\tinfoPacientes.setCodigo_historia(hisc_urgencia_odontologico\n\t\t\t\t\t\t.getCodigo_historia());\n\n\t\t\t\tactualizarRemision(admision, getInformacionClinica(), this);\n\t\t\t\tcargarServicios();\n\n\t\t\t\tMensajesUtil.mensajeInformacion(\"Informacion ..\",\n\t\t\t\t\t\t\"Los datos se guardaron satisfactoriamente\");\n\t\t\t}\n\n\t\t} catch (ImpresionDiagnosticaException e) {\n\t\t\tlog.error(e.getMessage(), e);\n\t\t} catch (Exception e) {\n\t\t\tif (!(e instanceof WrongValueException)) {\n\t\t\t\tMensajesUtil.mensajeError(e, \"\", this);\n\t\t\t}\n\t\t}\n\t}",
"private void insertData() {\r\n \r\n TeatroEntity teatro = factory.manufacturePojo(TeatroEntity.class);\r\n em.persist(teatro);\r\n FuncionEntity funcion = factory.manufacturePojo(FuncionEntity.class);\r\n List<FuncionEntity> lista = new ArrayList();\r\n lista.add(funcion);\r\n em.persist(funcion);\r\n for (int i = 0; i < 3; i++) \r\n {\r\n SalaEntity sala = factory.manufacturePojo(SalaEntity.class);\r\n sala.setTeatro(teatro);\r\n sala.setFuncion(lista);\r\n em.persist(sala);\r\n data.add(sala);\r\n }\r\n for (int i = 0; i < 3; i++) \r\n {\r\n SalaEntity sala = factory.manufacturePojo(SalaEntity.class);\r\n sala.setTeatro(teatro);\r\n em.persist(sala);\r\n sfdata.add(sala);\r\n }\r\n \r\n }",
"public void grabar(CalidadPcc o) {\n\t\ttry {\r\n\t\t\tem.getTransaction().begin();\r\n\t\t\tem.persist(o);\r\n\t\t\tem.getTransaction().commit();\r\n\t\t} finally {\r\n\t\t\tem.close();\r\n\t\t}\r\n\t}",
"public void guardarTripulante(Tripulante tripulante);",
"public void SaveUsuario(UsuarioDTO u) {\n Conexion c = new Conexion();\n PreparedStatement ps = null;\n String sql = \"INSERT INTO Usuario(nombre,apellido,usuario,email,password,fecha_nacimiento,fecha_creacion)\"\n + \"VALUES (?,?,?,?,?,?,?)\";\n try {\n ps = c.getConexion().prepareStatement(sql);\n ps.setString(1, u.getNombre());\n ps.setString(2, u.getApellido());\n ps.setString(3, u.getUsuario());\n ps.setString(4, u.getEmail());\n ps.setString(5, u.getPassword());\n ps.setDate(6, Date.valueOf(u.getFecha_Nacimiento()));\n ps.setDate(7, Date.valueOf(u.getFecha_Creacion()));\n ps.executeUpdate();\n } catch (SQLException ex) {\n System.out.println(\"A \" + ex.getMessage());\n } catch (Exception ex) {\n System.out.println(\"B \" + ex.getMessage());\n } finally {\n try {\n ps.close();\n c.cerrarConexion();\n } catch (Exception ex) {\n }\n }\n }",
"public void guardarEntrada(HashMap<String, Object> diccionario_datos){\n File file = new File(fichero_database);\n FileWriter writer = null;\n if(file.exists()){\n try{\n writer = new FileWriter(file, true);\n //crea un buffer o flujo intermedio antes de escribir directamente en el archivo\n BufferedWriter bfwriter = new BufferedWriter(writer);\n Iterator it = diccionario_datos.entrySet().iterator();\n while (it.hasNext()) {\n HashMap.Entry pair = (HashMap.Entry)it.next();\n bfwriter.write(pair.getKey() + \",\" );\n it.remove(); // para evitar ConcurrentModificationException\n }\n bfwriter.write(\"\\n\" );\n bfwriter.close();\n }\n catch (IOException e) {\n e.printStackTrace();\n } finally {\n if (writer != null) {\n try {//cierra el flujo principal\n writer.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n }\n\n }",
"protected void saveValues() {\n dataModel.persist();\n }",
"private void saveData(){\n databaseReference.setValue(new Teacher(0, \"\", 0.0));\n }",
"public void guardar(Modelo modelo) throws SipsaExcepcion;",
"private void saveUnsyncedDonor() {\n LocalDonor ldonor = LocalDonor.convert(donor,realm);\n realm.beginTransaction();\n realm.copyToRealmOrUpdate(ldonor);\n realm.commitTransaction();\n Toast.makeText(this, \"Donor record save.\", Toast.LENGTH_LONG).show();\n finish();\n }",
"public void insertar(String dato){\r\n \r\n if(estaVacia()){\r\n \r\n primero = new NodoJugador(dato);\r\n }else{\r\n NodoJugador temporal = primero;\r\n while(temporal.getSiguiente()!=null){\r\n temporal = temporal.getSiguiente();\r\n }\r\n \r\n temporal.setSiguiente(new NodoJugador(dato));\r\n }\r\n }",
"public void guardar(Periodo periodo)\r\n/* 22: */ {\r\n/* 23: 42 */ this.periodoDao.guardar(periodo);\r\n/* 24: */ }",
"public void guardar(Usuario u) throws Exception{\r\n //paso1 generar el archivo a guardarse\r\n File f=new File(\"archivaldo.raton\");\r\n if(f.exists()) usuarios= buscarTodos();\r\n //indicar que se va a guardar\r\n FileOutputStream fos=new FileOutputStream(f);\r\n \r\n //generar el objeto que nos va a ayudar a guardar el arraylist de usuarios\r\n ObjectOutputStream oos=new ObjectOutputStream(fos);\r\n //ahora si a guardar el objeto\r\n usuarios.add(u);\r\n oos.writeObject(usuarios);\r\n }",
"protected void saveDatos() {\r\n\r\n myNombre = (TextView) findViewById(R.id.spinNombre);\r\n myPrecio = (TextView) findViewById(R.id.spinPrecio);\r\n myMarca = (TextView) findViewById(R.id.spinMarca);\r\n myId_juego = (TextView) findViewById(R.id.spinID);\r\n\r\n String id = myId_juego.getText().toString();\r\n String precio = myPrecio.getText().toString();\r\n String marca = myMarca.getText().toString();\r\n String nombre = myNombre.getText().toString();\r\n\r\n try {\r\n MainActivity.myDbHelper.open();\r\n MainActivity.myDbHelper.insertJuegos(nombre, precio, marca, id);\r\n MainActivity.myDbHelper.close();\r\n } catch (SQLException e) {\r\n e.printStackTrace();\r\n }\r\n }",
"@Override\n\tpublic Horario guardarHorario(Horario h) {\n\t\tint idMedico = h.getMedico_id().getIdMedico(); \t\t// Obtener el Id del medico\n\t\tMedico objMedico = medicoS.obtenerMedico(idMedico); // Buscar y capturar al objeto medico\n\t\th.setMedico_id(objMedico); \t\t\t\t\t\t\t// Setear el medico dentro del campo de horario\n\n\t\tHorario horario = horarioRepository.save(h);\n\t\treturn horario;\n\t}",
"@Override\n\t@Transactional //los que no impliquen listados solo seran de tipo transactional\n\tpublic boolean grabar(Autoridad autoridad) {\n\t\tAutoridad objAutoridad = dAutoridad.save(autoridad);\n\t\tif (objAutoridad == null)\n\t\t\treturn false;\n\t\telse\n\t\t\treturn true;\n\t}",
"@Transactional\n DataRistorante insert(DataRistorante risto);",
"public void guardar() {\n try {\n if (this.buscarCodApelacion()) {\n Dr_siseg_usuarioBean usuario = new Dr_siseg_usuarioBean();\n FacesContext facesContext = FacesContext.getCurrentInstance();\n usuario = (Dr_siseg_usuarioBean) facesContext.getExternalContext().getSessionMap().get(\"usuario\");\n\n ApelacionesDao apelacionesDao = new ApelacionesDao();\n apelacionesDao.INSERTA_APELACIONES(apelacionesBean); \n\n BitacoraSolicitudDao bitacoraSolicitudDao = new BitacoraSolicitudDao();//INSERTA EL MOVIMIENTO EN LA BITACORA\n BitacoraSolicitudBean bitacoraSolicitudBean = new BitacoraSolicitudBean();\n bitacoraSolicitudBean.setBit_sol_id(this.apelacionesBean.getApel_sol_numero());\n bitacoraSolicitudBean.setUsuarioBean(usuario);\n bitacoraSolicitudBean.setBit_tipo_movimiento(\"0\");\n bitacoraSolicitudBean.setBit_detalle(\"Fue insertada la apelacion\");\n bitacoraSolicitudDao.dmlDr_regt_bitacora_solicitud(bitacoraSolicitudBean);\n\n this.Listar();\n this.apelacionesBean = new ApelacionesBean();\n addMessage(\"Guadado Exitosamente\", 1);\n } else {\n addMessage(\"La solicitud de apelacion especificada no existe\", 1);\n this.Listar();\n }\n } catch (ExceptionConnection ex) {\n Logger.getLogger(ApelacionController.class.getName()).log(Level.SEVERE, null, ex);\n addMessage(\"Se produjo un error al insertar el registro, contacte al administrador del sistema\", 1);\n }\n }",
"@Override\r\n\tpublic void guardar() {\n\t\ttab_nivel_funcion_programa.guardar();\r\n\t\tguardarPantalla();\r\n\t\t\r\n\t}",
"@Override\n\tpublic void save(CorsoDiLaurea corso) {\n\t\t\n\t}",
"private void saveData() {\n try {\n Student student = new Student(firstName.getText(), lastName.getText(),\n form.getText(), stream.getText(), birth.getText(),\n gender.getText(), Integer.parseInt(admission.getText()),\n Integer.parseInt(age.getText()));\n\n\n if (action.equalsIgnoreCase(\"new\") && !assist.checkIfNull(student)) {\n\n dao.insertNew(student);\n JOptionPane.showMessageDialog(null, \"Student saved !\", \"Success\", JOptionPane.INFORMATION_MESSAGE);\n\n } else if (action.equalsIgnoreCase(\"update\") && !assist.checkIfNull(student)) {\n dao.updateStudent(student, getSelected());\n JOptionPane.showMessageDialog(null, \"Student Updated !\", \"Success\", JOptionPane.INFORMATION_MESSAGE);\n }\n\n prepareTable();\n prepareHistory();\n buttonSave.setVisible(false);\n admission.setEditable(true);\n }catch (Exception e)\n {}\n }",
"private void guardarAposta(Aposta a) {\r\n\t\ttry {\r\n\t\t\tApostesSQL apostaHelper = new ApostesSQL(this, \"F1Bet.db\", null, 2);\r\n\t\t\tApostesConversor apostesConversor = new ApostesConversor(\r\n\t\t\t\t\tapostaHelper);\r\n\t\t\t// obtenir l'objecte BD\r\n\t\t\tSQLiteDatabase db = apostaHelper.getWritableDatabase();\r\n\t\t\t// Si s'ha obert correctament la BD4\r\n\t\t\tif (db != null) {\r\n\t\t\t\t// guardar a la base de dades\r\n\t\t\t\tapostesConversor.save(a);\r\n\t\t\t\tsetResult(RESULT_OK);\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tsetResult(RESULT_CANCELED);\r\n\t\t} finally {\r\n\t\t\tfinish();\r\n\t\t}\r\n\t}",
"@Override\n\tpublic VisitorDetails saveData(VisitorDetails data) {\n\t\treturn repo.save(data);\n\t}",
"public void saveFormData() {\r\n if(!saveRequired) return;\r\n if(cvHierarchyData != null && cvHierarchyData.size()>0) {\r\n SponsorHierarchyBean sponsorHierarchyBean;\r\n for(int index=0; index<cvHierarchyData.size(); index++) {\r\n try {\r\n sponsorHierarchyBean = (SponsorHierarchyBean)cvHierarchyData.get(index);\r\n if(sponsorHierarchyBean.getAcType() != null) {\r\n if(sponsorHierarchyBean.getAcType() == TypeConstants.UPDATE_RECORD) {\r\n queryEngine.update(queryKey,sponsorHierarchyBean);\r\n }else if(sponsorHierarchyBean.getAcType() == TypeConstants.INSERT_RECORD) {\r\n queryEngine.insert(queryKey,sponsorHierarchyBean);\r\n }else if(sponsorHierarchyBean.getAcType() == TypeConstants.DELETE_RECORD) {\r\n queryEngine.delete(queryKey,sponsorHierarchyBean);\r\n }\r\n }\r\n }catch(CoeusException coeusException){\r\n coeusException.printStackTrace();\r\n }\r\n }\r\n }\r\n saveRequired = false;\r\n }",
"public static void saveData() throws FileNotFoundException {\t\n\t\t\t\n\tScanner inputStream = new Scanner(new File(\"bookings.dat\"));\n\t\ttry {\n\t\t\t\n\t\t\tBookingList.surName = inputStream.nextLine();\n\t\t\tBookingList.tableNo = inputStream.nextLine();\n\t\t\tBookingList.sittingTime = inputStream.nextLine();\n\t\t\tBookingList.partyOf = inputStream.nextLine();\n\t\t\t\t\n\t\t\tBooking<?> bookingData = new Booking<Object>(null, surName, tableNo, sittingTime, partyOf);\n\t\t\tb1.insert(bookingData);\n\t\t\t\t\n\t\t}finally {\n\t\t\tinputStream.close();\n\t\t}\n\t\t\t\n\t}",
"public void saveData() {\n try {\n JsonWriter jw = new JsonWriter(openFileOutput(DATA_FILE, Context.MODE_PRIVATE));\n jw.write(user);\n jw.close();\n } catch(Exception e) {\n Log.i(\"Exception :\", e.toString());\n }\n }",
"public void gravar(StatussistemaDTO statussistemaDTO) {\n Database.manager.getTransaction().begin();\n if (statussistemaDTO.getIdStatussistema() == 0) {\n Database.manager.persist(statussistemaDTO); // gravar\n } else {\n Database.manager.merge(statussistemaDTO); // atualizar\n }\n Database.manager.getTransaction().commit();\n\n }",
"public boolean insertar(T dato){\n\t boolean resultado=true;\n\t if (vacio()) {\n\t \tdatoRaiz = dato;\n\t\t\tesVacio = false;\n\t\t}\n\t else {\n\t if (!(this.datoRaiz.equals(dato))) {\n\t Arbol<T> aux;\n\t if (dato.compareTo(this.datoRaiz)<0) { //dato < datoRaiz\n\t if ((aux=getHijoIzq())==null)\n\t hIzq = aux = new Arbol <T>();\n\t }\n\t else {\t\t\t\t\t\t\t\t\t//dato > datoRaiz\n\t if ((aux=getHijoDer())==null)\n\t hDer = aux = new Arbol <T>();\n\t }\n\t resultado = aux.insertar(dato);\n\t }\n\t else\n\t resultado=false;\n\t }\n\t return resultado;\n\t}",
"@Transactional\n public void guardarPedido(PedidoMaterial pedido){\n \n pedidoMaterialRepository.save(pedido);\n }",
"Object getCurrentData();",
"private void saveSensor() {\n new SensorDataSerializer(sensorID, rawData);\n rawData.clear();\n }",
"private void saveToFileData() {//Context context) {\n try {\n FileOutputStream fileOutputStream = openFileOutput(fileNameData, Context.MODE_PRIVATE);\n ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream);\n objectOutputStream.writeObject(Data.userData);\n objectOutputStream.close();\n fileOutputStream.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"PersistentDataHolder getDataHolder();",
"public Usuario buscarUsuario(String usuario) {\n Usuario usuario1 = new Usuario();\n try{\n\t\tString seleccion = \"SELECT usuario, nombre, clave FROM usuarios where usuario=? \";\n\t\tPreparedStatement ps = con.prepareStatement(seleccion);\n ps.setString(1, usuario);\n \n\t\t//Savepoint sp1 = con.setSavepoint(\"SAVE_POINT_ONE\");\n \n\t\tResultSet rs = ps.executeQuery();\n\t\tcon.commit();\n\t\twhile(rs.next()){\n usuario1.setUsuario(rs.getString(\"usuario\")); \n usuario1.setNombre(rs.getString(\"nombre\")); \n usuario1.setClave(rs.getString(\"clave\")); \n return usuario1;\n\t\t} \n \n }catch(Exception e){\n System.out.println(e.getMessage());\n e.printStackTrace();\n }\n return null; \n\n }",
"public void guardarDireccionAlcabalaHstorico(RaDireccionAlcabalaHistorico raDireccionAlcabalaHistorico)throws Exception;",
"@PrePersist\n private void onSave()\n {\n this.lastUpdateDateTime = new Date();\n if(this.registerDateTime == null)\n {\n this.registerDateTime = new Date();\n }\n \n if(this.personKey == null || this.personKey.isEmpty())\n {\n this.personKey = UUID.randomUUID().toString();\n }\n \n if(this.activationDate == null && (this.activationKey == null || this.activationKey.isEmpty()))\n {\n this.activationKey = UUID.randomUUID().toString();\n this.activationDate = new Date();\n }\n \n // O ID só será 0 (zero) se for a criação do registro no banco\n if(this.id == 0)\n {\n this.isValid = false;\n }\n }",
"@Autowired\n private void instansierData() {\n todoRepository.save(new Todo(\"Handle melk på butikken\",false, \"04/09/2017\",\"10/10/2017\"));\n todoRepository.save(new Todo(\"Plukk opp barna i barnehagen\",false, \"05/09/2017\",\"10/10/2017\"));\n todoRepository.save(new Todo(\"Vask klær\",true, \"08/09/2017\",\"12/09/2017\"));\n }",
"public void saveData ( ) {\n\t\tinvokeSafe ( \"saveData\" );\n\t}",
"@PrePersist\n protected void onPersist() {\n this.data = LocalDate.now();\n }",
"public boolean guardar(Empleado empleado) {\n\n try {\n\n empDAO.create(empleado);\n System.out.println(\"Guardando Empleado:\" + empleado.toString());\n return true;\n\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n\n return false;\n\n }",
"public void guarda(Cliente cliente) {\n\n clienteDAO.guarda(cliente);\n editRow=0;\n //force get data from DAO (see getClientes() )\n lc=null;\n }",
"@Override\n\tpublic boolean save(UsuarioDTO objUsuarioDTO) {\n\t\treturn false;\n\t}",
"private void insertData() {\n compra = factory.manufacturePojo(CompraVentaEntity.class);\n compra.setId(1L);\n compra.setQuejasReclamos(new ArrayList<>());\n em.persist(compra);\n\n for (int i = 0; i < 3; i++) {\n QuejasReclamosEntity entity = factory.manufacturePojo(QuejasReclamosEntity.class);\n entity.setCompraVenta(compra);\n em.persist(entity);\n data.add(entity);\n compra.getQuejasReclamos().add(entity);\n }\n }",
"public void guardarTripulanteEncontrado(Tripulante tripulante);",
"public void guardarDietaComida(DietaComida dietaComida){\r\n try {\r\n \r\n String sql = \"INSERT INTO dietacomida (idDieta,idComida) VALUES ( ? , ? );\";\r\n \r\n PreparedStatement ps = con.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);\r\n ps.setInt(1, dietaComida.getIdDieta());\r\n ps.setInt(2, dietaComida.getIdComida());\r\n \r\n ps.executeQuery();\r\n \r\n ResultSet rs = ps.getGeneratedKeys();\r\n\r\n /* if (rs.next()) {\r\n dietaComida.setId(rs.getInt(1));\r\n } else {\r\n System.out.println(\"No se pudo obtener el id luego de insertar una DietaComida\");\r\n }*/\r\n ps.close();\r\n \r\n } catch (SQLException ex) {\r\n System.out.println(\"Error al insertar una DietaComida \" + ex.getMessage());\r\n }\r\n }",
"public static boolean solicitudGuardar(Partida partida) {\n DaoGenerico preguntaMDAO = new DaoGenerico();\n String objeto = convertirGson(partida);\n return preguntaMDAO.guardar(objeto, tabla);\n }",
"public void inserir(Conserto conserto) throws SQLException{\r\n conecta = FabricaConexao.conexaoBanco();\r\n Date dataentradasql = new Date(conserto.getDataEntrada().getTime());\r\n //Date datasaidasql = new Date(conserto.getDataSaida().getTime());\r\n sql = \"insert into conserto (concodigo, condataentrada, condatasaida, concarchassi, conoficodigo) values (?, ?, ?, ?, ?)\";\r\n pstm = conecta.prepareStatement(sql);\r\n pstm.setInt(1, conserto.getCodigo());\r\n pstm.setDate(2, (Date) dataentradasql);\r\n pstm.setDate(3, null);\r\n pstm.setString(4, conserto.getCarro().getChassi());\r\n pstm.setInt(5, conserto.getOficina().getCodigo());\r\n pstm.execute();\r\n FabricaConexao.fecharConexao();\r\n \r\n }",
"public Producto guardar(Producto producto) throws IWDaoException;",
"public void salvaDati(Object dati){\n\t\ttry{\n\t\t\tFileOutputStream fos = new FileOutputStream(file);\n\t\t\tObjectOutputStream oos = new ObjectOutputStream(fos);\n\t\t\toos.writeObject(dati);\n\t\t\toos.close();\n\t\t\tfos.close();\n\t\t\tSystem.out.println(\"File \" + file + \" salvato\");\n\t\t} catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\t\n\t}",
"public Date getDataPreventivo() {\n return dataPreventivo;\n }",
"@Override\r\n public Assunto persistir(Assunto assunto) {\r\n EntityManager em = PersistenceUtil.getEntityManager();\r\n em.getTransaction().begin();\r\n try {\r\n assunto = em.merge(assunto);\r\n em.getTransaction().commit();\r\n System.out.println(\"Registro Assunto gravado com sucesso\");\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n return assunto;\r\n }"
]
| [
"0.6350081",
"0.61230946",
"0.61217064",
"0.6047014",
"0.5964895",
"0.5948236",
"0.58824533",
"0.58631736",
"0.58441746",
"0.57872564",
"0.5777987",
"0.57559264",
"0.57557625",
"0.5735686",
"0.5730383",
"0.57262874",
"0.57240313",
"0.5718223",
"0.5717994",
"0.5716427",
"0.56966794",
"0.5695131",
"0.5690972",
"0.56862295",
"0.5663346",
"0.56611085",
"0.5657568",
"0.5656544",
"0.5618996",
"0.56117535",
"0.5604636",
"0.5599713",
"0.55869305",
"0.5583941",
"0.55812734",
"0.5580525",
"0.5575142",
"0.5572383",
"0.55664694",
"0.5566074",
"0.5563034",
"0.5554525",
"0.55387443",
"0.5534303",
"0.5525578",
"0.5519499",
"0.5508964",
"0.550889",
"0.55031115",
"0.5495984",
"0.54847646",
"0.5482145",
"0.5473034",
"0.5462102",
"0.5460698",
"0.5456732",
"0.5452423",
"0.54474837",
"0.5443616",
"0.54420185",
"0.5438907",
"0.54350996",
"0.54311776",
"0.54270583",
"0.5422802",
"0.5410123",
"0.54095536",
"0.5406607",
"0.53941095",
"0.5388882",
"0.538003",
"0.5378193",
"0.5376679",
"0.5374552",
"0.5373087",
"0.5370654",
"0.5367653",
"0.5366743",
"0.5366405",
"0.53640246",
"0.5363964",
"0.53591645",
"0.5348113",
"0.53408456",
"0.53313273",
"0.532993",
"0.53270555",
"0.53266144",
"0.532129",
"0.5318298",
"0.5315129",
"0.5313006",
"0.5311034",
"0.5306655",
"0.5305408",
"0.5299998",
"0.5296758",
"0.52967113",
"0.52961713",
"0.528881",
"0.52842045"
]
| 0.0 | -1 |
Coloca el dato en el nodo | public void setDato(int dato) {
this.dato = dato;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Nodo (String d){\n\t\tthis.dato = d;\n\t\tthis.siguiente = null; //para que apunte el nodo creado a nulo\n\t}",
"public Nodo (String d, Nodo n){\n\t\tdato = d;\n\t\tsiguiente=n;\n\t}",
"public Nodo(datos libro)\n {\n this.libro=libro;//LA VARIABLE LIBRO TENDRA LOS DATOS DE LA CLASE LIBRO\n }",
"public Nodo() {\r\n this.dato = null;\r\n this.siguiente = null;\r\n }",
"@Override\r\n public String toString() {\r\n return \"Nodo: \" + this.dato.toString();\r\n }",
"public void insertarOrden(Object dato) {\n Nodo nuevo = new Nodo(dato);\n int res = 0;\n // System.out.println(\"esxa\"+res);\n if (primero == null) {\n nuevo.setReferencia(primero);\n primero = nuevo;\n // System.out.println(\"Es nulo\");\n// System.out.println(\"sss\"+primero.getDato());\n } else {\n res = comp.evaluar(dato, primero.getDato());\n // System.out.println(\"\"+res);\n if (res == -1) {\n nuevo.setReferencia(primero);\n primero = nuevo;\n } else {\n int auxres = 0;\n Nodo anterior, actual;\n anterior = actual = primero;\n auxres = comp.evaluar(dato, actual.getDato());\n while ((actual.getReferencia() != null) && (auxres == 1)) {\n anterior = actual;\n actual = actual.getReferencia();\n auxres = comp.evaluar(dato, actual.getDato());\n }\n if (auxres == 1) {\n anterior = actual;\n }\n nuevo.setReferencia(anterior.getReferencia());\n anterior.setReferencia(nuevo);\n\n }\n }\n\n }",
"public void insertarInicio(E dato) {\n\t\tprimero=new Nodo<E>(dato,primero);\n\t\tif (estaVacia()) {\n\t\t\tultimo=primero;\n\t\t}\n\t\tcantidad++;\n\t}",
"public void crearNodos()\n\t{\n\t\tfor(List<String> renglon: listaDeDatos)\n\t\t{\n\t\t\tPersona persona = new Persona(Integer.parseInt(renglon.get(1)), Integer.parseInt(renglon.get(2))); //crea la persona\n\t\t\t\n\t\t\tNodo nodo = new Nodo(Integer.parseInt(renglon.get(0)), 0, 0, false); //crea el nodo con id en posicion 1\n\t\t\t\n\t\t\tnodo.agregarPersona(persona);\n\t\t\tlistaNodos.add(nodo);\n\t\t}\n\t\t\n\t}",
"public void inserisci(String dove, String contenuto){\n if (n_nodi == 0){\n root = new NodoAlbero(contenuto, null, \"directory\");\n n_nodi++;\n return;\n }\n //troviamo il nodo che sarà il padre del nodo che dobbiamo aggiungere\n NodoAlbero cercato = ricerca(dove);\n \n //se il nodo padre non esiste, non aggiungiamo il nuovo nodo\n if (cercato == null)\n return;\n //se il nodo padre non ha un figlio, lo creiamo\n if (cercato.getFiglio() == null)\n cercato.setFiglio(new NodoAlbero(contenuto, cercato, \"directory\"));\n //se ce ne ha già almeno uno, lo accodiamo agli altri figli\n else {\n NodoAlbero temp = cercato.getFiglio();\n while (temp.getFratello() != null)\n temp = temp.getFratello();\n temp.setFratello(new NodoAlbero(contenuto, temp.getPadre(), \"directory\"));\n }\n n_nodi++;\n }",
"public void InsertarNodo(int nodo) {\r\n Nodo nuevo_nodo = new Nodo(nodo);\r\n nuevo_nodo.siguiente = UltimoValorIngresado;\r\n UltimoValorIngresado = nuevo_nodo;\r\n tamaño++;\r\n }",
"public void inserisci(NodoAlbero dove, String contenuto, String tipo){\n if (n_nodi == 0){\n root = new NodoAlbero(contenuto, null, tipo);\n n_nodi++;\n return;\n }\n //se il nodo padre non ha un figlio, lo creiamo\n if (dove.getFiglio() == null)\n dove.setFiglio(new NodoAlbero(contenuto, dove, tipo));\n //se ce ne ha già almeno uno, lo accodiamo agli altri figli\n else {\n NodoAlbero temp = dove.getFiglio();\n while (temp.getFratello() != null)\n temp = temp.getFratello();\n temp.setFratello(new NodoAlbero(contenuto, temp.getPadre(), tipo));\n }\n n_nodi++;\n }",
"public void insertar(String dato){\r\n \r\n if(estaVacia()){\r\n \r\n primero = new NodoJugador(dato);\r\n }else{\r\n NodoJugador temporal = primero;\r\n while(temporal.getSiguiente()!=null){\r\n temporal = temporal.getSiguiente();\r\n }\r\n \r\n temporal.setSiguiente(new NodoJugador(dato));\r\n }\r\n }",
"public void setNodo(Long nodo);",
"public NodoDoble(Object valor) {\n this.valor = valor;\n }",
"public Nino(int id, int edad, Paso paso, Tobogan tobogan, Columpios columpios, Tiovivo tiovivo) {\n this.id = id; //se asignan todos los datos\n this.edad = edad;\n this.paso = paso;\n this.tobogan = tobogan;\n this.columpios = columpios;\n this.tiovivo = tiovivo;\n start(); //strat de los hilos\n }",
"public Nodo dosNoSeguidos(Nodo nodo) throws IOException{\n System.out.println(\"----------------inicio heuristica dosnoseguidos--------------\");\n Operadores operadores = new Operadores();\n //variables de matriz\n int numFilas,numColumnas,numColores;\n \n numColumnas = nodo.getnColumnas();\n numFilas = nodo.getnFilas();\n numColores = nodo.getnColores();\n \n String [][] matriz = new String [numFilas][numColumnas];\n matriz = operadores.clonarMatriz(nodo.getMatriz());\n //-------------------\n \n //variables de filas y columnas\n ArrayList<ArrayListColumna> columnas = new ArrayList<ArrayListColumna>();\n columnas = (ArrayList<ArrayListColumna>)nodo.getColumnas();\n \n ArrayList<ArrayListFila> filas = new ArrayList<ArrayListFila>();\n filas = (ArrayList<ArrayListFila>)nodo.getFilas();\n //---------------------------\n \n ArrayListFila auxListFila = new ArrayListFila();\n ArrayListColumna auxListColumna = new ArrayListColumna();\n \n int cambio=1;\n \n while(cambio!=0){\n cambio=0;\n \n nodo.setCambio(0);\n for(int i = 0;i<numFilas;i++){\n if(operadores.isFilaVacia(nodo.getMatriz(), i) == true){\n //filas\n auxListFila = (ArrayListFila)filas.get(i);\n\n int contadorColores = 0;\n for(int j=0;j<numColores;j++){\n Color auxColor = new Color();\n auxColor = auxListFila.getColor(j);\n if(auxColor.getNumero() > 0){\n contadorColores++;\n }\n }//fin color\n\n\n if(contadorColores == 2){//esto quiere decir que hay dos colores disponibles para usar en la matriz\n //ahora hay que ver si uno de los dos es igual a 2 y false\n for(int j1=0;j1<numColores;j1++){\n Color auxColor1 = new Color();\n auxColor1 = auxListFila.getColor(j1);\n\n if(auxColor1.getNumero() == 2 && auxColor1.isSeguido() == false){\n for(int j2=0;j2<numColores;j2++){\n Color auxColor2 = new Color();\n auxColor2 = auxListFila.getColor(j2);\n\n if(auxColor2.isSeguido() == true){\n cambio=1;\n nodo.setCambio(1);\n //pinta los extremos de la fila\n matriz = operadores.pintarPosicion(matriz,i, (numColumnas-1), auxColor1.getColor());\n \n matriz = operadores.pintarPosicion(matriz, i, 0, auxColor1.getColor());\n \n //pinta el resto de la fila\n matriz = operadores.pintarFilaCompleta(matriz, auxColor2.getColor(), i);\n //descuenta los colores en las filas\n auxColor1.setNumero(0);\n auxColor2.setNumero(0);\n \n //descontar colores en las columnas\n for(int c=0;c<numColumnas;c++){\n auxListColumna = (ArrayListColumna)columnas.get(c);\n \n if(c == 0){\n for(int c1=0;c1<numColores;c1++){\n Color auxColorc1 = new Color();\n auxColorc1 = auxListColumna.getColor(c1);\n \n if(auxColorc1.getColor().equals(auxColor1.getColor())){\n auxColorc1.setNumero(auxColorc1.getNumero()-1);\n }\n \n }\n }else if(c == (numColumnas-1)){\n for(int c1=0;c1<numColores;c1++){\n Color auxColorc1 = new Color();\n auxColorc1 = auxListColumna.getColor(c1);\n \n if(auxColorc1.getColor().equals(auxColor1.getColor())){\n auxColorc1.setNumero(auxColorc1.getNumero()-1);\n }\n }\n }else{\n for(int c1=0;c1<numColores;c1++){\n Color auxColorc1 = new Color();\n auxColorc1 = auxListColumna.getColor(c1);\n \n if(auxColorc1.getColor().equals(auxColor2.getColor())){\n auxColorc1.setNumero(auxColorc1.getNumero()-1);\n }\n }\n \n }\n \n }\n \n nodo.setMatriz(matriz.clone());\n System.out.println(\"-----\");\n operadores.imprimirMatriz(nodo.getMatriz());\n System.out.println(\"-----\");\n }\n }\n }\n }//fin color\n }\n }//fin isfilaVacia\n }//fin filas\n \n \n //---------columnas\n for(int i = 0;i<numColumnas;i++){\n if(operadores.isColumnaVacia(nodo.getMatriz(), i) == true){ \n //columnas\n auxListColumna = (ArrayListColumna)columnas.get(i);\n\n int contadorColores = 0;\n for(int j=0;j<numColores;j++){\n Color auxColor = new Color();\n auxColor = auxListColumna.getColor(j);\n if(auxColor.getNumero() > 0){\n contadorColores++;\n } \n }//fin color\n if(contadorColores == 2){//esto quiere decir que hay dos colores disponibles para usar en la matriz\n //ahora hay que ver si uno de los dos es igual a 2 y false\n for(int j1=0;j1<numColores;j1++){\n Color auxColor1 = new Color();\n auxColor1 = auxListColumna.getColor(j1);\n\n if(auxColor1.getNumero() == 2 && auxColor1.isSeguido() == false){\n for(int j2=0;j2<numColores;j2++){\n Color auxColor2 = new Color();\n auxColor2 = auxListColumna.getColor(j2);\n if(auxColor2.isSeguido() == true){\n cambio=1;\n nodo.setCambio(1);\n matriz = operadores.pintarPosicion(matriz,(numFilas-1), i, auxColor1.getColor());\n matriz = operadores.pintarPosicion(matriz, 0, i, auxColor1.getColor());\n \n matriz = operadores.pintarColumnaCompleta(matriz, auxColor2.getColor(), i);\n \n auxColor1.setNumero(0);\n auxColor2.setNumero(0);\n \n \n //descontar colores en las columnas\n for(int f=0;f<numFilas;f++){\n auxListFila = (ArrayListFila)filas.get(f);\n \n if(f == 0){\n for(int f1=0;f1<numColores;f1++){\n Color auxColorf1 = new Color();\n auxColorf1 = auxListFila.getColor(f1);\n \n if(auxColorf1.getColor().equals(auxColor1.getColor())){\n auxColorf1.setNumero(auxColorf1.getNumero()-1);\n }\n \n }\n }else if(f == (numColumnas-1)){\n for(int f1=0;f1<numColores;f1++){\n Color auxColorf1 = new Color();\n auxColorf1 = auxListFila.getColor(f1);\n \n if(auxColorf1.getColor().equals(auxColor1.getColor())){\n auxColorf1.setNumero(auxColorf1.getNumero()-1);\n }\n \n }\n }else{\n for(int f1=0;f1<numColores;f1++){\n Color auxColorf1 = new Color();\n auxColorf1 = auxListFila.getColor(f1);\n \n if(auxColorf1.getColor().equals(auxColor2.getColor())){\n auxColorf1.setNumero(auxColorf1.getNumero()-1);\n }\n }\n \n }\n \n }\n \n nodo.setMatriz(matriz.clone());\n System.out.println(\"-----\");\n operadores.imprimirMatriz(nodo.getMatriz());\n System.out.println(\"-----\");\n }\n }\n }\n }//fin color\n }\n }\n }//fin columnas\n }//fin while principal\n \n System.out.println(\"---------------final heuristica dosnoseguidos---------------\");\n return nodo;\n }",
"public int getDato() {\r\n return dato;\r\n }",
"public Fornecedor(int código, String nome, String data_cadastro, String n_documento) {\r\n super(código, nome, data_cadastro, n_documento);\r\n }",
"public void setNodoDerecho(Nodo nodo){\n der = nodo;\n }",
"void stampaStatisticheNodo() {\r\n for(Object obj : this.nodes)\r\n {\r\n Nodo n = (Nodo)obj;\r\n \r\n TransportLayer tl = n.myTransportLayer;\r\n tl.stampaStatistiche();\r\n \r\n // System.out.println(\"=====STAMPA STATISTICHE NODO NETWORK LAYER====\");\r\n NetworkLayer nl = n.myNetLayer;\r\n // String s = nl.getStat();\r\n nl.stampaStatistiche();\r\n // System.out.println(s);\r\n // System.out.println(\"=====FINE====\");\r\n \r\n physicalLayer pl = n.myPhyLayer;\r\n pl.stampaStatistiche();\r\n }\r\n }",
"public void eliminarNodo_Dat(int dato) {\n\t raiz = eliminarNodo(raiz, dato);\r\n\t}",
"public Nodo() {\n this.valor = 0;\n this.proximo=null;\n\n }",
"public void addend(int dato) {\n //agrega nuevo nodo \n NodoEnteroSimple nodo = new NodoEnteroSimple();\n\n nodo.setValor(dato);\n\n if (vacia()) {\n\n head = nodo;\n } else {\n //un temporal de la lista \n NodoEnteroSimple temp = head;\n\n while (temp.getSiguiente() != null) {\n temp = temp.getSiguiente();\n\n }\n temp.getSiguiente();\n }\n size++;\n }",
"@Override\n\tpublic DatosNit obtenerDatos(DatosNit datos) {\n\t\tnit = datos.getNit();\n\t\treturn null;\n\t}",
"public void nodata();",
"public void agregarNodo(Nodo nuevo){\n agregarNodoRec(root, nuevo);//la primera vez inicia en la raiz \n }",
"public NodoDoble(E elemento){\n this(null, elemento, null);//mando a llamar al ctrctor que recibe 2 parámetros\n }",
"public void recorrer(){\r\n \r\n NodoJugador temporal = primero;\r\n while(temporal != null){\r\n System.out.println(temporal.getDato());\r\n temporal = temporal.getSiguiente();\r\n \r\n }\r\n \r\n }",
"public T getDato() {\n\t\treturn dato;\n\t}",
"public ProduttoreDato(Semaforo pieno, Semaforo vuoto) {\n this.pieno = pieno;\n this.vuoto = vuoto;\n }",
"private void limpiarDatos() {\n\t\t\n\t}",
"public void Nodo(){\r\n this.valor = \"\";\r\n this.siguiente = null;\r\n }",
"public Nodo(String _nombre_palabra, int _idtoken) {\n nombre_palabra = _nombre_palabra;\n idtoken = _idtoken;\n Siguiente = null;\n }",
"@Override\n\tpublic List<Nodo> obtenerNodos() {\n\t\treturn nodos;\n\t}",
"public void resetNodo()\r\n {\r\n this.nodo = null;\r\n }",
"public Nodo (int info)\n\t\t{\n\t\t\n\t\t\tthis.info = info;\n\t\t\tnext = null ;\n\t\t}",
"public void AgregarDeMayorAMenor(int el) throws Exception{\n if(repetido(el)){\n throw new Exception(\"El dato ya existe en la lista!!!\");\n }else{\n /*\n Crear un nodo para el nuevo dato.\n Si la lista esta vacía, o el valor del primer elemento de la lista \n es mayor que el nuevo, insertar el nuevo nodo en la primera posición \n de la lista y modificar la cabecera respectivamente.\n \n */\n NodoDoble newNode = new NodoDoble(el);\n if (estVacia() || inicio.GetDato() == el) {\n newNode.SetSiguiente(inicio);\n inicio = newNode;\n } else {\n /* \n Si no se cumple el caso anterior, buscar el lugar adecuado \n para la inserción: recorrer la lista conservando el nodo actual. \n Inicializar nodo actual con el valor de primera posición, \n y avanzar mientras el siguiente nodo no sea nulo y el dato \n que contiene la siguiente posición sea mayor o igual que \n el dato a insertar.\n */\n NodoDoble current = inicio;//\n while (current.GetSiguiente() != null\n && current.siguiente.GetDato() >= el) {\n current = current.GetSiguiente();\n }\n /*\n Con esto se señala al nodo adecuado, \n a continuación insertar el nuevo nodo a continuación de él.\n */\n newNode.SetSiguiente(current.GetSiguiente());\n current.SetSiguiente(newNode);\n }\n } \n }",
"public Nodo getNodoDerecho(){\n return der;\n }",
"public void addNodo(String nombre) {\n\t\tNodo nodo = new Nodo();\n\t\tnodo.setNombre(nombre);\n\t\tnodos.add(nodo);\n\t}",
"public void inOrden(Nodo r){\n if(r != null){\n inOrden(r.hijoIzquierdo);\n System.out.println(r.valor);\n inOrden(r.hijoDerecho);\n }\n }",
"public misDatos() {\n\tinitComponents();\n\tsetLocationRelativeTo(null);\n\tthis.nombre.setText(nodo.getContenido().getNombre());\n\tthis.apellido.setText(nodo.getContenido().getApellido());\n\tthis.carrera.setText(nodo.getContenido().getCarrera());\n\tthis.carnet.setText(Integer.toString(nodo.getContenido().getCarnet()));\n\n }",
"String getDataNascimento();",
"public GrafoNDNP(String archivo) {\n\t\tint fila, columna;\n\n\t\ttry {\n\t\t\tsc = new Scanner(new File(archivo));\n\n\t\t\tcantNodos = sc.nextInt();\n\t\t\tcantAristas = sc.nextInt();\n\t\t\tporcentAdy = Double.parseDouble(sc.next());\n\t\t\tgrMax = sc.nextInt();\n\t\t\tgrMin = sc.nextInt();\n\t\t\tthis.matriz = new MatrizSimetrica(cantNodos);\n\n\t\t\tfor (int i = 0; i < cantAristas; i++) {\n\t\t\t\tfila = sc.nextInt() - 1;\n\t\t\t\tcolumna = sc.nextInt() - 1;\n\t\t\t\tmatriz.setValor(fila, columna, true);\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < matriz.getDimension(); i++) {\n\t\t\t\tint grado = 0;\n\t\t\t\tfor (int j = 0; j < matriz.getDimension(); j++) {\n\t\t\t\t\tif (matriz.getValor(i, j) && i != j) {\n\t\t\t\t\t\tgrado++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tnodos.add(new Nodo(i + 1, 0, grado));\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tsc.close();\n\t\t}\n\t}",
"public void insert(Nodo nodo) {\r\n\t\tif(cont<7){\r\n\t\t\tif(this.getRaiz() == null) {\r\n\t this.setRaiz(nodo);\r\n\t nodo.setClave(0);\r\n\t return;\r\n\t }\r\n\t \r\n\t Nodo t = this.getRaiz();\r\n\t boolean val = true;\r\n\t while((t != null)&&(val)) {\r\n\t if(t.getLeft() == null) {\r\n\t \tt.setLeft(nodo);\r\n\t \tcont++;\r\n\t \tNivel(nodo);\r\n\t \tval=false;\r\n\t }\r\n\t else if(t.getRight() == null) {\r\n\t t.setRight(nodo);\r\n\t cont++;\r\n\t \tNivel(nodo);\r\n\t val=false;\r\n\t }\r\n\t else {\r\n\t int lCount = countChildren(t.getLeft());\r\n\t int rCount = countChildren(t.getRight());\r\n\t if(lCount == rCount)\r\n\t t = t.getLeft(); \r\n\t \r\n\t else if(lCount == 0 || lCount == 1)\r\n\t t = t.getLeft(); \r\n\t \r\n\t else\r\n\t t = t.getRight();\r\n\t \r\n\t }\r\n\t\r\n\t }\r\n\t\t}\r\n\t}",
"@Override\n\tpublic void construir(Doctor d, Graph g, ArrayList<String> nodosFecha,\n\t\t\tdouble coste) {\n\t\tString dni = d.getDni();\n\t\tg.addNode(dni + \";\" + mes); // creo el node intermedio mes\n\t\tint mesId = g.getNodeId(dni + \";\" + mes);\n\t\tint docId = g.getNodeId(dni);\n\t\tg.addEdge(0, maxDias, 0, docId, mesId);\n\t\tint diaId;\n\n\t\tfor (String s : nodosFecha) {\n\t\t\tString[] nodoFecha = s.split(\";\");\n\t\t\tString[] nodoMes = nodoFecha[0].split(\"/\");\n\t\t\tif (mes.equals(nodoMes[1])\n\t\t\t\t\t&& nodoFecha[1].equals(d.getEspecialidad())) {\n\t\t\t\tdiaId = g.getNodeId(s);\n\t\t\t\tg.addEdge(0, 1, coste, mesId, diaId);\n\t\t\t}\n\t\t}\n\t}",
"Nodo(T info, Nodo sig) {\n this.info = info;\n this.sig = sig;\n }",
"public void push(datos libro) {\n\t\tNodo nodo=new Nodo(libro);\n //SI CABEZA ES IGUAL A NULO\n\t\tif (cabeza==null) {\n //LO INGRESARA EN CABEZA\n\t\t\tcabeza=nodo;\n //DE LO CONTRARIO LE ASIGNARA UN PUNTERO A CUAL INGRESAR LOS DATOS\n\t\t} else {\n\t\t\tNodo puntero=cabeza;\n\t\t\twhile (puntero.siguiente!=null) {\n\t\t\t\tpuntero=puntero.siguiente;\n\t\t\t}\n\t\t\tpuntero.siguiente=nodo;\n\t\t}\n\t\tlongitud++;\n\t}",
"private void cargarCodDocente() {\n ClsNegocioDocente negoDoc = new ClsNegocioDocente(); \n txtCodDocente.setText(negoDoc.ObtenerCodigo());\n try {\n negoDoc.conexion.close();\n } catch (SQLException ex) {\n Logger.getLogger(FrmCRUDDocente.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"public NodoA desconectar(NodoA t){\n if(t != cabeza){\n t.getLigaDer().setLigaIzq(t.getLigaIzq());\n System.out.println(\"Direccion:\"+t+\" izquierdo:\"+t.getLigaIzq()+\" derecho:\"+t.getLigaDer());\n t.getLigaIzq().setLigaDer(t.getLigaDer());\n return t;\n }\n return null;\n }",
"public static int datoint(){\n \n try {\n return(Integer.parseInt(dato()));\n } catch (NumberFormatException error) {\n return (Integer.MIN_VALUE);\n }\n \n }",
"private void cargarDatosDefault() {\n\t\tPersonasJSON personas = new PersonasJSON();\n\t\tpersonas = personas.leerJSON(\"src/datosJSON/Personas.JSON\");\n\t\t\n\t\tfor(int i=0 ; i<personas.getCantidadPersonas(); i++) {\n\t\t\t\n\t\t\tString nombre = personas.getPersona(i).getNombre();\n\t\t\tint deporte = personas.getPersona(i).getDeporte();\n\t\t\tint musica = personas.getPersona(i).getMusica();\n\t\t\tint espectaculo = personas.getPersona(i).getEspectaculo();\n\t\t\tint ciencia = personas.getPersona(i).getCiencia();\n\t\t\t\n\t\t\tmodel.addRow(new String[]{ nombre, String.valueOf(deporte), String.valueOf(musica),\n\t\t\t\t\tString.valueOf(espectaculo), String.valueOf(ciencia) });\n\t\t}\n\t\t\n\t\tdatos.addAll(personas.getTodasLasPersonas());\n\t\t\n\t}",
"public Nodo() {\n\t\tthis(null, null);\n\t}",
"public TDAPrioridad getDato(int pos) {\r\n return datos[pos];\r\n }",
"public Nodo espaciosJustos(Nodo nodo){\n System.out.println(\"----------------inicio heuristica espaciosJustos--------------\");\n Operadores operadores = new Operadores();\n //variables de matriz\n int numFilas,numColumnas,numColores;\n \n numColumnas = nodo.getnColumnas();\n numFilas = nodo.getnFilas();\n numColores = nodo.getnColores();\n \n String [][] matriz = new String [numFilas][numColumnas];\n matriz = operadores.clonarMatriz(nodo.getMatriz());\n //-------------------\n \n //variables de filas y columnas\n ArrayList<ArrayListColumna> columnas = new ArrayList<ArrayListColumna>();\n columnas = (ArrayList<ArrayListColumna>)nodo.getColumnas();\n \n ArrayList<ArrayListFila> filas = new ArrayList<ArrayListFila>();\n filas = (ArrayList<ArrayListFila>)nodo.getFilas();\n //---------------------------\n \n ArrayListFila auxListFila = new ArrayListFila();\n ArrayListColumna auxListColumna = new ArrayListColumna();\n \n int cambio=1;\n int changue=0;\n while(cambio!=0){\n cambio=0;\n \n nodo.setCambio(0);\n for(int i=0;i<numFilas;i++){\n auxListFila = (ArrayListFila)filas.get(i);\n for(int j=0;j<numColores;j++){\n Color auxColor = new Color();\n auxColor = auxListFila.getColor(j);\n\n if(auxColor.getNumero() > 0){\n int contador=0;\n for(int c=0;c<numColumnas;c++){\n auxListColumna=(ArrayListColumna)columnas.get(c);\n\n for(int j1=0;j1<numColores;j1++){\n Color auxColor1 = new Color();\n auxColor1 = auxListColumna.getColor(j1);\n if(auxColor1.getNumero() > 0){\n if(auxColor.getColor().equals(auxColor1.getColor()) && operadores.isPosicionVaciaFila(nodo.getMatriz(), i, c)){\n contador++;\n }\n }\n }\n }\n \n if(auxColor.getNumero() == contador){\n changue=1;\n cambio=1;\n auxColor.setNumero(0);\n for(int c=0;c<numColumnas;c++){\n auxListColumna=(ArrayListColumna)columnas.get(c);\n\n for(int j1=0;j1<numColores;j1++){\n Color auxColor1 = new Color();\n auxColor1 = auxListColumna.getColor(j1);\n if(auxColor1.getNumero() > 0){\n if(auxColor.getColor().equals(auxColor1.getColor()) && operadores.isPosicionVaciaFila(nodo.getMatriz(), i, c)){\n \n auxColor1.setNumero(auxColor1.getNumero()-1);\n\n matriz = operadores.pintarPosicion(matriz, i, c, auxColor.getColor());\n\n nodo.setMatriz(matriz);\n }\n }\n }\n }\n System.out.println(\"-----\");\n operadores.imprimirMatriz(nodo.getMatriz());\n System.out.println(\"-----\");\n \n \n }\n }\n }\n }\n \n }\n if(changue==1) nodo.setCambio(1);\n System.out.println(\"----------------fin heuristica espaciosJustos-------------- \");\n return (Nodo)nodo;\n }",
"public Nodo1Controlador() {\n this.reinit();\n\n }",
"public T getDato(int posicion) {\n return this.listaDeDatos.get(posicion);\n }",
"private void insertar(String nombre, String Contra) {\n ini.Tabla.insertar(nombre, Contra);\n AVLTree arbol = new AVLTree();\n Nod nodo=null;\n ini.ListaGen.append(0,0,\"\\\\\",nombre,\"\\\\\",\"\\\\\",arbol,\"C\",nodo); \n \n }",
"public void setDataNascimentoFromSQL(Date dataNascimento) {\r\n\r\n\t\t// montando a data atrav�s do Calendar\r\n\t\tCalendar data = Calendar.getInstance();\r\n\t\tdata.setTime(dataNascimento);\r\n\t\tthis.dataNascimento = data;\r\n\r\n\t}",
"public datosTaller() {\n this.cedulaCliente = new int[100]; //Atributo de la clase\n this.nombreCliente = new String[100]; //Atributo de la clase\n this.compraRealizada = new String[100]; //Atributo de la clase\n this.valorCompra = new float[100]; //Atributo de la clase\n this.posicionActual = 0; //Inicializacion de la posicion en la que se almacenan datos\n }",
"private Nodo eliminarNodo(Nodo aux, int dato) {\n\t\tif(aux == null) { \r\n\t\t\tSystem.out.println(\"El nodo no se encontro\");\r\n\t\t}else if(dato < aux.getDato()) { // Se busca el dato por el lado izquierdo.\r\n\t\t\tNodo izq = eliminarNodo(aux.getHijoIzq(), dato);\r\n\t\t\taux.setHijoIzq(izq);\r\n\t\t}else if (dato > aux.getDato()) { // Se busca el dato por el lado derecho.\r\n\t\t\tNodo der = eliminarNodo(aux.getHijoDer(), dato);\r\n\t\t\taux.setHijoIzq(der);\r\n\t\t}else { // Un vez encontrado se ejecuta el else.\r\n\t\t\tNodo n = aux; \r\n\t\t\tif(n.getHijoDer() == null) {// si el nodo del lado derecho es igual null se captura el nodo izquierdo.\r\n\t\t\t\taux = n.getHijoIzq(); \r\n\t\t\t}else if (n.getHijoIzq() == null) {// si el nodo del lado izquierdo es igual null se captura el nodo izquierdo.\r\n\t\t\t\taux = n.getHijoDer();\r\n\t\t\t}else { // Si el nodo a eliminar tiene dos hijos entonces hacemos cambiamos los lugaresa para despues eliminarlo. \r\n\t\t\t\tn = cambiar(n);\r\n\t\t\t}\r\n\t\t\tn = null; // ELiminamos el nodo.\r\n\t\t}\r\n\t\treturn aux;\r\n\t}",
"public NodoArbol buscarNodo(int d){\n\t\tNodoArbol aux= raiz;\n\t\twhile(aux.dato!=d){\n\t\t\tif(d<aux.dato){\n\t\t\t\taux=aux.hijoizq;\n\t\t\t}else{\n\t\t\t\taux=aux.hijoder;\n\t\t\t}\n\t\t\tif(aux==null){\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\treturn aux;\n\t}",
"public void dodajZmiju() {\n\t\t\n\t\tint i = this.zmija.get(0).i;\n\t\tint j = this.zmija.get(0).j;\n\t\tthis.tabla[i][j] = 'O';\n\t\t\n\t\tfor (int k = 1; k < this.zmija.size(); k++) {\n\t\t\ti = this.zmija.get(k).i;\n\t\t\tj = this.zmija.get(k).j;\n\t\t\tthis.tabla[i][j] = 'o';\n\t\t}\t\n\t}",
"public Data() {\n\t\tCalendar now = new GregorianCalendar();\n\t\tthis.anno = now.get(Calendar.YEAR);\n\t\tthis.giorno = now.get(Calendar.DAY_OF_MONTH);\n\t\tthis.mese = Data.MESI[now.get(Calendar.MONTH)];\n\t}",
"public void agregarAlInicio(int edad){\n //CREAR UN NUEVO NODO AL INICIO DE LA LISTA\n inicio = new Nodo(edad,inicio);\n if(fin==null){\n fin=inicio;\n }\n }",
"public Nodo(Elemento e) {\n\t\tthis(e, null);\n\t}",
"public static void main(String[] args) {\n Alumno aaDatos []; // El identificador es nulo\n \n aaDatos = new Alumno[tam];//Creamos un arreglo de 10 \n //alumnos - AQUI HABRA PREGUNTA\n for (int i = 0; i < aaDatos.length; i++) {\n aaDatos[i]= new Alumno(\"Dany\",\"16550518\", 0);//Para cada lugar de arreglo se crea un objeto de la clase alumno\n \n }\n for (Alumno aaDatos1: aaDatos) {\n System.out.println(\"Nombre: \"+ aaDatos1.getsNom());\n System.out.println(\"Marticula: \"+ aaDatos1.getsMatri());\n System.out.println(\"Carrera: \"+ aaDatos1.getiCar());\n \n }\n \n \n //CREAMOS UNA COPIA DEL ARREGLO\n Alumno aaCopiaDatos [];\n aaCopiaDatos = new Alumno [tam];\n \n for (int i = 0; i < aaCopiaDatos.length; i++) {\n aaCopiaDatos[i]= new Alumno(aaDatos[i].getsNom(), // <<<Se llenan todos los datos que pide el constructor por argumentos\n aaDatos[i].getsMatri(), \n aaDatos[i].getiCar());\n \n }\n for (Alumno aaCopiaDatos1 : aaCopiaDatos) {\n System.out.println(\"Nombre: \"+ aaCopiaDatos1.getsNom());\n System.out.println(\"Marticula: \"+ aaCopiaDatos1.getsMatri());\n System.out.println(\"Carrera: \"+ aaCopiaDatos1.getiCar());\n }\n System.out.println(aaDatos);\n System.out.println(aaCopiaDatos);\n }",
"public NodoDoble(NodoDoble<E> anterior, E elemento, NodoDoble<E> siguiente){//a ver si no te da problema el nodo por no estar especigicando su tipo... puesto que esta clase es genérica y aquí estas creando uno sin saber, asi que creo que debería de especificarselo\n contenido = elemento;\n nodoSiguiente = siguiente;\n nodoAnterior = anterior;\n }",
"public NodoArbolSintactico(String nombre, int tipo) {\r\n hijos = new ArrayList<>();\r\n this.nombre = nombre;\r\n accion = null;\r\n this.tipo = tipo;\r\n }",
"private void reinit() {\n this.nodo1Sel = new Nodo1();\n this.objNodo1 = new Nodo1();\n this.objNodo1Buscar = new Nodo1();\n this.lstNodo1 = new ArrayList<Nodo1>();\n this.lstNodoB = new ArrayList<Nodo1>();\n this.lstNodoBuscar = new ArrayList<Nodo1>();\n this.estadoSel = -1;\n this.estadoSel1 = -1;\n this.comando1 = \"rman\";\n this.comando2 = \"rmaf\";\n this.comando5 = \"uuyy\";\n //this.cargarNodo1();\n this.obtenerNodo1DadoFecha();\n this.graficar();\n\n //fecha1 = sdf.format(date1);\n }",
"public Nodo(String _nombre_palabra, int _idtoken, String _valor, String _tipo, String _pertenece_a, Nodo _Anterior) {\n nombre_palabra = _nombre_palabra;\n idtoken = _idtoken;\n valor = _valor;\n tipo = _tipo;\n pertenece_a = _pertenece_a;\n Siguiente = null;\n Anterior = _Anterior;\n }",
"public TreeImpl(T dato) {\r\n\t\traiz = new NodeImpl<T>(dato, null);// El null dice que es raiz\r\n\t}",
"public void insertar(int x, String nombre) {\n \tNodo nuevo;\n nuevo = new Nodo();\n nuevo.edad = x;\n nuevo.nombre = nombre;\n //Validar si la lista esta vacia\n if (raiz==null)\n {\n nuevo.sig = null;\n raiz = nuevo;\n }\n else\n {\n nuevo.sig = raiz;\n raiz = nuevo;\n }\n }",
"@Override\n public Nodo ejecutar() {\n listaNodos.add(nodoRaiz);\n //nodo almacenado temporalmente\n Nodo nodoActual;\n //cola de hijos producto de aplicar ops\n ArrayList <Nodo> cola;\n \n NODO:while(!(listaNodos.isEmpty()))\n {\n nodoActual=listaNodos.get(0);\n listaNodos.remove(0);\n //Detecto el nodo como un ciclo y salto si sí es luego verifico meta\n if(nodoCiclo(nodoActual))\n {\n \n// System.out.println(\"Es Ciclo: \"+nodoActual.getOperador());\n continue NODO;\n }\n else if(esMeta(nodoActual)){\n solucion(nodoActual);\n JOptionPane.showMessageDialog(null, \"nodos expandidos\"+nodoexpandidos+\"profundidad\"+profundidad);\n return nodoActual;\n }\n //Expando Nodo\n cola=expandirNodo(nodoActual);\n nodoexpandidos++;\n for(int i=0;i<cola.size();i++)\n {\n Nodo temporal=cola.get(i);\n cola.set(i, temporal);\n \n }\n //Armo cola general\n cola.addAll(listaNodos);\n listaNodos=(ArrayList <Nodo>)cola.clone();\n }\n return null;\n }",
"public String getDataNascimentoString() {\r\n\r\n\t\tSimpleDateFormat data = new SimpleDateFormat(\"dd/MM/yyyy\");\r\n\r\n\t\treturn data.format(this.dataNascimento.getTime());\r\n\r\n\t}",
"public interface InterfazNodo extends VisitableNode{\n\t\tpublic void add(InterfazNodo nodo);\n\t\tpublic void remove(InterfazNodo nodo);\n\t\tpublic Codigo generarCodigo(Codigo codigo, TempManager tempManager, LabelManager labelManager);\n\t\tpublic TablaDeSimbolos acceptTSVisitor(\n\t\t\t\tTablaSimbolosVisitor tablaSimbolosVisitor);\n\t\t\n\t}",
"protected T buscarSucesorInOrden(NodoBinario<T> hijoDerecho) {\n if (NodoBinario.esNodoVacio(hijoDerecho.getHijoIzquierdo())) {\n return hijoDerecho.getDato(); //si no tiene mas que ir por la izquierda retorna su dato\n } else {\n return buscarSucesorInOrden(hijoDerecho.getHijoIzquierdo()); //todo izquierda\n }\n }",
"public void agregarAlInicio(String valor){\r\n // Define un nuevo nodo.\r\n Nodo nuevo = new Nodo();\r\n // Agrega al valor al nodo.\r\n nuevo.setValor(valor);\r\n // Consulta si la lista esta vacia.\r\n if (esVacia()) {\r\n // Inicializa la lista agregando como inicio al nuevo nodo.\r\n inicio = nuevo;\r\n // Caso contrario va agregando los nodos al inicio de la lista.\r\n } else{\r\n // Une el nuevo nodo con la lista existente.\r\n nuevo.setSiguiente(inicio);\r\n // Renombra al nuevo nodo como el inicio de la lista.\r\n inicio = nuevo;\r\n }\r\n // Incrementa el contador de tamaño de la lista.\r\n tamanio++;\r\n }",
"public NodoArbol obtenerNodoRemplazo(NodoArbol nodoReemp){\n\t\tNodoArbol remplazarPadre=nodoReemp;\n\t\tNodoArbol reemplazo= nodoReemp;\n\t\tNodoArbol auxiliar=nodoReemp.hijoder;\n\t\twhile(auxiliar!=null){\n\t\t\tremplazarPadre=reemplazo;\n\t\t\treemplazo= auxiliar;\n\t\t\tauxiliar=auxiliar.hijoizq;\n\t\t}\n\t\tif(reemplazo!=nodoReemp.hijoder){\n\t\t\tremplazarPadre.hijoizq= reemplazo.hijoder;\n\t\t\treemplazo.hijoder= nodoReemp.hijoder;\n\t\t} \n\t\tSystem.out.println(\"el nodo reeemplazo es: \"+reemplazo);\n\t\treturn reemplazo;\n\t}",
"public void llenarDatos() {\n String nombre = \"\";\n String descripcion = \"\";\n try {\n ResultSet resultado = buscador.getResultSet(\"select nombre, descripcion from NODO where ID = \" + IDNodoPadre + \";\");\n if (resultado.next()) {\n nombre = resultado.getObject(\"nombre\").toString();\n descripcion = resultado.getObject(\"descripcion\").toString();\n }\n } catch (SQLException e) {\n System.out.println(\"*SQL Exception: *\" + e.toString());\n }\n campoNombre.setText(nombre);\n campoDescripcion.setText(descripcion);\n //Si esta asociada a categorias\n if(conCategorias)\n llenarComboCategoria();\n else{\n comboCategoria.setVisible(false);\n labelCategoria.setVisible(false);\n }\n }",
"public Tienda(String direccion,float dinero){\n\t\tthis.direccion = direccion;\n\t\tthis.dinero = dinero;\n\t\tnumeroTiendas++;\n\t\ttotalDinero+=dinero;\n\t}",
"public static void insertar(plantilla p,String nombre){\n\t\ttry {\r\n \tObjectInputStream entrada=new ObjectInputStream(new FileInputStream(nombre+\".lorito\"));\r\n patronesPlantillas obj1=(patronesPlantillas)entrada.readObject();\r\n obj1.mostrarPatronesPlantillas();\r\n System.out.println(\"-----------------------------\");\r\n entrada.close();\r\n \r\n\t\tobj1.insertarPlantilla(p);\r\n \r\n \r\n ObjectOutputStream salida=new ObjectOutputStream(new FileOutputStream(obj1.nombre()+\".lorito\"));\r\n // salida.writeObject(\"guardar este string y un objeto\\n\");\r\n salida.writeObject(obj1);\r\n salida.close();\r\n \r\n entrada=new ObjectInputStream(new FileInputStream(nombre+\".lorito\"));\r\n // String str=(String)entrada.readObject();\r\n obj1=(patronesPlantillas)entrada.readObject();\r\n obj1.mostrarPatronesPlantillas();\r\n System.out.println(\"-----------------------------\");\r\n entrada.close(); \r\n \r\n }catch (Exception e) { }\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t}",
"public void asignar_Nodo(Nodo e) {\n\t\tthis.elem = e;\n\t}",
"private NodoGrafo Vert2Nodo(int v) {\n\t\tNodoGrafo aux = origen;\n\t\twhile (aux != null && aux.nodo != v)\n\t\t\taux = aux.sigNodo;\t\t\n\t\treturn aux;\n\t}",
"public void setDominio(String p) { this.dominio = p; }",
"public void insertar(int dato) {\n if (estaLlena()){ // si la pila esta lllena (,etodo en linea 43)\r\n incrementarArreglo(); //incrementamos su capacidad\r\n }\r\n array[++top] = dato; //e insertamos el dato\r\n }",
"public Alumno(String dni, String nombre, Direccion direccion, String[] telefonos, LocalDate fecha_nac,\n\t\t\tCurso curso) {\n\t\tthis.dni = dni;\n\t\tthis.nombre = nombre;\n\t\tthis.direccion = direccion;\n\t\tthis.telefonos = telefonos;\n\t\tthis.fecha_nac = fecha_nac;\n\t\tthis.curso = curso;\n\t\tthis.notas = new ArrayList<Notas>();\n\t}",
"public Object leggiDati(){\n\t\ttry{\n\t\t\tFileInputStream fis = new FileInputStream(file);\n\t\t\tObjectInputStream ois = new ObjectInputStream(fis);\n\t\t\tdati = ois.readObject();\n\t\t\tois.close();\n\t\t\tfis.close();\n\t\t\tSystem.out.println(\"File \" + file + \" letto\");\n\t\t} catch(Exception e){\n\t\t\t//e.printStackTrace();\n\t\t\tSystem.out.println(\"File \" + file + \" non trovato\");\n\t\t\treturn null;\n\t\t}\n\t\treturn dati;\n\t}",
"public Nodo(Elemento e, Nodo<Elemento> p) {\n\t\tthis.proximo = p;\n\t\tthis.elemento = e;\n\t}",
"public void tipoDatos() {\n\t\tint num = 10;\n\t\t// Texto STring\n\t\tString cadena = \"cadena\";\n\n\t\t// Decimale O flotante\n\t\tdouble decimal = 12.16;\n\t\tfloat fl = new Float(10);\n\t\t// Bolean\n\t\tboolean bl = true;\n\n\t\t// ARREGLOS\n\t\t// string\n\t\tString[] veString = new String[5];\n\t\tveString[0] = \"hola mundo\";\n\t\tveString[1] = \"hola mundo\";\n\t\tveString[2] = \"hola mundo\";\n\t\tveString[3] = \"hola mundo\";\n\t\tveString[4] = \"hola mundo\";\n\n\t\tint[] varNum = new int[] { 0, 1, 2, 3, 4, 5 };\n\n\t}",
"public ClaveDicotomica(String url, String nodoInicial) {\n\t\tuserAgent = new UserAgent();\n\t\tarbolNodos = new TreeMap<String, ArrayList<String>>();\n\t\tcontenidoNodos = new TreeMap<String, ArrayList<String>>();\n\t\tgenerosNodos = new TreeMap<String, String>();\n\t\ttraductor = new Translator();\n\t\t// Inicializo el primer nodo\n\t\tArrayList<String> contenidoNodoUno = new ArrayList<String>();\n\t\tcontenidoNodoUno.add(\"Nodo inicial\");\n\t\tcontenidoNodoUno.add(url);\n\t\tcontenidoNodoUno.add(nodoInicial);\n\t\tcontenidoNodos.put(nodoInicial, contenidoNodoUno);\n\t}",
"Aluno(String dataNascimento) {\n this.dataNascimento = dataNascimento;\n }",
"public Nodo NodoNotExec(Nodo nodo){\n if (nodo.getParent()!=null){\n Nodo hermano=nodo.getParent().getChildren().getFirst();\n Nodo n= hermano.getHermanos().get(nodo.getSimbolo());\n return n;\n }\n return null;\n }",
"public HoaDon() {\n initComponents();\n dtn = (DefaultTableModel) jTableHDNhap.getModel();\n dtx = (DefaultTableModel) jTableHDXuat.getModel();\n LocalDate localDate = LocalDate.now();\n datenow = DateTimeFormatter.ofPattern(\"yyyy/MM/dd\").format(localDate);\n\n conn = JavaConnect.ConnectDB();\n updateTableHoaDonNhap();\n updateTableHoaDonXuat();\n\n }",
"public void mostrarDatos() {\n\t\tSystem.out.println(\"DNI: \" + dni);\n\t\tSystem.out.println(\"Nombre: \" + nombre);\n\t\tdireccion.mostrarDatos();\n\t\tSystem.out.println(\"Telefono 1: \" + telefonos[0]);\n\t\tSystem.out.println(\"Telefono 2: \" + telefonos[1]);\n\t\tSystem.out.println(\"Fecha de Nacimiento: \" + fecha_nac.getDayOfMonth() + \"-\" + fecha_nac.getMonth() + \"-\"\n\t\t\t\t+ fecha_nac.getYear());\n\t\tcurso.mostrarDatos();\n\t\tSystem.out.println(\"Motrando todas las notas registradas:\");\n\t\tnotas.stream().forEach(notas -> notas.mostrarDatos());\n\t}",
"private Nodo cambiar (Nodo aux) {\n\t\tNodo n = aux;\r\n\t\tNodo m = aux.getHijoIzq(); \r\n\t\twhile (m.getHijoDer() != null) {//el while sirve para recorrer el lado derecho para encotrar el dato mayor. \r\n\t\t\tn = m; // se guarda el nodo.\r\n\t\t\tm = m.getHijoDer();\r\n\t\t}\r\n\t\taux.setDato(m.getDato()); // se establece el dato del nodo mayor para que de ese nodo se hagan los cambios. \r\n\t\tif(n == aux) { // Si el nodo igual a aux entonces el dato y nodo que se van a eliminar por lo tanto se hacen los comabios. \r\n\t\t\tn.setHijoIzq(m.getHijoIzq());\r\n\t\t}else {\r\n\t\t\tn.setHijoDer(m.getHijoIzq());\r\n\t\t}\r\n\t\treturn n;\r\n\t}",
"public void grabarConcepto(){\r\n try {\r\n Conexion conexion = new Conexion();\r\n String query = \"insert into concepto (descripcion, tipoConcepto, porcentaje, monto, fijo) values (?,?,?,?,?);\";\r\n PreparedStatement st = conexion.getConnection().prepareStatement(query);\r\n st.setString(1, this.getDescripcion());\r\n st.setString(2, this.getTipoConcepto());\r\n st.setDouble(3, this.getPorcentaje());\r\n st.setDouble(4, this.getMonto());\r\n st.setString(5, this.getFijo());\r\n st.execute();\r\n System.out.println(\"SE GRABO EL CONCEPTO EN LA BASE DE DATOS\");\r\n st.close();\r\n conexion.desconectar();\r\n } catch (SQLException ex) {\r\n System.err.println(ex.getMessage());\r\n }\r\n }",
"private void subirDispositivo(){\n DatabaseReference subir_data = db_reference.child(\"Dispositivo\");\n Map<String, String> dataDispositivo = new HashMap<String, String>();\n dataDispositivo.put(\"Evento\", etNombreCurso.getText().toString());\n dataDispositivo.put(\"Latitud1\", disp_Lat1);\n dataDispositivo.put(\"Longitud1\", disp_Long1);\n dataDispositivo.put(\"Latitud2\", disp_Lat2);\n dataDispositivo.put(\"Longitud2\", disp_Long2);\n subir_data.push().setValue(dataDispositivo);\n }",
"public String getDataNastereString(){\n\t\tDateFormat df = new SimpleDateFormat(\"dd/MM/yyyy\");\n\t\tString sd = df.format(new Date(data_nastere.getTime()));\n\t\treturn sd;\n\t\t\n\t}",
"public void obtener() {\r\n \t\r\n \tif (raiz!=null)\r\n {\r\n int informacion = raiz.dato;\r\n raiz = raiz.sig;\r\n end = raiz;\r\n System.out.println(\"Obtenemos el dato de la cima: \"+informacion);\r\n }\r\n else\r\n {\r\n System.out.println(\"No hay datos en la pila\");\r\n }\r\n }",
"public GestioneDomandeD() {\n this.daoDomande = null;\n this.daoPunteggi = null;\n this.daoDipendenti = null;\n this.gestionePunteggiD = null;\n this.gestioneLog = null;\n this.gestioneBadge = null;\n }"
]
| [
"0.6851296",
"0.6671904",
"0.66305983",
"0.65483767",
"0.64620954",
"0.6396698",
"0.6280633",
"0.6255377",
"0.62158036",
"0.62075883",
"0.6159986",
"0.6126852",
"0.6121511",
"0.61122763",
"0.6101268",
"0.60231763",
"0.60177577",
"0.6015744",
"0.5998167",
"0.5996182",
"0.5968434",
"0.59620374",
"0.59420586",
"0.59201497",
"0.5913656",
"0.57846415",
"0.5780059",
"0.57786816",
"0.5772812",
"0.5709423",
"0.57038873",
"0.56706804",
"0.5666266",
"0.5640778",
"0.5632092",
"0.55962026",
"0.55686045",
"0.55663306",
"0.5555162",
"0.5527277",
"0.5515541",
"0.5502193",
"0.5485854",
"0.54836655",
"0.54806817",
"0.54738414",
"0.5452853",
"0.545066",
"0.5445916",
"0.54324996",
"0.54223967",
"0.5411861",
"0.5407746",
"0.53972447",
"0.53961784",
"0.5395137",
"0.5395104",
"0.53949606",
"0.53842795",
"0.5379235",
"0.5378633",
"0.5369296",
"0.5361681",
"0.5350428",
"0.5350214",
"0.53493553",
"0.5344576",
"0.5344016",
"0.53360194",
"0.5318199",
"0.5315082",
"0.5308932",
"0.53042126",
"0.53041476",
"0.53020495",
"0.52928305",
"0.52869606",
"0.5262651",
"0.525202",
"0.5252005",
"0.5240661",
"0.52222806",
"0.52203834",
"0.5219711",
"0.52173734",
"0.5215745",
"0.5215615",
"0.5213856",
"0.5211866",
"0.5208504",
"0.5204412",
"0.5203847",
"0.5200473",
"0.519804",
"0.5192875",
"0.5192677",
"0.5182305",
"0.518161",
"0.51797354",
"0.5179494"
]
| 0.6406212 | 5 |
/ Method to generate all Prime Number list up to a give number | public static void main(String[] args) {
System.out.println("Enter the number up to which all prime number list to print: ");
int num = new Scanner(System.in).nextInt();
int i=0,n=0;
String PrimeNum = "";
for (i=1;i<=num; i++)
{
int counter =0;
for (n=i; n>=1; n--)
{
if (i%n == 0)
{
counter=counter+1;
}
}
if (counter ==2)
{
PrimeNum=PrimeNum+i+" ";
}
}
System.out.println("Prime Number list: "+ PrimeNum);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static ArrayList<Integer> generatePrimes(int maxPrime)\n\t{\n\t\t\n\t\t// Create an array of number with the max number being the maxPrime\n\t\t\n\t\tArrayList<Integer> arrayNumbers = new ArrayList<Integer>();\n\t\t\n\t\tint upperbound = (int) Math.sqrt(maxPrime);\n\t\t\n\t\tfor (int counterNumber = 2; counterNumber <= maxPrime; counterNumber++)\n\t\t{\n\t\t\tarrayNumbers.add(counterNumber);\n\t\t}\n\t\t\n\t\tArrayList<Integer> arrayPrimes = new ArrayList<Integer>();\n\t\t\n\t\twhile (arrayNumbers.size() > 0)\n\t\t{\n\t\t\tint currentNumber = arrayNumbers.get(0);\n\t\t\tremoveMultiple(arrayNumbers, currentNumber);\n\t\t\tarrayPrimes.add(currentNumber);\n\t\t}\n\t\t\n\t\treturn arrayPrimes;\n\t\t\n\t}",
"public static List<Integer> primes(final int fromNumber, final int count) {\n return Stream.iterate(primeAfter(fromNumber - 1), Prime::primeAfter)\n .limit(count)\n .collect(Collectors.toList());\n }",
"List<Long> generatePrimes(long lowerBound, long upperBound);",
"public int[] generatePrimes(int limit);",
"public void findPrimeNumbers(){\n boolean [] numbers = new boolean[this.n +1];\n\n Arrays.fill(numbers,true);\n\n numbers[0]= numbers[1]=false;\n\n for (int i = P; i< numbers.length; i++) {\n if(numbers[i]) {\n for (int j = P; i*j < numbers.length; j++) {\n numbers[i*j]=false;\n }\n }\n }\n\n for (int i = 0; i < numbers.length; i++){\n if(numbers[i] == true){\n this.primeNumbers.add(i);\n }\n }\n\n }",
"private static void getPrime() {\n\t\tfor(int i=2;i<MAXN;i++){\n\t\t\tif(prime[i]==0){\n\t\t\t\tprime[++prime[0]]=i;\n\t\t\t}\n\t\t}\n\t}",
"public PrimeSequence(int startingNumber)\n\t{\n\t\tnumber = startingNumber;\n\t}",
"public List<Integer> getPrimesUpTo(int upperLimit) {\n\n // For each number up to the limit\n boolean[] composites = new boolean[upperLimit + 1];\n\n for (int i = 2; i * i <= upperLimit; i++) {\n if (!composites[i]) {\n for (int j = i; i * j <= upperLimit; j++) {\n composites[i * j] = true;\n }\n }\n }\n\n List<Integer> primes = new ArrayList<Integer>();\n for (int i = 2; i <= upperLimit; i++) {\n if (!composites[i]) {\n primes.add(i);\n }\n }\n\n return primes;\n }",
"public PrimeSequence(int startingNumber) \r\n\t{\r\n\t\tcurrentNumber = startingNumber;\r\n\t\tlastDigitCounters = new int[DIGITS];\r\n\t}",
"public static List<Integer> prime(int n) {\n ArrayList<Integer> list = new ArrayList<>();\n for (int i = 2; i <= n; i++) {\n if (isPrime(i)) {\n list.add(i);\n }\n }\n return list;\n }",
"static boolean[] primesThroughN(int n) {\n boolean[] composite = new boolean[n+1];\n composite[0] = true;\n composite[1] = true;\n\n for(int i = 2; i < composite.length; i++) {\n if(composite[i]) continue;\n for(int step = 2; i * step < composite.length; step++) composite[i*step] = true;\n }\n\n return composite;\n }",
"public List<Integer> getPrimes() {\n numberList.set(0, 0);\n numberList.set(1, 0);\n\n // Iterating from 2 (the first prime) until the square of the index is less than the upper limit\n // This is used because of the property of the multiplication, 2 * 3 = 3 * 2\n for (int i = 2; i * i <= _upperLimit; i++) {\n // If the number at i isn't marked as a non-prime (is prime)\n if (numberList.get(i) != 0) {\n // Mark (set to zero) all the multiples of this number up to the upper limit\n for (int j = i; i * j <= _upperLimit; j++) {\n numberList.set(i*j, 0);\n }\n }\n }\n\n // Remove all the zeros from the list, leaving just the primes below upperLimit\n numberList.removeIf(s -> s.equals(0));\n\n return numberList;\n }",
"public ArrayList<Integer> generatePrimes(int l, int r) {\n ArrayList<Integer> primes = new ArrayList<Integer>();\n for (int i = l; i <= r ; i++) {\n if (isPrime(i)) {\n primes.add(i);\n }\n }\n return primes;\n }",
"private static int nextPrime(int n) {\n\t if (n % 2 == 0)\n\t n++;\n\n\t for (; !isPrime(n); n += 2)\n\t ;\n\n\t return n;\n\t }",
"public List<Long> generatePrimeInRangeUsingParellelStream(long start, long till) {\n //Could have used CopyOnWrite list but think that would be inefficient.\n ConcurrentLinkedQueue<Long> primeQ = new ConcurrentLinkedQueue<Long>(); //using a threadsafe collection\n LongStream.rangeClosed(start, till).parallel(). // the filter and subsequent adding happens parallel for each number in the range\n filter(i -> isPrime(i)). //if prime number\n forEach(primeQ::add); // add to concurrent queue\n\n List<Long> primes = new ArrayList<>();\n //convert queue to list.\n primeQ.stream().forEach(primes::add);\n return primes;\n }",
"public Prime_Numbers() {\n initComponents();\n }",
"private static int nextPrime(int n) { // calcula el siguiente numero primo\n\t\t\t\t\t\t\t\t\t\t\t// mallor o igual a n.\n\t\tif (n % 2 == 0)\n\t\t\tn++;\n\n\t\tfor (; !isPrime(n); n += 2)\n\t\t\t;\n\n\t\treturn n;\n\t}",
"public Prime(Integer threadId, Integer limit, List<Integer> primeNumbers) {\n this.limit = limit;\n this.threadId = threadId;\n this.primeNumbers = primeNumbers;\n }",
"private static int nextPrime( int n )\n {\n if( n % 2 == 0 )\n n++;\n\n for( ; !isPrime( n ); n += 2 )\n ;\n\n return n;\n }",
"public void printPrimeNumbers(int n) {\n int upperBound = (int) Math.sqrt(n);\n boolean[] isComposite = new boolean[n + 1];\n for (int i = 2; i <= upperBound; i++) {\n if (!isComposite[i]) {\n for (int k = i * i; k <= n; k += i) {\n isComposite[k] = true;\n }\n }\n }\n\n for (int i = 2; i <= n; i++) {\n if (!isComposite[i]) {\n System.out.print(String.format(\"%d \", i));\n }\n }\n }",
"private static int[] findAllPrimes(int numberOfPrimes)\n\t{\n\t\tif (numberOfPrimes < 0)\n\t\t{\n\t\t\treturn new int[0];\n\t\t}\n\t\t\n\t\tint[] primes = new int[numberOfPrimes];\n\t\tint count = 0;\n\t\tint number = 2;\n\t\t\n\t\twhile (count < numberOfPrimes) \n\t\t{\n\t\t\tif ((number > 2) && ((number % 2) == 0))\n\t\t\t{\n\t\t\t\tnumber++;\n\t\t\t}\n\t\t\t\n\t\t\tboolean isPrime = true;\n\t\t\t\n\t\t\tfor (int index = 0; (index < count) && (primes[index] <= Math.sqrt(number)); index++) \n\t\t\t{\n\t\t\t\tif (number % primes[index] == 0) \n\t\t\t\t{\n\t\t\t\t\tisPrime = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (isPrime) \n\t\t\t{\n\t\t\t\tprimes[count] = number;\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\t\n\t\t\tnumber++;\n\t\t}\n\t\t\n\t\treturn primes;\n\t}",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n System.out.println(\"Enter a number to get prime numbers below that number\");\nint givenum = sc.nextInt();\nint i,number,count;\nfor(number=1;number<=givenum;number++)\n{\n\tcount=0;\n\tfor(i=2;i<=number/2;i++)\n\t{\n\t\tif(number%i==0)\n\t\t{\n\t\t\tcount++;\n\t\t\tbreak;\n\t\t}\n\t}\nif(count==0 && number !=1)\n{\n\tSystem.out.println(number);\n}\n}\n\t}",
"public static List<Integer> getPrimesLessThan(int limit) {\n\t\tList<Integer> primes = new ArrayList<Integer>(limit-1);\n\t\tfor (int i = 2; i <= limit; i++) {\n\t\t\tprimes.add(i);\n\t\t}\n\t\t\n\t\tfor (int i = 2; i <= 9; i++) {\n\t\t\tint multiplier = 2;\n\t\t\tint multiple = i*multiplier;\n\t\t\twhile (multiple <= limit) {\n\t\t\t\tprimes.remove(Integer.valueOf(multiple));\n\t\t\t\tmultiplier++;\n\t\t\t\tmultiple = i*multiplier;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn primes;\n\t}",
"public List<Long> generatePrimeInRange(long start, long till) {\n final List<Long> primes = new ArrayList<>(); // hold all primes from 1 to 'till'\n final List<Long> rangeList = new ArrayList<>(); // primes only within start and till\n LongStream.rangeClosed(0, till). // linear filtering mechanism\n filter(i -> isPrime(primes, i)).\n forEach(primes::add);\n // filter primes only between start and till\n primes.stream().filter(i -> i > start && i < till + 1).forEach(rangeList::add);\n return rangeList;\n }",
"static void allPrimeLessThanN(int n){\n\t\t\n\t\tboolean[] prime = new boolean[n+1];\n\t\tArrays.fill(prime, true);\n\t\t\n\t\tfor(int p=2;p*p<=n;p++)\n\t\t{\n\t\t\tif(isPrime(p))\n\t\t\t{\n\t\t\t\tfor(int i=p*p; i<=n; i+=p)\n\t\t\t\t\tprime[i]=false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i=2;i<=n;i++)\n\t\t\tif(prime[i])\n\t\t\t\tSystem.out.print(i+\" \");\n\t\tSystem.out.println();\n\t}",
"public void showPrimeNumbers(){\n for(Integer i : this.primeNumbers){\n System.out.print(i + \" \");\n }\n }",
"private static int nextPrime(int n)\n\t{\n\t\tif( n % 2 == 0 )\n\t\t\tn++;\n\n\t\tfor( ; !isPrime(n); n += 2 );\n\n\t\treturn n;\n\t}",
"public static List<BigInteger> primeList(BigInteger upper) {\r\n List<BigInteger> list = new ArrayList<BigInteger>();\r\n BigInteger num = BigInteger.ONE;\r\n\r\n if (upper.compareTo(nine) < 0) {\r\n while (num.compareTo(upper) < 0) {\r\n if (isPrime(num)) {\r\n list.add(num);\r\n }\r\n num = num.add(BigInteger.ONE);\r\n }\r\n\r\n return list;\r\n }\r\n\r\n list.add(two);\r\n list.add(three);\r\n num = five;\r\n while (num.compareTo(upper) < 0) {\r\n if (isPrime(num)) list.add(num);\r\n if (isPrime(num.add(two))) list.add(num.add(two));\r\n num = num.add(six);\r\n }\r\n\r\n return list;\r\n }",
"public static List<Integer> linearSieve(int n) {\n\t\tList<Integer> primes = new ArrayList<>();\n\t\tboolean[] isComposite = new boolean[n + 1];\n\t\tfor (int i = 2; i <= n; i++) {\n\t\t\tif (!isComposite[i]) {\n\t\t\t\tprimes.add(i);\n\t\t\t}\n\t\t\tfor (int j = 0; j < primes.size() && i * primes.get(j) <= n; j++) {\n\t\t\t\tisComposite[i * primes.get(j)] = true;\n\t\t\t\tif (i % primes.get(j) == 0) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn primes;\n\t}",
"static void primeNumberSeries(){\n\t}",
"public static void calculatePrimeNumbers(){\n int NUM = 5000000;\n\n boolean[] flags = new boolean[NUM + 1];\n\n int count = 0;\n\n for(int i = 2; i <= NUM; i++) {\n primeNumberFlagOperation(flags, i);\n }\n\n for(int i = 2; i <= NUM; i++) {\n if(flags[i]) {\n\n // remove all multiples of prime: i\n for(int k = i + i; k <= NUM; k += i) {\n flags[k] = false;\n }\n\n count++;\n }\n }\n }",
"public static void main(String[] args) {\n Random r = new Random();\n final int min=0, max=100;\n int num = r.nextInt(max - min) + min;\n System.out.println(\"Random integer : \"+num);\n \n System.out.println(\"The first \"+num+\" prime numbers\");\n // prime number can only be divided by itself and 1\n int loop=0; \n for (int i = 2; loop < num; i++) {\n int count=0;\n for (int j = i; j >= 1; j--) {\n if (i%j == 0) {\n count++;\n }\n }\n if (count == 2) {\n System.out.print(i+\" \");\n loop++;\n }\n }System.out.println(); \n }",
"public void PrimeNumber()\r\n\t{\r\n\t\tint num;\r\n\t\tSystem.out.println(\"Enter the Number\");\r\n\t\tnum = sc.nextInt();// read input to calculate prime number\r\n\t\tint count=0;\r\n\t\twhile(count!=2)\r\n\t\t{\r\n\t\t\tnum++;\r\n\t\t\tcount=0;\r\n\t\t\tint i=1;\r\n\t\t\twhile(i<=num)\r\n\t\t\t{\r\n\t\t\t\tif(num%i==0)\r\n\t\t\t\t{\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t}\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t\tif(count==2)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(num);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t/*for(int i=2;i<=num;i++)\r\n\t\t{\r\n\t\t\tif(num%i!=0)\r\n\t\t\tbreak;\r\n\t\t\tSystem.out.println(+num);\r\n\t\t}\r\n\t\t//System.out.println(+num);*/\r\n\t\t\r\n\t}",
"public static void findPrime (int n){\n\t\tboolean [] isPrime = new boolean[n];\n\t\tisPrime[0] = false;\n\t\tisPrime[1] = true;\n\t\t\n\t\tfor(int i = 2; i< n; i++){\n\t\t\tisPrime[i]= true;\n\t\t}\n\t\tint limit = (int)Math.sqrt(n);\n\t\tfor(int i = 2; i<= limit; i++){\n\t\t\tif(isPrime[i])\n\t\t\t{\n\t\t\t\tfor(int j= i * i ; j < n; j+= i){\n\t\t\t\t\tisPrime[j] = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i=0; i< n; i++){\n\t\t\tif(isPrime[i])\n\t\t\tSystem.out.println(i);\n\t\t}\n\t}",
"protected static int nextPrime(int n )\r\n\t{\r\n\t\tif( n % 2 == 0 )\r\n\t\t\tn++;\r\n\t\tfor( ; !isPrime( n ); n += 2 )\r\n\t\t\t;\r\n\t\treturn n;\r\n\t}",
"public Primes(int n) {\n this.n = n;\n }",
"public static int nextPrime(int n) {\r\n boolean isPrime = false;\r\n int start = 2; // start at 2 and omit your if statement\r\n\r\n while (!isPrime) {\r\n // always incrememnt n at the beginning to check a new number\r\n n += 1;\r\n // redefine max boundary here\r\n int m = (int) Math.ceil(Math.sqrt(n));\r\n\r\n isPrime = true;\r\n // increment i by 1, not 2 (you're skipping numbers...)\r\n for (int i = start; i <= m; i++) {\r\n if (n % i == 0) {\r\n isPrime = false;\r\n break;\r\n }\r\n }\r\n }\r\n return n;\r\n }",
"public PrimeNumberCalculator() {\n\t\t\t\tthis.threads = 1;\n\t\t}",
"public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int N = scanner.nextInt();\n \n boolean[] isNotPrime = new boolean[(N - 1 - 1) / 2 + 1];\n List<Integer> list = new ArrayList<Integer>();\n HashSet<Integer> primes = new HashSet<Integer>();\n \n list.add(2);\n primes.add(2);\n long sum = 0;\n for (int i = 1; i < isNotPrime.length; i++) {\n if (isNotPrime[i]) {\n continue;\n }\n list.add(2 * i + 1);\n primes.add(2 * i + 1);\n long nextIndex = (((long) 2 * i + 1) * (2 * i + 1) - 1) / 2;\n if (nextIndex >= isNotPrime.length) {\n continue;\n }\n for (int j = ((2 * i + 1) * (2 * i + 1) - 1) / 2; j < isNotPrime.length; j += 2 * i + 1) {\n isNotPrime[j] = true;\n }\n }\n int index = 0;\n while (index < list.size()) {\n int curPrime = list.get(index);\n index++;\n if (curPrime < 10) {\n continue;\n }\n int base = 1;\n while (curPrime / base > 9) {\n base *= 10;\n }\n int leftTruncate = curPrime;\n int rightTruncate = curPrime;\n boolean isValid = true;\n while (base != 1) {\n leftTruncate = leftTruncate - leftTruncate / base * base;\n rightTruncate = rightTruncate / 10;\n base /= 10;\n if (primes.contains(leftTruncate) == false || primes.contains(rightTruncate) == false) {\n isValid = false;\n break;\n }\n }\n if (isValid) {\n sum += curPrime;\n }\n }\n System.out.println(sum);\n scanner.close();\n }",
"public List<Long> generatePrimeInRangeUsingSqrt(long start, long till) {\n final List<Long> primes = new ArrayList<>(); // hold all primes from 1 to 'till'\n final List<Long> rangeList = new ArrayList<>(); // primes only within start and till\n LongStream.rangeClosed(1, till). // we start from 1 since we need all primes previous to 'till' for this algo\n filter(i -> isPrime(i)).\n forEach(primes::add);\n primes.stream().filter(i -> i > start && i < till + 1).forEach(rangeList::add); // filter primes only between start and till\n return rangeList;\n }",
"publci int countPrime(int n){\n boolean[] notPrime = new boolean[n];\n for (int i = 2; i * i <= n; i++){\n if(!notPrime[i]){\n for (int j = i; j * i < n; j++)\n notPrime[j * i] = true;\n }\n }\n}",
"public PrimeCounter(long startValue) {\n\t\t\tnum = startValue;\n\t\t}",
"public static void main(String[] args) {\n\n System.out.println(primeNumbers(1000000));\n\n }",
"ArrayList<BigInteger> factorize(BigInteger num) {\n ArrayList<BigInteger> result = calcPrimeFactors(num);\n return result;\n }",
"private static void primeCalc(int UI)\n\t{\n\t\tSystem.out.print(\"The Prime Numbers are: \");\n\t\tSystem.out.println();\n\t\t\n\t\tint P = 0;\n \n\t\twhile (++P <= UI) \n\t\t{\n\n \tint P2 = (int) Math.ceil(Math.sqrt(P));\n\n boolean Decision = false;\n\n while (P2 > 1) \n\t\t\t{\n\n \tif ((P != P2) && (P % P2 == 0)) \n\t\t\t\t{\n \tDecision = false;\n break;\n }\n\t\t\t\telse if (!Decision) \n\t\t\t\t{\n \tDecision = true;\n }\n\n --P2;\n\t\t\t}\n\n if (Decision) \n\t\t\t{\n \tSystem.out.println(P);\n \n }\n\n\t\n\t\t}\n\n\n\t}",
"private synchronized void verifyNumbersPrime() {\n\t\tint primeIndex = 1;\n\t\tfor (int j = NUMBER_TWO; j <= Integer.MAX_VALUE && primeIndex < primes.length; j++) {\n\t\t\tif(isPrime(j)) {\n\t\t\t\tprimes[primeIndex++] = j;\n\t\t\t}\n\t\t}\n\t}",
"public List<Long> generatePrimeInRangeMultiThreaded(long start, long till) {\n //Could have used CopyOnWrite list but think that would be inefficient.\n ConcurrentLinkedQueue<Long> primesQ = new ConcurrentLinkedQueue<>(); //using a threadsafe collection\n ExecutorService executor = Executors.newFixedThreadPool(10); // no particular reason to keep them to 10\n\n // worker thread class to calculate whether a number is prime\n class worker implements Runnable {\n long workOn; //the number to check for Primality\n\n worker(long workOn) {\n this.workOn = workOn;\n }\n\n @Override\n public void run() {\n if (isPrime(workOn)) {\n primesQ.add(workOn); // add to central collection\n }\n }\n }\n\n List<Future> futures = new ArrayList<>();\n for (long num = start; num <= till; num++) {\n // keep a list of futures to check whether all threads have completed thier job\n futures.add(executor.submit(new worker(num)));\n }\n\n for (Future f : futures) {\n try {\n f.get(); // blocks till it completes\n } catch (InterruptedException e) {\n e.printStackTrace();\n } catch (ExecutionException e) {\n e.printStackTrace();\n }\n } // by the end , we should be pretty sure that the threads have completed\n executor.shutdown(); //stop the executor\n\n List<Long> primes = new ArrayList<>();\n primesQ.stream().forEach(primes::add); // convert concurrent queue to List\n return primes;\n }",
"public static void setupPrimes() {\n int[] naturals = new int[BIGGEST_PRIME];\n for (int i = 0; i < naturals.length; i++) {\n naturals[i] = i;\n }\n int nthPrime = 2;\n for (int n = 0; n < primes.length; n++) {\n for (int nthPrimeMultiple = nthPrime*nthPrime; nthPrimeMultiple < BIGGEST_PRIME; nthPrimeMultiple+=nthPrime) {\n naturals[nthPrimeMultiple] = 0;\n }\n primes[n] = nthPrime;\n\n do {\n nthPrime++;\n if (nthPrime >= naturals.length) return;\n } while (naturals[nthPrime] == 0);\n }\n }",
"public void exec() {\n\t\n\t// prompt user for limit, and read what is typed\n\tprintStr(\"Find primes through: \");\n\tint num = readInt();\n\t\n\t// ensure that number is not negative\n\tint n = num;\n\tif (n < 0) {\n\t n = 0;\n\t}\n\t\n\t////////////////////////////////\n\t// compute the primes\n\t////////////////////////////////\n\t\n\t// array that tells whether number is composite\n\tboolean[] seive = new boolean[n+1];\n\t\n\t// run through all candidates \"seive-ing\" when we find a prime\n\tfor (int i = 2; i <= n; i++) {\n\t if (!seive[i]) { // prime, so need to \"seive\"\n\t\tfor (int j = 2*i; j < n; j = j + i) {\n\t\t seive[j] = true; // mark composite\n\t\t}\n\t }\n\t}\n\t\n\t////////////////////////////////\n\t// print the primes\n\t////////////////////////////////\n\t\n\t// print initial line\n\tprintStr(\"primes up through \");\n\tprintInt(n);\n\tprintStr(\":\\n\");\n\t\n\t// print primes, 20 per line\n\tint elementsOnLine = 0; // number of elements on current line\n\tfor (int i = 2; i < n; i++) {\n\t if (!seive[i]) {\n\t\t// found prime, so print it\n\t\tprintInt(i);\n\t\telementsOnLine++; // bump elements on line\n\t\tif (elementsOnLine >= 20) {\n\t\t // reached line limit; print newline and reset\n\t\t printStr(\"\\n\");\n\t\t elementsOnLine = 0;\n\t\t}\n\t\telse {\n\t\t // did not reach line limit; print space-separator\n\t\t printStr(\" \");\n\t\t}\n\t }\n\t}\n\t\n\t// print final newline\n\tprintStr(\"\\n\");\n }",
"public PrimesIterator(int totalPrimesNeeded) {\n this.totalPrimesNeeded = totalPrimesNeeded;\n this.p = 1;\n }",
"public PrimeCounter() {\n\t\t}",
"public static void main(String[] args) {\n\t\tScanner s=new Scanner(System.in);\r\n\t\tArrayList <Integer>arr= new ArrayList<Integer>();\r\n\t\tArrayList <Boolean>isPrime= new ArrayList<Boolean>();\r\n\t\tSystem.out.println(\"Enter the max range\");\r\n\t\tint n =s.nextInt();\r\n\t\tint i,j,p=0;\r\n\t\tfor(i=0;i<=(n-2)/2;i=i+1)\r\n\t\t{\r\n\t\t\tisPrime.add(true);\r\n\t\t}\r\n\t\tSystem.out.println(isPrime);\r\n\t\tarr.add(2);\r\n\t\tfor(i=0;i<isPrime.size();++i)\r\n\t\t{\r\n\t\t\tif(isPrime.get(i))\r\n\t\t\t{\r\n\t\t\t\tp=2*i+3;\r\n\t\t\t\tarr.add(p);\r\n\t\t\t}\r\n\t\t\tfor(j=2*i*i +6*i+3;j<isPrime.size();j=j+p)\r\n\t\t\t{\r\n\t\t\t\tisPrime.set(j,false);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tSystem.out.println(isPrime);\r\n\t\tSystem.out.println(arr);\r\n\t}",
"int nextPrime(int input) { //Ikke særlig optimalt dette. Hadde problemer med å iterere over binærArrayet direkte\n if(input < 2)\n return 2;\n if(input % 2 == 0){ //Unødvendig å sjekke partall.\n input++;\n }\n while(input < maxNum){\n if(isPrime(input)){\n return input;\n }\n input += 2;\n }\n return -1;\n }",
"public void nextPrime()\n\t{\n\t\tint num; \n\t \n\t\tScanner limit = new Scanner(System.in); \n\t\tSystem.out.println(\"Please enter a prime number to get the next one: \"); \n\t\tnum = limit.nextInt(); \n\t\n\t\tfor(int i=num;;i++ )\n\t\t{ \n\t\t\tboolean Prime = true;\n\t\n\t\t\t//check to see if the number is prime\n\t\t\tfor(int j=2; j < 10; j++)\n\t\t\t{ \n\t\t\t\tif(i % j == 0)\n\t\t\t\t{\n\t\t\t\t\tPrime = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//if the number is prime then print it out and break from the program.\n\t\t\tif(Prime)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Prime: \"+ i);\n\t\t\t\tif(Prime = true && i !=num){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public List<Long> calculatePrimeFactorsOf(long l) {\n\t\t// TODO Write an implementation for this method declaration\n\t\tList<Long> primeList = new ArrayList<Long>();\n\t\t//List<Long> divisorList = new ArrayList<Long>();\n\t\tfor(long i = 2; i <= l; i++) {\n\t\t\twhile(l % i == 0) {\n\t\t\t\tprimeList.add(i);\n\t\t\t\tl = l / i; \n\t\t\t}\n\t\t}\n\n\t\treturn primeList;\n\t}",
"static boolean isPrime(long n)\n {\n // Corner cases\n if (n <= 1)\n return false;\n if (n <= 3)\n return true;\n \n // This is checked so that we can skip\n // middle five numbers in below loop\n if (n % 2 == 0 || n % 3 == 0)\n return false;\n \n for (int i = 5; i * i <= n; i = i + 6)\n if (n % i == 0 || n % (i + 2) == 0)\n return false;\n \n return true;\n }",
"public static void Prime(int number)\n\t {\n\t \tboolean isPrime=true;\n\t \tfor(int i=2;i<=number/2;i++)\n\t \t{\n\t \tint temp;\n\t \t\n\t \ttemp=number%i;\n\t \tif(temp==0) \n\t \t{\n\t \t\tisPrime=false;\n\t \t\tFactorization(number); //Calling Factorization method\n\t \t\tbreak;\n\t \t\t\n\t \t}\n\t \t\n }\n\t \tif(isPrime)\n\t \t{\n\t \t\tSystem.out.println(\"Entered number is prime number\");\n\t\t \tcheck();\t\n\t \t}\n\t}",
"@Override\n protected int[] initMatrix(final int n) {\n final int[] matrix = new int[n * n];\n int k = 0;\n for (int i = 1; i <= n; ++i) {\n for (int j = 1; j <= n; ++j) {\n final int i2 = 2 * i;\n final int j2 = 2 * j - 1;\n if (mPrime.isPrime(i2 * i2 + j2 * j2)) {\n matrix[k] = 1;\n }\n ++k;\n }\n }\n return matrix;\n }",
"public static void primePermutationsHM(List<Integer> primes) {\n HashMap<String, List<Integer>> map = new HashMap<>();\n for (int p : primes) {\n int[] nums = new int[4];\n int num = p;\n int i = 0;\n\n while (num > 0) {\n nums[i++] = num % 10;\n num /= 10;\n }\n\n // save the number (p) in a key hashed from the lowest permutation (s) of the number \n Arrays.sort(nums);\n String s = Arrays.toString(nums);\n\n List<Integer> ll = map.getOrDefault(s, new LinkedList<>());\n ll.add(p);\n map.put(s, ll);\n }\n\n // loop through map entries; if at least 3 numbers are found, check for common difference\n for (Map.Entry mEntry : map.entrySet()) {\n List<Integer> numbers = (List<Integer>) mEntry.getValue();\n\n if (numbers.size() >= 3) {\n int[] res = findTripletWithCommonDifference(numbers);\n\n if (res.length == 3) {\n System.out.println(Arrays.toString(res));\n }\n }\n }\n }",
"public interface PrimeGenerator {\n\n /**\n * Generate all primes lower or equal to the limit.\n * \n * @param limit\n * maximum number to consider\n * @return array of numbers, never null\n * @throws IllegalArgumentException\n * if the limit is negative\n */\n public int[] generatePrimes(int limit);\n\n}",
"private boolean[] markAllComposites(int initial) {\n boolean[] primes = new boolean[initial + 1];\n //Mark all indexes as true initially\n Arrays.fill(primes, true);\n\n //Start marking the array indexes as false if divisible by the number in iteration, starting from 2\n IntStream.rangeClosed(2, (int) Math.sqrt(initial))\n .filter(num -> primes[num])\n .forEach(num -> {\n //Mark multiples of num as false as this number will be composite.\n //i.e. all the multiples of 2, 3, 4 and so on in the iteration will be marked false if not already marked\n //All the indexes which are not marked at the end of loop will be primes\n for (int i = num * 2; i <= initial; i += num) {\n primes[i] = false;\n }\n });\n return primes;\n }",
"public static void main(String[] args) {\n\n int[] range = new int[100];\n\n\n for (int i = 0; i<range.length; i++) {\n range[i]=i+2;\n }\n /*\n for (int i = 1; i <prange; i++) {\n System.out.println(numbers[i]);\n\n\n }\n\n primearray obj = new primearray(numbers);\n for (int i = 1; i <prange; i++) {\n System.out.println(obj.range[i]);\n\n\n }*/\n primearray obj = new primearray(range);\n\n obj.perform();\n\n\n\n\n }",
"public static boolean[] getPrimes(int n) {\n\t\tboolean[] isPrime = new boolean[n+1];\n\t\tArrays.fill(isPrime, true);\n\t\t\n\t\tisPrime[0] = false;\n\t\tisPrime[1] = false;\n\t\t\n\t\tint m = (int)Math.sqrt(n);\n\t\tfor (int i=2; i<=m; i++) {\n\t\t\tif (isPrime[i]) {\n\t\t\t\tfor (int j=i+i; j<=n; j+=i) {\n\t\t\t\t\tisPrime[j] = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn isPrime;\n\t}",
"public static void main(String[] args) {\n\t\tlong n = 600851475143L;\n\t\tArrayList<Integer> list = Primitives.primesUpTo((int)Math.sqrt(n));\n\t\tArrayList<Integer> list2 = new ArrayList<Integer>();\n\t\tfor(int i = 0; i < list.size(); i++)\n\t\t{\n\t\t\tif(n % list.get(i) == 0)\n\t\t\t{\n\t\t\t\tlist2.add(list.get(i));\n\t\t\t}\n\t\t}\n\t\tSystem.out.print(list2.get(list2.size() - 1));\n\t}",
"public static List<Integer> sieveOfEratosthenes(int n) {\n\t\t// Declaring a boolean array of size n+1\n\t\t// Where true denotes prime and false denotes non prime\n\t\t// Initially all the values will be prime\n\t\t// After calculation we will update the values\n\t\tboolean isPrime[] = new boolean[n + 1];\n\n\t\t// Initializing all the value as true\n\t\tfor (int i = 0; i <= n; i++) {\n\t\t\tisPrime[i] = true;\n\t\t}\n\n\t\t// Declaring 0 and 1 as non prime\n\t\tisPrime[0] = isPrime[1] = false;\n\n\t\t// Calculating the primes\n\t\tfor (int i = 2; i * i <= n; i++) {\n\t\t\t// If isPrime[i] is true then it is prime\n\t\t\tif (isPrime[i] == true) {\n\t\t\t\t// Then all of its multiples will be non prime\n\t\t\t\tfor (int j = i * i; j <= n; j += i) {\n\t\t\t\t\tisPrime[j] = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Declaring a list to store all the primes\n\t\tList<Integer> primes = new ArrayList<Integer>();\n\n\t\t// Storing all the primes in the list\n\t\tfor (int i = 0; i <= n; i++) {\n\t\t\tif (isPrime[i] == true) {\n\t\t\t\tprimes.add(i);\n\t\t\t}\n\t\t}\n\n\t\t// Returning the list containing all the primes\n\t\treturn primes;\n\t}",
"public static ArrayList primeFactors(int num, int num2)\n { \n //if the number is prime add it to the arrayList\n if(isPrime(num))\n {\n primeFactorsList.add(num); \n return primeFactorsList;\n } \n else if(num % num2 == 0)\n {\n primeFactors(num2, num2 -1); \n primeFactors(num / num2, (num / num2) - 1); \n }\n else\n {\n primeFactors(num, num2 - 1);\n }\n //return the arrayList to be printed\n return primeFactorsList;\n }",
"public static void primeNumber() {\n\t\tboolean isprimeNumber = false;\n\t\tSystem.out.println(\"prime numbers between 1 and 1000 are\");\n\n\t\tfor (int i = 2; i <1000; i++) {\n\t\tif(calculation(i)==true)\n\t\t{\n\t\t\tSystem.out.println(i);\n\t\t\tprime++;\n\t\t}\n\t\t\n\t}\n\t\tSystem.out.println(prime+\" numbers are prime\");\n\t}",
"public ArrayList<BigInteger> getAll() {\n\t\treturn primes;\n\t}",
"public static void main(String[] args) {\n\t\tint i=1,j;\r\nString prime=\"\";\r\nfor( i=1;i<=100;i++){\r\n\tint c=0;\r\n\tfor( j=i;j>=i;j--){\r\n\t\tif(i%j==0){\r\n\t\t\tc=c+1;\r\n\t\t}\r\n\t}\r\n\tif(c==2){\r\n\t\tprime=prime+i+\"\";\r\n\t}\r\n}\r\nSystem.out.println(\"Enter the prime numbers are:\");\r\nSystem.out.println(\"prime\");\r\n\t}",
"@GET\n\t@Path(\"{maxPrimeNumber}\")\n\t/**\n\t * REST endpoint to generate a list of prime numbers\n\t * \n\t * Access using http://localhost:8080/primenumbers-rest-api/resources/generate-prime-numbers/<maxPrimeNumber>\n\t * \n\t * @param maxPrimeNumber\n\t * @return List of prime numbers \n\t */\n\tpublic PrimeNumbers generatePrimeNumbers(@PathParam(\"maxPrimeNumber\") String maxPrimeNumber) {\n\t\ttry {\n\t\t\tInteger.parseInt(maxPrimeNumber);\n\t\t} catch (java.lang.NumberFormatException e) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t/*\n\t\t * generate the prime numbers then send them to a new PrimeNumbers pojo\n\t\t */\n\t\treturn new PrimeNumbers(primeNumbersController.getPrimeNumbers(Integer.parseInt(maxPrimeNumber)));\n\t}",
"public static void main(String[] args) {\n //Loop to iterate over the 100 numbers\n for (int i = 0; i <= 100; i++) {\n //Variable to hold the prime numbers.\n String primeNumbers = \"\";\n //Boolean checker to ensure that the single digit prime numbers are inclusive.\n boolean prime = i == 2 || i == 3 || i == 5 || i == 7 || i == 9;\n //Checking if you get a whole number as a remainder after dividing by the single digit prime\n if (i % 2 != 0 && i % 3 != 0 && i % 5 != 0 && i % 7 != 0 && i % 9 != 0 || prime) {\n //Appending the prime numbers to the string variable.\n primeNumbers += i;\n //Adding an extra white space after each checked prime.\n System.out.print(primeNumbers + \" \");\n }\n }\n System.out.println(\"\");\n }",
"public int primetest(int primenumber){ // method tests if number is prime\n\t\tfor (int j=2; j < prime.size()+2; j++){\n\t\t\tif ((primenumber % prime.get(j-2)) == 0){\n \t \t\t\treturn 0;\n \t \t\t}\n \t\t}\n \t\tprime.add(prime.size(), primenumber);\n \t\treturn 1;\n\n\t}",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tSystem.out.println(\"Enter the number within which you want all prime numbers :\");\n\t\tint num = sc.nextInt();\n\n\t\tSystem.out.println(\"All the prime number within \" + num + \" are : \");\n\n\t\tfor (int i = 1; i <= num; i++) {\n\t\t\tint count = 0;\n\t\t\tint number = i;\n\t\t\tfor (int j = 1; j <= number; j++) {\n\t\t\t\tif (number % j == 0) {\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (count == 2) {\n\t\t\t\tSystem.out.print(number + \" \");\n\t\t\t}\n\t\t}\n\n\t}",
"public static void func(){\n\t\tHashMap<Integer,Integer> map = new HashMap<Integer,Integer>();\n\t\tint limit = 1000;\n\t\tboolean psb[] = generatePrime(limit);\n\t\t\n\t\tint ps[] = MathTool.generatePrime(100000);\n\t\tfor (int i = 1; ps[i]<1000; i++) {\n\t\t\t//System.out.println(ps[i]);\n\t\t}\n\t\tint max=0;\n\t\tfor (int i = 0; ps[i] < limit; i++) {\n\t\t\tint n = ps[i];\n\t\t\tint j=i;\n\t\t\twhile(n<limit){\n\t\t\t\tif(!psb[n]){\n\t\t\t\t\tint num =j-i+1;\n\t\t\t\t\tif(map.containsKey(n)){\n\t\t\t\t\t\tif(map.get(new Integer(n)) < num){\n\t\t\t\t\t\t\tmap.put(n, num);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmap.put(n, num);\n\t\t\t\t\t}\n\t\t\t\t\tif(num > max){\n\t\t\t\t\t\tmax=num;\n\t\t\t\t\t\tSystem.out.println(num+\" \"+n+\" \"+i+\" \"+j);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tj++;\n\t\t\t\tn+=ps[j];\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"public static void main(String[] args) {\n\n int limit = 1000;\n\n for (int num = 0; num <= 1000; num++) {\n boolean isPrime = true;\n for (int divisor = 2; divisor < num; divisor++) {\n if (num % divisor == 0) {\n isPrime = false;\n break;\n }\n }\n if (isPrime) {\n System.out.print(num + \" \");\n }\n }\n }",
"int getRandomPrime(int minimum);",
"public static boolean isPrime(int n) \n{ \n//base case \nif (n <= 1) \nreturn false; \n//loop executes from 2 to n-1 \nfor (int i = 2; i < n; i++) \nif (n % i == 0) \n//returns false if the condition returns true \nreturn false; \n//returns true if the condition returns false \nreturn true; \n}",
"public static int[] generateSequence(String arguments[]){\n int size = Integer.parseInt(arguments[1]);\n int i;\n int primeArray[] = new int[size];\n PrimeSequence prime = new PrimeSequence(Integer.parseInt(arguments[0]));\n \n for(i = 0; i < size; i++){\n primeArray[i] = prime.next();\n } \n return primeArray;\n \n }",
"private void verifyNumbersPrimeWitStream(){\n\t\tList<Integer> primeList = IntStream.range(2, Integer.MAX_VALUE)\n\t\t\t\t.filter(n -> isPrime(n))\n\t\t\t\t.limit(primes.length)\n\t\t\t\t.boxed()\n\t\t\t\t.collect(Collectors.toList());\n\t\tprimes = primeList.stream().mapToInt(i->i).toArray();\n\t}",
"private static boolean isPrime(int number) {\n\n\t\tif (number <= NUMBER_ONE) {\n\t\t\treturn false; \n\t\t}\n\n\t\tfor (int i = NUMBER_TWO; i < number; i++) {\n\t\t\tif (number % i == NUMBER_ZERO) { \n\t\t\t\treturn false; \n\t\t\t}\n\t\t}\n\t\treturn true; \n\t}",
"public static void main(String[] args) {\r\nScanner scan = new Scanner(System.in);\r\n int totalTests = scan.nextInt();\r\n\r\n for(int x = 0; x < totalTests; x++){\r\n \r\n int number = scan.nextInt();\r\n int primes=0;\r\n \r\n\r\n for(int y =2 ; y<number/2; y++){\r\n if(number%y==0)\r\n \r\n primes++;\r\n if(primes>0){\r\n break;\r\n }\r\n \r\n }\r\n\r\n if(primes>0 && number>2 || number ==1 || number ==4)\r\n System.out.println(\"Not prime\");\r\n\r\n else System.out.println(\"Prime\");\r\n \r\n \r\n }\r\n }",
"public RatNumPrimes(int n) {\n \tdenom = one;\n \t\n \tif (n == 0) {\n \t\tsign = Sign.ZERO;\n \t\tnumer = one;\n \t} else if (n < 0) {\n \t\tsign = Sign.NEGATIVE;\n \t\tnumer = primeFactorization(-n);\n \t} else {\n \t\tsign = Sign.POSITIVE;\n \t\tnumer = primeFactorization(n);\n \t}\n }",
"public List<PrimeNr> getAllPrimeNrs(){\n Cursor cursor = database.query(PrimeNrBaseHelper.TABLE,null, null, null, null\n , null, PrimeNrBaseHelper.PRIME_NR);\n\n List<PrimeNr> primeNrList = new ArrayList<>();\n\n try {\n cursor.moveToFirst();\n while(!cursor.isAfterLast()){\n Long pnr = cursor.getLong(cursor.getColumnIndex(PrimeNrBaseHelper.PRIME_NR));\n String foundOn = cursor.getString(cursor.getColumnIndex(PrimeNrBaseHelper.FOUND_ON));\n primeNrList.add(new PrimeNr(pnr, foundOn));\n cursor.moveToNext();\n }\n } finally {\n cursor.close();\n }\n\n return primeNrList;\n }",
"void computeTo(int max)\n {\n if(max < 2)\n throw new IllegalArgumentException();\n lastComp=max;\n Queue<Integer> nums = new LinkedList<>(); //Use built in queue and LL\n for (int i = 2; i <= max; i++)\n {\n nums.add(i);\n }\n primes = new LinkedList<>(); // Built in.\n\n int p;\n do{\n p = nums.remove();\n Iterator<Integer> it = nums.iterator();\n while(it.hasNext())\n {\n int i = it.next();\n if (i % p == 0)\n it.remove(); //removes last returned element\n }\n primes.add(p);\n\n } while (p < Math.sqrt(max));\n primes.addAll(nums);\n }",
"public static void main(String[] args) {\n int index = 1; //starting with 2 already done.\r\n int targetIndex = 10001; //we're looking for the 10 001st prime number\r\n int value = 2;\r\n while (index < targetIndex) {\r\n value++;\r\n if (isPrime(value)) {\r\n index++;\r\n }\r\n }\r\n System.out.println(value);\r\n\r\n }",
"public static void main(String[] args) {\n Scanner scan = new Scanner(System.in);\n int primesTill = scan.nextInt();\n\n int[] arr = new int[30];\n arr[0] = 2;\n arr[1] = 3;\n arr[2] = 5;\n arr[3] = 7;\n arr[4] = 11;\n int tracker = 5;\n for(int i = 11; i <= primesTill; i = i+ 2) {\n if (i % 3 == 0)\n continue;\n if (i % 5 == 0)\n continue;\n if (i % 7 == 0)\n continue;\n if (i % 11 == 0)\n continue;\n arr[tracker] = i;\n tracker++;\n }\n\n for(int i : arr) {\n if(i == 0)\n break;\n else\n System.out.println(i);\n }\n }",
"public List<Long> calculatePrimeFactorsOf(long l) {\n\n\t\tList<Long> primeFactors = new ArrayList<>();\n\t\tfor (long i = 2; i < l; i++) {\n\t\t\tif ((l % i == 0) && (isPrime(i))) {\n\t\t\t\tlong result = l;\n\t\t\t\twhile (result % i == 0) {\n\t\t\t\t\tprimeFactors.add(i);\n\t\t\t\t\tresult /= i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (l <= 2) // Catch the case where the number is 2 or 1\n\t\t\tprimeFactors.add(l);\n\t\treturn primeFactors;\n\t}",
"static void PrintPrimes(int limit)\n {\n final int primePerLine = 22; // Prime numbers in a line\n int count = 0; // count for prime numbers in line\n int n = 2; // numbers to print if it is prime\n\n // while n is less than limit \n while(n < limit)\n {\n // check number is prime\n if(isPrime(n))\n {\n count++; // if prime than increase count for prime numbers in line\n \n // if count is greater than prime per line add another line\n if(count % primePerLine == 0)\n {\n System.out.printf(\"%-5s\\n\", n);\n }\n else\n {\n System.out.printf(\"%-5s\", n);\n }\n }\n\n n++; // check next number\n }\n }",
"public static void main(String[] args) {\n\nint count=0;\n\n\nfor(int i=13;count<100;i++){\n\tboolean a=isPrime(i);\n\tboolean b=isReversePrime(i);\n\t\n\tif(a && b){\n\t\tcount++;\n\t\tSystem.out.print(count%10 != 0 ? i+\" \":i+\"\\n\" );\n\t}\n}\n\t}",
"public static void main(String[] args) {\n\t\tBigInteger number = new BigInteger(Long.MAX_VALUE + \"\");\r\n\t\tnumber = number.add(BigInteger.ONE);\r\n\t\t\r\n\t\tint count = 0;\r\n\t\twhile (count < 5){\r\n\t\t\tif (isPrime(number)){\r\n\t\t\t\tcount++;\r\n\t\t\t\tSystem.out.println(number);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//increment number by 1\r\n\t\t\tnumber = number.add(BigInteger.ONE);\r\n\t\t\t\r\n\t\t}\r\n\t}",
"public static void main(String[] args) {\n\t\tlong num=123456789;\r\n\t\tlong rev = 0;\r\n\r\n\t\t//boolean isprime=true;\r\n\r\n\t\tfor(int i=2;i<num;i++)\r\n\t\t{\t\r\n\t\t\twhile(num!=0)\r\n\t\t\t{\r\n\r\n\r\n\t\t\t\trev=num % 10;\r\n\t\t\t\tnum=num/10;\r\n\r\n\r\n\t\t\t\tSystem.out.println(rev);\r\n\r\n\t\t\t\tif(rev>2) {\r\n\t\t\t\t\tboolean flag=true;\r\n\t\t\t\t\tfor(int temp=2;temp<rev;temp++) {\r\n\t\t\t\t\t\tif(rev%temp==0) {\r\n\t\t\t\t\t\t\tflag=false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(flag)\r\n\t\t\t\t\t{\r\n\r\n\t\t\t\t\t\tSystem.out.println(rev + \"is prime number\");\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\tSystem.out.println(rev + \"is not a prime\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tSystem.out.println(rev+\" is a prime\");\r\n\t\t\t\t}\r\n\r\n\r\n\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void getRangeOfPrimesInPairs(int[][] pairsOfNumbers) {\n\t\tif(pairsOfNumbers != null) {\n\t\t\tList<Integer> primeList = new ArrayList<Integer>();\n\t\t\tfor(int i=0; i < pairsOfNumbers.length; i++) {\n\t\t\t\tprimeList.addAll(getRangeOfPrimesInPair(pairsOfNumbers[i][0], pairsOfNumbers[i][1]));\n\t\t\t\n\t\t\t}\n\t\t\tif(primeList != null) {\n\t\t\t\tsetListOfAllPrimes(primeList);\n\t\t\t}\n\t\t} \n\t}",
"public static List<Integer> sieve(int n) {\n\t\tboolean[] arr = new boolean[n + 1];\n\t\t\n\t\tarr[0] = true;\n\t\t\n\t\t// 1 is not prime by definition\n\t\tif (arr.length > 1) {\n\t\t\tarr[1] = true;\n\t\t}\n\n\t\tint i = 2;\n\t\twhile (i < n) {\n\t\t\tarr = markMultiples(i, arr);\n\t\t\ti = getNextUnmarked(++i, arr);\n\n\t\t\t// next i exceeds n\n\t\t\tif (i == -1) { \n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn getUnmarked(arr);\n\t}",
"public IntList(int size){\n\t\tprime = new ArrayList<Integer>(size);\n\t}",
"public static boolean isPrime(MyInteger number1){\r\n\t\tfor (int i = 2; i<number1.getInt(); i++){\r\n\t\t\tif(number1.getInt()/i==0){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"public static IntStream primeStream(){\n return IntStream.iterate(2, PrimeFactory::getNextHigherPrime);\n }",
"private static boolean isPrime(int number){\n for(int divisor = 2; divisor <= number / 2; divisor++){\n if(number % divisor == 0){ // If true. number is not prime\n return false;\n }\n }\n return true; // Number is prime\n }",
"static void printPrimes(int N){\n boolean[] primes = new boolean[N+1];\n Arrays.fill(primes, true); //TC: O(n)\n\n primes[0] = primes[1] = false; //0 &1 are not prime numbers\n int sqrt = (int)Math.sqrt(N);\n for(int i=2; i<=sqrt; i++){\n if(primes[i]){\n //mark multiple of i as false\n for(int j=i*i; j<=N; j+=i){\n primes[j] = false;\n }\n }\n }\n\n for(int i=2; i<=N; i++){\n if(primes[i]) System.out.print(i +\", \");\n }\n System.out.println();\n }",
"private int getNextPrime(int n) {\n for (int i = n + 1; i <= 2 * n; i++) {\n if (isPrime(i)) {\n return i;\n }\n }\n return -1;\n }",
"public List<Integer> getPrimesList() {\n return primes;\n }"
]
| [
"0.72267103",
"0.7188342",
"0.7182174",
"0.71532005",
"0.68722296",
"0.6845785",
"0.683158",
"0.67358667",
"0.67161965",
"0.6707668",
"0.6686259",
"0.6678516",
"0.66526693",
"0.6604072",
"0.65524024",
"0.6548398",
"0.6497523",
"0.64735395",
"0.6466162",
"0.64570034",
"0.6456463",
"0.6454487",
"0.6399724",
"0.639305",
"0.6389629",
"0.63833463",
"0.63625175",
"0.63586867",
"0.63569736",
"0.6333709",
"0.63303703",
"0.6330145",
"0.63078594",
"0.6307399",
"0.62962466",
"0.6285906",
"0.6283064",
"0.6272476",
"0.6259247",
"0.6210814",
"0.62052363",
"0.6172413",
"0.6166996",
"0.6164308",
"0.61423135",
"0.60972804",
"0.60830504",
"0.6082814",
"0.60534936",
"0.60242224",
"0.60015374",
"0.5990714",
"0.59819365",
"0.5958708",
"0.59491897",
"0.5946951",
"0.59451145",
"0.593789",
"0.592637",
"0.5920914",
"0.59163046",
"0.5902474",
"0.59000546",
"0.5896756",
"0.58959293",
"0.5894761",
"0.5892735",
"0.5890729",
"0.5890439",
"0.58864295",
"0.58837104",
"0.5882953",
"0.58656704",
"0.5861408",
"0.5845171",
"0.5844986",
"0.58441013",
"0.58374053",
"0.5837389",
"0.58346015",
"0.58276296",
"0.58199304",
"0.5812627",
"0.5806773",
"0.58032334",
"0.5791051",
"0.57868326",
"0.5782035",
"0.57808566",
"0.57771343",
"0.5776861",
"0.5774083",
"0.5773022",
"0.576636",
"0.57566726",
"0.5752616",
"0.5749561",
"0.574525",
"0.5735866",
"0.5733099"
]
| 0.6311364 | 32 |
Klaus Schmeh challenge 3 | private static void challenge3M138(int len, boolean offsetKnown, boolean withCrib) {
String cipherStr = "RIGVRXIXRHZQOGDQYIXVHCZKJLCDKUSGNDPPIBCLGPZBRUTRFJXHTNQPHWXGQAXPKEEEKMDPWFKSDTLKPTFIXIRUXNTIMTZQQCQOSOPFBXFMMZPSIGZSANJKYHWIO".substring(0, len);
String cribStr = withCrib ? "INTHEEARLYNINETEENTWENTIESTHECABLEBECAMETHEFAVOUREDMEANSOFCOMMUNICATIONFORLOVERSSEPARATEDBYTHOUSANDSOFMILESITSEEMEDMIRACULOUS".substring(0, len) : null;
int[] key = {51, 23, 15, 62, 14, 22, 39, 21, 99, 12, 19, 24, 4, 73, 6, 18, 85, 20, 11, 25, 42, 38, 8, 26, 9};
ArrayList<Integer> offset = new ArrayList<>();
if (offsetKnown) {
offset.add(6);
}
solve(offset, cipherStr, cribStr, 0, -1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main(String[] args) throws Exception {\n\t\tScanner scn = new Scanner(System.in);\r\n\t\tint tc = scn.nextInt();\r\n\t\tfor(int t=1; t<=tc; t++) {\r\n\t\t\tint n = scn.nextInt();\r\n\t\t\tint k = scn.nextInt();\r\n\t\t\tString str = scn.next();\r\n\t\t\tString arr[] = new String[n];\r\n\t\t\tarr = str.split(\"\");\r\n\t\t\tLinkedList<String> list = new LinkedList<>();\r\n\t\t\tLinkedList<Integer> result = new LinkedList<>();\r\n\t\t\tfor(int i=0; i<n; i++) {\r\n\t\t\t\tlist.add(arr[i]);\r\n\t\t\t}\r\n\t\t\tint comeback = 0;\r\n\t\t\twhile(comeback<4) {\r\n\t\t\t\tint cnt = 0;\r\n\t\t\t\tcomeback = 0;\r\n\t\t\t\tString st = \"\";\r\n\t\t\t\tfor(int i=0; i<n; i++) {\r\n\t\t\t\t\tif(cnt==(n/4)-1) {\r\n\t\t\t\t\t\tcnt = 0;\r\n\t\t\t\t\t\tst += list.get(i);\r\n\t\t\t\t\t\tint tmp = Integer.parseInt(st, 16);\r\n\t\t\t\t\t\tif(!isHave(result,tmp) && (result.size()>0)) {\r\n\t\t\t\t\t\t\tresult.add(tmp);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if(result.size() == 0){\r\n\t\t\t\t\t\t\tresult.add(tmp);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tcomeback++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tst = \"\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tst+= list.get(i);\r\n\t\t\t\t\t\tcnt++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\trotate(list);\r\n\t\t\t}\r\n\t\t\tCollections.sort(result);\r\n\t\t\tint cnt = 0;\r\n\t\t\tSystem.out.println(\"#\"+t+\" \"+result.get(result.size()-k));\t\t\t\r\n\t\t}\r\n\t}",
"String algorithm();",
"public void solve(Scanner in) {\n\tint K = in.nextInt();\n\tint L = in.nextInt();\n\tint S = in.nextInt();\n\t\n\tint[] letters = new int[26];\n\t\n\tin.nextLine();\n\n\tString keyboard = in.nextLine(), word = in.nextLine();\n\tchar c;\n\t\n\t\n\n\tfor (int i = 0; i < K; i++) {\n\t\tc = keyboard.charAt(i);\n\t\tletters[c - 'A']++;\n\t}\n\t\n\tdouble chanceOfWord = 1;\n\n\tfor (int i = 0; i < L; i++) {\n\t\tchanceOfWord *= (letters[word.charAt(i)-'A']+0.0)/(K+0.0);\n\t}\n\t\n \tif (chanceOfWord == 0 || chanceOfWord == 1){\n\t\tSystem.out.println (0.0);\n\t\treturn;\n\t}\n\telse if (L == S) {\n\t\tSystem.out.println (1.0-chanceOfWord);\n\t\treturn;\n\t}\t\n\n\tmax = 0;\n\tcol = 0;\n\tdouble result = full (letters,\"\",word,S);\n\tSystem.out.println ((max - (result+0.0)/(col+0.0)));\n}",
"public static void main(String[] args) {\n\t\tScanner scn = new Scanner(System.in);\n\t\tint t = scn.nextInt();\n\t\twhile (t-- > 0) {\n\t\t\tint n = scn.nextInt();\n\t\t\tint k = scn.nextInt();\n\t\t\tString s = scn.next();\n\t\t\tString s1 = new StringBuilder(s).reverse().toString();\n\t\t\tint[][] dp = new int[n + 1][n + 1];\n\t\t\tfor (int i = 0; i <= n; i++) {\n\t\t\t\tfor (int j = 0; j <= n; j++) {\n\t\t\t\t\tif (i == 0 || j == 0)\n\t\t\t\t\t\tdp[i][j] = 0;\n\t\t\t\t\telse if (s.charAt(i - 1) == s1.charAt(j - 1))\n\t\t\t\t\t\tdp[i][j] = dp[i - 1][j - 1] + 1;\n\t\t\t\t\telse\n\t\t\t\t\t\tdp[i][j] = Math.max(dp[i - 1][j], dp[i][j - 1]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (int[] c : dp) {\n\t\t\t\tfor (int v : c) {\n\t\t\t\t\tSystem.out.print(v + \" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t\tint rem = n - dp[n][n];\n\t\t\tif (rem <= k)\n\t\t\t\tSystem.out.println(\"YES\");\n\t\t\telse\n\t\t\t\tSystem.out.println(\"NO\");\n\t\t}\n\t}",
"public static int Main()\n\t {\n\t\t int x;\n\t\t int j;\n\t\t int[] a = new int[16];\n\t\t x = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\t int i = 1;\n\t\t int k = 0;\n\t\t while (x != -1)\n\t\t {\n\t\t\ta[i] = x;\n\t\t\ti++;\n\t\t if (x != 0)\n\t\t {\n\t\t\t k = i;\n\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\tint sum = 0;\n\t\t\t for (i = 1;i <= k;i++)\n\t\t\t {\n\t\t\t\t for (j = 1;j <= k ;j++)\n\t\t\t\t {\n\t\t\t\t if (a[i] == 2 * a[j])\n\t\t\t\t {\n\t\t\t\t\t sum++;\n\t\t\t\t }\n\t\t\t\t }\n\t\t\t }\n\t\t\t\t\tSystem.out.print((sum - 1));\n\t\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t\t\ti = 1;\n\t\t\t }\n\t\t\tx = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\t }\n\t\t\treturn 0;\n\t }",
"public static void main(String[] args) throws FileNotFoundException, IOException{\n\tScanner sc=new Scanner(new BufferedReader(new InputStreamReader (new FileInputStream(\"CodeJam2014/r1c_a/A-large.in\"))));\r\n\t\t//Scanner sc=new Scanner(new BufferedReader(new InputStreamReader(System.in)));\r\n\t\tPrintWriter ou=new PrintWriter(new FileWriter(\"CodeJam2014/r1c_a/testal.out\"));\r\n\t\tint res,rep,i,j;\r\n\t\tlong p,q,tp,tq,cp,cq;\r\n\t\tboolean vis;\r\n\t\tString s;\r\n\t\tString[] s2=new String[3];\r\n\t\tString out=\"\";\r\n\t\t\r\n\t\tres=sc.nextInt();\r\n\t\ts=sc.nextLine();\r\n\t\tfor(rep=1;rep<=res;rep++){\r\n\t\t\ts=sc.nextLine();\r\n\t\t\ts2=s.split(\"/\");\r\n\t\t\tp=0; q=0;\r\n\t\t\tfor(i=0;i<s2[0].length();i++){\r\n\t\t\t\tp*=10;\r\n\t\t\t\tp+=(int)s2[0].charAt(i)-(int)'0';\r\n\t\t\t}\r\n\t\t\tfor(i=0;i<s2[1].length();i++){\r\n\t\t\t\tq*=10;\r\n\t\t\t\tq+=(int)s2[1].charAt(i)-(int)'0';\r\n\t\t\t}\r\n\t\t\t//p=Integer.parseInt(s2[0]); q=Integer.parseInt(s2[1]);\r\n\t\t\t//p=sc.nextInt(); q=sc.nextInt();\r\n\t\t\ttp=p/gcd(p,q); tq=q/gcd(p,q);\r\n\t\t\tSystem.out.println(tp);\r\n\t\t\tcp=0; cq=0;\r\n\t\t\tvis=true;\r\n\t\t\twhile(tp!=1){\r\n\t\t\t\ttp=tp>>1;\r\n\t\t\t\tcp++;\r\n\t\t\t}\r\n\t\t\twhile(tq!=1){\r\n\t\t\t\tif (tq%2==1) {vis=false; break;}\r\n\t\t\t\ttq/=2;\r\n\t\t\t\tcq++;\r\n\t\t\t}\r\n\t\t\tou.print(\"Case #\"+rep+\": \");\r\n\t\t\tif (!vis) ou.print(\"impossible\");\r\n\t\t\telse ou.print(cq-cp);\r\n\t\t\tif (res!=rep) ou.println();\r\n\t\t\tSystem.out.println(cq-cp);\r\n\t\t}\r\n\t\tou.close();\r\n\t}",
"public static int Main()\n\t{\n\t\tint s = 0;\n\t\tint t = 0;\n\t\tint[] a = new int[100000];\n\t\tint n;\n\t\tint i;\n\t\tint j;\n\t\tint k;\n\n\t\tn = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\n\t\tfor (i = 1;i <= n;i++)\n\t\t{\n\t\t\ta[i - 1] = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\t}\n\n\t\tk = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\n\t\tfor (j = 1;j <= n;j++) //?for??????????k??????\n\t\t{\n\t\t\tif (a[j - 1] != k)\n\t\t\t{\n\t\t\t\tt++; //?t?????k???????????????????????\n\t\t\t}\n\t\t}\n\t\tfor (j = 1;j <= n;j++)\n\t\t{\n\t\t\tif (a[j - 1] != k) //???k?????\n\t\t\t{\n\t\t\t\ts++;\n\t\t\t\tif (s <= t - 1) //?????????k???s?t????????????\n\t\t\t\t{\n\t\t\t\t\tSystem.out.print(a[j - 1]);\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\telse //??????????????\n\t\t\t\t{\n\t\t\t\tSystem.out.print(a[j - 1]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}",
"public static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tint t = s.nextInt();\n\t\twhile(t-->0)\n\t\t{\n\t\t\tint n = s.nextInt();\n\t\t\tint k = s.nextInt();\n\t\t\tint[] arr = new int[n];\n\t\t\tfor(int i=0;i<n;i++)\n\t\t\t\tarr[i] = s.nextInt();\n\t\t\tArrays.sort(arr);\n\t\t\tint[][] dp = new int[k+1][n+1];\n\t\t\tfor(int i=0;i<=k;i++)\n\t\t\t\tfor(int j=0;j<=n;j++)\n\t\t\t\t{\n\t\t\t\t\tif(i==0)\n\t\t\t\t\t\tdp[i][j] = 0;\n\t\t\t\t\telse if(j==0)\n\t\t\t\t\t\tdp[i][j] = -1;\n\t\t\t\t\telse if(i-arr[j-1]>=0)\n\t\t\t\t\t{\n\t\t\t\t\t\tint val1 = dp[i-arr[j-1]][j-1];\n\t\t\t\t\t\tint val2 = dp[i][j-1];\n\t\t\t\t\t\tif(val1!=-1 && val2!=-1)\n\t\t\t\t\t\t\tdp[i][j] = Math.min(1+val1,val2);\n\t\t\t\t\t\telse if(val1!=-1)\n\t\t\t\t\t\t\tdp[i][j] = 1+val1;\n\t\t\t\t\t\telse if(val2!=-1)\n\t\t\t\t\t\t\tdp[i][j] = val2;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdp[i][j] = -1;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif(dp[i][j-1]==-1)\n\t\t\t\t\t\t\tdp[i][j] = -1;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdp[i][j] = dp[i][j-1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tif(dp[k][n]!=-1)\n\t\t\t\tSystem.out.println(dp[k][n]);\n\t\t\telse\n\t\t\t\tSystem.out.println(\"impossible\");\n\t\t}\n\t}",
"public static void main(String[] args) throws NumberFormatException, IOException {\n\t\tBufferedReader br= new BufferedReader(new FileReader(\"C-small-attempt7.in\"));\n\t\t//BufferedReader br= new BufferedReader(new FileReader(\"A-large-practice(2).in\"));\n\t\t\n\t\t// TODO WRITER\n\t\tPrintWriter pw = new PrintWriter(\"Dijkstra.txt\", \"UTF-8\");\n\t\tint T=Integer.parseInt(br.readLine());\n\t\t\n\t\t\n\t\tfor(int i = 0; i < T; i++){\n\t\t\tString[] tab =br.readLine().split(\" \");\n\t\t\tint L = Integer.parseInt(tab[0]);\n\t\t\t//int X=Integer.parseInt(tab[1].length()>2 ? tab[1].substring(tab[1].length()-2) : tab[1]);\n\t\t\tlong X=Long.parseLong(tab[1]);\n\t\t\tString str = br.readLine();\n\t\n\t\t\t\n\t\t\t\t\n\t\t\tString a=\"NO\";\n\t\t\tchar current = '1';\n\t\t\tboolean minus = false;\n\t\t\tint finish=0;\n\t\t\tfor(long j=0; j<X*L; j++){\n\t\t\t\tchar temp = str.charAt((int)(j%L));\n\t\t\t\t\n\t\t\t\tif(current==temp){\n\t\t\t\t\tcurrent='1';\n\t\t\t\t\tminus = !minus;\n\t\t\t\t}\n\t\t\t\telse if(current=='1')current=temp;\n\t\t\t\telse if(current=='i'&&temp=='j') current='k';\n\t\t\t\telse if(current=='i'&&temp=='k'){\n\t\t\t\t\tcurrent='j';\n\t\t\t\t\tminus=!minus;\n\t\t\t\t}\n\t\t\t\telse if(current=='j'&&temp=='i'){\n\t\t\t\t\tcurrent='k';\n\t\t\t\t\tminus=!minus;\n\t\t\t\t}\n\t\t\t\telse if(current=='j'&&temp=='k') current='i';\n\t\t\t\telse if(current=='k'&&temp=='i') current='j';\n\t\t\t\telse if(current=='k'&&temp=='j'){\n\t\t\t\t\tcurrent='i';\n\t\t\t\t\tminus=!minus;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(current=='i'&&finish==0){\n\t\t\t\t\tfinish++;\n\t\t\t\t\tcurrent='1';\n\t\t\t\t}\n\t\t\t\telse if(current=='j'&&finish==1){\n\t\t\t\t\tfinish++;\n\t\t\t\t\tcurrent='1';\n\t\t\t\t}\n\t\t\t\telse if(current=='k'&&finish==2){\n\t\t\t\t\tfinish++;\n\t\t\t\t\tcurrent='1';\n\n\t\t\t\t}\n\t\t\t}\n\t\t\t//&&X%2==1 &&X%4==2 ||(current!='1'&&finish==3)\n\t\t\tif((current=='1'&&!minus&&finish==3))a=\"YES\";\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\"current \"+(minus?\"-\":\"\")+current+\" finish \"+finish +\" X \"+X);//+\" str: \"+str);\n\t\n\t\t\tSystem.out.print(\"Case #\"+(i+1)+\": \"+a+\"\\n\");\n\t\t\tpw.write(\"Case #\"+(i+1)+\": \"+a+\"\\n\");\n\n\t\t}\n\t\tpw.close();\n\t}",
"public static int fullHouseYahtzee(int... result) {\n\n int score = nSame(3, 6, result);\n int firstPairVal = score/3;\n\n result = IntStream.of(result).filter(val -> val != firstPairVal).toArray();\n score = nSame(2, 6, result);\n int secondPairVal = score/2;\n\n if (firstPairVal*secondPairVal > 0) {\n score = 25;\n } else {\n score = 0;\n }\n\n return score;\n }",
"public void solve() throws IOException {\r\n int T = nextInt();\r\n for (int t = 1; t <= T; t++) {\r\n int N = nextInt();\r\n int J = nextInt();\r\n \r\n out.format(\"Case #%d:%n\", t);\r\n \r\n boolean[] bitmask = new boolean[N - 2];\r\n int count = 0;\r\n while (count < J) {\r\n BigInteger[] factors = new BigInteger[9];\r\n boolean success = true;\r\n for (int base = 2; base <= 10; base++) {\r\n BigInteger value = BigInteger.ONE;\r\n BigInteger biBase = BigInteger.valueOf(base);\r\n \r\n for (int i = 0; i < N - 2; i++) {\r\n if (bitmask[i]) {\r\n value = value.add(biBase.pow(i + 1));\r\n }\r\n }\r\n value = value.add(biBase.pow(N - 1));\r\n \r\n if (value.isProbablePrime(10)) {\r\n success = false;\r\n break;\r\n } else {\r\n // Pollard rho\r\n BigInteger x = BigInteger.valueOf(2);\r\n BigInteger y = BigInteger.valueOf(2);\r\n BigInteger d = BigInteger.ONE;\r\n while (d.compareTo(BigInteger.ONE) == 0) {\r\n x = x.pow(2).add(BigInteger.ONE).mod(value);\r\n y = y.pow(2).add(BigInteger.ONE).mod(value)\r\n .pow(2).add(BigInteger.ONE).mod(value);\r\n d = x.subtract(y).gcd(value);\r\n }\r\n if (d.compareTo(value) != 0) {\r\n factors[base - 2] = d;\r\n } else {\r\n success = false;\r\n break;\r\n }\r\n }\r\n }\r\n if (success) {\r\n count++;\r\n StringBuilder sb = new StringBuilder(\"1\");\r\n for (int i = N - 3; i >= 0; i--) {\r\n if (bitmask[i]) {\r\n sb.append(1);\r\n } else {\r\n sb.append(0);\r\n }\r\n }\r\n sb.append(1);\r\n \r\n System.out.println(sb.toString() + \" \" + count);\r\n out.print(sb.toString());\r\n for (int i = 0; i < 9; i++) {\r\n out.print(\" \");\r\n out.print(factors[i].toString());\r\n }\r\n out.println();\r\n }\r\n \r\n // Increment bitmask\r\n for (int i = 0; i < N - 2; i++) {\r\n if (!bitmask[i]) {\r\n bitmask[i] = true;\r\n break;\r\n } else {\r\n bitmask[i] = false;\r\n }\r\n }\r\n }\r\n }\r\n }",
"public int[] solution(String S, int[] P, int[] Q) {\n \n int[][] result = new int[S.length()][4];\n int[] returnResult = new int[P.length];\n \n //how many different solutions exist?\n //'A' [0], [0] - 1 solution\n //'AG' [0, 0, 1], [0, 1, 1] - 3\n // 'AGT' [0,0,0,1,1,2], [0,1,1,2,2,2] - 6\n // 10\n // 15\n // 21\n \n //Prefix Sum - calculation\n \n for (int i = 1; i< S.length()+1; i++){\n \n if (i == 1){\n switch (S.substring(i-1, i)){\n case \"A\": result[i-1][0] = 1;\n break;\n case \"C\": result[i-1][1] = 1;\n break;\n case \"G\": result[i-1][2] = 1;\n break;\n case \"T\": result[i-1][3] = 1;\n break;\n }\n }else{\n int a = 0;\n switch (S.substring(i-1, i)){\n case \"A\": a = 0;\n break;\n case \"C\": a= 1;\n break;\n case \"G\": a =2;\n break;\n case \"T\": a =3;\n break;\n }\n result[i-1][a] = 1 + result[i-2][a];\n result[i-1][(a+1)%4] = result[i-2][(a+1)%4];\n result[i-1][(a+2)%4] = result[i-2][(a+2)%4];\n result[i-1][(a+3)%4] = result[i-2][(a+3)%4];\n }\n\n }\n \n /*\n for (double i : result){\n System.out.println(i);\n }\n */\n \n //A = 1, G = 2, C = 3, T = 4\n //when A found return 1 and move to next computation.\n // P[k] <= Q[K]\n int lowerBound = 0;\n int upperBound = 0;\n for (int i = 0; i < P.length; i++){\n lowerBound = P[i];\n upperBound = Q[i];\n \n int[] toEvaluate = new int[4];\n\n //System.out.println(lowerBound);\n if (lowerBound == 0){\n toEvaluate[0]= result[upperBound][0];\n toEvaluate[1]= result[upperBound][1];\n toEvaluate[2]= result[upperBound][2];\n toEvaluate[3]= result[upperBound][3];\n }else{\n toEvaluate[0]= result[upperBound][0] - result[lowerBound-1][0]; \n toEvaluate[1]= result[upperBound][1] - result[lowerBound-1][1];\n toEvaluate[2]= result[upperBound][2] - result[lowerBound-1][2];\n toEvaluate[3]= result[upperBound][3] - result[lowerBound-1][3];\n }\n \n /*\n for (int eval : toEvaluate){\n System.out.println(eval);\n \n }\n */\n if (toEvaluate[0] > 0) {returnResult[i] = 1;\n }else if (toEvaluate[1] > 0) {returnResult[i] = 2;\n }else if (toEvaluate[2] > 0) {returnResult[i] = 3;\n }else if (toEvaluate[3] > 0) {returnResult[i] = 4;\n }\n \n }\n \n return returnResult; \n }",
"@Override\r\n\tpublic int challengeThree(int[] arr) {\n\t\treturn 0;\r\n\t}",
"public static int Main()\n\t{\n\t\tint n; //????\n\t\tint k;\n\t\tint i;\n\t\tint i2;\n\t\tint j;\n\t\tn = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\tk = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\tfor (i2 = 1;;i2++)\n\t\t{ //????\n\t\t\ti = i2;\n\t\t\tfor (j = 0;j < n;j++)\n\t\t\t{ //????\n\t\t\t\tif (i % (n - 1) != 0)\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\ti = i * n / (n - 1) + k;\n\t\t\t}\n\t\t\tif (j == n)\n\t\t\t{\n\t\t\t\tSystem.out.print(i);\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}",
"public static void main(String[] args) {\n\t\tScanner ip = new Scanner(System.in);\r\n\t\tSystem.out.println(\"Welcome to the Katapayadi Wizard! Enter the 1st syllable of the raga of your choice: \");\r\n\t\t\r\n\t\tString F = ip.nextLine();\r\n\t\tSystem.out.println(\"Great! Now enter the 2nd syllable of the raga of your choice: \");\r\n\t\t\r\n\t\tString S = ip.nextLine();\r\n\t\t//int firstIndex; \r\n\t\t\r\n\t\tString [] [] alphabets = {{\"nya\", \"ka\", \"kha\", \"ga\", \"gha\", \"nga\", \"cha\", \"ccha\", \"ja\", \"jha\"}, \r\n\t\t\t\t\t\t\t\t {\"na\", \"ta\", \"tah\",\"da\", \"dah\", \"nna\", \"tha\", \"ttha\", \"dha\", \"ddha\"},\r\n\t\t\t\t\t\t\t\t {\"null\",\"pa\", \"pha\",\"ba\",\"bha\",\"ma\", \"null\", \"null\", \"null\", \"null\", },\r\n\t\t\t\t\t\t\t\t {\"null\",\"ya\", \"ra\", \"la\", \"va\", \"se\", \"sha\", \"sa\", \"ha\",\"null\"}};\r\n\t\t\r\n\t\tint firstNum = getFirstIndex(alphabets, F);\r\n\t\tint secondNum = getSecondIndex(alphabets, S); \r\n\t\tint finalIndex = concat(firstNum, secondNum);\r\n\t\t\r\n\t\tString swaras1= swaraSthanam1(finalIndex);\r\n\t\t//String finalanswer = The [index]th melakartha: aro [swaras1] and ava [swaras2].\r\n\t\tSystem.out.println(firstNum);\r\n\t\tSystem.out.println(secondNum);\r\n\t\t\r\n\t\tSystem.out.println(finalIndex);\r\n\t\t\r\n\t\tSystem.out.println(swaras1);\r\n\t\t\r\n\t}",
"public static String euklid(int a, int b, int c)\n {\n int[] rk = new int[20];\n rk[0] = a;\n rk[1] = b;\n int k = -1;\n int qk = 0;\n int[] sk = new int[20];\n sk[0] = 1;\n sk[1] = 0;\n int[] tk = new int[20];\n tk[0] = 0;\n tk[1] = 1;\n int i = 0;\n String d = null;\n String konstant = d;\n\n if (b == 0)\n {\n return Integer.toString(a);\n }\n\n System.out.println(\"\\n k | qk rk sk tk\");\n System.out.println(\"-----|------------------------\");\n System.out.println(\" \"+k+\" | -\"+\" \"+rk[0]+\" \"+\"1\"+\" \"+\"0\"); k++;\n System.out.println(\" \"+k+\" | -\"+\" \"+rk[1]+\" 0\"+\" \"+\"1\"); k++;\n System.out.println(\"-----|------------------------\");\n\n for (i = 2; i < rk.length; i++)\n {\n try\n {\n rk[i] = Math.abs(rk[i-2]%rk[i-1]);\n }\n catch (Exception e)\n {\n break;\n }\n\n qk = Math.floorDiv(rk[i-2], rk[i-1]);\n\n System.out.print(\" \"+k+\" | \"+qk+\" \"+rk[i]+\" \");\n\n if (rk[i]!=0)\n {\n sk[i] = sk[i-2]-(qk*sk[i-1]);\n\n tk[i] = tk[i-2]-(qk*tk[i-1]);\n System.out.println(+sk[i]+\" \"+tk[i]);\n }\n\n k++;\n }\n\n System.out.println(\"\\n\");\n\n boolean test = (sk[i-2]*a+tk[i-2]*b == c);\n\n System.out.println(\"sfd(\"+a+\",\"+b+\") = \"+c+\" = \"+sk[i-2]+\"*\"+a+\"+(\"+tk[i-2]+\"*\"+b+\") \"+test);\n\n System.out.println(\"\");\n\n return Arrays.toString(rk);\n\n }",
"private static int solution3(String s) {\r\n int n = s.length();\r\n Set<Character> set = new HashSet<>();\r\n int ans = 0, i = 0, j = 0;\r\n while (i < n && j < n) {\r\n if (!set.contains(s.charAt(j))) {\r\n set.add(s.charAt(j++));\r\n ans = Math.max(ans, j - i);\r\n } else {\r\n set.remove(s.charAt(i++));\r\n }\r\n }\r\n return ans;\r\n }",
"@Override\n\tpublic void challenge6() {\n\n\t}",
"static void minimumBribes(int[] q) {\nint count =0;\nboolean isprint = true;\nint first = 1;\nint second = 2;\nint third = 3;\n\n for(int i=0;i< q.length-1;i++){\n \n if (q[i] == first) {\n first = second;\n second = third;\n third++;\n }else if(q[i]== second){\n second = third;\n third++;\n count++;\n }else if(q[i]==third){\n third++;\n count++;\n count++;\n }else{\n isprint = false;\n }\n }\n\n // if((q[i-1]-q[i]) > 2){\n // System.out.println(\"Too chaotic\");\n // isprint = false;\n // break; \n // }else if((q[i-1]-q[i])==1){\n // count++;\n // }else if((q[i-1]-q[i])==2){\n // count+=2;\n // }\n \n //}\n if(isprint){\n System.out.println(count);\n }else{\n System.out.println(\"Too chaotic\");\n }\n }",
"void solve() {\n num = new ArrayList<>();\n num.add(BigInteger.valueOf(4));\n for (int len = 2; len <= 100; len++)\n generate(\"4\", 1, len, false);\n Collections.sort(num);\n for (int tc = ii(); tc > 0; tc--) {\n long x = il();\n BigInteger X = BigInteger.valueOf(x);\n for (int i = 0; i < num.size(); i++) {\n if (num.get(i).mod(X).equals(BigInteger.ZERO)) {\n String z = num.get(i).toString();\n int end = z.lastIndexOf('4');\n int len = z.length();\n int a = 2 * (end+1);\n int b = len - end;\n out.println(a + b);\n break;\n }\n }\n }\n }",
"public static void main(String[] args) {\nScanner sc=new Scanner(System.in);\r\nString input1=sc.nextLine();\r\ninput1=input1.toLowerCase();\r\nint l=input1.length();\r\nchar a[]=input1.toCharArray();\r\nint d[]=new int[1000];\r\nString str=\"\";\r\nint i=0,k1=0,k2=0,m=0,c1=0,c2=0,c3=0,l1=0,u=0,u1=0;\r\nchar b[]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};\r\nfor(i=0;i<l;i++)\r\n{ c3=0;\r\n\tif(a[i]==' ')\r\n\t{u=i;c3=0;\r\n\t\tfor(k1=u1,k2=i-1;k1<k2 && k2>k1;k1++,k2--)\r\n\t\t{ c1=0;c2=0;\r\n\t\t\tfor(m=0;m<26;m++)\r\n\t\t\t{\r\n\t\t\t\tif(b[m]==a[k1]) {\r\n\t\t\t\tc1=m+1;}\t\r\n\t\t\t\tif(b[m]==a[k2]) {\r\n\t\t\t\t\tc2=m+1;}\t\r\n\t\t\t}\r\n\t\t\tc3=c3+Math.abs(c1-c2);\r\n\t\t}\r\n\t\tif(k1==k2) {\r\n\t\t\tfor(m=0;m<26;m++) {\r\n\t\t\t\tif(b[m]==a[k1])\r\n\t\t\t\t\tc3=c3+(m+1);\r\n\t\t\t }\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\td[l1]=c3;\r\n\t\tl1++;\r\n\t\tu1=i+1;\r\n\t\tc3=0;\r\n\t}\r\n\tif(i==l-1)\r\n\t{\r\n\t\tfor(k1=u+1,k2=i;k1<k2 && k2>k1;k1++,k2--)\r\n\t\t{ c1=0;c2=0;\r\n\t\t\tfor(m=0;m<26;m++)\r\n\t\t\t{\r\n\t\t\t\tif(b[m]==a[k1]) {\r\n\t\t\t\tc1=m+1;}\t\r\n\t\t\t\tif(b[m]==a[k2]) {\r\n\t\t\t\t\tc2=m+1;}\t\r\n\t\t\t}\r\n\t\t\tc3=c3+Math.abs(c1-c2);\r\n\t\t}\r\n\t\tif(k1==k2) {\r\n\t\t\tfor(m=0;m<26;m++) {\r\n\t\t\t\tif(b[m]==a[k1])\r\n\t\t\t\t\tc3=c3+(m+1);\r\n\t\t\t }\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\td[l1]=c3;\r\n\t\tl1++;\r\n\t\tk1=i+1;\r\n\t}\r\n}\r\n\r\n for(i=0;i<l1;i++)\r\n {\r\n\t str=str+Integer.toString(d[i]);\r\n }\r\n int ans=Integer.parseInt(str);\r\n System.out.print(ans);\r\n}",
"public static void main(String[] args) {\n Scanner sc=new Scanner(System.in);\n int p=sc.nextInt();\n int q=sc.nextInt();\n long i=0;\n String S=null;\n String substring1=null;\n String substring2=null;\n long square=0;\n int fsquare=0;\n int ssquare=0;\n int sum=0;\n int v=0;\n for(i=p;i<=q;i++)\n {\n square=squar(i);\n S=Long.toString(square);\n \n if(square<=9)\n { S=0+S; }\n int length=S.length();\n int d=length/2;\n String lsquare=S.substring(0,d);\n String rsquare=S.substring(d);\n fsquare=Integer.parseInt(lsquare);\n ssquare=Integer.parseInt(rsquare);\n sum=fsquare+ssquare;\n if(sum==i)\n {\n System.out.print(i);\n System.out.print(\" \");\n v=1;\n } \n } \n if(v==0)\n {\n System.out.print(\"INVALID RANGE\");\n } \n \n }",
"public static void main(String... args) {\n System.out.println(judgeSquareSum3(27)); //F\n// System.out.println(judgeSquareSum3(315)); //F\n\n }",
"public static void main(String[] args) throws java.lang.Exception {\n\t\tScanner s = new Scanner(System.in);\n\t\tint a = s.nextInt();\n\t\t// output the sum of divisors of numbers in an array having exactly 4 divisors.\n\n\t\tfor (int i = 0; i < a; i++) {\n\t\t\tint len = s.nextInt();\n\t\t\tint[] subsequence = new int[len];\n\t\t\tint key = 0;\n\t\t\tint[] div = new int[len];\n\t\t\tint[] div1 = new int[len];\n\t\t\tint sum = 0;\n\t\t\tfor (int j = 0; j < len; j++) {\n\n\t\t\t\tsubsequence[j] = s.nextInt();\n\t\t\t\tint d = (int) Math.sqrt(subsequence[j]);\n\t\t\t\tif (d * d == subsequence[j])\n\t\t\t\t\tcontinue;\n\t\t\t\tboolean f = false;\n\t\t\t\tfor (int k = 2; k <= d; k++) {\n\t\t\t\t\tif (subsequence[j] % k == 0) {\n\t\t\t\t\t\tif (div1[key] == 0) {\n\t\t\t\t\t\t\tdiv1[key] = k;\n\t\t\t\t\t\t\tdiv[key] = subsequence[j];\n\t\t\t\t\t\t\tf = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tf = false;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tif (f) {\n\t\t\t\t\tkey++;\n\t\t\t\t}\n\n\t\t\t\t\n\n\t\t\t}\n\t\t\tint n = 0;\n\t\t\tfor (int k = 0; k < key; k++) {\n\t\t\t\tn = div[k] / div1[k];\n\t\t\t\tsum += 1 + div[k] + div1[k] + n;\n\t\t\t}\n\t\t\tSystem.out.println(sum);\n\n\t\t}\n\n\t\ts.close();\n\n\t}",
"public static void main(String[] args){\n int n;int k;\n Scanner sc=new Scanner(System.in);\n n=sc.nextInt();\n k=sc.nextInt();\n int[] a=new int[n];\n int[] reMain=new int[k];\n int num=0;\n for(int i=0;i<k;i++){\n reMain[i]=0;\n }\n for(int i=0;i<n;i++){\n int d=sc.nextInt()%k;\n reMain[d]++;\n }\n int p=0;\n if(k%2==0)\n p=k/2;\n else p=(k+1)/2;\n for(int i=1;i<p;i++){\n if(reMain[i]>reMain[k-i])\n num+=reMain[i];\n else\n num+=reMain[k-i];\n \n }\n if(reMain[p]%2==1 && k%2==0)\n num++;\n if(k==2)\n num=reMain[1];\n \n \n System.out.println(num);\n\t}",
"@Override\n public String solve() {\n int LIMIT = 50 * NumericHelper.ONE_MILLION_INT;\n int[] nCount = new int[LIMIT+1];\n for(long y = 1; y<= LIMIT; y++) {\n for(long d= (y+3)/4; d<y; d++) { // +3 is to make d atleast 1\n long xSq = (y+d) * (y+d);\n long ySq = y * y;\n long zSq = (y-d) * (y-d);\n\n long n = xSq - ySq - zSq;\n\n if(n<0) {\n continue;\n }\n\n if(n>=LIMIT) {\n break;\n }\n\n\n nCount[(int)n]++;\n\n }\n }\n\n int ans = 0;\n for(int i = 1; i<LIMIT; i++) {\n if(nCount[i] == 1) {\n //System.out.print(i +\",\");\n ans++;\n }\n }\n\n return Integer.toString(ans);\n }",
"public static void main(String[] args) throws IOException {\n\t\tScanner sc = new Scanner(System.in);\n//\t\tint T = stoi(br.readLine());\n\t\tint T = sc.nextInt();\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor(int Tcase=1; Tcase <= T; Tcase++){\n\t\t\tint ans=0;\n\t\t\tsb.append(\"#\").append(Tcase).append(\" \");\n\t\t\t//오름차순 //내림차순\n\t\t\tint N = sc.nextInt();\n\t\t\tint[] dataSet = new int[N];\n\t\t\tfor (int count = 0; count < N; count++) {\n\t\t\t\tdataSet[count] = sc.nextInt();\n\t\t\t}\n\t\t\t\n\t\t\t//시작상태 0 //오름차순 1// 내림차순 2\n\t\t\tint swit = 0;\n\t\t\tint leftIdx = 0;\n\t\t\tint rightIdx = 0;\n\t\t\tint midIdx = 0;\n\t\t\tint preData = dataSet[0];\n\t\t\tint hi;\n\t\t\tfor (int idx = 1; idx < dataSet.length; idx++) {\n\t\t\t\thi = dataSet[idx];\n\t\t\t\tif(preData < hi) { //오름차순 1\n\t\t\t\t\tif(swit == 2) {\n\t\t\t\t\t\trightIdx = idx-1;\n\t\t\t\t\t\tans += (midIdx-leftIdx)*(rightIdx-midIdx);\n\t\t\t\t\t\tleftIdx = idx-1;\n\t\t\t\t\t}\n\t\t\t\t\tswit = 1;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t//같은경우 고려 안함\n\t\t\t\telse {//내림차순 2\n\t\t\t\t\tif(swit == 1) midIdx = idx-1;\n\t\t\t\t\t\n\t\t\t\t\tswit = 2;\n\t\t\t\t\tif(idx == dataSet.length-1){\n\t\t\t\t\t\trightIdx = idx;\n\t\t\t\t\t\tans += (midIdx-leftIdx)*(rightIdx-midIdx);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tpreData = hi;\n\t\t\t}\n\t\t\t\n\t\t\tsb.append(ans).append(\"\\n\");\n\t\t}\n\t\tSystem.out.print(sb);\n\t\t\n\t}",
"@Override\n\tpublic void challenge7() {\n\n\t}",
"public static void main (String[] args) throws java.lang.Exception\n\t{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint t = sc.nextInt();\n\t\twhile(t-->0)\n\t\t{\n\t\t int n = sc.nextInt();\n\t\t long[] arr = new long[n];\n\t\t long sum=0;\n\t\t for(int i=0;i<n;i++)\n\t\t {\n\t\t arr[i]=sc.nextLong();\n\t\t sum=sum+arr[i];\n\t\t }\n\t\t int i, k=0;\n\t\t double x=(double)sum/n;\n for(i=0;i<n;i++){\n if(arr[i]==x) \n {\n k=i; \n break;\n \n }\n }\n if(i==n)\n System.out.println(\"Impossible\");\n else \n System.out.println(k+1);\n\t\t}\n\t\t \n\t}",
"public static String solution() {\r\n\t\treturn \"73162890\";\r\n\t}",
"public static void main(String[] args) {\n\t\n\t Scanner in = new Scanner(System.in);\n\t int n = in.nextInt();\n\t int k = in.nextInt();\n\t int a[] = new int[n];\n\t for(int a_i=0; a_i < n; a_i++){\n\t a[a_i] = in.nextInt();\n\t }\n\t int count=0;\n\t for(int a1=0;a1<n-1;a1++)\n\t {\n\t \tfor(int b=1;b<n;b++)\n\t \t{\n\t \t if(a[a1]+a[b]%3==0)\n\t \t {\n\t \t\t count++;\n\t \t }\n\t \t}\n\t }\n\t System.out.println(count);\n\n\t}",
"public static String solution(String S, int K) {\n StringBuilder string = new StringBuilder();\n for (int i = 0; i < S.length(); i++) {\n char character = S.charAt(i);\n if (character == '-') continue;\n string.append(character);\n }\n // Builds a new string with hyphens between characters,\n // separating string into substrings of size K.\n StringBuilder output = new StringBuilder(string.length());\n for (int i = 0; i < string.length(); i++) {\n char character = string.charAt(i);\n if (i != 0 && i % K == 0) {\n output.append('-');\n output.append(character);\n } else {\n output.append(character);\n }\n }\n\n char character = output.charAt(output.length() - 1);\n int count = 0;\n while (character != '-') {\n count++;\n character = output.charAt(output.length() - (count + 1));\n }\n\n String result = output.toString();\n while (count < 3) {\n result = moveHypensLeft(result);\n count++;\n }\n\n return result;\n }",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(new BufferedReader(new InputStreamReader(System.in)));\r\n\t\tint n = sc.nextInt();\r\n\t\tint[] a = new int[n];\r\n\t\tfor(int i = 0; i < n; i++){\r\n\t\t\ta[i] = sc.nextInt();\r\n\t\t}\r\n\t\tint res = 0, p = 0, t = 0;\r\n\t\twhile(true){\r\n\t\t\tp = 0; t = 0;\r\n\t\t\tfor(int i = 0; i < a.length; i++){\r\n\t\t\t\t\r\n\t\t\t\tif(i == a.length-1){\r\n\t\t\t\t\ta[i] /= 2;\r\n\t\t\t\t\tt = a[i];\r\n\t\t\t\t\ta[i] += p;\r\n\t\t\t\t\tp = t;\r\n\t\t\t\t\ta[0] += p;\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\ta[i] /= 2;\r\n\t\t\t\t\tt = a[i];\r\n\t\t\t\t\ta[i] += p;\r\n\t\t\t\t\tp = t;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tboolean flag = true;\r\n\t\t\tint temp = a[0];\r\n\t\t\tfor(int j = 1; j < a.length; j++){\r\n\t\t\t\tif(a[j] != temp){\r\n\t\t\t\t\tflag = false;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(flag){\r\n\t\t\t\tSystem.out.println(res);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tfor(int j = 0; j < a.length; j++){\r\n\t\t\t\tif(a[j] % 2 != 0){\r\n\t\t\t\t\ta[j] += 1;\r\n\t\t\t\t\tres++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"@Override\r\n\tpublic int challengeTwo(String[] arr, String query) {\n\t\treturn 0;\r\n\t}",
"public static void main(String[] args) {\n\n pairsSum();\n\n printAllSubArrays();\n\n tripletZero();\n\n // int[][] sub = subsets();\n\n PairsSum sum = new PairsSum();\n int[] arr = { 10, 1, 2, 3, 4, 5, 6, 1 };\n boolean flag = sum.almostIncreasingSequence(arr);\n System.out.println(flag);\n\n String s = \"\";\n for (int i = 0; i < 100000; i++) {\n // s += \"CodefightsIsAwesome\";\n }\n long start = System.currentTimeMillis();\n // int k = subStr(s, \"IsA\");\n System.out.println(System.currentTimeMillis() - start);\n // System.out.println(k);\n\n String[] a = { \"aba\", \"aa\", \"ad\", \"vcd\", \"aba\" };\n String[] b = sum.allLongestStrings(a);\n System.out.println(Arrays.deepToString(b));\n\n List<String> al = new ArrayList<>();\n al.toArray();\n\n Map<Integer, Integer> map = new HashMap<>();\n Set<Integer> keySet = map.keySet();\n for (Integer integer : keySet) {\n\n }\n\n String st = reverseBracksStack(\"a(bc(de)f)g\");\n System.out.println(st);\n\n int[] A = { 1, 2, 3, 2, 2, 3, 3, 33 };\n int[] B = { 1, 2, 2, 2, 2, 3, 2, 33 };\n\n System.out.println(sum.isIPv4Address(\"2.2.34\"));\n\n Integer[] AR = { 5, 3, 6, 7, 9 };\n int h = sum.avoidObstacles(AR);\n System.out.println(h);\n\n int[][] image = { { 36, 0, 18, 9 }, { 27, 54, 9, 0 }, { 81, 63, 72, 45 } };\n int[][] im = { { 7, 4, 0, 1 }, { 5, 6, 2, 2 }, { 6, 10, 7, 8 }, { 1, 4, 2, 0 } };\n int[][] res = sum.boxBlur(im);\n\n for (int i = 0; i < res.length; i++) {\n for (int j = 0; j < res[0].length; j++) {\n System.out.print(res[i][j] + \" \");\n }\n System.out.println();\n }\n\n boolean[][] ms = { { true, false, false, true }, { false, false, true, false }, { true, true, false, true } };\n int[][] mines = sum.minesweeper(ms);\n for (int i = 0; i < mines.length; i++) {\n for (int j = 0; j < mines[0].length; j++) {\n System.out.print(mines[i][j] + \" \");\n }\n System.out.println();\n }\n\n System.out.println(sum.variableName(\"var_1__Int\"));\n\n System.out.println(sum.chessBoard());\n\n System.out.println(sum.depositProfit(100, 20, 170));\n\n String[] inputArray = { \"abc\", \"abx\", \"axx\", \"abx\", \"abc\" };\n System.out.println(sum.stringsRearrangement(inputArray));\n\n int[][] queens = { { 1, 1 }, { 3, 2 } };\n int[][] queries = { { 1, 1 }, { 0, 3 }, { 0, 4 }, { 3, 4 }, { 2, 0 }, { 4, 3 }, { 4, 0 } };\n boolean[] r = sum.queensUnderAttack(5, queens, queries);\n\n }",
"public static void main(String... args) {\n\n Set<Long> As = new HashSet<>();\n int N = 100;\n for (long p = -N; p <= N; ++p) {\n for (long q = -N; q <= p; ++q) {\n for (long r = -N; r <= q; ++r) {\n if (r==0 || p==0 || q==0)\n continue;\n\n long nom = r*p*q;\n long den = r*p + r*q + p*q;\n\n if (den != 0 && nom % den==0 && (nom^den)>=0) {\n long A = nom/den;\n\n if (A==nom) {\n As.add(A);\n System.out.printf(\"A=%d (p=%d, q=%d, r=%d)\\n\", A, p, q, r);\n }\n }\n }\n }\n }\n Long[] aa = As.toArray(new Long[As.size()]);\n Arrays.sort(aa);\n System.out.printf(\"============\\n\");\n System.out.printf(\"A(%d)=%s\\n\", aa.length, Arrays.toString(aa));\n\n for (long a = 1; a < 100; ++a) {\n if (isAlexandrian(a))\n System.out.printf(\"A=%dn\", a);\n }\n }",
"public static void main(String[] args) {\n\t\tint[] stones = {2, 4, 5, 3, 2, 1, 4, 2, 5, 1};\n\t\tint k = 3;\n\t\tSystem.out.println(solution(stones, k));\n\t}",
"private double solution() {\n final double h = (getTextToDouble(textX1) - getTextToDouble(textX0)) / ( 2*getTextToDouble(textN)) / 3;\n double[][] mass = xInitialization();\n double answer, evenSum = 0, oddSum = 0;\n for (int i = 0; i < 2; i++) {\n for (double element : mass[i]) {\n if (i == 0)\n oddSum += getValue(element);\n else\n evenSum += getValue(element);\n }\n }\n answer = h * (getValue(getTextToDouble(textX0)) + 4 * oddSum + 2 * evenSum + getValue(getTextToDouble(textX1)));\n return answer;\n }",
"@Override\n\tpublic void challenge9() {\n\n\t}",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tint N = sc.nextInt();\r\n\t\tint[] arr = new int[N+1];\r\n\t\tfor (int i = 1; i < arr.length; i++) {\r\n\t\t\tarr[i] = sc.nextInt();\r\n\t\t}\r\n\r\n\t\tint num = sc.nextInt();\r\n\r\n\t\tfor (int i = 0; i < num; i++) {\r\n\t\t\tint s = sc.nextInt(); // 성별\r\n\t\t\tint n = sc.nextInt(); // 받은 수\r\n\r\n\t\t\tif (s == 1) { // 남자\r\n\t\t\t\tfor (int j = 1; j < arr.length; j++) {\r\n\t\t\t\t\tif (j % n == 0) { // 자기가 받은 수의 배수이면\r\n\t\t\t\t\t\tarr[j] = Math.abs(arr[j] - 1); // 스위치 상태 변경\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else { // 여자\r\n\t\t\t\tarr[n] = Math.abs(arr[n] - 1); // 스위치 상태 변경\r\n\t\t\t\tint left = n - 1;\r\n\t\t\t\tint right = n + 1;\r\n\t\t\t\twhile (true) {\r\n\t\t\t\t\tif (left <= 0 || right >= arr.length || arr[left] != arr[right])\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tarr[left] = Math.abs(arr[left] - 1); // 스위치 상태 변경\r\n\t\t\t\t\tarr[right] = Math.abs(arr[right] - 1); // 스위치 상태 변경\r\n\t\t\t\t\tleft -= 1;\r\n\t\t\t\t\tright += 1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tfor (int i = 1; i < arr.length; i++) {\r\n\t\t\tSystem.out.print(arr[i] + \" \");\r\n\t\t\tif(i % 20 == 0) {\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public static void main(String[] args) throws IOException {\n Scanner sc = new Scanner(new File(\"A-small-attempt1.in\")) ;\n// FileOutputStream out = new FileOutputStream(\"output.txt\");\n// PrintWriter out = new PrintWriter(\"output.txt\");\n PrintWriter out = new PrintWriter(\"output.txt\");\n \n \n int TEST_CASE_NUMBER = sc.nextInt();\n \n for (int test_case = 1; test_case <= TEST_CASE_NUMBER; test_case++) \n {\n int MAX_SHYNESSS = sc.nextInt();\n String str = sc.next();\n \n int answer = 0;\n int sum = 0;\n char shift = '0';\n// System.out.println(str);\n for(int i = 0; i <= MAX_SHYNESSS; i++) \n {\n char element = str.charAt(i);\n int elementInt = element - shift;\n// System.out.println(element);\n// boolean flagChecked = false\n if(elementInt > 0) \n {\n \n if(i > sum) {\n answer += i - sum;\n sum += i -sum;\n// System.out.println(answer);\n }\n \n \n }\n sum += elementInt;\n// System.out.println(sum);\n }\n \n out.println(\"Case #\"+test_case+\": \"+answer);\n// System.out.println(\"____________________\");\n }\n \n out.close();\n }",
"public static int Main()\n\t{\n\t\tint n; //????\n\t\tint k;\n\t\tint i = 1;\n\t\tint j;\n\t\tn = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\tk = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\tint[] f = new int[n + 1]; //????\n\t\twhile (i > 0) //??????????\n\t\t{\n\t\t\tf[0] = (n - 1) * i; //?????\n\t\t\tfor (j = 1;j < n + 1;j++) //????\n\t\t\t{\n\t\t\t\tif (f[j - 1] % (n - 1) != 0)\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tf[j] = f[j - 1] * n / (n - 1) + k;\n\t\t\t}\n\t\t\tif (j == n + 1)\n\t\t\t{\n\t\t\t\tbreak; //???????\n\t\t\t}\n\t\t\ti = i + 1;\n\t\t}\n\t\tSystem.out.print(f[n]);\n\t\tSystem.out.print(\"\\n\");\n\t\treturn 0;\n\t}",
"public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n int n = in.nextInt();\n int k = in.nextInt();\n int q = in.nextInt();\n\n int a[] = new int[n];\n for(int a_i=0; a_i < n; a_i++){\n a[a_i] = in.nextInt();\n }\n\n int fist;\n int last;\n\n //brute force will get timeout\n for(int i = 0; i< k; i++){\n fist = a[0];\n last = a[n-1];\n a[0] = last;\n for (int j = 1; j<n; j++){\n last = a[j];\n a[j] = fist;\n fist = last;\n }\n }\n\n for(int a0 = 0; a0 < q; a0++){\n System.out.println(a[in.nextInt()]);\n }\n\n\n }",
"public static void main(String[] args) {\n\n\t\tScanner scan = new Scanner(System.in);\n\t\t\n\t\tSystem.out.println(\"XAC DINH SO HOAN HAO\");\n\t\tSystem.out.println();\n\t\t\n\t\tint j = 0;\n\t\twhile (j < j+1)\n\t\t{\n\t\tint number;//biến số nhập vào\n\t\t\n\t\tdo\n\t\t{\n\t\t//nhập số cần xác định\n\t\tSystem.out.print(\"Nhap so can xac dinh: \");\n\t\tnumber = scan.nextInt();\n\t\t}\n\t\twhile (number < 0); //bắt người dùng nhập số dương\n\t\t\n\t\t\n\t\tint i; //khai báo biến i dùng để thực hiện bài toán\n\t\tint sumDivisor = 0; //tổng các ước\n\t\t\n\t\tfor (i = 1; i < number ;i++ )\n\t\t{\n\t\t\tif (number % i == 0)\n\t\t\t{\n\t\t\t\tsumDivisor += i;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//xác định số đó có phải số hoàn hảo hay không\n\t\tif (sumDivisor == number)\n\t\t{\n\t\t\tSystem.out.println(number +\" La so hoan hao.\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(number + \" Khong phai la so hoan hao.\");\n\t\t}\n\t\tSystem.out.println();\n\t\t\n\t\t}\n\t}",
"public static int Main()\n\t{\n\t\t//????i???,j?,hang????????lie????num???????h????????l?????\n\t\tint i;\n\t\tint j;\n\t\tint[] h = new int[5];\n\t\tint[] l = new int[5];\n\t\tint hang = 0;\n\t\tint lie;\n\t\tint num;\n\t\tint[][] a = new int[5][5];\n\t\tfor (i = 0; i < 5; i++)\n\t\t{\n\t\t\tfor (j = 0; j < 5; j++)\n\t\t\t{\n\t\t\t\ta[i][j] = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\t\t}\n\t\t}\n\t\tfor (i = 0; i < 5; i++)\n\t\t{\n\t\t\th[i] = a[i][0]; //???????????????\n\t\t\tfor (j = 0; j < 5; j++)\n\t\t\t{\n\t\t\t\tif (a[i][j] > h[i])\n\t\t\t\t{\n\t\t\t\t\th[i] = a[i][j]; //??????h?????\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (j = 0; j < 5; j++)\n\t\t{\n\t\t\t\tl[j] = a[0][j];\n\t\t\t\tfor (i = 0; i < 5; i++)\n\t\t\t\t{\n\t\t\t\t\tif (a[i][j] < l[j])\n\t\t\t\t\t{\n\t\t\t\t\t\tl[j] = a[i][j]; //???l\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n\t\tfor (i = 0; i < 5; i++)\n\t\t{\n\t\t\tfor (j = 0; j < 5; j++) //??????\n\t\t\t{\n\t\t\t\t//??????????????????\n\t\t\t\tif ((a[i][j] == h[i]) && (a[i][j] == l[j]))\n\t\t\t\t{\n\t\t\t\t\thang = i + 1; //hang?i??,??hang????0\n\t\t\t\t\tlie = j + 1; //lie?j??\n\t\t\t\t\tnum = a[i][j]; //???a[i][j]\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (hang == 0) //??hang??0????????????\n\t\t{\n\t\t\tSystem.out.print(\"not found\");\n\t\t\tSystem.out.print(\"\\n\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//??????\n\t\t\tSystem.out.print(hang);\n\t\t\tSystem.out.print(\" \");\n\t\t\tSystem.out.print(lie);\n\t\t\tSystem.out.print(\" \");\n\t\t\tSystem.out.print(num);\n\t\t\tSystem.out.print(\"\\n\");\n\t\t}\n\n\t\treturn 0;\n\t}",
"public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\n\t\tint a[] = {2,1,3,-4,-2};\n\t\t//int a[] = {1 ,2, 3, 7, 5};\n\t\tboolean found = false;\n\t\t\n\t\t//this will solve in o n^2\n\t\tfor(int i = 0 ; i < a.length ; i++){\n\t\t\tint sum = 0;\n\t\t\tfor(int j = i ; j< a.length ; j++){\n\t\t\t\tsum += a[j] ;\n\t\t\t\tif(sum == 0){\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tif(found)\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t\n\t\t// link : https://www.youtube.com/watch?v=PSpuM9cimxA&list=PLKKfKV1b9e8ps6dD3QA5KFfHdiWj9cB1s&index=49\n\t\tSystem.out.println(found + \" found\");\n\t\tfound = false;\n\t\t//solving with O of N with the help sets\n\t\t// x + 0 = y\n\t\tSet<Integer> set = new HashSet<>();\n\t\tint sum = 0;\n\t\tfor(int element : a){\n\t\t\tset.add(sum);\n\t\t\tsum += element;\n\t\t\tif(set.contains(sum)){\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\tSystem.out.println(set);\n\t\t\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t\tfound = false;\n\t\t// when the sum of subarray is K\n\t\t\n\t\t//solving with O of N with the help sets\n\t\t//x + k = y >>>\n\t\tSet<Integer> set1 = new HashSet<>();\n\t\tint k = 12;\n\t\tint summ = 0;\n\t\tfor(int element : a){\n\t\t\tset1.add(summ);\n\t\t\tsumm += element;\n\t\t\tif(set1.contains(summ - k)){ // y - k = x(alredy presnt or not)\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(set1);\n\t\tSystem.out.println();\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t}",
"public static void main(String[] args) throws IOException{\n Reader sc = new Reader();\n \n int n=sc.nextInt();\n int m=sc.nextInt();\n \n int ans[]=new int[n];\n \n for(int i=0;i<m;i++)\n {\n int l=sc.nextInt();\n int r=sc.nextInt();\n // indexing is 1 based.\n l--;\n r--;\n \n ans[l]++;\n if(r!=n-1)\n {\n ans[r+1]--;\n \n } \n \n }\n \n int s=0;\n int max=0;\n for(int i=0;i<n;i++)\n {\n s+=ans[i];\n ans[i]=s;\n if(s>max)\n {\n max=s;\n }\n }\n \n int brr[]=new int[max+1];\n for(int i=0;i<n;i++)\n {\n brr[ans[i]]++;\n \n }\n \n s=0;\n for(int i=max;i>=0;i--)\n {\n s+=brr[i];\n brr[i]=s;\n \n }\n \n int q=sc.nextInt();\n for(int i=0;i<q;i++)\n {\n int x=sc.nextInt();\n if(x>max)\n {\n System.out.println(0);\n }\n else\n \tSystem.out.println(brr[x]);\n }\n \n\t}",
"public static void main(String[] args) {\n Homework1 hw1 = new Homework1();\n\n System.out.println(\"===Problem 1===\");\n hw1.problem1();\n\n System.out.println(\"===Problem 2===\");\n System.out.println(hw1.topInt(1.5));\n System.out.println(hw1.topInt(5.1));\n System.out.println(hw1.topInt(1.0));\n System.out.println(hw1.topInt(-4.2));\n\n\n System.out.println(\"===Problem 3===\");\n hw1.draw4x4('-');\n hw1.draw4x4('4');\n\n System.out.println(\"===Problem 4===\");\n System.out.println(hw1.citationName(\"Alastair\", \"Reynolds\"));\n System.out.println(hw1.citationName(\"Grace\", \"Hopper\"));\n\n System.out.println(\"===Problem 5===\");\n System.out.println(String.valueOf(hw1.min3(1.0, 2.0, 3.0)));\n System.out.println(String.valueOf(hw1.min3(4.0, 3.0, 2.0)));\n System.out.println(String.valueOf(hw1.min3(0.5, 0.1, 0.5)));\n \n System.out.println(\"===Problem 6===\");\n System.out.println(hw1.fibonacci(0));\n System.out.println(hw1.fibonacci(1));\n System.out.println(hw1.fibonacci(2));\n System.out.println(hw1.fibonacci(3));\n System.out.println(hw1.fibonacci(10));\n System.out.println(hw1.fibonacci(25));\n \n \n System.out.println(\"===Problem 7===\");\n //System.out.println(hw1.isPalindrome(\"racecar\"));\n //System.out.println(hw1.isPalindrome(\"cat\"));\n //System.out.println(hw1.isPalindrome(\"hannah\"));\n //System.out.println(hw1.isPalindrome(\"saippuakivikauppias\"));\n }",
"public void solution() {\n\t\t\n\t}",
"public static void main(String[] args) throws NumberFormatException, IOException {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\r\n\t\tString input = in.readLine();\r\n\t\tString[] temp = new String[3];\r\n\t\tInteger[] stats = new Integer[3];\r\n\t\ttemp = input.split(\" \");\r\n\t\tstats[0] = Integer.parseInt(temp[0]);\r\n\t\tstats[1] = Integer.parseInt(temp[1]);\r\n\t\tstats[2] = Integer.parseInt(temp[2]);\r\n\t\tint numberofholds = stats[0];\r\n\t\tint[] H = new int[stats[0] + 1];\r\n\t\tH[0] = 0;\r\n\t\tboolean possible = true;\r\n\t\tint M = stats[1];\r\n\t\tint E = stats[2];\r\n\t\tint distance;\r\n\t\tfor (int i = 1; i < numberofholds + 1; i++) {\r\n\t\t\tH[i] = Integer.parseInt(in.readLine());\r\n\t\t}\r\n\t\tfor (int i = 0; i < numberofholds; i++) {\r\n\t\t\tdistance = H[i + 1] - H[i];\r\n\t\t\tif (distance > M) {\r\n\t\t\t\tif (E > 0) {\r\n\t\t\t\t\tif (distance > M * 2) {\r\n\t\t\t\t\t\tpossible = false;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tE--;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tpossible = false;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (possible) {\r\n\t\t\tSystem.out.println(\"Too easy!\");\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"Unfair!\");\r\n\t\t}\r\n\t}",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n if (n == 1) \n System.out.println(\"Kaprekar number\");\n // Count number of digits in square \n int sq_n = n * n; \n int count_digits = 0; \n int sum=0;\n while (sq_n != 0) \n { \n count_digits++; \n sq_n /= 10; \n } \n sq_n = n*n; // Recompute square as it was changed \n // Split the square at different poitns and see if sum \n // of any pair of splitted numbers is equal to n. \n for (int r_digits=1; r_digits<count_digits; r_digits++) \n { \n int eq_parts = (int) Math.pow(10, r_digits); \n \n // To avoid numbers like 10, 100, 1000 (These are not \n // Karprekar numbers \n if (eq_parts == n) \n continue; \n \n // Find sum of current parts and compare with n \n sum = sq_n/eq_parts + sq_n % eq_parts; \n }\n if (sum == n){\n System.out.println(\"Kaprekar number\");\n }else{\n System.out.println(\"Not a Kaprekar number\");\n }\n }",
"public void calcS(){\n if (n.subtract(one).mod(new BigNumber(\"2\")).compareTo(zero)!=0){\n s=zero;\n return;\n }\n while(n.subtract(one).mod(pow(two,s)).compareTo(zero)!=0){\n //System.out.println(s);\n s=s.add(one);\n }\n s=s.subtract(one);\n }",
"static int theLoveLetterMystery(String s) {\n char[] a = s.toCharArray();\n\n int i=0;\n int j=a.length-1;\n int cost=0;\n for(;i<j;i++,j--){\n\n if(a[i]<a[j]){\n cost+=a[j]-a[i];\n a[j]=a[i];\n \n }\n else{\n if(a[i]>a[j]){\n cost+=a[i]-a[j];\n a[i]=a[j];\n \n }\n }\n\n }\n\n System.out.println(\"\");\n\nreturn cost;\n }",
"public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\t int a = 0;\n\t\t a=scan.nextInt();\n\t\t int [] arr=new int[a+1];\n\t\t arr[1]=arr[2]=1;\n\t\t for(int i=3;i<arr.length;i++){\n\t\t arr[i]=(arr[i-1]+arr[i-2])%10007;//对每一个斐波那契数列进行取余数\n\t\t }\n\t\t System.out.println(arr[a]);\n\t\t }",
"public static void main(String[] args) throws IOException {\n BufferedReader f = new BufferedReader(new FileReader(\"whereami.in\"));\n PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(\"whereami.out\")));\n\n //reads in and initializes n and k values\n StringTokenizer st = new StringTokenizer(f.readLine());\n int stringSize = Integer.parseInt(st.nextToken());\n\n st = new StringTokenizer(f.readLine());\n //initializes variable for input string\n String string = st.nextToken();\n\n //computes all subsequences and adds to set\n subsequence(string, string.length());\n\n boolean[] checks= new boolean[stringSize];\n\n int smallestSize = 0;\n\n for (int i = 0; i < stringSize; i++) {\n checks[i] = true;\n for (String s : subSequences) {\n if (s.length() == i + 1 && numberOccurrences(string, s) != 1) {\n checks[s.length() - 1] = false;\n }\n }\n if (checks[i] == true) {\n smallestSize = i + 1;\n break;\n }\n }\n\n out.println(smallestSize);\n out.close();\n }",
"private int hashFunc2(String word) {\n int hashVal = word.hashCode();\n hashVal = hashVal % arraySize;\n\n if (hashVal < 0) {\n hashVal += arraySize;\n }\n\n // Research shows that you can use a Prime number Less than the array size to calculate the step value.\n // Prime Number 3 arbitrarily chosen.\n return 3 - hashVal % 3;\n }",
"private static int solution4(String s) {\r\n int n = s.length(), ans = 0;\r\n Map<Character, Integer> map = new HashMap<>();\r\n for (int j = 0, i = 0; j < n; j++) {\r\n if (map.containsKey(s.charAt(j)))\r\n i = Math.max(map.get(s.charAt(j)), i);\r\n ans = Math.max(ans, j - i + 1);\r\n map.put(s.charAt(j), j + 1);\r\n }\r\n return ans;\r\n }",
"public static int solution(int[] l) {\n // remainder 1 mod 3\n final List<Integer> r1 = new ArrayList<>();\n // remainder 2 mod 3\n final List<Integer> r2 = new ArrayList<>();\n // remainder 0 mod 3;\n final List<Integer> r0 = new ArrayList<>();\n int total = 0;\n for (int num : l) {\n if (num % 3 == 0) {\n r0.add(num);\n } else if (num % 3 == 1) {\n r1.add(num);\n } else {\n r2.add(num);\n }\n total = (total + num) % 3;\n }\n final List<Integer> ok = new ArrayList<>(r0);\n if (total == 0) {\n ok.addAll(r1);\n ok.addAll(r2);\n } else if (total == 1) {\n Collections.sort(r1);\n Collections.sort(r2);\n if (!r1.isEmpty()) {\n for (int i = 1; i < r1.size(); i++) { ok.add(r1.get(i)); }\n ok.addAll(r2);\n } else {\n for (int i = 2; i < r2.size(); i++) { ok.add(r2.get(i)); }\n }\n } else if (total == 2) {\n Collections.sort(r1);\n Collections.sort(r2);\n if (!r2.isEmpty()) {\n for (int i = 1; i < r2.size(); i++) { ok.add(r2.get(i)); }\n ok.addAll(r1);\n } else {\n for (int i = 2; i < r1.size(); i++) { ok.add(r1.get(i)); }\n }\n }\n ok.sort(Collections.reverseOrder());\n int res = 0;\n for (int num : ok) {\n res = res * 10 + num;\n }\n return res;\n }",
"public static void main(String[] args) {\n\n Scanner sc=new Scanner(System.in);\n System.out.println(\"Nhập số lượng phần tử trong mảng: \");\n int n=sc.nextInt();\n int []a=new int[n];\n\n for(int i=0;i<n;i++) {\n System.out.println(\"Nhập phần tử thứ \"+i+\": \");\n a[i]=sc.nextInt();\n }\n\n Arrays.sort(a);\n System.out.println(\"Mảng sau khi xắp xếp là: \");\n for(int i=0;i<n;i++) {\n System.out.print(\" \" +a[i]+\" \" );\n\n }\n int min=a[0];\n for(int j=0;j<n;j++) {\n min = Math.min(min, a[j]);\n }\n System.out.println();\n System.out.println(\"số nhỏ nhất trong mảng là: \"+ min);\n\n int dem=0,tong=0;\n for(int i=0; i<n;i++)\n {\n if (a[i]%3==0) {\n dem++;\n tong=tong+a[i];\n }\n }\n System.out.println(\"Trung bình cộng các phần tử chia hết cho 3 là: \"+tong/dem);\n\n }",
"public static int Main()\n\t{\n\t\tint m;\n\t\tint n;\n\t\tint a;\n\t\tint b;\n\t\tint r;\n\t\tint i;\n\t\tm = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\tn = m / 2;\n\t\tfor (a = 3; a <= n; a = a + 2)\n\t\t{\n\t\t\tr = Math.ceil(Math.sqrt(a)); //?a????\n\t\t\tfor (i = 2; i <= r; i++)\n\t\t\t{\n\t\t\t\tif ((a % i) == 0)\n\t\t\t\t{\n\t\t\t\t\tbreak; //??????\n\t\t\t\t}\n\t\t\t}\n\t\t\t\tif (i == r + 1)\n\t\t\t\t{\n\t\t\t\t\tb = m - a;\n\t\t\t\t\tr = Math.ceil(Math.sqrt(b)); //?b????\n\t\t\t\t\tfor (i = 2; i <= r; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ((b % i) == 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbreak; //??????\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\tif (i == r + 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSystem.out.print(a);\n\t\t\t\t\t\t\tSystem.out.print(' ');\n\t\t\t\t\t\t\tSystem.out.print(b);\n\t\t\t\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}",
"public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n int n = in.nextInt();\n int k = in.nextInt();\n ArrayList<Integer> list = new ArrayList<>();\n for(int arr_i=0; arr_i < n; arr_i++){\n int integer = in.nextInt();\n list.add(new Integer(integer));\n }\n in.close();\n\n\n\n if(k == 1){\n System.out.println(k);\n return;\n }\n\n for(int i = 0;i < list.size();i ++){\n int x = list.get(i) % k;\n list.set(i, x);\n }\n\n int[] kx = new int[k];\n for(int i = 0;i < k;i ++){\n kx[i] = 0;\n }\n for(int i = 0;i < list.size();i ++){\n int x = list.get(i);\n kx[x] ++;\n }\n\n\n int num = 0;\n int A = 0;\n if(k % 2 == 0){\n A = k / 2 - 1;\n }else{\n A = k / 2;\n }\n if(kx[0] != 0){\n num += 2;\n }\n for(int i = 1; i <= A;i ++){\n if(kx[i] >= kx[k - i]){\n num += kx[i];\n }else {\n\n num += kx[k - i];\n }\n\n }\n System.out.println(num);\n }",
"@Override\n\tpublic void challenge17() {\n\n\t}",
"private static int betterSolution(int n) {\n return n*n*n;\n }",
"public static int Main()\n\t{\n\t\ts = (String)malloc(100000 * (Character.SIZE / Byte.SIZE));\n\t\tint[] count = new int[26];\n\t\tint[] p = new int[26];\n\t\tint n;\n\t\tchar cc;\n\t\tchar key = '-';\n\t\tint min = 100001;\n\t\tint i;\n\t\tString tempVar = ConsoleInput.scanfRead();\n\t\tif (tempVar != null)\n\t\t{\n\t\t\tn = Integer.parseInt(tempVar);\n\t\t}\n\t\tString tempVar2 = ConsoleInput.scanfRead(null, 1);\n\t\tif (tempVar2 != null)\n\t\t{\n\t\t\tcc = tempVar2.charAt(0);\n\t\t}\n\n\t\twhile (n-- != 0)\n\t\t{\n\t\t\ts = new Scanner(System.in).nextLine();\n\t\t\tfor (i = 0;i < 26;i++)\n\t\t\t{\n\t\t\t\tcount[i] = 0;\n\t\t\t\tp[i] = 100001;\n\t\t\t}\n\t\t\tfor (i = 0;i < s.length();i++)\n\t\t\t{\n\t\t\t\tcount[*(s.Substring(i)) - 'a']++;\n\t\t\t\tif (p[*(s.Substring(i)) - 'a'] > i)\n\t\t\t\t{\n\t\t\t\t\tp[*(s.Substring(i)) - 'a'] = i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tkey = '-';\n\t\t\tmin = 100001;\n\t\t\tfor (i = 0;i < 26;i++)\n\t\t\t{\n\t\t\t\tif (count[i] == 1 && p[i] < min)\n\t\t\t\t{\n\t\t\t\t\tkey = 'a' + i;\n\t\t\t\t\tmin = p[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (key == '-')\n\t\t\t{\n\t\t\t\tSystem.out.print(\"no\\n\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.out.printf(\"%c\\n\",key);\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\t}",
"public static void main(String args[]) throws IOException {\n Scanner sc=new Scanner (System.in);\r\n int t= sc.nextInt();\r\n while(t-->0)\r\n {\r\n int s=0;\r\n int n=sc.nextInt();\r\n for (int i=1; i<n;i++)\r\n {\r\n if(n%i==0)\r\n {\r\n s=s+i;\r\n }\r\n }\r\n if(s==n)\r\n {\r\n System.out.println(\"true\");\r\n }else {\r\n System.out.println(\"false\");\r\n }\r\n }\r\n }",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int k = sc.nextInt();\n int[] array = new int[n];\n for(int i = 0 ; i < n ; i++)\n array[i] = sc.nextInt();\n int bCharged = sc.nextInt();\n int sum = Arrays.stream(array).sum();\n int bActual = (sum - array[k]) / 2;\n if(bCharged <= bActual)\n System.out.println(\"Bon Appetit\");\n else\n System.out.println(bCharged - bActual);\n }",
"public static int Main()\n\t{\n\t\tint[] num = new int[16];\n\t\tint i;\n\t\tint k;\n\t\tint j;\n\t\tint count;\n\t\tfor (;;) //????\n\t\t{\n\t\t\ti = -1; //?????i?count\n\t\t\tcount = 0;\n\t\t\tdo\n\t\t\t{\n\t\t\t\ti++;\n\t\t\t\tnum[i] = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\t\t\tif (num[0] == -1) //?????????-1???\n\t\t\t\t{\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t} while (num[i] != 0); //????0??\n\t\t\tfor (j = 0 ; j <= i - 1 ; j++)\n\t\t\t{\n\t\t\t\tfor (k = j ; k <= i - 1 ; k++)\n\t\t\t\t{\n\t\t\t\t\tif ((num[j] == 2 * num[k]) || (num[j] * 2 == num[k])) //????\n\t\t\t\t\t{\n\t\t\t\t\t\tcount++; //??\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.print(count);\n\t\t\tSystem.out.print(\"\\n\");\n\t\t}\n\t}",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tint a = sc.nextInt();\r\n\t\tfor (int i = 0; i < a; i++) {\r\n\t\t\tint n = sc.nextInt();\r\n\t\t\tint m = sc.nextInt();\r\n\t\t\tint J = 4 * n - m;\r\n\t\t\tint T = m - 2 * n;\r\n\r\n\t\t\tif (J % 2 == 0 && T % 2 == 0 && J >= 0 && T >= 0)\r\n\t\t\t\tSystem.out.println(String.format(\"%d %d\", J / 2, T / 2));\r\n\t\t\telse\r\n\t\t\t\tSystem.out.println(\"No answer\");\r\n\r\n\t\t}\r\n\t}",
"public static void main(String[] args) {\n\t\tint n=3;\n\t\tString s=\"1\";\n\t\tint count =1;\n\t\tint k=1;\n\t\twhile(k<n){\n\t\t\tStringBuilder t=new StringBuilder();\n\t\t\t//t.append(s.charAt(0));\n\t\t\tfor(int i=1;i<=s.length();i++){\n\t\t\t\t\t\t\t\t\n\t\t\t\tif(i==s.length() || s.charAt(i-1)!=s.charAt(i)){\n\t\t\t\t\tt.append(count); t.append(s.charAt(i-1));\n\t\t\t\t\tcount=1;\n\t\t\t\t}\n\t\t\t\telse if(s.charAt(i-1)==s.charAt(i)){count=count+1;}\n\t\t\t }\t\n\t\t\t\ts=t.toString();\n\t\t\t\tk=k+1;\n\t\t\t\tSystem.out.println(\"k:\"+k);\n\n\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(s);\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t}",
"@Override\n\tpublic void challenge11() {\n\n\t}",
"public static int smallStraightYahtzee(int... result) {\n\n Arrays.sort(result);\n\n int[] uniqueValues = IntStream.of(result).distinct().sorted().toArray();\n long noUniqVals = IntStream.of(uniqueValues).distinct().count();\n\n int score = 0;\n\n if (noUniqVals >= 4) {\n\n ArrayList<int[]> matchArrays = new ArrayList<>();\n matchArrays.add(new int[] {1, 2, 3, 4});\n matchArrays.add(new int[] {2, 3, 4, 5});\n matchArrays.add(new int[] {3, 4, 5, 6});\n\n ArrayList<int[]> resultSubArrays = new ArrayList<>();\n for (int i = 0; i < noUniqVals - 3; i++) {\n int[] testArr = Arrays.copyOfRange(uniqueValues, i, i + 4);\n resultSubArrays.add(testArr);\n }\n\n for (int[] arr : resultSubArrays) {\n for (int[] match : matchArrays) {\n if (Arrays.equals(arr, match)) {\n score = 30;\n }\n }\n }\n }\n return score;\n }",
"public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n int n = scanner.nextInt();\n int c = 0;\n int p = 0;\n int prev = 0;\n while (n-- > 0) {\n int a = scanner.nextInt();\n if (p == 0 ) {\n p = 1;\n } else if (prev != a - 1) {\n if (p >= 3) c+= p - 2;\n p = 1;\n } else if (prev == a - 1) {\n p++;\n }\n prev = a;\n }\n if (p >= 3) c+= p - 2;\n System.out.print(c);\n }",
"public static void main(String[] args) throws Exception {\n BufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n int t = Integer.parseInt(in.readLine());int j=0,k=0; int res1=0, res2=0; \n for(int p=0;p<t;p++){\n int m = Integer.parseInt(in.readLine());\n int n = Integer.parseInt(in.readLine());\n String[] str=in.readLine().split(\" \");\n int[] num = new int[n];\n for(int i=0;i<n;i++){\n num[i] = Integer.parseInt(str[i]);\n }\n for(j=0;j<n;j++){\n for(k=j+1;k<n;k++){\n \tint tmp = num[j]+num[k];\n if(m==tmp){res1=j+1;res2=k+1; break;}\n }\n }\n System.out.println(res1+\" \"+res2);\n j=0;k=0;\n }\n }",
"public static void main (String[] args) throws java.lang.Exception\n\t{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint t =sc.nextInt();\n\t\t\n\t\twhile(t!=0){\n\t\t \n\t\t int n = sc.nextInt();\n\t\t int sum = 3;\n\t\t int ans = 0;\n\t\t \n\t\t if(n==2){\n\t\t System.out.println(1);\n\t\t //break;\n\t\t }\n\t\t \n\t\t else{\n\t\t \n\t\t for(int i=3; i<=n; i++){\n\t\t int nsum = sum + i; //6\n\t\t \n\t\t if(nsum % 2 == 0){\n\t\t ans = i;\n\t\t }\n\t\t else{\n\t\t ans = i-1;\n\t\t }\n\t\t \n\t\t sum = nsum;\n\t\t }\n\t\t \n\t\t \n\t\t System.out.println(ans);\n\t\t \n\t\t }\n\n\t\t \n\t\t t--;\n\t\t}\n\t}",
"public static void main(String[] args) throws IOException {\n BufferedReader f = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));\n int n = Integer.parseInt(f.readLine());\n HashSet<String> res = new HashSet<>();\n for(int i = 0; i < n; i++) {\n StringTokenizer st = new StringTokenizer(f.readLine());\n int k = Integer.parseInt(st.nextToken());\n int b = -Integer.parseInt(st.nextToken());\n if(k == 0) {\n continue;\n }\n if(k < 0) {\n k = -k;\n b = -b;\n }\n int gcd = gcd(k, Math.abs(b));\n k /= gcd;\n b /= gcd;\n res.add(b+\"/\"+k);\n }\n out.println(res.size());\n f.close();\n out.close();\n }",
"static int yeusOptimized(){\n for(int x=9;x>=0;--x){\tint a=x*100001; //Setting up palindrome. 100001 * 9 = 900009\n for(int y=9;y>=0;--y){\tint b=a+y*10010; //Setting up the inner numbers so 10010*9. 90090 + 900009 = 990099\n for(int z=9;z>=0;--z){\tint n=b+z*1100; //Final inner numbers 9900+990099 = 999999 Palindrome\n for(int i=990;i>99;i-=11){ //Since we start with the largest palindrome, we just need to make sure it is a factor of two 3 digit numbers.\n if(n%i==0){//If there is a remainder, i isn't a factor.\n int t=n/i; //t is the palindrome divided by the factor to get the other factor\n if(t<1000)return n; //make sure that other factor was also a 3 digit number (only one check since we're starting from the maximum possible values)\n }}}}} //And return the palindrome\n return 0;}",
"public static int Main()\n\t{\n\tint[] b = new int[12];\n\tint w;\n\tint i;\n\tint[] a = {13, 44, 72, 103, 133, 164, 194, 225, 256, 286, 317, 347};\n\tString tempVar = ConsoleInput.scanfRead();\n\tif (tempVar != null)\n\t{\n\t\tw = Integer.parseInt(tempVar);\n\t}\n\tfor (i = 0;i < 12;i++)\n\t{\n\t\tb[i] = a[i] % 7 - 1;\n\t\tb[i] = (b[i] + w) % 7;\n\t}\n\tfor (i = 0;i < 12;i++)\n\t{\n\t\tif (b[i] == 5)\n\t\t{\n\t\t\tSystem.out.printf(\"%d\\n\",i + 1);\n\t\t}\n\t}\n\treturn 0;\n\t}",
"public static void main(String[] args) {\n int N, Q;\n int a, x, y;\n int lastAnswer = 0;\n\n Scanner sc = new Scanner(System.in);\n N = sc.nextInt();\n Q = sc.nextInt();\n\n ArrayList<ArrayList<Integer>> seqList = new ArrayList<ArrayList<Integer>>(N);\n ArrayList<Integer> seq;\n for (int i = 0; i < N; i++) {\n seq = new ArrayList<Integer>();\n seqList.add(seq);\n }\n for (int i = 0; i < Q; i++) {\n seq = new ArrayList<Integer>();\n a = sc.nextInt();\n x = sc.nextInt();\n y = sc.nextInt();\n\n seq = seqList.get((x ^ lastAnswer) % N);\n if (a == 1) {\n seq.add(y);\n } else if(a == 2) {\n lastAnswer = seq.get(y % seq.size());\n System.out.println(lastAnswer);\n }\n\n }\n }",
"private static int solution2(String s) {\r\n int n = s.length();\r\n int ans = 0;\r\n for (int i = 0; i < n; i++)\r\n for (int j = i + 1; j <= n; j++)\r\n if (allUnique(s, i, j)) ans = Math.max(ans, j - i);\r\n return ans;\r\n }",
"private static int lucas_cost(int n, double v) {\r\n\t\tint c, d, e, r;\r\n\r\n\t\td = n;\r\n\t\tr = (int) ((double) d / v + 0.5);\r\n\t\tif (r >= n)\r\n\t\t\treturn (ADD * n);\r\n\t\td = n - r;\r\n\t\te = 2 * r - n;\r\n\t\tc = DUP + ADD; /* initial duplicate and final addition */\r\n\t\twhile (d != e) {\r\n\t\t\tif (d < e) {\r\n\t\t\t\tr = d;\r\n\t\t\t\td = e;\r\n\t\t\t\te = r;\r\n\t\t\t}\r\n\t\t\tif (4 * d <= 5 * e && ((d + e) % 3) == 0) { /* condition 1 */\r\n\t\t\t\tr = (2 * d - e) / 3;\r\n\t\t\t\te = (2 * e - d) / 3;\r\n\t\t\t\td = r;\r\n\t\t\t\tc += 3 * ADD; /* 3 additions */\r\n\t\t\t} else if (4 * d <= 5 * e && (d - e) % 6 == 0) { /* condition 2 */\r\n\t\t\t\td = (d - e) / 2;\r\n\t\t\t\tc += ADD + DUP; /* one addition, one duplicate */\r\n\t\t\t} else if (d <= (4 * e)) { /* condition 3 */\r\n\t\t\t\td -= e;\r\n\t\t\t\tc += ADD; /* one addition */\r\n\t\t\t} else if ((d + e) % 2 == 0) { /* condition 4 */\r\n\t\t\t\td = (d - e) / 2;\r\n\t\t\t\tc += ADD + DUP; /* one addition, one duplicate */\r\n\t\t\t} else if (d % 2 == 0) { /* condition 5 */\r\n\t\t\t\td /= 2;\r\n\t\t\t\tc += ADD + DUP; /* one addition, one duplicate */\r\n\t\t\t} else if (d % 3 == 0) { /* condition 6 */\r\n\t\t\t\td = d / 3 - e;\r\n\t\t\t\tc += 3 * ADD + DUP; /* three additions, one duplicate */\r\n\t\t\t} else if ((d + e) % 3 == 0) { /* condition 7 */\r\n\t\t\t\td = (d - 2 * e) / 3;\r\n\t\t\t\tc += 3 * ADD + DUP; /* three additions, one duplicate */\r\n\t\t\t} else if ((d - e) % 3 == 0) { /* condition 8 */\r\n\t\t\t\td = (d - e) / 3;\r\n\t\t\t\tc += 3 * ADD + DUP; /* three additions, one duplicate */\r\n\t\t\t} else if (e % 2 == 0) { /* condition 9 */\r\n\t\t\t\te /= 2;\r\n\t\t\t\tc += ADD + DUP; /* one addition, one duplicate */\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn (c);\r\n\t}",
"@Override\n\tpublic void challenge8() {\n\n\t}",
"private void hailstoneSeq() {\r\n\t\tint evenCount = 0; //number of times the even operation is used\r\n\t\tint oddCount = 0; //number of times the of operation is used\r\n\t\t\r\n\t\tint num = readInt(\"Enter a number:\");\r\n\t\t\r\n\t\twhile(num != 1) {\r\n\t\t\t//even numbers\r\n\t\t\tif(num % 2 == 0) { \r\n\t\t\t\tprintln(num + \" is even, so I take half: \" + (num/2));\r\n\t\t\t\tnum = num / 2;\r\n\t\t\t\tevenCount += 1;\r\n\t\t\t\t\r\n\t\t\t\tif(num == 1) { \r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t\t//odd numbers\r\n\t\t\tif(num % 2 != 0) { \r\n\t\t\t\tprintln(num + \" is odd, so I make 3n + 1: \" + (3 * num + 1));\r\n\t\t\t\tnum = 3 * num + 1;\r\n\t\t\t\toddCount += 1;\r\n\t\t\t\t\r\n\t\t\t\tif(num == 1) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//determining the number of steps to reach number 1\r\n\t\tint totalCount = evenCount + oddCount;\r\n\t\tprintln(\"It took \" + totalCount + \" steps to reach 1.\");\r\n\t}",
"public static int tower(int... result) {\n\n int score = nSame(4, 6, result);\n int firstMatch = score/4;\n\n result = IntStream.of(result).filter(val -> val != firstMatch).toArray();\n score = nSame(2, 6, result);\n int secondMatch = score/2;\n\n if (firstMatch*secondMatch > 0) {\n score = 4*firstMatch + 2*secondMatch;\n } else {\n score = 0;\n }\n\n return score;\n }",
"public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new FileReader(\"superbull.in\"));\n PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(\"superbull.out\")));\n //Only in a tree is the winner condition(as stated in problem) satisfied\n int N = Integer.parseInt(br.readLine());\n \n long ret = 0;\n \n int[] nums = new int[N];\n for(int i = 0; i<N; i++) nums[i] = Integer.parseInt(br.readLine());\n int[] prims = new int[N]; //for dense graphs: N edges each. Loop thru edges anyways, so selection sort remove log factor\n Arrays.fill(prims, Integer.MIN_VALUE);\n prims[0] = -1;\n int curr = 0;\n \n for(int i = 0; i<N-1; i++){\n int max = Integer.MIN_VALUE;\n int next = -1;\n for(int j = 0; j<N; j++){\n if(prims[j] == -1) continue;\n \n int xor = nums[curr]^nums[j];\n prims[j] = Math.max(prims[j], xor);\n \n if(prims[j] > max){\n next = j;\n max = prims[j];\n }\n }\n ret += max;\n prims[next] = -1;\n curr = next;\n }\n pw.println(ret);\n pw.close();\n br.close();\n }",
"public static int hammingWeight(int n) {\n if(n == 0) return 0;\n\n String s = n + \"\";\n int counter = 0;\n char[] chars = s.toCharArray();\n for(int i = 0; i < chars.length; i++)\n {\n if(chars[i] == '1')\n {\n counter++;\n }\n }\n return counter;\n }",
"static int hireAssistant(int tab[]) {\n int best = 0;\n for(int i = 0; i<tab.length; i++) {\n if(tab[i] > best)\n best = tab[i];\n }\n return best;\n }",
"static String solve(String puzzle, String delimiter) {\n char cc = 0; // Current character\n\n // Melakukan iterasi ke dalam string dan menyimpan alfabet ke dalam cc\n for (int i = 0; i < puzzle.length(); i++) {\n if (isAlphabetic(puzzle.charAt(i))) {\n cc = puzzle.charAt(i);\n break;\n }\n }\n\n if (cc == 0) {\n // Jika seluruh karakter dalam string sudah diganti dengan digit angka, maka akan dilakukan pengujian\n // terhadap kombinasi angka\n\n totalTest++; // Menghitung total tes yang dilakukan untuk menemukan kombinasi angka yang benar\n String[] operands = puzzle.split(delimiter);\n int op1 = check(operands[0]);\n int op2 = check(operands[1]);\n if (op1 == op2) {\n return puzzle;\n } else {\n return \"\";\n }\n } else {\n // Buat array of numbers [0..9] untuk menyimpan angka-angka yang sudah digunakan\n boolean[] numbers = new boolean[10];\n\n // Melakukan iterasi ke dalam string untuk menandai angka-angka yang sudah digunakan\n for (int i = 0; i < puzzle.length(); i++)\n if (isDigit(puzzle.charAt(i)))\n numbers[puzzle.charAt(i) - '0'] = true;\n\n for (int i = 0; i < 10; i++) {\n if (!numbers[i]) {\n\n // Melakukan substitusi alfabet dengan angka sampai ketemu kombinasi angka yang sesuai\n String solution = solve(puzzle.replaceAll(String.valueOf(cc),\n String.valueOf(i)), delimiter);\n\n // Jika kombinasi angka sudah teruji benar secara matematis,\n // kita akan cek apakah ada angka 0 di depan\n if (!solution.isEmpty()) {\n String[] split = solution.split(\"\\n\");\n boolean zeroAtLeft = false;\n\n for (int j = 0; j < split.length; j++){\n split[j] = split[j].trim();\n if (split[j].charAt(0) == '0'){\n zeroAtLeft = true;\n break;\n }\n }\n // Jika tidak ada angka 0 di depan, solusi ditemukan dan di-return ke main\n if (!zeroAtLeft) {\n return solution;\n }\n }\n }\n }\n }\n return \"\";\n }",
"public static void main(String[] args) throws IOException{\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n int T = Integer.parseInt(br.readLine());\n for(int a=0;a<T;a++)\n {\n String p = br.readLine();\n String s[] = p.split(\" \");\n int m = Integer.parseInt(s[0]);\n int n = Integer.parseInt(s[1]);\n int count=0;\n while(true)\n {\n if(m%2 != n%2)\n {\n count++;\n }\n m=m>>1;\n n=n>>1;\n if(m==0 && n==0)\n {\n break;\n }\n }\n System.out.println(count);\n }\n }",
"public static void main(String[] args)\n\t{\n\t\tSloution6 an =new Sloution6();\n\t\t//Test case1;\n\t\tint[] src = {0,1};\n\t\tint[] ret = an.sortArrayByParity1(src);\n\t\tfor(int ch:ret)\n\t\tSystem.out.println(ch);\n\t}",
"public static void main(String[] args) {\n\t\t Scanner sc = new Scanner(System.in);\r\n\t // Write your code here\r\n\t int t=sc.nextInt();\r\n\t while(t-->0)\r\n\t {\r\n\t int x=sc.nextInt();\r\n\t int k=sc.nextInt();\r\n\t while(x!=0)\r\n\t {\r\n\t if(x%k!=0)\r\n\t {\r\n\t x--;\r\n\t if(x%k!=0)\r\n\t {\r\n\t System.out.println(\"NO\");\r\n\t break;\r\n\t }\r\n\t else\r\n\t x=x/k;\r\n\t }\r\n\t else\r\n\t x=x/k;\r\n\t if(x==0)\r\n\t\t \t System.out.println(\"YES\");\r\n\t }\r\n\t }\r\n\t \r\n\t \r\n\t}",
"public static int Main()\n\t{\n\t\t//cout << \"?????????n\" << endl;\n\t\tint n; //n????????a,b,c???,y??????x??????\n\t\tint a;\n\t\tint b;\n\t\tint c;\n\t\tint y;\n\t\tint x;\n\t\tint z;\n\t\tn = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\tfor (int i = 1; i <= n; i++) //n???\n\t\t{\n\t\t\tx = 0;\n\t\t\ty = 0;\n\t\t\ta = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\t\tb = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\t\tc = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\t\tif (b > c) //?b??c\n\t\t\t{\n\t\t\t\tz = c;\n\t\t\t\tc = b;\n\t\t\t\tb = z;\n\t\t\t}\n\t\t\tif ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0)) //????\n\t\t\t{\n\t\t\t\ty = 1;\n\t\t\t}\n\t\t\tfor (; b <= c - 1; b++) //??????\n\t\t\t{\n\t\t\t\tswitch (b)\n\t\t\t\t{\n\t\t\t\tcase 1 :\n\t\t\t\tcase 3 :\n\t\t\t\tcase 5 :\n\t\t\t\tcase 7 :\n\t\t\t\tcase 8 :\n\t\t\t\tcase 10 :\n\t\t\t\tcase 12 :\n\t\t\t\t\tx = x + 31;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4 :\n\t\t\t\tcase 6 :\n\t\t\t\tcase 9 :\n\t\t\t\tcase 11 :\n\t\t\t\t\tx = x + 30;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2 :\n\t\t\t\t\tx = x + 28 + y;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (x % 7 == 0) //??????????\n\t\t\t{\n\t\t\t\tSystem.out.print(\"YES\");\n\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.out.print(\"NO\");\n\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\t}",
"public static void main(String[] args) {\nScanner s =new Scanner(System.in);\r\nint n=s.nextInt();\r\nfor(int i=n;i>=0;i--)\r\n{ int a=n;\r\n for(int j=n;j>=i;j--)\r\n {System.out.print(a+\" \");a--;}\r\n a=a+1;\r\n for(int k=1;k<=2*i-1;k++)\r\n {System.out.print(\" \"+\" \");}\r\n if(a!=0) {\r\n for(int l=n;l>=i;l--)\r\n {System.out.print(a+\" \");a++;}\r\n }\r\n else {for(int m=1;m<=n;m++)\r\n {System.out.print(m+\" \");}\r\n }\r\n System.out.print(\"\\n\");\r\n}\r\nfor(int x=1;x<=n;x++)\r\n{ int c=n;\r\n for(int y=n;y>=x;y--)\r\n {System.out.print(c+\" \");c--;}\r\n c=c+1;\r\n for(int z=1;z<=2*x-1;z++)\r\n {System.out.print(\" \"+\" \");}\r\n for(int p=x;p<=n;p++)\r\n {System.out.print(c+\" \");c++;}\r\n \r\n\t\r\nSystem.out.print(\"\\n\");\r\n\r\n\r\n}\r\n}",
"public static void main(String[] args) {\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\t\t//사람의 수 -> n\n\t\tint n = sc.nextInt();\n\t\t//놀이기구의 수 -> m\n\t\tint m = sc.nextInt();\n\t\t//play에 개수를 넣는다.\n\t/*\tdouble[] play =new double[m];*/\n\t\tdouble[] play = new double[10001];\n\t\t//운행시간\n\t\tint time;\n\t\tdouble lo=0, hi=2e9*31, mid, sum;\n\t\tfor(int i=1; i<m; i++) {\n\t\t\tplay[i]=i;\n\t\t}\n\t\t//놀이기구보다 사람 수가 적으면 n을 출력한다. 마지막으로 탄 아이의 놀이기구 번호는 자기의 번호이다.\n\t\tif(n<=m) {\n\t\t\tSystem.out.println(n);\n\t\t}\n\t\t\n\n\t\twhile(lo+1!=hi) {\n\t\t\tmid =(lo+hi)/2;\n\t\t\t\n\t\t\tsum=m;\n\t\t\tfor(int i=0; i<m;i++) {\n\t\t\t\tsum +=mid/play[i];\n\t\t\t}\n\t\t\tif(sum>=n) hi =mid;\n\t\t\telse lo= mid;\n\t\t}\n\t\t\n\t\tsum= m;\n\t\tfor(int i=0; i<m; i++)\n\t\t\tsum +=lo/play[i];\n\t\t\n\t\tif(sum>=n) {\n\t\t\tlo--;\n\t\t\tsum=m;\n\t\t\tfor(int i=0; i<m; i++)\n\t\t\t\tsum+=lo/play[i];\n\t\t}\n\t\t\n\t\tlo++;\n\t\t\n\t\tif(sum==n) {\n\t\t\tSystem.out.println(m);\n\t\t}\n\t\tif(lo==0) {\n\t\t\tSystem.out.println(n);\n\t\t}\n\t\tfor(int i=0; i<m; i++) {\n\t\t\tif(lo%play[i]==0) {\n\t\t\t\tsum++;\n\t\t\t\tif(sum==n) {\n\t\t\t\t\tSystem.out.println(i+1);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint input1 = sc.nextInt(); //input 값 입력\n\t\tint length1 = (int)(Math.log10(input1)+1); // input값 자릿수 저장\n\t\tint input2 = sc.nextInt();\n\t\tint length2 = (int)(Math.log10(input2)+1);\n\t\t\n\t\tString trans = String.valueOf(input2); //두번째 값 string형 변환\n\t\t\n\t\tchar [] arr = trans.toCharArray(); // 변환된 String char배열 변환\n\t\tint [] arr2 = new int[arr.length]; // arr의 값을 int형을 바꿀 배열\n\t\tint [] result = new int[arr2.length];//arr2의 값을 첫번째 input값과 계산하여 저장\n\n\t\t\n\t\tif(length1 < 3 || length1 > 3) { //자릿수 검사\n\t\t\tSystem.out.println(\"입력값의 자릿수는 3자리\");\n\t\t}else if(length2 <3 || length2 > 3) {\n\t\t\tSystem.out.println(\"입력값의 자릿수는 3자리\");\n\t\t}\n\t\tfor(int i = arr.length-1 ; i <= 0 ; i--) {\n\t\t\tSystem.out.println(arr[i]);\n\t\t}\n\t\t\n\t\t\n\t\tfor(int i = 0 ; i < arr2.length ; i++) { //int형 변환\n\t\t\tarr2[i] = arr[i] - '0';\n\t\t}\n\t\t\n\t\t\n\t\tint count = 100, sum = 0;\n\t\tfor(int i = 0 ; i < result.length ; i++) {\n\t\t\tresult[i] = input1*arr2[i]; //계산결과 저장\n\t\t\tsum += result[i] * count; // 계산결과 저장\n\t\t\tcount /= 10;\n\t\t}\n\t\t\n\t\tfor(int i = result.length-1 ; i >= 0 ; i--) { // 출력\n\t\t\tSystem.out.println(result[i]);\n\t\t}\n\t\tSystem.out.println(sum);\n\t\t\n\t\t\n\t\t\n\t}",
"@Override\r\n\tpublic boolean solutionCase() {\n\t\tint v=0, e1=0, e2=0, w=0, a=0;\r\n\t\twhile(sc.hasNextInt()){\r\n\t\t\tv=sc.nextInt();\r\n\t\t\ta=sc.nextInt();\r\n\t\t\tEdgeWeightedGraph g= new EdgeWeightedGraph(v);\r\n\t\t\tfor(int i=0;i<a;++i){\r\n\t\t\t\te1=sc.nextInt();\r\n\t\t\t\te2=sc.nextInt();\r\n\t\t\t\tw=sc.nextInt();\r\n\t\t\t\tEdge e= new Edge(e1-1, e2-1, w);\r\n\t\t\t\tg.addEdge(e);\r\n\t\t\t}\r\n\t\t\tDijkstraS m = new DijkstraS(g, 0);\r\n\t\t\t\r\n\t\t\tfor(int i=0;i<v;i++)\r\n\t\t\t\tSystem.out.println(\"V[\"+i+\"] \"+m.nWays[i]);\r\n\t\t\t\t//System.out.println(m.nWays[v-1]);\r\n\t\t\t\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic int challengeFour(int[][] arr) {\n\t\treturn 0;\r\n\t}",
"public static void main(String[] args) throws IOException {\n\n\t\tScanner sc = new Scanner(System.in);\n\t\tint tc = sc.nextInt();\n\n\t\tfor (int num = 1; num <= tc; num++) {\n\t\t\tint n = sc.nextInt();\n\t\t\tString str = \"\";\n\t\t\tint arr[] = new int[n];\n\t\t\tboolean flag = false;\n\t\t\tboolean visit[]=new boolean[1001];\n\t\t\tfor (int i = 0; i < n; i++) {\n\t\t\t\tarr[i] = sc.nextInt();\n\t\t\t\tif (!flag && arr[i] == 0)\n\t\t\t\t\tflag = true;\n\t\t\t\tstr += arr[i];\n\t\t\t}\n\t\t\tif (flag) {\n\t\t\t\tint ans = 0;\n\t\t\t\tboolean p=false;\n\t\t\t\tfor (int i = 1; i <= n; i++) {\n\t\t\t\t\tfor (int j = 0; j + i <= n; j++) {\n\t\t\t\t\t\t\tint tmp = Integer.parseInt(str.substring(j, j + i));\n\t\t\t\t\t\t\tvisit[tmp]=true;\n\t\t\t\t\t}\n\t\t\t\t\tint amount=(int)Math.pow(10, i);\n\t\t\t\t\tfor(int k=0;k<amount;k++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(!visit[k])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tans=k;\n\t\t\t\t\t\t\tp=true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(p)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"#\" + num + \" \" + ans);\n\t\t\t} else\n\t\t\t\tSystem.out.println(\"#\" + num + \" \" + 0);\n\t\t}\n\t}",
"public String solve(long n, long a, long b, long c, long d, long x0, long y0, long m)\n {\n long[] count = new long[9];\n long x = x0;\n long y = y0;\n for (long t = 0; t < n; t++)\n {\n// System.out.println(x + \", \" + y);\n int i = (int) (x % 3) * 3 + (int) (y % 3);\n count[i]++;\n x = (a * x + b) % m;\n y = (c * y + d) % m;\n }\n\n long totalCount = 0;\n for (int i1 = 0; i1 < 9; i1++)\n {\n long count1 = count[i1];\n if (count1 == 0)\n {\n continue;\n }\n count[i1]--;\n for (int i2 = i1; i2 < 9; i2++)\n {\n long count2 = count[i2];\n if (count2 == 0)\n {\n continue;\n }\n count[i2]--;\n int x1 = i1 / 3;\n int y1 = i1 % 3;\n int x2 = i2 / 3;\n int y2 = i2 % 3;\n int x3 = (3 - (x1 + x2) % 3) % 3;\n int y3 = (3 - (y1 + y2) % 3) % 3;\n int i3 = (x3 % 3) * 3 + (y3 % 3);\n long count3 = count[i3];\n if (i3 >= i2 && count3 > 0)\n {\n // either i1==i2==i3 OR i1!=i2!=i3; you can never have only two i's the same.\n if (i1 == i2 && i2 == i3)\n {\n totalCount += calcCombinations(count1);//the first count value is the genuine count for that x,y coordinate.\n }\n else\n {\n totalCount += count1 * count2 * count3;\n }\n }\n count[i2]++;\n }\n count[i1]++;\n }\n\n return String.valueOf(totalCount);\n }",
"public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n boolean isSymmetric = true;\n String s = input.nextLine();\n for (int i = 0; i < s.length() / 2; i++) {\n if (s.charAt(i) != s.charAt(s.length() - 1 - i)) {\n isSymmetric = false;\n }\n }\n System.out.println(isSymmetric ? 1 : 37);\n }",
"private static Answer kruskalsAlgo(int v, int e, List<edge> edges) {\n Collections.sort(edges, new Comparator<edge>() {\n @Override\n public int compare(edge o1, edge o2) {\n return o1.w - o2.w;\n }\n });\n //To apply unionfind algorithm , we need to maintain a parent array\n //this will be initialised with same vertex\n int[] p = new int[v];\n for (int i = 0; i < v; i++) {\n p[i] = i;\n }\n //keep a boolean visited array\n boolean[] vis = new boolean[v];\n int cost=0;\n //iterate though edges 1 by 1 and check for cycle detection either by hasPath method or by unionFindalgorithm\n for (int i = 0; i < e; i++) {\n edge edge = edges.get(i);\n\n int p1 = findTopmostParent(edge.a, p);\n int p2 = findTopmostParent(edge.b, p);\n\n if (p1!=p2 && edges.get(i).w <A ) {\n cost+=edges.get(i).w;\n p[p2] = p1;\n\n }\n }\n int c =0;\n for(int i =0;i<v;i++){\n if(p[i]==i){\n c++;\n }\n }\n cost+=c*A;\n return new Answer(c,cost );\n }",
"@Test\n public void calculationOnElevenDigitMsgIsCorrect() {\n final String msg = \"00110001110\";\n final int[] expectedMsg = {0,0,1,0, 1,0,1,1, 1,0,0,0, 1,1,1,0};\n\n // When\n int[] transformedMsg = HammingAlgorithm.calculate(msg);\n\n // Then\n assertThat(transformedMsg).isEqualTo(expectedMsg);\n }"
]
| [
"0.64769316",
"0.64298314",
"0.63998604",
"0.6295914",
"0.6279556",
"0.62614024",
"0.6167759",
"0.6166985",
"0.6123787",
"0.6101127",
"0.6089652",
"0.60780996",
"0.6053278",
"0.6037239",
"0.60113007",
"0.6001089",
"0.59942436",
"0.59666306",
"0.5964949",
"0.5958963",
"0.59437656",
"0.5941967",
"0.5939128",
"0.59212226",
"0.59118146",
"0.5876951",
"0.586797",
"0.58665335",
"0.5860932",
"0.5860115",
"0.5846741",
"0.58438504",
"0.5841989",
"0.58327204",
"0.5828489",
"0.58124226",
"0.5806591",
"0.58040404",
"0.57986486",
"0.5793916",
"0.57931155",
"0.5789864",
"0.57835114",
"0.5779364",
"0.57768106",
"0.57750404",
"0.5772697",
"0.57664055",
"0.5762342",
"0.57535154",
"0.5751456",
"0.5749297",
"0.5745534",
"0.5734192",
"0.57336885",
"0.57266307",
"0.57208574",
"0.57117754",
"0.57095003",
"0.5706213",
"0.570368",
"0.57030416",
"0.5693499",
"0.5692817",
"0.5688068",
"0.56758094",
"0.56747425",
"0.56727207",
"0.5670113",
"0.56603265",
"0.56567353",
"0.5655842",
"0.5654784",
"0.5651656",
"0.5650412",
"0.56466854",
"0.564533",
"0.5644236",
"0.56436044",
"0.5630166",
"0.5630041",
"0.56283045",
"0.56209147",
"0.5617324",
"0.561622",
"0.56133986",
"0.5609032",
"0.56084335",
"0.56062376",
"0.56010705",
"0.56000966",
"0.55992514",
"0.55985564",
"0.55881387",
"0.558633",
"0.55771214",
"0.5573979",
"0.55738646",
"0.5573262",
"0.5571434",
"0.55689925"
]
| 0.0 | -1 |
Klaus Schemh challenge 4 | private static void challenge4M138(boolean offsetKnown, boolean withCrib) {
String cipherStr = "PTIJJHDJPKYTMTKUVEPDHYKLHDEYMGLIJLNWKXVGZILQNCJRHWJNBJFUAQHNBJGXWZBESXNXPZH";
String cribStr = withCrib ? "CRYPTOGRAPHYPROVIDESMEANSFORSECURECOMMUNICATIONSINTHEPRESENCEOFTHIRDPARTIES" : null;
int[] key = {79, 62, 66, 12, 18, 88, 27, 54, 91, 85, 72, 90, 76, 78, 36, 28, 30, 41, 48, 2, 8, 22, 59, 98, 33};
// 79,42!,66,12,18,88,27,54,91,60!,72,90,76,78,36,28,30,41,48,02,08,22,59,98,33
ArrayList<Integer> offset = new ArrayList<>();
if (offsetKnown) {
offset.add(22);
}
solve(offset, cipherStr, cribStr, 0, -1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main(String[] args) throws Exception {\n\t\tScanner scn = new Scanner(System.in);\r\n\t\tint tc = scn.nextInt();\r\n\t\tfor(int t=1; t<=tc; t++) {\r\n\t\t\tint n = scn.nextInt();\r\n\t\t\tint k = scn.nextInt();\r\n\t\t\tString str = scn.next();\r\n\t\t\tString arr[] = new String[n];\r\n\t\t\tarr = str.split(\"\");\r\n\t\t\tLinkedList<String> list = new LinkedList<>();\r\n\t\t\tLinkedList<Integer> result = new LinkedList<>();\r\n\t\t\tfor(int i=0; i<n; i++) {\r\n\t\t\t\tlist.add(arr[i]);\r\n\t\t\t}\r\n\t\t\tint comeback = 0;\r\n\t\t\twhile(comeback<4) {\r\n\t\t\t\tint cnt = 0;\r\n\t\t\t\tcomeback = 0;\r\n\t\t\t\tString st = \"\";\r\n\t\t\t\tfor(int i=0; i<n; i++) {\r\n\t\t\t\t\tif(cnt==(n/4)-1) {\r\n\t\t\t\t\t\tcnt = 0;\r\n\t\t\t\t\t\tst += list.get(i);\r\n\t\t\t\t\t\tint tmp = Integer.parseInt(st, 16);\r\n\t\t\t\t\t\tif(!isHave(result,tmp) && (result.size()>0)) {\r\n\t\t\t\t\t\t\tresult.add(tmp);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if(result.size() == 0){\r\n\t\t\t\t\t\t\tresult.add(tmp);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tcomeback++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tst = \"\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tst+= list.get(i);\r\n\t\t\t\t\t\tcnt++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\trotate(list);\r\n\t\t\t}\r\n\t\t\tCollections.sort(result);\r\n\t\t\tint cnt = 0;\r\n\t\t\tSystem.out.println(\"#\"+t+\" \"+result.get(result.size()-k));\t\t\t\r\n\t\t}\r\n\t}",
"String algorithm();",
"public static void main(String[] args) throws FileNotFoundException, IOException{\n\tScanner sc=new Scanner(new BufferedReader(new InputStreamReader (new FileInputStream(\"CodeJam2014/r1c_a/A-large.in\"))));\r\n\t\t//Scanner sc=new Scanner(new BufferedReader(new InputStreamReader(System.in)));\r\n\t\tPrintWriter ou=new PrintWriter(new FileWriter(\"CodeJam2014/r1c_a/testal.out\"));\r\n\t\tint res,rep,i,j;\r\n\t\tlong p,q,tp,tq,cp,cq;\r\n\t\tboolean vis;\r\n\t\tString s;\r\n\t\tString[] s2=new String[3];\r\n\t\tString out=\"\";\r\n\t\t\r\n\t\tres=sc.nextInt();\r\n\t\ts=sc.nextLine();\r\n\t\tfor(rep=1;rep<=res;rep++){\r\n\t\t\ts=sc.nextLine();\r\n\t\t\ts2=s.split(\"/\");\r\n\t\t\tp=0; q=0;\r\n\t\t\tfor(i=0;i<s2[0].length();i++){\r\n\t\t\t\tp*=10;\r\n\t\t\t\tp+=(int)s2[0].charAt(i)-(int)'0';\r\n\t\t\t}\r\n\t\t\tfor(i=0;i<s2[1].length();i++){\r\n\t\t\t\tq*=10;\r\n\t\t\t\tq+=(int)s2[1].charAt(i)-(int)'0';\r\n\t\t\t}\r\n\t\t\t//p=Integer.parseInt(s2[0]); q=Integer.parseInt(s2[1]);\r\n\t\t\t//p=sc.nextInt(); q=sc.nextInt();\r\n\t\t\ttp=p/gcd(p,q); tq=q/gcd(p,q);\r\n\t\t\tSystem.out.println(tp);\r\n\t\t\tcp=0; cq=0;\r\n\t\t\tvis=true;\r\n\t\t\twhile(tp!=1){\r\n\t\t\t\ttp=tp>>1;\r\n\t\t\t\tcp++;\r\n\t\t\t}\r\n\t\t\twhile(tq!=1){\r\n\t\t\t\tif (tq%2==1) {vis=false; break;}\r\n\t\t\t\ttq/=2;\r\n\t\t\t\tcq++;\r\n\t\t\t}\r\n\t\t\tou.print(\"Case #\"+rep+\": \");\r\n\t\t\tif (!vis) ou.print(\"impossible\");\r\n\t\t\telse ou.print(cq-cp);\r\n\t\t\tif (res!=rep) ou.println();\r\n\t\t\tSystem.out.println(cq-cp);\r\n\t\t}\r\n\t\tou.close();\r\n\t}",
"@Override\n\tpublic void challenge6() {\n\n\t}",
"public void solve(Scanner in) {\n\tint K = in.nextInt();\n\tint L = in.nextInt();\n\tint S = in.nextInt();\n\t\n\tint[] letters = new int[26];\n\t\n\tin.nextLine();\n\n\tString keyboard = in.nextLine(), word = in.nextLine();\n\tchar c;\n\t\n\t\n\n\tfor (int i = 0; i < K; i++) {\n\t\tc = keyboard.charAt(i);\n\t\tletters[c - 'A']++;\n\t}\n\t\n\tdouble chanceOfWord = 1;\n\n\tfor (int i = 0; i < L; i++) {\n\t\tchanceOfWord *= (letters[word.charAt(i)-'A']+0.0)/(K+0.0);\n\t}\n\t\n \tif (chanceOfWord == 0 || chanceOfWord == 1){\n\t\tSystem.out.println (0.0);\n\t\treturn;\n\t}\n\telse if (L == S) {\n\t\tSystem.out.println (1.0-chanceOfWord);\n\t\treturn;\n\t}\t\n\n\tmax = 0;\n\tcol = 0;\n\tdouble result = full (letters,\"\",word,S);\n\tSystem.out.println ((max - (result+0.0)/(col+0.0)));\n}",
"@Override\n\tpublic void challenge7() {\n\n\t}",
"public static void main(String[] args) throws NumberFormatException, IOException {\n\t\tBufferedReader br= new BufferedReader(new FileReader(\"C-small-attempt7.in\"));\n\t\t//BufferedReader br= new BufferedReader(new FileReader(\"A-large-practice(2).in\"));\n\t\t\n\t\t// TODO WRITER\n\t\tPrintWriter pw = new PrintWriter(\"Dijkstra.txt\", \"UTF-8\");\n\t\tint T=Integer.parseInt(br.readLine());\n\t\t\n\t\t\n\t\tfor(int i = 0; i < T; i++){\n\t\t\tString[] tab =br.readLine().split(\" \");\n\t\t\tint L = Integer.parseInt(tab[0]);\n\t\t\t//int X=Integer.parseInt(tab[1].length()>2 ? tab[1].substring(tab[1].length()-2) : tab[1]);\n\t\t\tlong X=Long.parseLong(tab[1]);\n\t\t\tString str = br.readLine();\n\t\n\t\t\t\n\t\t\t\t\n\t\t\tString a=\"NO\";\n\t\t\tchar current = '1';\n\t\t\tboolean minus = false;\n\t\t\tint finish=0;\n\t\t\tfor(long j=0; j<X*L; j++){\n\t\t\t\tchar temp = str.charAt((int)(j%L));\n\t\t\t\t\n\t\t\t\tif(current==temp){\n\t\t\t\t\tcurrent='1';\n\t\t\t\t\tminus = !minus;\n\t\t\t\t}\n\t\t\t\telse if(current=='1')current=temp;\n\t\t\t\telse if(current=='i'&&temp=='j') current='k';\n\t\t\t\telse if(current=='i'&&temp=='k'){\n\t\t\t\t\tcurrent='j';\n\t\t\t\t\tminus=!minus;\n\t\t\t\t}\n\t\t\t\telse if(current=='j'&&temp=='i'){\n\t\t\t\t\tcurrent='k';\n\t\t\t\t\tminus=!minus;\n\t\t\t\t}\n\t\t\t\telse if(current=='j'&&temp=='k') current='i';\n\t\t\t\telse if(current=='k'&&temp=='i') current='j';\n\t\t\t\telse if(current=='k'&&temp=='j'){\n\t\t\t\t\tcurrent='i';\n\t\t\t\t\tminus=!minus;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(current=='i'&&finish==0){\n\t\t\t\t\tfinish++;\n\t\t\t\t\tcurrent='1';\n\t\t\t\t}\n\t\t\t\telse if(current=='j'&&finish==1){\n\t\t\t\t\tfinish++;\n\t\t\t\t\tcurrent='1';\n\t\t\t\t}\n\t\t\t\telse if(current=='k'&&finish==2){\n\t\t\t\t\tfinish++;\n\t\t\t\t\tcurrent='1';\n\n\t\t\t\t}\n\t\t\t}\n\t\t\t//&&X%2==1 &&X%4==2 ||(current!='1'&&finish==3)\n\t\t\tif((current=='1'&&!minus&&finish==3))a=\"YES\";\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\"current \"+(minus?\"-\":\"\")+current+\" finish \"+finish +\" X \"+X);//+\" str: \"+str);\n\t\n\t\t\tSystem.out.print(\"Case #\"+(i+1)+\": \"+a+\"\\n\");\n\t\t\tpw.write(\"Case #\"+(i+1)+\": \"+a+\"\\n\");\n\n\t\t}\n\t\tpw.close();\n\t}",
"public int[] solution(String S, int[] P, int[] Q) {\n \n int[][] result = new int[S.length()][4];\n int[] returnResult = new int[P.length];\n \n //how many different solutions exist?\n //'A' [0], [0] - 1 solution\n //'AG' [0, 0, 1], [0, 1, 1] - 3\n // 'AGT' [0,0,0,1,1,2], [0,1,1,2,2,2] - 6\n // 10\n // 15\n // 21\n \n //Prefix Sum - calculation\n \n for (int i = 1; i< S.length()+1; i++){\n \n if (i == 1){\n switch (S.substring(i-1, i)){\n case \"A\": result[i-1][0] = 1;\n break;\n case \"C\": result[i-1][1] = 1;\n break;\n case \"G\": result[i-1][2] = 1;\n break;\n case \"T\": result[i-1][3] = 1;\n break;\n }\n }else{\n int a = 0;\n switch (S.substring(i-1, i)){\n case \"A\": a = 0;\n break;\n case \"C\": a= 1;\n break;\n case \"G\": a =2;\n break;\n case \"T\": a =3;\n break;\n }\n result[i-1][a] = 1 + result[i-2][a];\n result[i-1][(a+1)%4] = result[i-2][(a+1)%4];\n result[i-1][(a+2)%4] = result[i-2][(a+2)%4];\n result[i-1][(a+3)%4] = result[i-2][(a+3)%4];\n }\n\n }\n \n /*\n for (double i : result){\n System.out.println(i);\n }\n */\n \n //A = 1, G = 2, C = 3, T = 4\n //when A found return 1 and move to next computation.\n // P[k] <= Q[K]\n int lowerBound = 0;\n int upperBound = 0;\n for (int i = 0; i < P.length; i++){\n lowerBound = P[i];\n upperBound = Q[i];\n \n int[] toEvaluate = new int[4];\n\n //System.out.println(lowerBound);\n if (lowerBound == 0){\n toEvaluate[0]= result[upperBound][0];\n toEvaluate[1]= result[upperBound][1];\n toEvaluate[2]= result[upperBound][2];\n toEvaluate[3]= result[upperBound][3];\n }else{\n toEvaluate[0]= result[upperBound][0] - result[lowerBound-1][0]; \n toEvaluate[1]= result[upperBound][1] - result[lowerBound-1][1];\n toEvaluate[2]= result[upperBound][2] - result[lowerBound-1][2];\n toEvaluate[3]= result[upperBound][3] - result[lowerBound-1][3];\n }\n \n /*\n for (int eval : toEvaluate){\n System.out.println(eval);\n \n }\n */\n if (toEvaluate[0] > 0) {returnResult[i] = 1;\n }else if (toEvaluate[1] > 0) {returnResult[i] = 2;\n }else if (toEvaluate[2] > 0) {returnResult[i] = 3;\n }else if (toEvaluate[3] > 0) {returnResult[i] = 4;\n }\n \n }\n \n return returnResult; \n }",
"@Override\n\tpublic void challenge9() {\n\n\t}",
"@Override\n\tpublic void challenge11() {\n\n\t}",
"@Override\n\tpublic void challenge17() {\n\n\t}",
"public static void main(String[] args) {\n\t\tScanner scn = new Scanner(System.in);\n\t\tint t = scn.nextInt();\n\t\twhile (t-- > 0) {\n\t\t\tint n = scn.nextInt();\n\t\t\tint k = scn.nextInt();\n\t\t\tString s = scn.next();\n\t\t\tString s1 = new StringBuilder(s).reverse().toString();\n\t\t\tint[][] dp = new int[n + 1][n + 1];\n\t\t\tfor (int i = 0; i <= n; i++) {\n\t\t\t\tfor (int j = 0; j <= n; j++) {\n\t\t\t\t\tif (i == 0 || j == 0)\n\t\t\t\t\t\tdp[i][j] = 0;\n\t\t\t\t\telse if (s.charAt(i - 1) == s1.charAt(j - 1))\n\t\t\t\t\t\tdp[i][j] = dp[i - 1][j - 1] + 1;\n\t\t\t\t\telse\n\t\t\t\t\t\tdp[i][j] = Math.max(dp[i - 1][j], dp[i][j - 1]);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (int[] c : dp) {\n\t\t\t\tfor (int v : c) {\n\t\t\t\t\tSystem.out.print(v + \" \");\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t\tint rem = n - dp[n][n];\n\t\t\tif (rem <= k)\n\t\t\t\tSystem.out.println(\"YES\");\n\t\t\telse\n\t\t\t\tSystem.out.println(\"NO\");\n\t\t}\n\t}",
"@Override\n\tpublic void challenge8() {\n\n\t}",
"public static void main(String[] args) throws IOException {\n BufferedReader f = new BufferedReader(new FileReader(\"whereami.in\"));\n PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(\"whereami.out\")));\n\n //reads in and initializes n and k values\n StringTokenizer st = new StringTokenizer(f.readLine());\n int stringSize = Integer.parseInt(st.nextToken());\n\n st = new StringTokenizer(f.readLine());\n //initializes variable for input string\n String string = st.nextToken();\n\n //computes all subsequences and adds to set\n subsequence(string, string.length());\n\n boolean[] checks= new boolean[stringSize];\n\n int smallestSize = 0;\n\n for (int i = 0; i < stringSize; i++) {\n checks[i] = true;\n for (String s : subSequences) {\n if (s.length() == i + 1 && numberOccurrences(string, s) != 1) {\n checks[s.length() - 1] = false;\n }\n }\n if (checks[i] == true) {\n smallestSize = i + 1;\n break;\n }\n }\n\n out.println(smallestSize);\n out.close();\n }",
"public void solve() throws IOException {\r\n int T = nextInt();\r\n for (int t = 1; t <= T; t++) {\r\n int N = nextInt();\r\n int J = nextInt();\r\n \r\n out.format(\"Case #%d:%n\", t);\r\n \r\n boolean[] bitmask = new boolean[N - 2];\r\n int count = 0;\r\n while (count < J) {\r\n BigInteger[] factors = new BigInteger[9];\r\n boolean success = true;\r\n for (int base = 2; base <= 10; base++) {\r\n BigInteger value = BigInteger.ONE;\r\n BigInteger biBase = BigInteger.valueOf(base);\r\n \r\n for (int i = 0; i < N - 2; i++) {\r\n if (bitmask[i]) {\r\n value = value.add(biBase.pow(i + 1));\r\n }\r\n }\r\n value = value.add(biBase.pow(N - 1));\r\n \r\n if (value.isProbablePrime(10)) {\r\n success = false;\r\n break;\r\n } else {\r\n // Pollard rho\r\n BigInteger x = BigInteger.valueOf(2);\r\n BigInteger y = BigInteger.valueOf(2);\r\n BigInteger d = BigInteger.ONE;\r\n while (d.compareTo(BigInteger.ONE) == 0) {\r\n x = x.pow(2).add(BigInteger.ONE).mod(value);\r\n y = y.pow(2).add(BigInteger.ONE).mod(value)\r\n .pow(2).add(BigInteger.ONE).mod(value);\r\n d = x.subtract(y).gcd(value);\r\n }\r\n if (d.compareTo(value) != 0) {\r\n factors[base - 2] = d;\r\n } else {\r\n success = false;\r\n break;\r\n }\r\n }\r\n }\r\n if (success) {\r\n count++;\r\n StringBuilder sb = new StringBuilder(\"1\");\r\n for (int i = N - 3; i >= 0; i--) {\r\n if (bitmask[i]) {\r\n sb.append(1);\r\n } else {\r\n sb.append(0);\r\n }\r\n }\r\n sb.append(1);\r\n \r\n System.out.println(sb.toString() + \" \" + count);\r\n out.print(sb.toString());\r\n for (int i = 0; i < 9; i++) {\r\n out.print(\" \");\r\n out.print(factors[i].toString());\r\n }\r\n out.println();\r\n }\r\n \r\n // Increment bitmask\r\n for (int i = 0; i < N - 2; i++) {\r\n if (!bitmask[i]) {\r\n bitmask[i] = true;\r\n break;\r\n } else {\r\n bitmask[i] = false;\r\n }\r\n }\r\n }\r\n }\r\n }",
"public static String solution() {\r\n\t\treturn \"73162890\";\r\n\t}",
"public static void main(String[] args) {\n\t\tScanner ip = new Scanner(System.in);\r\n\t\tSystem.out.println(\"Welcome to the Katapayadi Wizard! Enter the 1st syllable of the raga of your choice: \");\r\n\t\t\r\n\t\tString F = ip.nextLine();\r\n\t\tSystem.out.println(\"Great! Now enter the 2nd syllable of the raga of your choice: \");\r\n\t\t\r\n\t\tString S = ip.nextLine();\r\n\t\t//int firstIndex; \r\n\t\t\r\n\t\tString [] [] alphabets = {{\"nya\", \"ka\", \"kha\", \"ga\", \"gha\", \"nga\", \"cha\", \"ccha\", \"ja\", \"jha\"}, \r\n\t\t\t\t\t\t\t\t {\"na\", \"ta\", \"tah\",\"da\", \"dah\", \"nna\", \"tha\", \"ttha\", \"dha\", \"ddha\"},\r\n\t\t\t\t\t\t\t\t {\"null\",\"pa\", \"pha\",\"ba\",\"bha\",\"ma\", \"null\", \"null\", \"null\", \"null\", },\r\n\t\t\t\t\t\t\t\t {\"null\",\"ya\", \"ra\", \"la\", \"va\", \"se\", \"sha\", \"sa\", \"ha\",\"null\"}};\r\n\t\t\r\n\t\tint firstNum = getFirstIndex(alphabets, F);\r\n\t\tint secondNum = getSecondIndex(alphabets, S); \r\n\t\tint finalIndex = concat(firstNum, secondNum);\r\n\t\t\r\n\t\tString swaras1= swaraSthanam1(finalIndex);\r\n\t\t//String finalanswer = The [index]th melakartha: aro [swaras1] and ava [swaras2].\r\n\t\tSystem.out.println(firstNum);\r\n\t\tSystem.out.println(secondNum);\r\n\t\t\r\n\t\tSystem.out.println(finalIndex);\r\n\t\t\r\n\t\tSystem.out.println(swaras1);\r\n\t\t\r\n\t}",
"public static void main(String[] args) {\n\n pairsSum();\n\n printAllSubArrays();\n\n tripletZero();\n\n // int[][] sub = subsets();\n\n PairsSum sum = new PairsSum();\n int[] arr = { 10, 1, 2, 3, 4, 5, 6, 1 };\n boolean flag = sum.almostIncreasingSequence(arr);\n System.out.println(flag);\n\n String s = \"\";\n for (int i = 0; i < 100000; i++) {\n // s += \"CodefightsIsAwesome\";\n }\n long start = System.currentTimeMillis();\n // int k = subStr(s, \"IsA\");\n System.out.println(System.currentTimeMillis() - start);\n // System.out.println(k);\n\n String[] a = { \"aba\", \"aa\", \"ad\", \"vcd\", \"aba\" };\n String[] b = sum.allLongestStrings(a);\n System.out.println(Arrays.deepToString(b));\n\n List<String> al = new ArrayList<>();\n al.toArray();\n\n Map<Integer, Integer> map = new HashMap<>();\n Set<Integer> keySet = map.keySet();\n for (Integer integer : keySet) {\n\n }\n\n String st = reverseBracksStack(\"a(bc(de)f)g\");\n System.out.println(st);\n\n int[] A = { 1, 2, 3, 2, 2, 3, 3, 33 };\n int[] B = { 1, 2, 2, 2, 2, 3, 2, 33 };\n\n System.out.println(sum.isIPv4Address(\"2.2.34\"));\n\n Integer[] AR = { 5, 3, 6, 7, 9 };\n int h = sum.avoidObstacles(AR);\n System.out.println(h);\n\n int[][] image = { { 36, 0, 18, 9 }, { 27, 54, 9, 0 }, { 81, 63, 72, 45 } };\n int[][] im = { { 7, 4, 0, 1 }, { 5, 6, 2, 2 }, { 6, 10, 7, 8 }, { 1, 4, 2, 0 } };\n int[][] res = sum.boxBlur(im);\n\n for (int i = 0; i < res.length; i++) {\n for (int j = 0; j < res[0].length; j++) {\n System.out.print(res[i][j] + \" \");\n }\n System.out.println();\n }\n\n boolean[][] ms = { { true, false, false, true }, { false, false, true, false }, { true, true, false, true } };\n int[][] mines = sum.minesweeper(ms);\n for (int i = 0; i < mines.length; i++) {\n for (int j = 0; j < mines[0].length; j++) {\n System.out.print(mines[i][j] + \" \");\n }\n System.out.println();\n }\n\n System.out.println(sum.variableName(\"var_1__Int\"));\n\n System.out.println(sum.chessBoard());\n\n System.out.println(sum.depositProfit(100, 20, 170));\n\n String[] inputArray = { \"abc\", \"abx\", \"axx\", \"abx\", \"abc\" };\n System.out.println(sum.stringsRearrangement(inputArray));\n\n int[][] queens = { { 1, 1 }, { 3, 2 } };\n int[][] queries = { { 1, 1 }, { 0, 3 }, { 0, 4 }, { 3, 4 }, { 2, 0 }, { 4, 3 }, { 4, 0 } };\n boolean[] r = sum.queensUnderAttack(5, queens, queries);\n\n }",
"@Override\n\tpublic void challenge14() {\n\n\t}",
"private static int zzaz(java.lang.String r5) {\n /*\n int r0 = r5.hashCode()\n r1 = 0\n r2 = 3\n r3 = 2\n r4 = 1\n switch(r0) {\n case -1095064472: goto L_0x002a;\n case 187078296: goto L_0x0020;\n case 1504578661: goto L_0x0016;\n case 1505942594: goto L_0x000c;\n default: goto L_0x000b;\n }\n L_0x000b:\n goto L_0x0034\n L_0x000c:\n java.lang.String r0 = \"audio/vnd.dts.hd\"\n boolean r5 = r5.equals(r0)\n if (r5 == 0) goto L_0x0034\n r5 = 3\n goto L_0x0035\n L_0x0016:\n java.lang.String r0 = \"audio/eac3\"\n boolean r5 = r5.equals(r0)\n if (r5 == 0) goto L_0x0034\n r5 = 1\n goto L_0x0035\n L_0x0020:\n java.lang.String r0 = \"audio/ac3\"\n boolean r5 = r5.equals(r0)\n if (r5 == 0) goto L_0x0034\n r5 = 0\n goto L_0x0035\n L_0x002a:\n java.lang.String r0 = \"audio/vnd.dts\"\n boolean r5 = r5.equals(r0)\n if (r5 == 0) goto L_0x0034\n r5 = 2\n goto L_0x0035\n L_0x0034:\n r5 = -1\n L_0x0035:\n if (r5 == 0) goto L_0x0045\n if (r5 == r4) goto L_0x0043\n if (r5 == r3) goto L_0x0041\n if (r5 == r2) goto L_0x003e\n return r1\n L_0x003e:\n r5 = 8\n return r5\n L_0x0041:\n r5 = 7\n return r5\n L_0x0043:\n r5 = 6\n return r5\n L_0x0045:\n r5 = 5\n return r5\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.internal.ads.zzio.zzaz(java.lang.String):int\");\n }",
"public static int Main()\n\t{\n\t\tint s = 0;\n\t\tint t = 0;\n\t\tint[] a = new int[100000];\n\t\tint n;\n\t\tint i;\n\t\tint j;\n\t\tint k;\n\n\t\tn = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\n\t\tfor (i = 1;i <= n;i++)\n\t\t{\n\t\t\ta[i - 1] = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\t}\n\n\t\tk = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\n\t\tfor (j = 1;j <= n;j++) //?for??????????k??????\n\t\t{\n\t\t\tif (a[j - 1] != k)\n\t\t\t{\n\t\t\t\tt++; //?t?????k???????????????????????\n\t\t\t}\n\t\t}\n\t\tfor (j = 1;j <= n;j++)\n\t\t{\n\t\t\tif (a[j - 1] != k) //???k?????\n\t\t\t{\n\t\t\t\ts++;\n\t\t\t\tif (s <= t - 1) //?????????k???s?t????????????\n\t\t\t\t{\n\t\t\t\t\tSystem.out.print(a[j - 1]);\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t\telse //??????????????\n\t\t\t\t{\n\t\t\t\tSystem.out.print(a[j - 1]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}",
"public void solution() {\n\t\t\n\t}",
"public static void main(String[] args) {\n Scanner sc=new Scanner(System.in);\n int p=sc.nextInt();\n int q=sc.nextInt();\n long i=0;\n String S=null;\n String substring1=null;\n String substring2=null;\n long square=0;\n int fsquare=0;\n int ssquare=0;\n int sum=0;\n int v=0;\n for(i=p;i<=q;i++)\n {\n square=squar(i);\n S=Long.toString(square);\n \n if(square<=9)\n { S=0+S; }\n int length=S.length();\n int d=length/2;\n String lsquare=S.substring(0,d);\n String rsquare=S.substring(d);\n fsquare=Integer.parseInt(lsquare);\n ssquare=Integer.parseInt(rsquare);\n sum=fsquare+ssquare;\n if(sum==i)\n {\n System.out.print(i);\n System.out.print(\" \");\n v=1;\n } \n } \n if(v==0)\n {\n System.out.print(\"INVALID RANGE\");\n } \n \n }",
"public static void main(String... args) {\n\n Set<Long> As = new HashSet<>();\n int N = 100;\n for (long p = -N; p <= N; ++p) {\n for (long q = -N; q <= p; ++q) {\n for (long r = -N; r <= q; ++r) {\n if (r==0 || p==0 || q==0)\n continue;\n\n long nom = r*p*q;\n long den = r*p + r*q + p*q;\n\n if (den != 0 && nom % den==0 && (nom^den)>=0) {\n long A = nom/den;\n\n if (A==nom) {\n As.add(A);\n System.out.printf(\"A=%d (p=%d, q=%d, r=%d)\\n\", A, p, q, r);\n }\n }\n }\n }\n }\n Long[] aa = As.toArray(new Long[As.size()]);\n Arrays.sort(aa);\n System.out.printf(\"============\\n\");\n System.out.printf(\"A(%d)=%s\\n\", aa.length, Arrays.toString(aa));\n\n for (long a = 1; a < 100; ++a) {\n if (isAlexandrian(a))\n System.out.printf(\"A=%dn\", a);\n }\n }",
"public static int Main()\n\t {\n\t\t int x;\n\t\t int j;\n\t\t int[] a = new int[16];\n\t\t x = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\t int i = 1;\n\t\t int k = 0;\n\t\t while (x != -1)\n\t\t {\n\t\t\ta[i] = x;\n\t\t\ti++;\n\t\t if (x != 0)\n\t\t {\n\t\t\t k = i;\n\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\tint sum = 0;\n\t\t\t for (i = 1;i <= k;i++)\n\t\t\t {\n\t\t\t\t for (j = 1;j <= k ;j++)\n\t\t\t\t {\n\t\t\t\t if (a[i] == 2 * a[j])\n\t\t\t\t {\n\t\t\t\t\t sum++;\n\t\t\t\t }\n\t\t\t\t }\n\t\t\t }\n\t\t\t\t\tSystem.out.print((sum - 1));\n\t\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t\t\ti = 1;\n\t\t\t }\n\t\t\tx = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\t }\n\t\t\treturn 0;\n\t }",
"public static void main(String[] args) {\nScanner sc=new Scanner(System.in);\r\nString input1=sc.nextLine();\r\ninput1=input1.toLowerCase();\r\nint l=input1.length();\r\nchar a[]=input1.toCharArray();\r\nint d[]=new int[1000];\r\nString str=\"\";\r\nint i=0,k1=0,k2=0,m=0,c1=0,c2=0,c3=0,l1=0,u=0,u1=0;\r\nchar b[]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};\r\nfor(i=0;i<l;i++)\r\n{ c3=0;\r\n\tif(a[i]==' ')\r\n\t{u=i;c3=0;\r\n\t\tfor(k1=u1,k2=i-1;k1<k2 && k2>k1;k1++,k2--)\r\n\t\t{ c1=0;c2=0;\r\n\t\t\tfor(m=0;m<26;m++)\r\n\t\t\t{\r\n\t\t\t\tif(b[m]==a[k1]) {\r\n\t\t\t\tc1=m+1;}\t\r\n\t\t\t\tif(b[m]==a[k2]) {\r\n\t\t\t\t\tc2=m+1;}\t\r\n\t\t\t}\r\n\t\t\tc3=c3+Math.abs(c1-c2);\r\n\t\t}\r\n\t\tif(k1==k2) {\r\n\t\t\tfor(m=0;m<26;m++) {\r\n\t\t\t\tif(b[m]==a[k1])\r\n\t\t\t\t\tc3=c3+(m+1);\r\n\t\t\t }\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\td[l1]=c3;\r\n\t\tl1++;\r\n\t\tu1=i+1;\r\n\t\tc3=0;\r\n\t}\r\n\tif(i==l-1)\r\n\t{\r\n\t\tfor(k1=u+1,k2=i;k1<k2 && k2>k1;k1++,k2--)\r\n\t\t{ c1=0;c2=0;\r\n\t\t\tfor(m=0;m<26;m++)\r\n\t\t\t{\r\n\t\t\t\tif(b[m]==a[k1]) {\r\n\t\t\t\tc1=m+1;}\t\r\n\t\t\t\tif(b[m]==a[k2]) {\r\n\t\t\t\t\tc2=m+1;}\t\r\n\t\t\t}\r\n\t\t\tc3=c3+Math.abs(c1-c2);\r\n\t\t}\r\n\t\tif(k1==k2) {\r\n\t\t\tfor(m=0;m<26;m++) {\r\n\t\t\t\tif(b[m]==a[k1])\r\n\t\t\t\t\tc3=c3+(m+1);\r\n\t\t\t }\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\td[l1]=c3;\r\n\t\tl1++;\r\n\t\tk1=i+1;\r\n\t}\r\n}\r\n\r\n for(i=0;i<l1;i++)\r\n {\r\n\t str=str+Integer.toString(d[i]);\r\n }\r\n int ans=Integer.parseInt(str);\r\n System.out.print(ans);\r\n}",
"public static void main(String[] args) {\n\t\tSolution sl=new Solution();\r\n\t\t/*ListNode l1=new ListNode(2);\r\n\t\tListNode l2=new ListNode(-1);\r\n\t\tl2.next=new ListNode(1);\r\n\t\tl2.next.next=new ListNode(3);\r\n\t\tListNode l3= sl.mergeTwoLists(l1, l2);\r\n\t\twhile(l3!=null)\r\n\t\t{System.out.println(l3.val);\r\n\t\tl3=l3.next;\r\n\t\t}*/\r\n\t\tString a=\"1ab2\",b=\"ab12\";\r\n\t\tSystem.out.println(sl.isRotate(a,b));\r\n\t\t//System.out.println(sl.canConstruct(ran, mag));\r\n\t\t//System.out.println(sl.myAtoi(\" 10522545459\"));\r\n\t}",
"void solve() {\n num = new ArrayList<>();\n num.add(BigInteger.valueOf(4));\n for (int len = 2; len <= 100; len++)\n generate(\"4\", 1, len, false);\n Collections.sort(num);\n for (int tc = ii(); tc > 0; tc--) {\n long x = il();\n BigInteger X = BigInteger.valueOf(x);\n for (int i = 0; i < num.size(); i++) {\n if (num.get(i).mod(X).equals(BigInteger.ZERO)) {\n String z = num.get(i).toString();\n int end = z.lastIndexOf('4');\n int len = z.length();\n int a = 2 * (end+1);\n int b = len - end;\n out.println(a + b);\n break;\n }\n }\n }\n }",
"public static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tint t = s.nextInt();\n\t\twhile(t-->0)\n\t\t{\n\t\t\tint n = s.nextInt();\n\t\t\tint k = s.nextInt();\n\t\t\tint[] arr = new int[n];\n\t\t\tfor(int i=0;i<n;i++)\n\t\t\t\tarr[i] = s.nextInt();\n\t\t\tArrays.sort(arr);\n\t\t\tint[][] dp = new int[k+1][n+1];\n\t\t\tfor(int i=0;i<=k;i++)\n\t\t\t\tfor(int j=0;j<=n;j++)\n\t\t\t\t{\n\t\t\t\t\tif(i==0)\n\t\t\t\t\t\tdp[i][j] = 0;\n\t\t\t\t\telse if(j==0)\n\t\t\t\t\t\tdp[i][j] = -1;\n\t\t\t\t\telse if(i-arr[j-1]>=0)\n\t\t\t\t\t{\n\t\t\t\t\t\tint val1 = dp[i-arr[j-1]][j-1];\n\t\t\t\t\t\tint val2 = dp[i][j-1];\n\t\t\t\t\t\tif(val1!=-1 && val2!=-1)\n\t\t\t\t\t\t\tdp[i][j] = Math.min(1+val1,val2);\n\t\t\t\t\t\telse if(val1!=-1)\n\t\t\t\t\t\t\tdp[i][j] = 1+val1;\n\t\t\t\t\t\telse if(val2!=-1)\n\t\t\t\t\t\t\tdp[i][j] = val2;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdp[i][j] = -1;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif(dp[i][j-1]==-1)\n\t\t\t\t\t\t\tdp[i][j] = -1;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tdp[i][j] = dp[i][j-1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tif(dp[k][n]!=-1)\n\t\t\t\tSystem.out.println(dp[k][n]);\n\t\t\telse\n\t\t\t\tSystem.out.println(\"impossible\");\n\t\t}\n\t}",
"public static void main(String[] args) {\n Homework1 hw1 = new Homework1();\n\n System.out.println(\"===Problem 1===\");\n hw1.problem1();\n\n System.out.println(\"===Problem 2===\");\n System.out.println(hw1.topInt(1.5));\n System.out.println(hw1.topInt(5.1));\n System.out.println(hw1.topInt(1.0));\n System.out.println(hw1.topInt(-4.2));\n\n\n System.out.println(\"===Problem 3===\");\n hw1.draw4x4('-');\n hw1.draw4x4('4');\n\n System.out.println(\"===Problem 4===\");\n System.out.println(hw1.citationName(\"Alastair\", \"Reynolds\"));\n System.out.println(hw1.citationName(\"Grace\", \"Hopper\"));\n\n System.out.println(\"===Problem 5===\");\n System.out.println(String.valueOf(hw1.min3(1.0, 2.0, 3.0)));\n System.out.println(String.valueOf(hw1.min3(4.0, 3.0, 2.0)));\n System.out.println(String.valueOf(hw1.min3(0.5, 0.1, 0.5)));\n \n System.out.println(\"===Problem 6===\");\n System.out.println(hw1.fibonacci(0));\n System.out.println(hw1.fibonacci(1));\n System.out.println(hw1.fibonacci(2));\n System.out.println(hw1.fibonacci(3));\n System.out.println(hw1.fibonacci(10));\n System.out.println(hw1.fibonacci(25));\n \n \n System.out.println(\"===Problem 7===\");\n //System.out.println(hw1.isPalindrome(\"racecar\"));\n //System.out.println(hw1.isPalindrome(\"cat\"));\n //System.out.println(hw1.isPalindrome(\"hannah\"));\n //System.out.println(hw1.isPalindrome(\"saippuakivikauppias\"));\n }",
"@Override\n\tpublic void challenge12() {\n\n\t}",
"public static void main(String[] args) {\n ArrayList<Character> actual=new ArrayList<>();\n actual.add('R');\n actual.add('G');\n actual.add('B');\n actual.add('Y');\n ArrayList<Character> guess=new ArrayList<>();\n guess.add('G');\n guess.add('G');\n guess.add('R');\n guess.add('R');\n ArrayList<Character> hitLists=new ArrayList<>();\n ArrayList<Character> pseudoLists=new ArrayList<>();\n int hits=0;\n int pseudoHits=0;\n for(int i=0;i<4;i++)\n {\n \t if(actual.get(i)==guess.get(i))\n \t {\n \t\t hits++;\n \t\t hitLists.add(actual.get(i));\n \t }\n }\n for(int i=0;i<4;i++)\n {\n \t char g=guess.get(i);\n \t if(g!=actual.get(i)&&!hitLists.contains(g)&&actual.contains(g))\n { \n\t pseudoLists.add(g);\n }\n }\n for(int i=0;i<pseudoLists.size();i++)\n { char g=pseudoLists.get(i);\n \t int actualOccs=numOccurences(g,actual);\n \t int guessOccs=numOccurences(g,guess);\n \t \n\t\tif(guessOccs==actualOccs)\n \t {\n \t\t pseudoHits++; \n \t }\n\t\telse{\n\t\t\tpseudoHits+=Math.min(guessOccs,actualOccs);\n\t\t}\t \n System.out.println(g);\n }\n \n \n System.out.println(hits+\" hits \"+pseudoHits+\" pseudoHits\");\n\t}",
"@Override\n\tpublic void challenge10() {\n\n\t}",
"public static int Main()\n\t{\n\t\ts = (String)malloc(100000 * (Character.SIZE / Byte.SIZE));\n\t\tint[] count = new int[26];\n\t\tint[] p = new int[26];\n\t\tint n;\n\t\tchar cc;\n\t\tchar key = '-';\n\t\tint min = 100001;\n\t\tint i;\n\t\tString tempVar = ConsoleInput.scanfRead();\n\t\tif (tempVar != null)\n\t\t{\n\t\t\tn = Integer.parseInt(tempVar);\n\t\t}\n\t\tString tempVar2 = ConsoleInput.scanfRead(null, 1);\n\t\tif (tempVar2 != null)\n\t\t{\n\t\t\tcc = tempVar2.charAt(0);\n\t\t}\n\n\t\twhile (n-- != 0)\n\t\t{\n\t\t\ts = new Scanner(System.in).nextLine();\n\t\t\tfor (i = 0;i < 26;i++)\n\t\t\t{\n\t\t\t\tcount[i] = 0;\n\t\t\t\tp[i] = 100001;\n\t\t\t}\n\t\t\tfor (i = 0;i < s.length();i++)\n\t\t\t{\n\t\t\t\tcount[*(s.Substring(i)) - 'a']++;\n\t\t\t\tif (p[*(s.Substring(i)) - 'a'] > i)\n\t\t\t\t{\n\t\t\t\t\tp[*(s.Substring(i)) - 'a'] = i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tkey = '-';\n\t\t\tmin = 100001;\n\t\t\tfor (i = 0;i < 26;i++)\n\t\t\t{\n\t\t\t\tif (count[i] == 1 && p[i] < min)\n\t\t\t\t{\n\t\t\t\t\tkey = 'a' + i;\n\t\t\t\t\tmin = p[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (key == '-')\n\t\t\t{\n\t\t\t\tSystem.out.print(\"no\\n\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.out.printf(\"%c\\n\",key);\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\t}",
"public static void main(String[] args) throws java.lang.Exception {\n\t\tScanner s = new Scanner(System.in);\n\t\tint a = s.nextInt();\n\t\t// output the sum of divisors of numbers in an array having exactly 4 divisors.\n\n\t\tfor (int i = 0; i < a; i++) {\n\t\t\tint len = s.nextInt();\n\t\t\tint[] subsequence = new int[len];\n\t\t\tint key = 0;\n\t\t\tint[] div = new int[len];\n\t\t\tint[] div1 = new int[len];\n\t\t\tint sum = 0;\n\t\t\tfor (int j = 0; j < len; j++) {\n\n\t\t\t\tsubsequence[j] = s.nextInt();\n\t\t\t\tint d = (int) Math.sqrt(subsequence[j]);\n\t\t\t\tif (d * d == subsequence[j])\n\t\t\t\t\tcontinue;\n\t\t\t\tboolean f = false;\n\t\t\t\tfor (int k = 2; k <= d; k++) {\n\t\t\t\t\tif (subsequence[j] % k == 0) {\n\t\t\t\t\t\tif (div1[key] == 0) {\n\t\t\t\t\t\t\tdiv1[key] = k;\n\t\t\t\t\t\t\tdiv[key] = subsequence[j];\n\t\t\t\t\t\t\tf = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tf = false;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tif (f) {\n\t\t\t\t\tkey++;\n\t\t\t\t}\n\n\t\t\t\t\n\n\t\t\t}\n\t\t\tint n = 0;\n\t\t\tfor (int k = 0; k < key; k++) {\n\t\t\t\tn = div[k] / div1[k];\n\t\t\t\tsum += 1 + div[k] + div1[k] + n;\n\t\t\t}\n\t\t\tSystem.out.println(sum);\n\n\t\t}\n\n\t\ts.close();\n\n\t}",
"public static int Main()\n\t{\n\t\tint n; //????\n\t\tint k;\n\t\tint i;\n\t\tint i2;\n\t\tint j;\n\t\tn = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\tk = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\tfor (i2 = 1;;i2++)\n\t\t{ //????\n\t\t\ti = i2;\n\t\t\tfor (j = 0;j < n;j++)\n\t\t\t{ //????\n\t\t\t\tif (i % (n - 1) != 0)\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\ti = i * n / (n - 1) + k;\n\t\t\t}\n\t\t\tif (j == n)\n\t\t\t{\n\t\t\t\tSystem.out.print(i);\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}",
"public static void main(String[] args) throws IOException{\n Reader sc = new Reader();\n \n int n=sc.nextInt();\n int m=sc.nextInt();\n \n int ans[]=new int[n];\n \n for(int i=0;i<m;i++)\n {\n int l=sc.nextInt();\n int r=sc.nextInt();\n // indexing is 1 based.\n l--;\n r--;\n \n ans[l]++;\n if(r!=n-1)\n {\n ans[r+1]--;\n \n } \n \n }\n \n int s=0;\n int max=0;\n for(int i=0;i<n;i++)\n {\n s+=ans[i];\n ans[i]=s;\n if(s>max)\n {\n max=s;\n }\n }\n \n int brr[]=new int[max+1];\n for(int i=0;i<n;i++)\n {\n brr[ans[i]]++;\n \n }\n \n s=0;\n for(int i=max;i>=0;i--)\n {\n s+=brr[i];\n brr[i]=s;\n \n }\n \n int q=sc.nextInt();\n for(int i=0;i<q;i++)\n {\n int x=sc.nextInt();\n if(x>max)\n {\n System.out.println(0);\n }\n else\n \tSystem.out.println(brr[x]);\n }\n \n\t}",
"public static void main(String[] args) {\n\t\tString str = \"66. All Valid Permutations Of Parentheses I\";\n//\t\tString str = \"Determine If One String Is Another's Substring\";\n//\t\tSystem.out.println(\"\"+connByUnderscore(str));\n\t\tSystem.out.println(leet(str));\n//\t\tSystem.out.println(\"\"+connByUnderscore(str));\n\t}",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int t = sc.nextInt();\n for(int ii=0;ii<t;ii++){\n String str = sc.next();\n int sa[] = getSuffixArray(str);\n int lcp[] = getLCP(sa,str);\n int n = str.length();\n long range[] = new long[n];\n for(int i=0;i<n;i++){\n long len = (long)(n-sa[i]);\n range[i] = (long)(len*(len+1)/2)-(long)(lcp[i]*(lcp[i]+1)/2);\n }\n long k = sc.nextLong();\n for(int i=0;i<n;i++){\n int s = sa[i];\n int lc = lcp[i];\n if(range[i]>=k){\n int len = 1+lc;\n while(k>len){\n k -= len;\n len++;\n }\n System.out.println(str.charAt(s+(int)k-1));\n break;\n }\n else\n k -= range[i];\n }\n }\n }",
"public static String euklid(int a, int b, int c)\n {\n int[] rk = new int[20];\n rk[0] = a;\n rk[1] = b;\n int k = -1;\n int qk = 0;\n int[] sk = new int[20];\n sk[0] = 1;\n sk[1] = 0;\n int[] tk = new int[20];\n tk[0] = 0;\n tk[1] = 1;\n int i = 0;\n String d = null;\n String konstant = d;\n\n if (b == 0)\n {\n return Integer.toString(a);\n }\n\n System.out.println(\"\\n k | qk rk sk tk\");\n System.out.println(\"-----|------------------------\");\n System.out.println(\" \"+k+\" | -\"+\" \"+rk[0]+\" \"+\"1\"+\" \"+\"0\"); k++;\n System.out.println(\" \"+k+\" | -\"+\" \"+rk[1]+\" 0\"+\" \"+\"1\"); k++;\n System.out.println(\"-----|------------------------\");\n\n for (i = 2; i < rk.length; i++)\n {\n try\n {\n rk[i] = Math.abs(rk[i-2]%rk[i-1]);\n }\n catch (Exception e)\n {\n break;\n }\n\n qk = Math.floorDiv(rk[i-2], rk[i-1]);\n\n System.out.print(\" \"+k+\" | \"+qk+\" \"+rk[i]+\" \");\n\n if (rk[i]!=0)\n {\n sk[i] = sk[i-2]-(qk*sk[i-1]);\n\n tk[i] = tk[i-2]-(qk*tk[i-1]);\n System.out.println(+sk[i]+\" \"+tk[i]);\n }\n\n k++;\n }\n\n System.out.println(\"\\n\");\n\n boolean test = (sk[i-2]*a+tk[i-2]*b == c);\n\n System.out.println(\"sfd(\"+a+\",\"+b+\") = \"+c+\" = \"+sk[i-2]+\"*\"+a+\"+(\"+tk[i-2]+\"*\"+b+\") \"+test);\n\n System.out.println(\"\");\n\n return Arrays.toString(rk);\n\n }",
"public static void main(String[] args) throws IOException {\n Scanner sc = new Scanner(new File(\"A-small-attempt1.in\")) ;\n// FileOutputStream out = new FileOutputStream(\"output.txt\");\n// PrintWriter out = new PrintWriter(\"output.txt\");\n PrintWriter out = new PrintWriter(\"output.txt\");\n \n \n int TEST_CASE_NUMBER = sc.nextInt();\n \n for (int test_case = 1; test_case <= TEST_CASE_NUMBER; test_case++) \n {\n int MAX_SHYNESSS = sc.nextInt();\n String str = sc.next();\n \n int answer = 0;\n int sum = 0;\n char shift = '0';\n// System.out.println(str);\n for(int i = 0; i <= MAX_SHYNESSS; i++) \n {\n char element = str.charAt(i);\n int elementInt = element - shift;\n// System.out.println(element);\n// boolean flagChecked = false\n if(elementInt > 0) \n {\n \n if(i > sum) {\n answer += i - sum;\n sum += i -sum;\n// System.out.println(answer);\n }\n \n \n }\n sum += elementInt;\n// System.out.println(sum);\n }\n \n out.println(\"Case #\"+test_case+\": \"+answer);\n// System.out.println(\"____________________\");\n }\n \n out.close();\n }",
"private static int solution4(String s) {\r\n int n = s.length(), ans = 0;\r\n Map<Character, Integer> map = new HashMap<>();\r\n for (int j = 0, i = 0; j < n; j++) {\r\n if (map.containsKey(s.charAt(j)))\r\n i = Math.max(map.get(s.charAt(j)), i);\r\n ans = Math.max(ans, j - i + 1);\r\n map.put(s.charAt(j), j + 1);\r\n }\r\n return ans;\r\n }",
"public static void main(String[] args) {\n\n Map<String, Integer> nyt;\n nyt = new HashMap<String, Integer>();\n Scanner scan = new Scanner(System.in);\n int n = scan.nextInt(), m = scan.nextInt();\n scan.nextLine();\n int cont = 0;\n seen = new boolean[193];\n g = new ArrayList[193];\n\n for (int i = 0; i < 193; i++) {\n g[i] = new ArrayList<Integer>();\n }\n for (int i = 0; i < n; i++) {\n String[] value = scan.nextLine().split(\" are worse than \");\n if (!nyt.containsKey(value[0])) {\n nyt.put(value[0], cont);\n cont++;\n }\n if (!nyt.containsKey(value[1])) {\n nyt.put(value[1], cont);\n cont++;\n }\n\n int u = nyt.get(value[0]);\n int v = nyt.get(value[1]);\n g[u].add(v);\n }\n boolean ok;\n for (int i = 0; i < m; i++) {\n ok = true;\n String[] trump = scan.nextLine().split(\" are worse than \");\n if (!nyt.containsKey(trump[0]) || !nyt.containsKey(trump[1])) {\n System.out.println(\"Pants on Fire\");\n } else {\n\n dfs(nyt.get(trump[0]));\n if (seen[nyt.get(trump[1])]) {\n System.out.println(\"Fact\");\n ok = false;\n }\n\n if (ok) {\n seen = new boolean[193];\n dfs(nyt.get(trump[1]));\n if (seen[nyt.get(trump[0])]) {\n System.out.println(\"Alternative Fact\");\n } else {\n System.out.println(\"Pants on Fire\");\n }\n\n }\n\n }\n seen = new boolean[193];\n\n }\n\n }",
"public static void main(String args[]) {\n\t\tString number = \"1924\";\n\t\tint k = 2;\n\t\tSystem.out.println(solution(number, k));\n\t}",
"public static void main(String[] args) throws IOException {\n\t\tScanner sc = new Scanner(System.in);\n//\t\tint T = stoi(br.readLine());\n\t\tint T = sc.nextInt();\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor(int Tcase=1; Tcase <= T; Tcase++){\n\t\t\tint ans=0;\n\t\t\tsb.append(\"#\").append(Tcase).append(\" \");\n\t\t\t//오름차순 //내림차순\n\t\t\tint N = sc.nextInt();\n\t\t\tint[] dataSet = new int[N];\n\t\t\tfor (int count = 0; count < N; count++) {\n\t\t\t\tdataSet[count] = sc.nextInt();\n\t\t\t}\n\t\t\t\n\t\t\t//시작상태 0 //오름차순 1// 내림차순 2\n\t\t\tint swit = 0;\n\t\t\tint leftIdx = 0;\n\t\t\tint rightIdx = 0;\n\t\t\tint midIdx = 0;\n\t\t\tint preData = dataSet[0];\n\t\t\tint hi;\n\t\t\tfor (int idx = 1; idx < dataSet.length; idx++) {\n\t\t\t\thi = dataSet[idx];\n\t\t\t\tif(preData < hi) { //오름차순 1\n\t\t\t\t\tif(swit == 2) {\n\t\t\t\t\t\trightIdx = idx-1;\n\t\t\t\t\t\tans += (midIdx-leftIdx)*(rightIdx-midIdx);\n\t\t\t\t\t\tleftIdx = idx-1;\n\t\t\t\t\t}\n\t\t\t\t\tswit = 1;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t//같은경우 고려 안함\n\t\t\t\telse {//내림차순 2\n\t\t\t\t\tif(swit == 1) midIdx = idx-1;\n\t\t\t\t\t\n\t\t\t\t\tswit = 2;\n\t\t\t\t\tif(idx == dataSet.length-1){\n\t\t\t\t\t\trightIdx = idx;\n\t\t\t\t\t\tans += (midIdx-leftIdx)*(rightIdx-midIdx);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tpreData = hi;\n\t\t\t}\n\t\t\t\n\t\t\tsb.append(ans).append(\"\\n\");\n\t\t}\n\t\tSystem.out.print(sb);\n\t\t\n\t}",
"@Override\n\tpublic void challenge16() {\n\n\t}",
"@Override\r\n\tpublic int challengeTwo(String[] arr, String query) {\n\t\treturn 0;\r\n\t}",
"public static void main(String[] args){\n int n;int k;\n Scanner sc=new Scanner(System.in);\n n=sc.nextInt();\n k=sc.nextInt();\n int[] a=new int[n];\n int[] reMain=new int[k];\n int num=0;\n for(int i=0;i<k;i++){\n reMain[i]=0;\n }\n for(int i=0;i<n;i++){\n int d=sc.nextInt()%k;\n reMain[d]++;\n }\n int p=0;\n if(k%2==0)\n p=k/2;\n else p=(k+1)/2;\n for(int i=1;i<p;i++){\n if(reMain[i]>reMain[k-i])\n num+=reMain[i];\n else\n num+=reMain[k-i];\n \n }\n if(reMain[p]%2==1 && k%2==0)\n num++;\n if(k==2)\n num=reMain[1];\n \n \n System.out.println(num);\n\t}",
"public static void main(String[] args)\n\t{\t\t\t\n\t\tSystem.out.println (\"***CHALLENGE # 1*** \\n\");\n\t\n\t\tchar userConsent;\n\t\tint a, input;\n\n\t\tdo {\n\t\t\n\t\t\tScanner sc= new Scanner (System.in);\n\t\t\tSystem.out.print(\"Do you want to run the program?\");\n\t\t\tuserConsent = sc.next(\".\").charAt(0);\n\t\t\n\t\t\n\t\t\tif(userConsent == 'Y' || userConsent == 'y')\n\t\t\t{\n\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\n\t\t}\n\t\twhile(userConsent != 'Y' || userConsent != 'y');\n\t\t\n\t\n\t\tScanner sc= new Scanner (System.in);\n\t\tSystem.out.print(\"Enter a number 2 to 100 for timetable: \");\n\t\tinput=sc.nextInt();\n\t\t\n\t\t\n\t\twhile (input<2 || input>100)\n\t\t{\n\t\t\tSystem.out.print(\"Invalid number!!!Enter number again between 2 to 100 only:\");\n\t\t\tinput=sc.nextInt();\n\t\t\t\t\t\t\n\t\t}\n\t\t\t\n\t\t\n\t\tfor (a=1; a<=12; a++)\n\t\t\t\n\t\t{\n\t\t\tSystem.out.println(a + \" X \" + input + \" = \" + (a*input) );\n\t\t}\n\t\t\n\t\tSystem.out.println(\"***END OF PROGRAM*** \\n\\n\\n\");\n\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t/*\n\t\t * \"STARTING NEW PROGRAM Challenge # 2(a)\n\t\t */\t\t\n\t\t\n\t\tSystem.out.println (\"***CHALLENGE # 2(a)***\" + \"\\n\");\n\t\tint b, c;\t\t\n\t\t\tfor (b=1; b<=5; b++)\n\t\t{\t\t\n\t\t\t\tfor (c=1; c<=b; c++)\t\t\t\n\t\t\t\tSystem.out.print(\"*\");\t\t\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"END OF PROGRAM \\n\\n\\n\");\n\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t/*\n\t\t * \"STARTING NEW PROGRAM Challenge # 2(b)\n\t\t */\t\t\n\t\t\n\t\tSystem.out.println (\"***CHALLENGE # 2(b)*** \\n\");\n\t\tint d, e;\t\t\n\t\t\tfor (d=5; d>=1; d--)\n\t\t{\t\t\n\t\t\t\tfor (e=1; e<=d; e++)\t\t\t\n\t\t\t\tSystem.out.print(\"*\");\t\t\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"END OF PROGRAM \\n\\n\\n\");\n\n\t\t\n\t\t\n\t\t\n\t\t\n\n\t\t\n\t\t/*\n\t\t * \"STARTING NEW PROGRAM Challenge # 2(c)\n\t\t */\t\t\n\t\t\n\t\tSystem.out.println (\"***CHALLENGE # 2(c)*** \\n\");\n\t\t\n\t\t\n\t\tfor(int i=0; i< 4; i++ )\n\t\t{\n\t\t\t\n\t\t\tif(i < 2)\n\t\t\t{\n\t\t\t\tfor(int j=0; j < 3; j++)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.print(\"*\");\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\telse\n\t\t\t{\n\t\t\t\tfor (int j=0; j<9; j++)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.print(\"*\");\n\t\t\t\t}\n\t\t\t\t\tSystem.out.println();\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\tSystem.out.println(\"END OF PROGRAM\");\n\t\t\t\t\t\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\tint[] stones = {2, 4, 5, 3, 2, 1, 4, 2, 5, 1};\n\t\tint k = 3;\n\t\tSystem.out.println(solution(stones, k));\n\t}",
"public static String solution(String S, int K) {\n StringBuilder string = new StringBuilder();\n for (int i = 0; i < S.length(); i++) {\n char character = S.charAt(i);\n if (character == '-') continue;\n string.append(character);\n }\n // Builds a new string with hyphens between characters,\n // separating string into substrings of size K.\n StringBuilder output = new StringBuilder(string.length());\n for (int i = 0; i < string.length(); i++) {\n char character = string.charAt(i);\n if (i != 0 && i % K == 0) {\n output.append('-');\n output.append(character);\n } else {\n output.append(character);\n }\n }\n\n char character = output.charAt(output.length() - 1);\n int count = 0;\n while (character != '-') {\n count++;\n character = output.charAt(output.length() - (count + 1));\n }\n\n String result = output.toString();\n while (count < 3) {\n result = moveHypensLeft(result);\n count++;\n }\n\n return result;\n }",
"@Override\r\n\tpublic int challengeFour(int[][] arr) {\n\t\treturn 0;\r\n\t}",
"static int sherlockAndAnagrams(String s) {\n HashTable hashTable = new HashTable(s.length() * s.length() * 4);\n substrings(s).map(Solution::ordered).forEach(hashTable::insert);\n return substrings(s).map(Solution::ordered).mapToInt(s1 -> {\n hashTable.remove(s1);\n return hashTable.count(s1);\n }).sum();\n }",
"public static void main(String[] args) {\n int kor,eng,math;\r\n char score='A';\r\n // 사용자가 입력 \r\n /*Scanner scan=new Scanner(System.in);\r\n System.out.print(\"국어 점수 입력:\");\r\n kor=scan.nextInt();\r\n System.out.print(\"영어 점수 입력:\");\r\n eng=scan.nextInt();\r\n System.out.print(\"수학 점수 입력:\");\r\n math=scan.nextInt();*/\r\n kor=input(\"국어\");\r\n eng=input(\"영어\");\r\n math=input(\"수학\");\r\n \r\n // 학점 \r\n int avg=(kor+eng+math)/30;\r\n score=hakjum(avg);// 메소드는 호출 => 메소드 처음부터 실행 => 결과값을 넘겨주고 다음문장으로 이동\r\n /*switch(avg)\r\n {\r\n case 10:\r\n case 9:\r\n \tscore='A';\r\n \tbreak;\r\n case 8:\r\n \tscore='B';\r\n \tbreak;\r\n case 7:\r\n \tscore='C';\r\n \tbreak;\r\n case 6:\r\n \tscore='D';\r\n \tbreak;\r\n default:\r\n \tscore='F';\r\n }*/\r\n \r\n System.out.println(\"국어:\"+kor);\r\n System.out.println(\"영어:\"+eng);\r\n System.out.println(\"수학:\"+math);\r\n System.out.println(\"총점:\"+(kor+eng+math));\r\n System.out.printf(\"평균:%.2f\\n\",(kor+eng+math)/3.0);\r\n System.out.println(\"학점:\"+score);\r\n\t}",
"public static void main(String... args) {\n System.out.println(judgeSquareSum3(27)); //F\n// System.out.println(judgeSquareSum3(315)); //F\n\n }",
"public static void main(String[] args) {\n /*camelCase(\"Bill is,\\n\" +\n \"in my opinion,\\n\" +\n \"an easier name to spell than William.\\n\" +\n \"Bill is shorter,\\n\" +\n \"and Bill is\\n\" +\n \"first alphabetically.\");*/\n\n String str = \"Bill is,\\n\" +\n \"in my opinion,\\n\" +\n \"an easier name to spell than William.\\n\" +\n \"Bill is shorter,\\n\" +\n \"and Bill is\\n\" +\n \"first alphabetically.\";\n convertToCamelCase(str,str.toCharArray());\n\n String value = \"BillIs,\\n\" +\n \"InMyOpinion,\\n\" +\n \"AnEasierNameToSpellThanWilliam.\\n\" +\n \"BillIsShorter,\\n\" +\n \"AndBillIsFirstAlphabetically.\";\n\n //reverseCamelCase(value,value.toCharArray());\n\n /* Set<Integer> set = new LinkedHashSet<Integer>(\n Arrays.asList(1,2,3,4,5,6));\n\n ArrayList<List<List<Integer>>> results =\n new ArrayList<List<List<Integer>>>();\n compute(set, new ArrayList<List<Integer>>(), results);\n for (List<List<Integer>> result : results)\n {\n System.out.println(result);\n }*/\n\n /*reverseCamelCase(\"BillIsOk\\n\" +\n \"ThisIsGood.\");*/\n\n //System.out.println(\"abc \\r\\n test\");\n\n //permutation(\"abc\");\n\n /*String[] database = {\"a\",\"b\",\"c\"};\n for(int i=1; i<=database.length; i++){\n String[] result = getAllLists(database, i);\n for(int j=0; j<result.length; j++){\n System.out.println(result[j]);\n }\n }*/\n\n /*char[] database = {'a', 'b', 'c'};\n char[] buff = new char[database.length];\n int k = database.length;\n for(int i=1;i<=k;i++) {\n permGen(database,0,i,buff);\n }*/\n\n\n\n }",
"public static int fullHouseYahtzee(int... result) {\n\n int score = nSame(3, 6, result);\n int firstPairVal = score/3;\n\n result = IntStream.of(result).filter(val -> val != firstPairVal).toArray();\n score = nSame(2, 6, result);\n int secondPairVal = score/2;\n\n if (firstPairVal*secondPairVal > 0) {\n score = 25;\n } else {\n score = 0;\n }\n\n return score;\n }",
"public static void main(String[] args) throws IOException {\n Scanner s = new Scanner(System.in);\n int t = Integer.parseInt(s.nextLine());\n for(int i=1;i<=t;i++){\n int n = Integer.parseInt(s.nextLine());\n Set<String> a = new HashSet<>();\n\n for(int j=0;j<n;j++) {\n String str = s.nextLine();\n if(str.equals(\"easy-medium\"))\n str=\"medium\";\n else if(str.equals(\"medium-hard\"))\n str=\"hard\";\n a.add(str);\n }\n System.out.println(a.size()<5?\"No\":\"Yes\");\n /*int a1=0,a2=0,a3=0,a4=0,a5=0;\n for(int k=0;k<n;k++){\n if(a.contains(\"cakewalk\"))\n a1++;\n if(a.contains(\"simple\"))\n a2++;\n if(a[k].equals(\"easy\"))\n a3++;\n if(a[k].equals(\"easy-medium\") || a[k].equals(\"medium\"))\n a4++;\n if(a[k].equals(\"medium-hard\") || a[k].equals(\"hard\"))\n a5++;\n }\n if(a1==1&&a2==1&&a3==1&&a4==1&&a5==1)\n System.out.println(\"Yes\");\n else\n System.out.println(\"No\");\n*/\n }\n }",
"public static void main(String[] args) throws NumberFormatException, IOException {\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\r\n\t\tString input = in.readLine();\r\n\t\tString[] temp = new String[3];\r\n\t\tInteger[] stats = new Integer[3];\r\n\t\ttemp = input.split(\" \");\r\n\t\tstats[0] = Integer.parseInt(temp[0]);\r\n\t\tstats[1] = Integer.parseInt(temp[1]);\r\n\t\tstats[2] = Integer.parseInt(temp[2]);\r\n\t\tint numberofholds = stats[0];\r\n\t\tint[] H = new int[stats[0] + 1];\r\n\t\tH[0] = 0;\r\n\t\tboolean possible = true;\r\n\t\tint M = stats[1];\r\n\t\tint E = stats[2];\r\n\t\tint distance;\r\n\t\tfor (int i = 1; i < numberofholds + 1; i++) {\r\n\t\t\tH[i] = Integer.parseInt(in.readLine());\r\n\t\t}\r\n\t\tfor (int i = 0; i < numberofholds; i++) {\r\n\t\t\tdistance = H[i + 1] - H[i];\r\n\t\t\tif (distance > M) {\r\n\t\t\t\tif (E > 0) {\r\n\t\t\t\t\tif (distance > M * 2) {\r\n\t\t\t\t\t\tpossible = false;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tE--;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tpossible = false;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (possible) {\r\n\t\t\tSystem.out.println(\"Too easy!\");\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"Unfair!\");\r\n\t\t}\r\n\t}",
"public static void main(String[] args) {\n\r\n\t\t\r\n\t\tTest01 t = new Test01();\r\n\t\t\r\n\t\t//String st = \"1927\";\r\n\t\t//int in\t= 2;\t// n 개 제거\r\n\r\n\t\tString st = \"1231234\";\r\n\t\tint in\t= 3;\t\r\n\t\t\r\n\t\tString an = t.solution(st, in);\r\n\t\t\r\n\t\tSystem.out.println(an);\r\n\t}",
"dkj mo4367a(dkk dkk);",
"@Override\n\tpublic void challenge15() {\n\n\t}",
"public static void main(String[] args) {\n\t\tString s = \"aabacbebebe\";\n\n\t\tSystem.out.println(\"Given String : \" + s);\n\n\t\tSystem.out.println(\"Longest Substring Using Set (2-pointer) : \"\n\t\t\t\t+ lengthOfLongestSubstringUsingSet(s));\n\t\tSystem.out.println(\"Longest Substring Using Sliding Window : \"\n\t\t\t\t+ longestStringWithNoRepeatingChars(s));\n\n\t\tSystem.out.println(\"\\n ===== Longest string with 2 distinct characters ===== \");\n\t\tSystem.out.println(\"Original String : \" + s);\n\t\tSystem.out\n\t\t\t\t.println(\"Length of Longest Substring with at most 2 distinct characters: \"\n\t\t\t\t\t\t+ longestStringWithTwoDistinctChars(s));\n\n\t\tSystem.out.println(\"\\n ===== Longest string with K distinct characters ===== \");\n\n\t\tPair<Integer, Pair<Integer, Integer>> pair = longestStringWithKDistinctChars(s, 3);\n\t\tSystem.out.print(\"Longest Substring length with 3 Distinct Chars : \");\n\t\tSystem.out.print(pair.getKey() + \", \" + pair.getValue().getKey() + \" \"\n\t\t\t\t+ pair.getValue().getValue());\n\n\t\tif (pair.getValue().getKey() != -1)\n\t\t\tSystem.out.println(\", \"\n\t\t\t\t\t+ s.substring(pair.getValue().getKey(), pair.getValue()\n\t\t\t\t\t\t\t.getValue() + 1));\n\t\telse\n\t\t\tSystem.out.println(\", Empty String\");\n\t\t\n\t\tSystem.out.println(\"\\n ===== Longest string with K distinct characters (AS approach) ===== \");\n\n\t\tPair<Integer, Pair<Integer, Integer>> pair1 = longestStringWithKDistinctCharsAS(s, 3);\n\t\tSystem.out.print(\"Longest Substring length with 3 Distinct Chars : \");\n\t\tSystem.out.print(pair1.getKey() + \", \" + pair1.getValue().getKey() + \" \"\n\t\t\t\t+ pair1.getValue().getValue());\n\n\t\tif (pair1.getValue().getKey() != -1)\n\t\t\tSystem.out.println(\", \"\n\t\t\t\t\t+ s.substring(pair1.getValue().getKey(), pair1.getValue()\n\t\t\t\t\t\t\t.getValue() + 1));\n\t\telse\n\t\t\tSystem.out.println(\", Empty String\");\n\n\t\tSystem.out.println(\"\\n ===== Longest string with no repeating characters ===== \");\n\n\t\ts = \"abcabcbb\";\n\t\tSystem.out.print(\"For string: \" + s);\n\t\tSystem.out.print(\"; Method Other: \"\n\t\t\t\t+ longestStringWithNoRepeatingChars(s));\n\t\tSystem.out.println(\"; AS: \" + longestStringWithNoRepeatingCharsAS(s));\n\n\t\ts = \"bbbbb\";\n\t\tSystem.out.print(\"For string: \" + s);\n\t\tSystem.out.print(\"; Method Other: \"\n\t\t\t\t+ longestStringWithNoRepeatingChars(s));\n\t\tSystem.out.println(\"; AS: \" + longestStringWithNoRepeatingCharsAS(s));\n\n\t\ts = \"pwwkew\";\n\t\tSystem.out.print(\"For string: \" + s);\n\t\tSystem.out.print(\"; Method Other: \"\n\t\t\t\t+ longestStringWithNoRepeatingChars(s));\n\t\tSystem.out.println(\"; AS: \" + longestStringWithNoRepeatingCharsAS(s));\n\t}",
"public static void main(String[] args) {\n Solution s = new Solution();\n System.out.println(s.letterCombinations(\"67\").toString());\n\n }",
"private int e(String paramString, int paramInt)\r\n/* 628: */ {\r\n/* 629:624 */ int i1 = paramString.length();\r\n/* 630:625 */ int i2 = 0;\r\n/* 631:626 */ int i3 = 0;\r\n/* 632:627 */ int i4 = -1;\r\n/* 633:628 */ int i5 = 0;\r\n/* 634:631 */ for (; i3 < i1; i3++)\r\n/* 635: */ {\r\n/* 636:632 */ char c1 = paramString.charAt(i3);\r\n/* 637:634 */ switch (c1)\r\n/* 638: */ {\r\n/* 639: */ case '§': \r\n/* 640:636 */ if (i3 < i1 - 1)\r\n/* 641: */ {\r\n/* 642:637 */ char c2 = paramString.charAt(++i3);\r\n/* 643:638 */ if ((c2 == 'l') || (c2 == 'L')) {\r\n/* 644:639 */ i5 = 1;\r\n/* 645:640 */ } else if ((c2 == 'r') || (c2 == 'R') || (c(c2))) {\r\n/* 646:641 */ i5 = 0;\r\n/* 647: */ }\r\n/* 648: */ }\r\n/* 649:643 */ break;\r\n/* 650: */ case '\\n': \r\n/* 651:646 */ i3--;\r\n/* 652:647 */ break;\r\n/* 653: */ case ' ': \r\n/* 654:649 */ i4 = i3;\r\n/* 655: */ default: \r\n/* 656:651 */ i2 += a(c1);\r\n/* 657:652 */ if (i5 != 0) {\r\n/* 658:653 */ i2++;\r\n/* 659: */ }\r\n/* 660: */ break;\r\n/* 661: */ }\r\n/* 662:657 */ if (c1 == '\\n')\r\n/* 663: */ {\r\n/* 664:658 */ i3++;i4 = i3;\r\n/* 665: */ }\r\n/* 666: */ else\r\n/* 667: */ {\r\n/* 668:662 */ if (i2 > paramInt) {\r\n/* 669: */ break;\r\n/* 670: */ }\r\n/* 671: */ }\r\n/* 672: */ }\r\n/* 673:667 */ if ((i3 != i1) && (i4 != -1) && (i4 < i3)) {\r\n/* 674:668 */ return i4;\r\n/* 675: */ }\r\n/* 676:670 */ return i3;\r\n/* 677: */ }",
"String getMGFAlgorithm();",
"public void testLiangFigure6() {\n int[] a = {0, 0, 0, 0, 1, 1, 1, 1};\n int[] b = {0, 0, 1, 1, 0, 0, 1, 1};\n int[] c = {0, 1, 0, 1, 0, 1, 0, 1};\n int[] ap = {0, 0, 1, 1, 0, 0, 1, 1};\n int[] bp = {0, 1, 0, 1, 1, 1, 1, 1};\n int[] cp = {0, 0, 0, 1, 0, 1, 1, 1};\n\n for (int i = 0; i < ntimes - 1; i++) {\n cases[i][0] = a[i];\n cases[i][1] = b[i];\n cases[i][2] = c[i];\n cases[i + 1][3] = ap[i];\n cases[i + 1][4] = bp[i];\n cases[i + 1][5] = cp[i];\n }\n cases[8][0] = 0;\n cases[8][1] = 0;\n cases[8][2] = 0;\n cases[0][3] = 0;\n cases[0][4] = 0;\n cases[0][5] = 0;\n\n RevealEvaluator re = new RevealEvaluator(cases);\n\n double rea = re.entropy(a);\n assertEquals(1.0, rea, TOLERANCE);\n System.out.println(\"H(a) = \" + rea); //Should be 1.0\n\n double reb = re.entropy(b);\n assertEquals(1.0, reb, TOLERANCE);\n System.out.println(\"H(b) = \" + reb); //Should be 1.0\n\n double rec = re.entropy(c);\n assertEquals(1.0, rec, TOLERANCE);\n System.out.println(\"H(c) = \" + rec); //Should be 1.0\n\n double reab = re.jointEntropy(a, b);\n assertEquals(2.0, reab, TOLERANCE);\n System.out.println(\"H(a,b) = \" + reab); //Should be 2.0\n\n double reap = re.entropy(ap);\n assertEquals(1.0, reap, TOLERANCE);\n System.out.println(\"H(ap) = \" + reap); //Should be 1.0\n\n double rebp = re.entropy(bp);\n assertEquals(0.8112781244591328, rebp, TOLERANCE);\n System.out.println(\"H(bp) = \" + rebp); //Should be 0.8112781244591328\n\n double recp = re.entropy(cp);\n assertEquals(1.0, recp, TOLERANCE);\n System.out.println(\"H(cp) = \" + recp); //Should be 1.0\n\n double reapa = re.jointEntropy(ap, a);\n assertEquals(2.0, reapa, TOLERANCE);\n System.out.println(\"H(ap, a) = \" + reapa); //Should be 2.0\n\n double rebpb = re.jointEntropy(bp, b);\n assertEquals(1.8112781244591327, rebpb, TOLERANCE);\n System.out.println(\n \"H(bp, b) = \" + rebpb); //Should be 1.8112781244591327\n\n double recpb = re.jointEntropy(cp, b);\n assertEquals(1.8112781244591327, recpb, TOLERANCE);\n System.out.println(\n \"H(cp, b) = \" + recpb); //Should be 1.8112781244591327\n\n int[][] ab = new int[2][8];\n for (int i = 0; i < 8; i++) {\n ab[0][i] = a[i];\n ab[1][i] = b[i];\n }\n\n double rebpab = re.jointEntropy(bp, ab);\n assertEquals(2.5, rebpab, TOLERANCE);\n System.out.println(\"H(bp, a, b) = \" + rebpab); //Should be 2.5\n\n double recpab = re.jointEntropy(cp, ab);\n assertEquals(2.5, recpab, TOLERANCE);\n System.out.println(\"H(cp, a, b) = \" + recpab); //Should be 2.5\n\n int[][] abc = new int[3][8];\n for (int i = 0; i < 8; i++) {\n abc[0][i] = a[i];\n abc[1][i] = b[i];\n abc[2][i] = c[i];\n }\n\n double recpabc = re.jointEntropy(cp, abc);\n assertEquals(3.0, recpabc, TOLERANCE);\n System.out.println(\"H(cp, a, b, c) = \" + recpabc); //Should be 3.0\n\n //Setup array cases and test mutualInformation\n int[] p = new int[1];\n p[0] = 0;\n\n double rembpa = re.mutualInformation(4, p, 1);\n assertEquals(0.31127812445913294, rembpa, TOLERANCE);\n System.out.println(\n \"M(Bp, A) = \" + rembpa); //Should be 0.31127812445913294\n\n int[] pp = new int[2];\n pp[0] = 0;\n pp[1] = 1;\n\n double rmcpab = re.mutualInformation(5, pp, 1);\n assertEquals(0.5, rmcpab, TOLERANCE);\n System.out.println(\"M(Cp, [A,B]) = \" + rmcpab); //Should be 0.5\n\n int[] ppp = new int[3];\n ppp[0] = 0;\n ppp[1] = 1;\n ppp[2] = 2;\n\n double rmcpabc = re.mutualInformation(5, ppp, 1);\n assertEquals(1.0, rmcpabc, TOLERANCE);\n System.out.println(\"M(Cp, [A,B,C]) = \" + rmcpabc); //Should be 1.0\n\n }",
"public static void main (String[] args) throws java.lang.Exception\n\t{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint t = sc.nextInt();\n\t\twhile(t-->0)\n\t\t{\n\t\t int n = sc.nextInt();\n\t\t long[] arr = new long[n];\n\t\t long sum=0;\n\t\t for(int i=0;i<n;i++)\n\t\t {\n\t\t arr[i]=sc.nextLong();\n\t\t sum=sum+arr[i];\n\t\t }\n\t\t int i, k=0;\n\t\t double x=(double)sum/n;\n for(i=0;i<n;i++){\n if(arr[i]==x) \n {\n k=i; \n break;\n \n }\n }\n if(i==n)\n System.out.println(\"Impossible\");\n else \n System.out.println(k+1);\n\t\t}\n\t\t \n\t}",
"public static int Main()\n\t{\n\t\t//cout << \"?????????n\" << endl;\n\t\tint n; //n????????a,b,c???,y??????x??????\n\t\tint a;\n\t\tint b;\n\t\tint c;\n\t\tint y;\n\t\tint x;\n\t\tint z;\n\t\tn = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\tfor (int i = 1; i <= n; i++) //n???\n\t\t{\n\t\t\tx = 0;\n\t\t\ty = 0;\n\t\t\ta = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\t\tb = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\t\tc = Integer.parseInt(ConsoleInput.readToWhiteSpace(true));\n\t\t\tif (b > c) //?b??c\n\t\t\t{\n\t\t\t\tz = c;\n\t\t\t\tc = b;\n\t\t\t\tb = z;\n\t\t\t}\n\t\t\tif ((a % 4 == 0 && a % 100 != 0) || (a % 400 == 0)) //????\n\t\t\t{\n\t\t\t\ty = 1;\n\t\t\t}\n\t\t\tfor (; b <= c - 1; b++) //??????\n\t\t\t{\n\t\t\t\tswitch (b)\n\t\t\t\t{\n\t\t\t\tcase 1 :\n\t\t\t\tcase 3 :\n\t\t\t\tcase 5 :\n\t\t\t\tcase 7 :\n\t\t\t\tcase 8 :\n\t\t\t\tcase 10 :\n\t\t\t\tcase 12 :\n\t\t\t\t\tx = x + 31;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4 :\n\t\t\t\tcase 6 :\n\t\t\t\tcase 9 :\n\t\t\t\tcase 11 :\n\t\t\t\t\tx = x + 30;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2 :\n\t\t\t\t\tx = x + 28 + y;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (x % 7 == 0) //??????????\n\t\t\t{\n\t\t\t\tSystem.out.print(\"YES\");\n\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.out.print(\"NO\");\n\t\t\t\tSystem.out.print(\"\\n\");\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\t}",
"public static int Main()\n\t{\n\t\tint len;\n\t\tint i;\n\t\tint j;\n\t\tint p;\n\t\tint l;\n\t\tMain_str = new Scanner(System.in).nextLine();\n\t\tfor (len = 0;Main_str.charAt(len) != '\\0';len++)\n\t\t{\n\t\t\t;\n\t\t}\n\t\tfor (l = 2;l <= len;l++)\n\t\t{\n\t\t\tfor (i = 0;i <= len - l;i++)\n\t\t\t{\n\t\t\t\tfor (j = 0;j < l / 2;j++)\n\t\t\t\t{\n\t\t\t\t\tif (Main_str.charAt(i + j) != Main_str.charAt(i + l - 1 - j))\n\t\t\t\t\t{\n//C++ TO JAVA CONVERTER TODO TASK: There are no gotos or labels in Java:\n\t\t\t\t\t\tgoto here;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\tfor (p = i;p < i + l;p++)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.printf(\"%c\",Main_str.charAt(p));\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.print(\"\\n\");\n//C++ TO JAVA CONVERTER TODO TASK: There are no gotos or labels in Java:\n\t\t\t\t\there:\n\t\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\t}",
"@Override\n public String solve() {\n int LIMIT = 50 * NumericHelper.ONE_MILLION_INT;\n int[] nCount = new int[LIMIT+1];\n for(long y = 1; y<= LIMIT; y++) {\n for(long d= (y+3)/4; d<y; d++) { // +3 is to make d atleast 1\n long xSq = (y+d) * (y+d);\n long ySq = y * y;\n long zSq = (y-d) * (y-d);\n\n long n = xSq - ySq - zSq;\n\n if(n<0) {\n continue;\n }\n\n if(n>=LIMIT) {\n break;\n }\n\n\n nCount[(int)n]++;\n\n }\n }\n\n int ans = 0;\n for(int i = 1; i<LIMIT; i++) {\n if(nCount[i] == 1) {\n //System.out.print(i +\",\");\n ans++;\n }\n }\n\n return Integer.toString(ans);\n }",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n if (n == 1) \n System.out.println(\"Kaprekar number\");\n // Count number of digits in square \n int sq_n = n * n; \n int count_digits = 0; \n int sum=0;\n while (sq_n != 0) \n { \n count_digits++; \n sq_n /= 10; \n } \n sq_n = n*n; // Recompute square as it was changed \n // Split the square at different poitns and see if sum \n // of any pair of splitted numbers is equal to n. \n for (int r_digits=1; r_digits<count_digits; r_digits++) \n { \n int eq_parts = (int) Math.pow(10, r_digits); \n \n // To avoid numbers like 10, 100, 1000 (These are not \n // Karprekar numbers \n if (eq_parts == n) \n continue; \n \n // Find sum of current parts and compare with n \n sum = sq_n/eq_parts + sq_n % eq_parts; \n }\n if (sum == n){\n System.out.println(\"Kaprekar number\");\n }else{\n System.out.println(\"Not a Kaprekar number\");\n }\n }",
"static int sherlockAndAnagrams(String s) {\n int total = 0;\n for (int width = 1; width <= s.length() - 1; width++) {\n\n for(int k = 0 ;k <= s.length() - width; k++){\n\n String sub = s.substring(k, k + width);\n\n int[] subFreq = frequenciesOf(sub);\n for (int j = k + 1; j <= s.length() - width; j++) {\n String target = s.substring(j, j + width);\n if (areAnagrams(subFreq,frequenciesOf(target))) total = total + 1;\n }\n }\n }\n return total;\n }",
"public static void main(String[] args) {\n\t\tScanner in=new Scanner(System.in);\r\n\t\tint n=in.nextInt();\r\n\t\tint nCont=0;\r\n\t\tlong max=0;\r\n\t\tlong sum=0;\r\n\t\tin.nextLine();\r\n\t\tHashMap<Long, Integer> maps=new HashMap<>();\r\n\t\tfor (int i=0;i<n;++i){\r\n\t\t\tString[] line=in.nextLine().split(\" \");\r\n\t\t\tif (line[0].equals(\"1\")){\r\n\t\t\t\tlong len=Long.parseLong(line[1]);\r\n\t\t\t\tmax=Math.max(max, len);\r\n\t\t\t\tnCont++;\r\n\t\t\t\tsum+=len;\r\n\t\t\t\tif (maps.containsKey(len)){\r\n\t\t\t\t\tmaps.put(len,maps.get(len)+1);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tmaps.put(len, 1);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tlong len=Long.parseLong(line[1]);\r\n\t\t\t\tif (maps.get(len)==1){\r\n\t\t\t\t\tmaps.remove(len);\r\n\t\t\t\t\tif (len==max){\r\n\t\t\t\t\t\tmax=findMax(maps);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tmaps.put(len, maps.get(len)-1);\r\n\t\t\t\t}\r\n\t\t\t\tnCont--;\r\n\t\t\t\tsum-=len;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (nCont<3){\r\n\t\t\t\tSystem.out.println(\"No\");\r\n\t\t\t}else if (sum-max>max){\r\n\t\t\t\tSystem.out.println(\"Yes\");\r\n\t\t\t}else{\r\n\t\t\t\tSystem.out.println(\"No\");\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"@Override\r\n\tpublic int challengeThree(int[] arr) {\n\t\treturn 0;\r\n\t}",
"private static Answer kruskalsAlgo(int v, int e, List<edge> edges) {\n Collections.sort(edges, new Comparator<edge>() {\n @Override\n public int compare(edge o1, edge o2) {\n return o1.w - o2.w;\n }\n });\n //To apply unionfind algorithm , we need to maintain a parent array\n //this will be initialised with same vertex\n int[] p = new int[v];\n for (int i = 0; i < v; i++) {\n p[i] = i;\n }\n //keep a boolean visited array\n boolean[] vis = new boolean[v];\n int cost=0;\n //iterate though edges 1 by 1 and check for cycle detection either by hasPath method or by unionFindalgorithm\n for (int i = 0; i < e; i++) {\n edge edge = edges.get(i);\n\n int p1 = findTopmostParent(edge.a, p);\n int p2 = findTopmostParent(edge.b, p);\n\n if (p1!=p2 && edges.get(i).w <A ) {\n cost+=edges.get(i).w;\n p[p2] = p1;\n\n }\n }\n int c =0;\n for(int i =0;i<v;i++){\n if(p[i]==i){\n c++;\n }\n }\n cost+=c*A;\n return new Answer(c,cost );\n }",
"@Override\r\n\tpublic boolean solutionCase() {\n\t\tint v=0, e1=0, e2=0, w=0, a=0;\r\n\t\twhile(sc.hasNextInt()){\r\n\t\t\tv=sc.nextInt();\r\n\t\t\ta=sc.nextInt();\r\n\t\t\tEdgeWeightedGraph g= new EdgeWeightedGraph(v);\r\n\t\t\tfor(int i=0;i<a;++i){\r\n\t\t\t\te1=sc.nextInt();\r\n\t\t\t\te2=sc.nextInt();\r\n\t\t\t\tw=sc.nextInt();\r\n\t\t\t\tEdge e= new Edge(e1-1, e2-1, w);\r\n\t\t\t\tg.addEdge(e);\r\n\t\t\t}\r\n\t\t\tDijkstraS m = new DijkstraS(g, 0);\r\n\t\t\t\r\n\t\t\tfor(int i=0;i<v;i++)\r\n\t\t\t\tSystem.out.println(\"V[\"+i+\"] \"+m.nWays[i]);\r\n\t\t\t\t//System.out.println(m.nWays[v-1]);\r\n\t\t\t\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"public static void main(String[] args) throws IOException {\n\t\tbr = new BufferedReader(new FileReader(new File(\"input.txt\")));\r\n\t\tSystem.setOut(new PrintStream(new File(\"output.txt\")));\r\n\t\tint T = readInt();\r\n\t\t\r\n\t\tfor (int ind = 1; ind<=T; ind++) {\r\n\t\t\tSystem.out.print(\"Case #\" + ind + \": \");\r\n\t\t\t\r\n\t\t\tint N = readInt();\r\n\t\t\tint[] ar = readIntArr();\r\n\t\t\tfor (int i = 0; i < N; i++)ar[i]--;\r\n\t\t\tboolean used[] = new boolean[N];\r\n\t\t\tint ans = 0;\r\n\t\t\tint pairMax = 0;\r\n\t\t\tint cycleMax = 0;\r\n\t\t\tint cyclePair = 0;\r\n\t\t\tint pair = 0;\r\n\t\t\tfor (int i = 0; i < N; i++) {\r\n\t\t\t\tif (!used[i]) {\r\n\t\t\t\t\tList<Integer> list = new LinkedList<Integer>();\r\n\t\t\t\t\tlist.add(i);\r\n\t\t\t\t\tused[i] = true;\r\n\t\t\t\t\tint j = ar[i];\r\n\t\t\t\t\twhile(!list.contains(j) && !used[j]) {\r\n\t\t\t\t\t\tlist.add(j);\r\n\t\t\t\t\t\tused[j] = true;\r\n\t\t\t\t\t\tj = ar[j];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!list.contains(j))continue;\r\n\t\t\t\t\tif (list.size() == 2)pair++;\r\n\t\t\t\t\tboolean removed = false;\r\n\t\t\t\t\twhile(list.get(0) != j){list.remove(0);removed = true;}\r\n\t\t\t\t\tif (list.size() > 2 && list.size() > cycleMax) cycleMax = list.size();\r\n\t\t\t\t\tif (list.size() == 2) {\r\n\t\t\t\t\t\tint a = list.remove(0);\r\n\t\t\t\t\t\tint b = list.remove(0);\r\n\t\t\t\t\t\tint tmp = 2;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tboolean us[] = new boolean[N];\r\n\t\t\t\t\t\t\tus[a] = true;\r\n\t\t\t\t\t\t\tus[b] = true;\r\n\t\t\t\t\t\t\t//System.out.println(\" test \" + a + b);\r\n\t\t\t\t\t\t\tSet<Integer> set = new HashSet<Integer>();\r\n\t\t\t\t\t\t\tset.add(a);\r\n\t\t\t\t\t\t\twhile (true) {\r\n\t\t\t\t\t\t\t\tboolean found = false;\r\n\t\t\t\t\t\t\t\tSet<Integer> tSet = new HashSet<Integer>();\r\n\t\t\t\t\t\t\t\tfor (int ii = 0; ii < N; ii++) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif (!us[ii] && set.contains(ar[ii])) {\r\n\t\t\t\t\t\t\t\t\t\tus[ii] = true;\r\n\t\t\t\t\t\t\t\t\t\tfound = true;\r\n\t\t\t\t\t\t\t\t\t\ttSet.add(ii);\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\tif (found)tmp++;\r\n\t\t\t\t\t\t\t\tif (!found)break;\r\n\t\t\t\t\t\t\t\tset.addAll(tSet);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tset = new HashSet<Integer>();\r\n\t\t\t\t\t\t\tset.add(b);\r\n\t\t\t\t\t\t\twhile (true) {\r\n\t\t\t\t\t\t\t\tboolean found = false;\r\n\t\t\t\t\t\t\t\tSet<Integer> tSet = new HashSet<Integer>();\r\n\t\t\t\t\t\t\t\tfor (int ii = 0; ii < N; ii++) {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif (!us[ii] && set.contains(ar[ii])) {\r\n\t\t\t\t\t\t\t\t\t\tus[ii] = true;\r\n\t\t\t\t\t\t\t\t\t\tfound = true;\r\n\t\t\t\t\t\t\t\t\t\ttSet.add(ii);\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\tif(found)tmp++;\r\n\t\t\t\t\t\t\t\tif (!found)break;\r\n\t\t\t\t\t\t\t\tset.addAll(tSet);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//if (removed) {\r\n\t\t\t\t\t\t//\tif (tmp > cyclePair)cyclePair = tmp;\r\n\t\t\t\t\t\t//} else {\r\n\t\t\t\t\t\t pairMax += tmp;\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}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//cyclePair += 2 * pair;\r\n\t\t\t//if (pair > 1) pairMax += 2 * (pair - 1);\r\n\t\t\tans = Math.max(cyclePair, pairMax);\r\n\t\t\tans = Math.max(cycleMax, ans);\r\n\t\t\tSystem.out.println(ans);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\r\n\t}",
"public static void main(String[] args) {\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(3, 3, 3, false, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(4, 3, 4, true, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(5, 3, 5, true, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(4, 3, 4, false, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(5, 3, 5, false, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(2, 2, 2, false, \"cartellainesistente\")));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(2, 2, 2, false, \"cartellainesistente\")));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(2, 2, 2, true, \"cartellainesistente\")));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(2, 2, 2, true, \"cartellainesistente\")));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(3, 3, 3, false, \"strategies\")));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(3, 3, 3, false, \"strategies\")));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(3, 3, 3, true, \"strategies\")));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(3, 3, 3, true, \"strategies\")));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(2, 2, 2, false, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(2, 2, 2, true, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(3, 3, 3, false, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(3, 3, 3, true, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(5, 5, 2, false, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(5, 5, 2, true, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(6, 6, 2, false, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(6, 6, 2, true, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(4, 4, 3, false, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(4, 4, 3, true, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(7, 7, 2, true, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(7, 7, 2, false, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(4, 4, 4, false, null)));\n tryOrPrintStackTrace(() -> measureTime(() -> testOptimalMNK(4, 4, 4, true, null)));\n measureTime(()->checkInterruptSequential(4, 4, 3, false));\n measureTime(()->checkInterruptSequential(4, 4, 3, true));\n }",
"@Override\n\tpublic void challenge13() {\n\n\t}",
"public static void main(String[] args) {\n FastReader sc = new FastReader();\n long t = sc.nextLong();\n for (long i = 0; i < t; i++) {\n String[] in = sc.nextLine().split(\" \");\n BigInteger A = new BigInteger(in[1]);\n BigInteger B = new BigInteger(in[2]);\n BigInteger K = new BigInteger(in[3]);\n BigInteger N = new BigInteger(in[0]);\n BigInteger countA=N.divide(A);\n BigInteger countB=N.divide(B);\n BigInteger count=countA.add(countB);\n //System.out.println(\"countA = \" + countA);\n //System.out.println(\"countB = \" + countB);\n BigInteger countBoth=(N.divide(A.multiply(B)));\n count=count.subtract(countBoth.multiply(BigInteger.valueOf(2)));\n //System.out.println(\"count = \" + count);\n if (count.compareTo(K)>=0) {\n System.out.println(\"Win\");\n } else {\n System.out.println(\"Lose\");\n }\n }\n }",
"static String solve(String puzzle, String delimiter) {\n char cc = 0; // Current character\n\n // Melakukan iterasi ke dalam string dan menyimpan alfabet ke dalam cc\n for (int i = 0; i < puzzle.length(); i++) {\n if (isAlphabetic(puzzle.charAt(i))) {\n cc = puzzle.charAt(i);\n break;\n }\n }\n\n if (cc == 0) {\n // Jika seluruh karakter dalam string sudah diganti dengan digit angka, maka akan dilakukan pengujian\n // terhadap kombinasi angka\n\n totalTest++; // Menghitung total tes yang dilakukan untuk menemukan kombinasi angka yang benar\n String[] operands = puzzle.split(delimiter);\n int op1 = check(operands[0]);\n int op2 = check(operands[1]);\n if (op1 == op2) {\n return puzzle;\n } else {\n return \"\";\n }\n } else {\n // Buat array of numbers [0..9] untuk menyimpan angka-angka yang sudah digunakan\n boolean[] numbers = new boolean[10];\n\n // Melakukan iterasi ke dalam string untuk menandai angka-angka yang sudah digunakan\n for (int i = 0; i < puzzle.length(); i++)\n if (isDigit(puzzle.charAt(i)))\n numbers[puzzle.charAt(i) - '0'] = true;\n\n for (int i = 0; i < 10; i++) {\n if (!numbers[i]) {\n\n // Melakukan substitusi alfabet dengan angka sampai ketemu kombinasi angka yang sesuai\n String solution = solve(puzzle.replaceAll(String.valueOf(cc),\n String.valueOf(i)), delimiter);\n\n // Jika kombinasi angka sudah teruji benar secara matematis,\n // kita akan cek apakah ada angka 0 di depan\n if (!solution.isEmpty()) {\n String[] split = solution.split(\"\\n\");\n boolean zeroAtLeft = false;\n\n for (int j = 0; j < split.length; j++){\n split[j] = split[j].trim();\n if (split[j].charAt(0) == '0'){\n zeroAtLeft = true;\n break;\n }\n }\n // Jika tidak ada angka 0 di depan, solusi ditemukan dan di-return ke main\n if (!zeroAtLeft) {\n return solution;\n }\n }\n }\n }\n }\n return \"\";\n }",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tint a = sc.nextInt();\r\n\t\tfor (int i = 0; i < a; i++) {\r\n\t\t\tint n = sc.nextInt();\r\n\t\t\tint m = sc.nextInt();\r\n\t\t\tint J = 4 * n - m;\r\n\t\t\tint T = m - 2 * n;\r\n\r\n\t\t\tif (J % 2 == 0 && T % 2 == 0 && J >= 0 && T >= 0)\r\n\t\t\t\tSystem.out.println(String.format(\"%d %d\", J / 2, T / 2));\r\n\t\t\telse\r\n\t\t\t\tSystem.out.println(\"No answer\");\r\n\r\n\t\t}\r\n\t}",
"public static void main(String[] args) {\n\t\tString number = \"777777\";\n\t\tint k = 2;\n\t\t\n\t\t//solution(number, k, 0, \"\", 0);\n\t\tsol(number, k);\n\t\t\n\t}",
"public static void main(String[] args) throws IOException {\n BufferedReader f = new BufferedReader(new InputStreamReader(System.in));\n PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));\n int n = Integer.parseInt(f.readLine());\n HashSet<String> res = new HashSet<>();\n for(int i = 0; i < n; i++) {\n StringTokenizer st = new StringTokenizer(f.readLine());\n int k = Integer.parseInt(st.nextToken());\n int b = -Integer.parseInt(st.nextToken());\n if(k == 0) {\n continue;\n }\n if(k < 0) {\n k = -k;\n b = -b;\n }\n int gcd = gcd(k, Math.abs(b));\n k /= gcd;\n b /= gcd;\n res.add(b+\"/\"+k);\n }\n out.println(res.size());\n f.close();\n out.close();\n }",
"public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n int n = in.nextInt();\n int k = in.nextInt();\n int q = in.nextInt();\n\n int a[] = new int[n];\n for(int a_i=0; a_i < n; a_i++){\n a[a_i] = in.nextInt();\n }\n\n int fist;\n int last;\n\n //brute force will get timeout\n for(int i = 0; i< k; i++){\n fist = a[0];\n last = a[n-1];\n a[0] = last;\n for (int j = 1; j<n; j++){\n last = a[j];\n a[j] = fist;\n fist = last;\n }\n }\n\n for(int a0 = 0; a0 < q; a0++){\n System.out.println(a[in.nextInt()]);\n }\n\n\n }",
"public static void main(String args[]){\n String s=\"abcabcbb\";\n String s1=\"bbbbb\";\n String s2=\"pwwkew\";\n System.out.println(solution(s));\n System.out.println(solution(s1));\n System.out.println(solution(s2));\n System.out.println(maxNonrepeatingstring(s));\n System.out.println(maxNonrepeatingstring(s1));\n System.out.println(maxNonrepeatingstring(s2));\n }",
"public static void main(String[] args) throws Exception {\n\t\tString filePath = \"/Users/Alen/Documents/CodeJam/2013/Qualification/C-Large-1.in\";\n\n\t\tBufferedReader br = new BufferedReader(new FileReader(filePath));\n\t\tString outFile = filePath.substring(0, filePath.lastIndexOf('.'))\n\t\t\t\t+ \".out\";\n\t\tBufferedWriter bw = new BufferedWriter(new FileWriter(outFile));\n\t\t\n\t\tfinal int MAX_POWER = 16;\n\t\t\n\t\tint[] palindrome = new int[MAX_POWER / 2];\n\t\tInteger[] palindromeSquarePalindrome = new Integer[MAX_POWER];\n\t\tList<Integer[]> pspList = new ArrayList<Integer[]>();\n\t\t\n\t\tfor (int i = 1; i <= palindrome.length; i++) {\n\t\t\tfor (int i2 = 0; i2 < palindrome.length; i2++) {\n\t\t\t\tpalindrome[i2] = 0;\n\t\t\t}\n\t\t\tfor (int i3 = 0; i3 < palindromeSquarePalindrome.length; i3++) {\n\t\t\t\tpalindromeSquarePalindrome[i3] = 0;\n\t\t\t}\n\t\t\tpalindromeSquarePalindrome[palindromeSquarePalindrome.length - 1] = 2 * i - 1;\n\t\t\t\n\t\t\tint j = 0;\n\t\t\twhile (j >= 0 && j <= i / 2) {\n\t\t\t\tif (palindrome[j] == 0) {\n\t\t\t\t\tif (j == 0 || j >= (i - 1) / 2 ) palindrome[j] = palindrome[i - j - 1] = 1;\n\t\t\t\t\telse {\n\t\t\t\t\t\tj++;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tboolean isPalindrome = true;\nk:\t\t\t\tfor (int k = 0; k < i; k++) {\n\t\t\t\t\tint palindromeSquare = 0;\n\t\t\t\t\tfor (int l = 0; l <= k; l++) {\n\t\t\t\t\t\tpalindromeSquare += palindrome[l] * palindrome[k - l];\n\t\t\t\t\t\tif (palindromeSquare > 9) {\n\t\t\t\t\t\t\tisPalindrome = false;\n\t\t\t\t\t\t\tbreak k;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tpalindromeSquarePalindrome[k] = palindromeSquare;\n\t\t\t\t\tpalindromeSquarePalindrome[2 * i - 2 - k] = palindromeSquare;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (isPalindrome) {\n\t\t\t\t\tpspList.add(palindromeSquarePalindrome.clone());\n\t\t\t\t\tif (j < (i - 1) / 2 || palindrome[j] == 9) {\n\t\t\t\t\t\tj++;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tpalindrome[j] = 0;\n\t\t\t\t\tpalindrome[i - j - 1] = 0;\n\t\t\t\t\tj--;\n\t\t\t\t}\n\t\t\t\tif (j >= 0) {\n\t\t\t\t\tint newValue = palindrome[j] + 1;\n\t\t\t\t\t//newValue %= 10;\n\t\t\t\t\tif (j == 0 && newValue == 0) {\n\t\t\t\t\t\tnewValue = 1;\n\t\t\t\t\t}\n\t\t\t\t\tpalindrome[j] = newValue;\n\t\t\t\t\tpalindrome[i - j - 1] = newValue;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\t\n\t\tString line = br.readLine();\n\t\tint t = Integer.valueOf(line);\n\t\tfor (int i = 0; i < t; i++) {\n\t\t\t// TODO main logical\n\t\t\t// ...\n\t\t\tline = br.readLine();\n\t\t\tString[] strs = line.split(\" \");\n\t\t\tInteger[] a = new Integer[MAX_POWER];\n\t\t\tInteger[] b = new Integer[MAX_POWER];\n\t\t\ta[a.length - 1] = strs[0].length();\n\t\t\tfor (int k = 0; k < strs[0].length(); k++) {\n\t\t\t\ta[k] = strs[0].charAt(k) - 0x30;\n\t\t\t}\n\t\t\tb[b.length - 1] = strs[1].length();\n\t\t\tfor (int k = 0; k < strs[1].length(); k++) {\n\t\t\t\tb[k] = strs[1].charAt(k) - 0x30;\n\t\t\t}\n\t\t\t\n\t\t\tint start = 0;\n\t\t\tfor (int k = 0; k < pspList.size(); k++) {\n\t\t\t\tif (compare(a, pspList.get(k)) <= 0) {\n\t\t\t\t\tstart = k;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tint end = pspList.size();\n\t\t\tfor (int k = start; k < pspList.size(); k++) {\n\t\t\t\tif (compare(b, pspList.get(k)) < 0) {\n\t\t\t\t\tend = k;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// TODO output\n\t\t\tbw.write(String.format(\"Case #%d: %d\\r\\n\", i + 1, end - start));\n\t\t}\n\n\t\tbw.flush();\n\t\tbw.close();\n\t\tbr.close();\n\n\t}",
"private static int solution3(String s) {\r\n int n = s.length();\r\n Set<Character> set = new HashSet<>();\r\n int ans = 0, i = 0, j = 0;\r\n while (i < n && j < n) {\r\n if (!set.contains(s.charAt(j))) {\r\n set.add(s.charAt(j++));\r\n ans = Math.max(ans, j - i);\r\n } else {\r\n set.remove(s.charAt(i++));\r\n }\r\n }\r\n return ans;\r\n }",
"public static void main(String[] args) {\n Scanner in = new Scanner (System.in);\n int n = in.nextInt(), k = in.nextInt();\n int[] t = new int[n]; for ( int i = 0; i < n; ++i ) { t[i] = in.nextInt(); }\n\n int special = 0;\n // the chapter might be numbered '1', but we need to index the vector\n for ( int chapter = 0, page = 1, nextChapterPage; chapter < n; ++chapter, page = nextChapterPage ) {\n int problemsInChapter = t[chapter], pagesInChapter = ( problemsInChapter + k - 1 ) / k;\n nextChapterPage = page + pagesInChapter;\n if ( page > problemsInChapter )\n continue;\n for ( int problem = 1, nextPageProblem; page < nextChapterPage; ++page, problem = nextPageProblem ) {\n nextPageProblem = problem + k;\n if ( page >= problem && page < nextPageProblem && page <= problemsInChapter )\n ++special;\n }\n }\n System.out.println (special);\n }",
"public static void main(String[] args) {\n\t\tScanner sc=new Scanner(System.in);\n\t\tint tc=sc.nextInt();\n\t\twhile(tc-->0)\n\t\t{\n\t\t\tString s=sc.next();\n\t\t\tchar ch[]=s.toCharArray();\n\t\t\tint first=-1;\n\t\t\tint last=-1;\n\t\t\tint crash=0;\n\t\t\tint d=0;\n\t\t\tfor(int i=0,j=ch.length;i<j-1;i++)\n\t\t\t{\n\t\t\t\tif(ch[i]=='r'&&ch[i+1]=='l')\n\t\t\t\t{\n\t\t\t\t\tch[i]='d';\n\t\t\t\t\tch[i+1]='d';\n\t\t\t\t\tcrash+=2;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i=0,j=ch.length;i<j;i++)\n\t\t\t{\n\t\t\t\tif(ch[i]=='d')\n\t\t\t\t{\n\t\t\t\t\td+=1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(d==0)\n\t\t\t{\n\t\t\t\tSystem.out.println(0);\n\t\t\t}else\n\t\t\t{\n\t\t\t\tfor(int i=0,j=ch.length;i<j;i++)\n\t\t\t\t{\n\t\t\t\t\tif(ch[i]=='d')\n\t\t\t\t\t{\n\t\t\t\t\t\tfirst=i;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor(int i=ch.length-1;i>=0;i--)\n\t\t\t\t{\n\t\t\t\t\tif(ch[i]=='d')\n\t\t\t\t\t{\n\t\t\t\t\t\tlast=i;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(first==last)\n\t\t\t\t{\n\t\t\t\t\tfor(int i=0;i<first;i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(ch[i]=='r')\n\t\t\t\t\t\t\tcrash+=1;\n\t\t\t\t\t}\n\t\t\t\t\tfor(int i=ch.length-1;i>=first;i--)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(ch[i]=='l')\n\t\t\t\t\t\t\tcrash+=1;\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println(crash);\n\t\t\t\t}else{\n\t\t\t\t\tfor(int i=0;i<first;i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(ch[i]=='r')\n\t\t\t\t\t\t\tcrash+=1;\n\t\t\t\t\t}\n\t\t\t\t\tfor(int i=ch.length-1;i>=last;i--)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(ch[i]=='l')\n\t\t\t\t\t\t\tcrash+=1;\n\t\t\t\t\t}\n\t\t\t\t\tfor(int i=first;i<=last;i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(ch[i]!='d')\n\t\t\t\t\t\t\tcrash+=1;\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println(crash);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public static void main(String[] args)\n\t{\n\t\tSloution6 an =new Sloution6();\n\t\t//Test case1;\n\t\tint[] src = {0,1};\n\t\tint[] ret = an.sortArrayByParity1(src);\n\t\tfor(int ch:ret)\n\t\tSystem.out.println(ch);\n\t}",
"public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\n\t\tint a[] = {2,1,3,-4,-2};\n\t\t//int a[] = {1 ,2, 3, 7, 5};\n\t\tboolean found = false;\n\t\t\n\t\t//this will solve in o n^2\n\t\tfor(int i = 0 ; i < a.length ; i++){\n\t\t\tint sum = 0;\n\t\t\tfor(int j = i ; j< a.length ; j++){\n\t\t\t\tsum += a[j] ;\n\t\t\t\tif(sum == 0){\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tif(found)\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t\n\t\t// link : https://www.youtube.com/watch?v=PSpuM9cimxA&list=PLKKfKV1b9e8ps6dD3QA5KFfHdiWj9cB1s&index=49\n\t\tSystem.out.println(found + \" found\");\n\t\tfound = false;\n\t\t//solving with O of N with the help sets\n\t\t// x + 0 = y\n\t\tSet<Integer> set = new HashSet<>();\n\t\tint sum = 0;\n\t\tfor(int element : a){\n\t\t\tset.add(sum);\n\t\t\tsum += element;\n\t\t\tif(set.contains(sum)){\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\tSystem.out.println(set);\n\t\t\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t\tfound = false;\n\t\t// when the sum of subarray is K\n\t\t\n\t\t//solving with O of N with the help sets\n\t\t//x + k = y >>>\n\t\tSet<Integer> set1 = new HashSet<>();\n\t\tint k = 12;\n\t\tint summ = 0;\n\t\tfor(int element : a){\n\t\t\tset1.add(summ);\n\t\t\tsumm += element;\n\t\t\tif(set1.contains(summ - k)){ // y - k = x(alredy presnt or not)\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(set1);\n\t\tSystem.out.println();\n\t\tSystem.out.println(found + \" found\");\n\t\t\n\t\t\n\t}",
"static int theLoveLetterMystery(String s) {\n char[] a = s.toCharArray();\n\n int i=0;\n int j=a.length-1;\n int cost=0;\n for(;i<j;i++,j--){\n\n if(a[i]<a[j]){\n cost+=a[j]-a[i];\n a[j]=a[i];\n \n }\n else{\n if(a[i]>a[j]){\n cost+=a[i]-a[j];\n a[i]=a[j];\n \n }\n }\n\n }\n\n System.out.println(\"\");\n\nreturn cost;\n }",
"public static void main(String[] args) {\n\t\t\n\t\tString data = \"\\r\\n\" + \n\t\t\t\t\"3\\r\\n\" + \n\t\t\t\t\"5 2\\r\\n\" + \n\t\t\t\t\"13 32\\r\\n\" + \n\t\t\t\t\"100 1000\";\n\t\t\n\t\tScanner sc = new Scanner(data);\n\t\t\n\t\tint T = sc.nextInt();\n\t\tfor(int test_case = 1; test_case<=T; ++test_case) {\n\t\t\tint minji = sc.nextInt();\n\t\t\tint treasure = sc.nextInt();\n\t\t\tint answer = 0;\n\t\t\t\n\t\t\tint start = (minji<=treasure)? minji : treasure;\n\t\t\tint target = (minji>treasure)? minji : treasure;\n\t\t\t\n\t\t\tint line = 1;\n\t\t\tint left = 1;\n\t\t\tint right =1;\n\t\t\t\n\t\t\tint startLine = 0;\n\t\t\tint targetLine = 0;\n\t\t\t\n\t\t\twhile(startLine == 0 || targetLine == 0) {\n\t\t\t\tif(left <= start && right>= start) \n\t\t\t\t\tstartLine = line;\n\t\t\t\t\n\t\t\t\tif(left <= target && right>= target) {\n\t\t\t\t\ttargetLine = line;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\tleft += line;\n\t\t\t\tright += (line + 1);\n\t\t\t\t\n\t\t\t\t++line;\n\t\t\t}\n\t\t\t\n\t\t\t//System.out.println(startLine + \" \" + targetLine);\n\t\t\t\n\t\t\tleft = start;\n\t\t\tright = start;\n\t\t\tline = startLine;\n\t\t\t\n\t\t\twhile(answer == 0) {\n\t\t\t\tif(targetLine == line) {\n\t\t\t\t\tif(left<=target && right>=target) {\n\t\t\t\t\t\tanswer = targetLine - startLine;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tanswer = targetLine - startLine + Math.min(Math.abs(target - left),Math.abs(right - target));\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t//System.out.println(left);\n\t\t\t\t\n\t\t\t\tleft += line;\n\t\t\t\tright += (line + 1);\n\t\t\t\t\n\t\t\t\t++line;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"#\" + test_case + \" \" + answer);\n\t\t}\n\t}",
"public static void main(String[] args) {\n Huffman huffman=new Huffman(\"Shevchenko Vladimir Vladimirovich\");\n System.out.println(huffman.getCodeText());//\n //answer:110100001001101011000001001110111110110101100110110001001110101111100011101000011011000100111010111110001110100101110101111100000\n\n huffman.getSizeBits();//размер в битах\n ;//кол-во символов\n System.out.println((double) huffman.getSizeBits()/(huffman.getValueOfCharactersOfText()*8)); //коэффициент сжатия относительно aski кодов\n System.out.println((double) huffman.getSizeBits()/(huffman.getValueOfCharactersOfText()*\n (Math.pow(huffman.getValueOfCharactersOfText(),0.5)))); //коэффициент сжатия относительно равномерного кода. Не учитывается размер таблицы\n System.out.println(huffman.getMediumLenght());//средняя длина кодового слова\n System.out.println(huffman.getDisper());//дисперсия\n\n\n }",
"public static void main(String[] args) {\n\t\t\n\t\tString str = \"abccbc\";\n\t\t\n\t\tlong[][] dp = new long[str.length()][str.length()];\t\n\t\t\n\t\tfor (int g=0 ; g<str.length() ; g++) {\n\t\t\t\n\t\t\tfor (int i=0 , j=g ; j<str.length() ; i++ , j++) {\n\t\t\t\tif (g == 0) dp[i][j] = 1;\n\t\t\t\t\n\t\t\t\telse if (g == 1) dp[i][j] = (str.charAt(i) == str.charAt(j)) ? 3 : 2;\n\t\t\t\t\n\t\t\t\telse dp[i][j] = (str.charAt(i) == str.charAt(j)) ? (dp[i][j-1] + dp[i+1][j] + 1) : (dp[i][j-1] + dp[i+1][j] - dp[i+1][j-1]);\n\t\t\t\t\n\t\t\t\t//if (dp[i][j] && str.substring(i, j+1).length() > result.length()) result = str.substring(i, j+1);\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(dp[0][str.length()-1]);\n\t}",
"public static String romaCoding(String s){\n s = s.toLowerCase().replaceAll(\" \", \"\");\n StringBuffer sb = new StringBuffer(s);\n System.out.println(s);\n /**\n * Step1: Reverse the string\n */\n String step1 = sb.reverse().toString();\n System.out.println(step1);\n\n /**\n * Step2: Rail Fence Cipher Coding\n */\n String step2 = RailFenceCipher.railFenceCipherCoding(step1);\n System.out.println(step2);\n\n /**\n * Step3: Computer Key Board Coding\n */\n String step3 = \"\";\n Map<Character, Character> map = KeyBoard.getCodingMap();\n for(int i = 0; i < step2.length(); i++){\n step3 = step3 + map.get(step2.charAt(i));\n }\n System.out.println(step3);\n\n /**\n * Step4: Covert string to numbers with Nokia phone keyboard\n */\n String step4 = \"\";\n Map nokiaMap = KeyBoard.getNokiaCodingMap();\n for(int i = 0; i < step3.length(); i++){\n step4 = step4 + nokiaMap.get(step3.charAt(i)) + \"\";\n }\n System.out.println(step4);\n\n /**\n * Step5: Convert string to morse code\n */\n String step5 = \"\";\n Map morseMap = MorseCode.getMorseMap();\n for(int i = 0; i < step4.length(); i++){\n Character c = step4.charAt(i);\n step5 = step5 + morseMap.get(c) + \"/\";\n }\n System.out.println(step5);\n return step5;\n }",
"public static void main(String[] args) {\n\t\tint n=3;\n\t\tString s=\"1\";\n\t\tint count =1;\n\t\tint k=1;\n\t\twhile(k<n){\n\t\t\tStringBuilder t=new StringBuilder();\n\t\t\t//t.append(s.charAt(0));\n\t\t\tfor(int i=1;i<=s.length();i++){\n\t\t\t\t\t\t\t\t\n\t\t\t\tif(i==s.length() || s.charAt(i-1)!=s.charAt(i)){\n\t\t\t\t\tt.append(count); t.append(s.charAt(i-1));\n\t\t\t\t\tcount=1;\n\t\t\t\t}\n\t\t\t\telse if(s.charAt(i-1)==s.charAt(i)){count=count+1;}\n\t\t\t }\t\n\t\t\t\ts=t.toString();\n\t\t\t\tk=k+1;\n\t\t\t\tSystem.out.println(\"k:\"+k);\n\n\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(s);\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\n\t Scanner in = new Scanner(System.in);\n\t int n = in.nextInt();\n\t int k = in.nextInt();\n\t int a[] = new int[n];\n\t for(int a_i=0; a_i < n; a_i++){\n\t a[a_i] = in.nextInt();\n\t }\n\t int count=0;\n\t for(int a1=0;a1<n-1;a1++)\n\t {\n\t \tfor(int b=1;b<n;b++)\n\t \t{\n\t \t if(a[a1]+a[b]%3==0)\n\t \t {\n\t \t\t count++;\n\t \t }\n\t \t}\n\t }\n\t System.out.println(count);\n\n\t}",
"public static void solve(){\n HashMap<Integer,HashMap<Integer,Queue<String>>> wordsByVowels = new HashMap<>();\n \n\n int n = in.nextInt();\n //String[] words = new String[n];\n for(int i=0; i<n;i++){\n String s = in.next();\n //words[i] = s;\n int vowelCount = vowelCount(s);\n int lastV = lastVowel(s);//a=1,e=2,i=3,o=4,u=5\n //vowelFrequency[vowelCount][lastV]++;\n //store index of a word\n if(!wordsByVowels.containsKey(vowelCount)){\n HashMap<Integer,Queue<String>> hm =new HashMap<>(); \n wordsByVowels.put(vowelCount,hm);\n }\n if(!wordsByVowels.get(vowelCount).containsKey(lastV)){\n wordsByVowels.get(vowelCount).put(lastV,new LinkedList<String>());\n }\n //if(wordsByVowels.get(vowelCount))\n wordsByVowels.get(vowelCount).get(lastV).add(s);\n }\n\n //now separate as complete \n Queue<Pairs> complete = new LinkedList<>();\n Queue<Pairs> incomplete = new LinkedList<>();\n for(Map.Entry<Integer , HashMap<Integer,Queue<String>> > entry: wordsByVowels.entrySet()){\n HashMap<Integer,Queue<String>> lastMap = entry.getValue();\n //iterate over Strings with same number of vowels\n for(Map.Entry<Integer,Queue<String>> e: lastMap.entrySet()){\n //take stack which contains elements with similar endVowel\n Queue<String> st = e.getValue();\n while(st.size()>=2){\n Pairs p = new Pairs();\n p.s1 = st.poll(); \n p.s2 = st.poll(); \n complete.add(p); \n }\n }\n Queue<String> remainings = new LinkedList<>();\n\n for(Map.Entry<Integer,Queue<String>> e: lastMap.entrySet()){\n //take stack which contains elements with similar endVowel\n Queue<String> st = e.getValue();\n if(st.size()>0){\n remainings.add(st.poll());\n }\n }\n while(remainings.size()>=2){\n Pairs p = new Pairs();\n p.s1 = remainings.poll();\n p.s2 = remainings.poll();\n incomplete.add(p); \n }\n }\n \n //System.out.println(\"here\");\n//now we have both complete and incomplete and we can mix them well first mix completes with incompletes then mix completes if left any\n //System.out.printf(\"com %d inc %d\\n\",complete.size(),incomplete.size());\n //System.out.printf(\"com %d inc %d\\n\",complete.size(),incomplete.size());\n int lc = 0;\n if(complete.size()>incomplete.size()){\n lc=incomplete.size()+ (complete.size()-incomplete.size())/2;\n }else{\n lc = complete.size();\n }\n\n System.out.println(lc);\n \n\n while(complete.size()>0 && incomplete.size()>0){\n Pairs inc =incomplete.poll();\n Pairs com =complete.poll();\n System.out.printf(\"%s %s\\n%s %s\\n\",inc.s1,com.s1,inc.s2,com.s2);\n }\n\n while(complete.size()>=2){\n Pairs com =complete.poll();\n Pairs com2 =complete.poll();\n System.out.printf(\"%s %s\\n%s %s\\n\",com2.s1,com.s1,com2.s2,com.s2);\n }\n \n\n\n\n }"
]
| [
"0.6597814",
"0.6560384",
"0.6558962",
"0.6365865",
"0.63385165",
"0.62816286",
"0.6182848",
"0.61749715",
"0.61743927",
"0.61610466",
"0.61505866",
"0.61497396",
"0.6100318",
"0.60745066",
"0.6063933",
"0.60636157",
"0.6059123",
"0.60570043",
"0.6026047",
"0.60145783",
"0.59643584",
"0.5953088",
"0.5913278",
"0.5903607",
"0.5886442",
"0.58562833",
"0.5843694",
"0.5841756",
"0.5814821",
"0.5796197",
"0.57950765",
"0.57886654",
"0.5788257",
"0.57813406",
"0.5774776",
"0.57566184",
"0.574498",
"0.57447433",
"0.57279235",
"0.5725016",
"0.57249",
"0.57037884",
"0.56939226",
"0.5692321",
"0.5687515",
"0.5686428",
"0.56818724",
"0.56781226",
"0.56759775",
"0.5665435",
"0.5663207",
"0.56570345",
"0.56569767",
"0.5654206",
"0.565001",
"0.5649429",
"0.56460965",
"0.5644053",
"0.56372464",
"0.5632503",
"0.5631219",
"0.56299263",
"0.56274414",
"0.5623063",
"0.56173015",
"0.56134796",
"0.56131625",
"0.56064415",
"0.5606266",
"0.5605569",
"0.5604095",
"0.55986434",
"0.55983955",
"0.55981946",
"0.559517",
"0.55946964",
"0.5590336",
"0.55901",
"0.5584134",
"0.5582632",
"0.5582331",
"0.558006",
"0.55771697",
"0.5571914",
"0.5570279",
"0.55676854",
"0.55675954",
"0.5565574",
"0.55586123",
"0.5557854",
"0.55552024",
"0.5554674",
"0.5550993",
"0.55477035",
"0.5541718",
"0.5533572",
"0.5532861",
"0.5532125",
"0.5531736",
"0.55215156",
"0.5521019"
]
| 0.0 | -1 |
Created by hossein on 20200909 | public interface Writeable {
void println(String s);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void perish() {\n \n }",
"public final void mo51373a() {\n }",
"@Override\n public void func_104112_b() {\n \n }",
"private stendhal() {\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 comer() {\n\t\t\n\t}",
"@Override\n public int describeContents() { return 0; }",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"public void mo38117a() {\n }",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"private static void cajas() {\n\t\t\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"private void poetries() {\n\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override public int describeContents() { return 0; }",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\n\tprotected void interr() {\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 gravarBd() {\n\t\t\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"protected boolean func_70814_o() { return true; }",
"@Override\n public void init() {\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 protected void initialize() {\n }",
"public void mo4359a() {\n }",
"@Override\n void init() {\n }",
"private void m50366E() {\n }",
"@Override\r\n\tpublic void init() {}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"Consumable() {\n\t}",
"@Override\n public void init() {}",
"public void mo6081a() {\n }",
"@Override\n protected void init() {\n }",
"@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}",
"protected void mo6255a() {\n }",
"@Override\n\t\tpublic void init() {\n\t\t}",
"@Override\n protected void prot() {\n }",
"protected MetadataUGWD() {/* intentionally empty block */}",
"@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\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}",
"@Override\n protected void initialize() {\n\n \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 int retroceder() {\n return 0;\n }",
"@Override\r\n\t\t\tpublic void test() {\n\t\t\t}",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"public Pitonyak_09_02() {\r\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n public int getSize() {\n return 1;\n }",
"@Override\n\tpublic void nghe() {\n\n\t}",
"public void mo1531a() {\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\n protected void initialize() \n {\n \n }",
"public void mo55254a() {\n }",
"private Rekenhulp()\n\t{\n\t}",
"@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\n\t}",
"protected abstract Set method_1559();",
"Petunia() {\r\n\t\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}",
"private Singletion3() {}",
"@Override\n\tpublic void jugar() {\n\t\t\n\t}",
"@Override\n public int getOrder() {\n return 0;\n }",
"public void gored() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\n public int describeContents()\n {\n return 0;\n }",
"public void mo12930a() {\n }",
"@Override\n\tpublic void einkaufen() {\n\t}"
]
| [
"0.5815176",
"0.562788",
"0.5608592",
"0.5457804",
"0.5441895",
"0.5441895",
"0.5424193",
"0.5378236",
"0.53571206",
"0.5350915",
"0.5336255",
"0.53133",
"0.5311852",
"0.5306894",
"0.53001803",
"0.52977866",
"0.5274974",
"0.52404803",
"0.523517",
"0.522932",
"0.52234995",
"0.5196926",
"0.51874346",
"0.51846915",
"0.51813847",
"0.51809776",
"0.5177973",
"0.5140195",
"0.5139037",
"0.5139037",
"0.5139037",
"0.5139037",
"0.5139037",
"0.5139037",
"0.5139037",
"0.5133969",
"0.5133253",
"0.5129932",
"0.5129132",
"0.51184523",
"0.5095116",
"0.5095116",
"0.5095116",
"0.5095116",
"0.5095116",
"0.5095116",
"0.50944847",
"0.5092241",
"0.50908226",
"0.50834554",
"0.5075192",
"0.50743455",
"0.50723743",
"0.506237",
"0.5050473",
"0.504983",
"0.503707",
"0.50152326",
"0.50152326",
"0.50152326",
"0.50152326",
"0.50152326",
"0.50081265",
"0.5005345",
"0.5000211",
"0.4996607",
"0.498867",
"0.498867",
"0.498867",
"0.49860877",
"0.49740273",
"0.49637413",
"0.49637413",
"0.49637413",
"0.4961762",
"0.49610862",
"0.49590176",
"0.49517667",
"0.49493697",
"0.4946471",
"0.4946471",
"0.49456814",
"0.49446836",
"0.49418858",
"0.49399856",
"0.49376464",
"0.49369857",
"0.49325064",
"0.49321002",
"0.49320748",
"0.4929661",
"0.49244174",
"0.49244174",
"0.49234498",
"0.49222648",
"0.492064",
"0.4919419",
"0.4917655",
"0.49153477",
"0.4914901",
"0.49114478"
]
| 0.0 | -1 |
Creates new form ManejoListaDistribucion | public ManejoListaDistribucion() {
initComponents();
var dataUser = Data.getData();
var user = dataUser.getUser();
var strError = "";
var objManejoArchivo = new ManejoArchivo();
var listaMostrar = new DefaultListModel();
File Archivo = new File("C:/MEIA/lista.txt");
var lista = objManejoArchivo.LecturaCompleta(Archivo, strError);
for (int i = 0; i < lista.size(); i++) {
var splitAux = lista.get(i).split(Pattern.quote("|"));
if(splitAux[1].equals(user) && splitAux[5].equals("1")){
listaMostrar.addElement(splitAux[0] + "-" + splitAux[2]);
}
}
Archivo = new File("C:/MEIA/bitacora_lista.txt");
lista = objManejoArchivo.LecturaCompleta(Archivo, strError);
for (int i = 0; i < lista.size(); i++) {
var splitAux = lista.get(i).split(Pattern.quote("|"));
if(splitAux[1].equals(user) && splitAux[5].equals("1")){
listaMostrar.addElement(splitAux[0] + "-" + splitAux[2]);
}
}
lListas.setModel(listaMostrar);
listaMostrar = new DefaultListModel();
Archivo = new File("C:/MEIA/contactos.txt");
lista = objManejoArchivo.LecturaCompleta(Archivo, strError);
for (int i = 0; i < lista.size(); i++) {
var splitAux = lista.get(i).split(Pattern.quote("|"));
if(splitAux[0].equals(user) && splitAux[4].equals("1")){
listaMostrar.addElement(splitAux[1]);
}
}
Archivo = new File("C:/MEIA/bitacora_contactos.txt");
lista = objManejoArchivo.LecturaCompleta(Archivo, strError);
for (int i = 0; i < lista.size(); i++) {
var splitAux = lista.get(i).split(Pattern.quote("|"));
if(splitAux[0].equals(user) && splitAux[4].equals("1")){
listaMostrar.addElement(splitAux[1]);
}
}
lContactoTotal.setModel(listaMostrar);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String nuevo() {\n\n\t\tLOG.info(\"Submitado formulario, accion nuevo\");\n\t\tString view = \"/alumno/form\";\n\n\t\t// las validaciones son correctas, por lo cual los datos del formulario estan en\n\t\t// el atributo alumno\n\n\t\t// TODO simular index de la bbdd\n\t\tint id = this.alumnos.size();\n\t\tthis.alumno.setId(id);\n\n\t\tLOG.debug(\"alumno: \" + this.alumno);\n\n\t\t// TODO comprobar edad y fecha\n\n\t\talumnos.add(alumno);\n\t\tview = VIEW_LISTADO;\n\t\tmockAlumno();\n\n\t\t// mensaje flash\n\t\tFacesContext facesContext = FacesContext.getCurrentInstance();\n\t\tExternalContext externalContext = facesContext.getExternalContext();\n\t\texternalContext.getFlash().put(\"alertTipo\", \"success\");\n\t\texternalContext.getFlash().put(\"alertMensaje\", \"Alumno \" + this.alumno.getNombre() + \" creado con exito\");\n\n\t\treturn view + \"?faces-redirect=true\";\n\t}",
"public ViewCreatePagamento() {\n initComponents();\n clientesDAO cDAO = DaoFactory.createClientesDao(); \n matriculaDAO mDAO = DaoFactory.createMatriculaDao();\n \n cmbIDClientes.addItem(null);\n cDAO.findAll().forEach((p) -> {\n cmbIDClientes.addItem(p.getNome());\n });\n \n \n txtDataAtual.setText(DateFormat.getDateInstance().format(new Date()));\n }",
"public void CrearNew(ActionEvent e) {\n List<Pensum> R = ejbFacade.existePensumID(super.getSelected().getIdpensum());\n if(R.isEmpty()){\n super.saveNew(e);\n }else{\n new Auxiliares().setMsj(3,\"PENSUM ID YA EXISTE\");\n }\n }",
"@GetMapping(value = \"/create\") // https://localhost:8080/etiquetasTipoDisenio/create\n\tpublic String create(Model model) {\n\t\tetiquetasTipoDisenio etiquetasTipoDisenio = new etiquetasTipoDisenio();\n\t\tmodel.addAttribute(\"title\", \"Registro de una nuev entrega\");\n\t\tmodel.addAttribute(\"etiquetasTipoDisenio\", etiquetasTipoDisenio); // similar al ViewBag\n\t\treturn \"etiquetasTipoDisenio/form\"; // la ubicacion de la vista\n\t}",
"public creacionempresa() {\n initComponents();\n mostrardatos();\n }",
"public GestaoFormando() {\n \n initComponents();\n listarEquipamentos();\n listarmapainscritos();\n }",
"public void AddReliquias(){\n DLList reliquias = new DLList();\n reliquias.insertarInicio(NombreReliquia); \n }",
"private void ucitajPodatke() {\n \n DefaultListModel<Voznja> m = new DefaultListModel<>();\n obrada.getPodaci().forEach(s->m.addElement(s));\n lstPodaci.setModel(m);\n\n }",
"@Command\n\tpublic void nuevoAnalista(){\n\t\tMap<String, Object> parametros = new HashMap<String, Object>();\n\n\t\t//parametros.put(\"recordMode\", \"NEW\");\n\t\tllamarFormulario(\"formularioAnalistas.zul\", null);\n\t}",
"public void crear() {\n con = new Conexion();\n con.setInsertar(\"insert into lenguajes_programacion (nombre, fecha_creacion, estado) values ('\"+this.getNombre()+\"', '\"+this.getFecha_creacion()+\"', 'activo')\");\n }",
"public CrearPedidos() {\n initComponents();\n }",
"public frmAdministracion() {\n initComponents();\n skin();\n DaoAdministracion da = new DaoAdministracion();\n da.setAdministracion(txtMedioAdministracion.getText());\n tblAdministracion.setModel(da.listar());\n\n }",
"public Listagem() {\n initComponents();\n editora = new EditoraPersistencia(\"Editoras.txt\");\n autor = new AutorPersistencia(\"Autores.txt\");\n areaDeConhecimento = new AreaDeConhecimentoPersistencia(\"DDD.txt\");\n colaborador = new ColaboradorPersistencia(\"Colaboradores.txt\");\n livro = new LivroPersistencia(\"Livros.txt\");\n \n // Criando tabela Listar Autor\n DefaultTableModel modelAutores = (DefaultTableModel) jTable_tabelaAutores.getModel();\n jTable_tabelaAutores.setRowSorter(new TableRowSorter(modelAutores)); \n \n // Criando tabala Listar Area de Conhecimento\n DefaultTableModel modelAreasDeConhecimento = (DefaultTableModel) jTable_tabelaAreaDeConhecimento.getModel();\n jTable_tabelaAreaDeConhecimento.setRowSorter(new TableRowSorter(modelAreasDeConhecimento)); \n \n //Criando tabela Listar Colaboradores\n DefaultTableModel modelColaboradores = (DefaultTableModel) jTable_tabelaColaboradores.getModel();\n jTable_tabelaColaboradores.setRowSorter(new TableRowSorter(modelColaboradores));\n \n //Criando tabela Listar Livros\n DefaultTableModel modelLivros = (DefaultTableModel) jTable_tabelaLivros.getModel();\n jTable_tabelaLivros.setRowSorter(new TableRowSorter(modelLivros));\n \n try{\n listarDadosNaTelaEditora(editora.recuperar());\n listarDadosNaTelaAutor(autor.recuperar(),modelAutores);\n listarDadosNaTelaAreaDeConhecimento(areaDeConhecimento.recuperar(), modelAreasDeConhecimento);\n listarDadosNaTelaColaborador(colaborador.recuperar(),modelColaboradores);\n listarDadosNaTelaLivro(livro.recuperar(),modelLivros);\n }catch (Exception erro){\n JOptionPane.showMessageDialog(rootPane, erro);\n }\n }",
"public static void create(Formulario form){\n daoFormulario.create(form);\n }",
"public String crea() {\n c.setId(0);\n clienteDAO.crea(c); \n //Post-Redirect-Get\n return \"visualiza?faces-redirect=true&id=\"+c.getId();\n }",
"public void crearModelo() {\n modeloagr = new DefaultTableModel(null, columnasAgr) {\n public boolean isCellEditable(int fila, int columna) {\n return false;\n }\n };\n tbl.llenarTabla(AgendarA.tblAgricultor, modeloagr, columnasAgr.length, \"SELECT idPersonalExterno,cedula,CONCAT(nombres,' ',apellidos),municipios.nombre,telefono,telefono2,telefono3 FROM personalexterno,municipios WHERE tipo='agricultor' AND personalexterno.idMunicipio=municipios.idMunicipio\");\n tbl.alinearHeaderTable(AgendarA.tblAgricultor, headerColumnas);\n tbl.alinearCamposTable(AgendarA.tblAgricultor, camposColumnas);\n tbl.rowNumberTabel(AgendarA.tblAgricultor);\n }",
"public void ListModelCreator(String NombreLista, String NombreTabla) {\r\n ArrayList<String> Atributos = new ArrayList();\r\n System.out.println(\"\");\r\n System.out.println(\"DefaultTableModel model = new DefaultTableModel();\");\r\n int NumVariables = this.Num_Atributes;\r\n String Lista = NombreLista;\r\n for (int i = 0; i < NumVariables; i++) {\r\n String Dato = this.DeclaredFields[i].getName();\r\n Atributos.add(Dato);\r\n System.out.println(\"model.addColumn(\\\"\"\r\n + Dato + \"\\\");\");\r\n }\r\n System.out.println(\"if (\" + Lista + \".size() >= 0) {\");\r\n System.out.println(\"Object[] o = new Object[model.getColumnCount()];\");\r\n System.out.println(\"for (int i = 0; i < \" + Lista + \".size(); i++) {\");\r\n for (int i = 0; i <= NumVariables; i++) {\r\n try {\r\n System.out.println(\"o[\" + i + \"] = \" + Lista + \".get(i).get\" + Atributos.get(i) + \"();\");\r\n } catch (Exception e) {\r\n }\r\n\r\n }\r\n System.out.println(\"model.addRow(o);\");\r\n System.out.println(\"}\");\r\n System.out.println(\"}\");\r\n String Tabla = NombreTabla;\r\n System.out.println(Tabla + \".setModel(model);\");\r\n }",
"public ListaComuniModel() {\n\t\tsuper();\n\t}",
"public Lista(int idLista, String nombreAgasajado, Date fechaAgasajo,int montoParticipante, int montoRecaudado,Date FechaInicio, Date FechaFin, boolean estado, String mail, UsuarioDeLista admin)\r\n\t{\r\n\t\tthis.idLista = idLista;\r\n\t\tthis.fechaAgasajo = fechaAgasajo;\r\n\t\tthis.montoPorParticipante = montoParticipante;\r\n\t\tthis.montoRecaudado = montoRecaudado;\r\n\t\tthis.administrador = admin;\r\n\t\tthis.fechaInicio = FechaInicio;\r\n\t\tthis.fechaFin = FechaFin;\r\n\t\tthis.nombreAgasajado = nombreAgasajado;\r\n\t\tthis.estado = estado;\r\n\t\tthis.mail = mail;\r\n\t\tthis.administrador = admin;\r\n\t}",
"public frmListarPedido(ArrayList<Pedido> pedd) {\n initComponents();\n listaPedidos = pedd;\n DefaultTableModel modelo = (DefaultTableModel)TablePedidos.getModel();\n for (int i = 0; i < listaPedidos.size(); i++){\n modelo.addRow(new String[] {String.valueOf(listaPedidos.get(i).getNumero()),\n listaPedidos.get(i).getCliente().getNome(),\n String.valueOf(listaPedidos.get(i).getData().getDia())\n +\"/\"+String.valueOf(listaPedidos.get(i).getData().getMes())\n +\"/\"+String.valueOf(listaPedidos.get(i).getData().getAno()),\n String.valueOf(listaPedidos.get(i).getTotalPedido())});\n }\n }",
"public MostraVenta(String idtrasp, Object[][] clienteM1, Object[][] vendedorM1, String idmarc, String responsable,ListaTraspaso panel)\n{\n this.padre = panel;\n this.clienteM = clienteM1;\n this.vendedorM = vendedorM1;\n this.idtraspaso= idtrasp;\n this.idmarca=idmarc;\n//this.tipoenvioM = new String[]{\"INGRESO\", \"TRASPASO\"};\n String tituloTabla =\"Detalle Venta\";\n // padre=panel;\n String nombreBoton1 = \"Registrar\";\n String nombreBoton2 = \"Cancelar\";\n // String nombreBoton3 = \"Eliminar Empresa\";\n\n setId(\"win-NuevaEmpresaForm1\");\n setTitle(tituloTabla);\n setWidth(400);\n setMinWidth(ANCHO);\n setHeight(250);\n setLayout(new FitLayout());\n setPaddings(WINDOW_PADDING);\n setButtonAlign(Position.CENTER);\n setCloseAction(Window.CLOSE);\n setPlain(true);\n\n but_aceptar = new Button(nombreBoton1);\n but_cancelar = new Button(nombreBoton2);\n // addButton(but_aceptarv);\n addButton(but_aceptar);\n addButton(but_cancelar);\n\n formPanelCliente = new FormPanel();\n formPanelCliente.setBaseCls(\"x-plain\");\n //formPanelCliente.setLabelWidth(130);\n formPanelCliente.setUrl(\"save-form.php\");\n formPanelCliente.setWidth(ANCHO);\n formPanelCliente.setHeight(ALTO);\n formPanelCliente.setLabelAlign(Position.LEFT);\n\n formPanelCliente.setAutoWidth(true);\n\n\ndat_fecha1 = new DateField(\"Fecha\", \"d-m-Y\");\n fechahoy = new Date();\n dat_fecha1.setValue(fechahoy);\n dat_fecha1.setReadOnly(true);\n\ncom_vendedor = new ComboBox(\"Vendedor al que enviamos\", \"idempleado\");\ncom_cliente = new ComboBox(\"Clientes\", \"idcliente\");\n//com_tipo = new ComboBox(\"Tipo Envio\", \"idtipo\");\n initValues1();\n\n\n\n formPanelCliente.add(dat_fecha1);\n// formPanelCliente.add(com_tipo);\n// formPanelCliente.add(tex_nombreC);\n// formPanelCliente.add(tex_codigoBarra);\n // formPanelCliente.add(tex_codigoC);\nformPanelCliente.add(com_vendedor);\n formPanelCliente.add(com_cliente);\n add(formPanelCliente);\nanadirListenersTexfield();\n addListeners();\n\n }",
"public JanelaTipoContato() {\r\n initComponents();\r\n try {\r\n\r\n List<TipoContato> tipoContatos = (List<TipoContato>) (Object) tipoContatoDao.pesquisarTodos();\r\n adicionarListaTipoContatosTabela(tipoContatos);\r\n } catch (Exception exception) {\r\n }\r\n }",
"public void registrarMateria() {\n materia.setIdDepartamento(departamento);\n ejbFacade.create(materia);\n RequestContext requestContext = RequestContext.getCurrentInstance();\n requestContext.execute(\"PF('MateriaCreateDialog').hide()\");\n items = ejbFacade.findAll();\n departamento = new Departamento();\n materia = new Materia();\n\n FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_INFO, \"Información\", \"La materia se registró con éxito\");\n FacesContext.getCurrentInstance().addMessage(null, msg);\n requestContext.update(\"msg\");//Actualiza la etiqueta growl para que el mensaje pueda ser mostrado\n\n requestContext.update(\"MateriaListForm\");\n requestContext.update(\"MateriaCreateForm\");\n }",
"@RequestMapping(value = \"/create\", method = RequestMethod.POST)\n public ModelAndView create(@RequestParam(\"horasalida\") Date horasalida,@RequestParam(\"horallegada\") Date horallegada,@RequestParam(\"aeropuerto_idaeropuerto\") Long aeropuerto_idaeropuerto,\n \t\t@RequestParam(\"aeropuerto_idaeropuerto2\") Long aeropuerto_idaeropuerto2,@RequestParam(\"avion_idavion\") Long avion_idavion) {\n Vuelo post=new Vuelo();\n post.setHorallegada(horallegada);\n post.setHorasalida(horasalida);\n\t\t\n post.setAeropuerto_idaeropuerto(aeropuerto_idaeropuerto);\n post.setAeropuerto_idaeropuerto2(aeropuerto_idaeropuerto2);\n post.setAvion_idavion(avion_idavion);\n repository.save(post);\n return new ModelAndView(\"redirect:/vuelos\");\n }",
"public ListSemental() {\n }",
"public void insert() {\n SiswaModel m = new SiswaModel();\n m.setNisn(view.getTxtNis().getText());\n m.setNik(view.getTxtNik().getText());\n m.setNamaSiswa(view.getTxtNama().getText());\n m.setTempatLahir(view.getTxtTempatLahir().getText());\n \n //save date format\n String date = view.getDatePickerLahir().getText();\n DateFormat df = new SimpleDateFormat(\"MM/dd/yyyy\"); \n Date d = null;\n try {\n d = df.parse(date);\n } catch (ParseException ex) {\n System.out.println(\"Error : \"+ex.getMessage());\n }\n m.setTanggalLahir(d);\n \n //Save Jenis kelamin\n if(view.getRadioLaki().isSelected()){\n m.setJenisKelamin(JenisKelaminEnum.Pria);\n }else{\n m.setJenisKelamin(JenisKelaminEnum.Wanita);\n }\n \n m.setAsalSekolah(view.getTxtAsalSekolah().getText());\n m.setHobby(view.getTxtHoby().getText());\n m.setCita(view.getTxtCita2().getText());\n m.setJumlahSaudara(Integer.valueOf(view.getTxtNis().getText()));\n m.setAyah(view.getTxtNamaAyah().getText());\n m.setAlamat(view.getTxtAlamat().getText());\n \n if(view.getRadioLkkAda().isSelected()){\n m.setLkk(LkkEnum.ada);\n }else{\n m.setLkk(LkkEnum.tidak_ada);\n }\n \n //save agama\n m.setAgama(view.getComboAgama().getSelectedItem().toString());\n \n dao.save(m);\n clean();\n }",
"public String modificar() {\n\n\t\tLOG.info(\"accion crear alumno\");\n\t\tString view = VIEW_LISTADO;\n\t\tview = VIEW_FORM_ALTA;\n\t\tthis.alumnos.add(this.alumno);\n\t\treturn view;\n\t}",
"public ListaDuplamenteEncadeada(){\r\n\t\t\r\n\t}",
"private void registrar() {\n String nombre = txtNombre.getText();\n if (!nombre.trim().isEmpty()) {\n Alumno a = new Alumno();\n \n // cont++ , ++cont\n// contIds++;\n a.setNombre(nombre);\n a.setId(++contIds);\n \n listaAlumnos.add(a);\n\n lblCantidad.setText(\"Cantidad de nombres: \" + listaAlumnos.size());\n\n txtNombre.setText(null);\n txtNombre.requestFocus();\n // Actualiza la interfaz gráfica de la tabla\n tblNombres.updateUI();\n \n// int cont = 1;\n// System.out.println(\"------------------\");\n// System.out.println(\"Listado de alumnos\");\n// System.out.println(\"------------------\");\n// for (String nom : listaNombres) {\n// System.out.println(cont+\") \"+nom);\n// cont++;\n// }\n// System.out.println(\"------------------\");\n }\n }",
"public frmTelaVendas() {\n initComponents();\n this.carrinho = new CarrinhoDeCompras();\n listaItens.setModel(this.lista);\n }",
"private void creerMethode() {\n if (estValide()) {\n methode = new Methode();\n methode.setNom(textFieldNom.getText());\n methode.setVisibilite(comboBoxVisibilite.getValue());\n methode.setType(comboBoxType.getValue());\n ArrayList<Parametre> temp = new ArrayList<>();\n for (Parametre parametre : parametreListView.getItems())\n temp.add(parametre);\n methode.setParametres(temp);\n close();\n }\n }",
"private void listar() throws Exception{\n int resId=1;\n List<PlatoDia> lista = this.servicioRestaurante.listarMenuDia(resId);\n this.modelListEspecial.clear();\n lista.forEach(lse -> {\n this.modelListEspecial.addElement(\"ID: \" + lse.getId() \n + \" NOMBRE: \" + lse.getNombre()\n + \" DESCRIPCION: \" + lse.getDescripcion()\n + \" PRECIO: \" + lse.getPrecio()\n + \" ENTRADA: \"+lse.getEntrada() \n + \" PRINCIPIO: \"+lse.getPrincipio()\n + \" CARNE: \"+lse.getCarne()\n + \" BEBIDA: \"+lse.getBebida()\n + \" DIA: \"+lse.getDiaSemana());\n });\n }",
"public FinPagamentosListagemBean()\n {\n }",
"public ABMTiposDesvios() {\n super(new TiposDesviosT());\n initComponents();\n btnBorrar.setEnabled(false);\n HashMap parametros = new HashMap();\n List<TiposDesviosT> nuevo = DesktopApp.getApplication().getTiposDesviosT(parametros);\n setListDto((ArrayList<TiposDesviosT>) nuevo);\n\n tableModel = new TiposDesviosTableModel(columnNames, this.getListDto());\n tableModel.addTableModelListener(new CustomTableModelListener());\n tiposDesviosTable.setModel(tableModel);\n\n sorter = new TableRowSorter<TableModel>(tableModel) {\n\n @Override\n public void toggleSortOrder(int column) {\n RowFilter<? super TableModel, ? super Integer> f = getRowFilter();\n setRowFilter(null);\n super.toggleSortOrder(column);\n setRowFilter(f);\n }\n };\n tiposDesviosTable.setRowSorter(sorter);\n\n setModificado(false);\n setNuevo(false);\n txtMotivo.setEnabled(false);\n\n if (getPadre() == null) {\n btnSeleccionar.setEnabled(false);\n }\n\n parametros = new HashMap();\n\n tiposDesviosTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\n }",
"public void crearModelo() {\r\n\t\tmodelo = new DefaultComboBoxModel<>();\r\n\t\tmodelo.addElement(\"Rojo\");\r\n\t\tmodelo.addElement(\"Verde\");\r\n\t\tmodelo.addElement(\"Azul\");\r\n\t\tmodelo.addElement(\"Morado\");\r\n\t}",
"public JIFReparaciones() {\n try {\n initComponents();\n conexion = new Conexion();\n sd = new ServicioData(conexion);\n List<Servicio> lista = sd.obtenerServicios();\n for (Servicio x:lista){\n jcServicios.addItem(x.getDescripcion());\n }\n \n } catch (ClassNotFoundException ex) {\n Logger.getLogger(JIFReparaciones.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n modelo=new DefaultTableModel();\n rd=new ReparacionesData(conexion);\n armarCabeceraTabla();\n }",
"protected void creaPagine() {\n Pagina pag;\n Pannello pan;\n\n try { // prova ad eseguire il codice\n\n /* crea la pagina e aggiunge campi e pannelli */\n pag = this.addPagina(\"generale\");\n\n pan = PannelloFactory.orizzontale(this);\n pan.add(Cam.data);\n pan.add(Cam.importo.get());\n pan.add(Cam.note.get());\n pag.add(pan);\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n }// fine del blocco try-catch\n\n }",
"private void ajouterParametre() {\n FenetreAjouterParametre fenetreAjouterParametre = new FenetreAjouterParametre();\n fenetreAjouterParametre.showAndWait();\n if (fenetreAjouterParametre.getParametre() == null) return;\n parametreListView.getItems().add(fenetreAjouterParametre.getParametre());\n }",
"@GetMapping(\"/restaurante/new\")\n\tpublic String newRestaurante(Model model) {\n\t\tmodel.addAttribute(\"restaurante\", new Restaurante());\n\t\tControllerHelper.setEditMode(model, false);\n\t\tControllerHelper.addCategoriasToRequest(categoriaRestauranteRepository, model);\n\t\t\n\t\treturn \"restaurante-cadastro\";\n\t\t\n\t}",
"public void agregarDetalleProducto() {\n //Creamos instancia de ProductoDao\n ProductoDao productoDao = new ProductoDaoImp();\n try {\n //obtenemos la instancia del producto\n producto = productoDao.obtenerProductoPorCodigoBarra(productoSeleccionado);\n if (cantidadProductoDlg != null && cantidadProductoDlg > 0) {\n //agregando detalle a la Lista de Detalle\n listDetalle.add(new Detallefactura(null, this.producto.getCodBarra(),\n this.producto.getNombreProducto(), cantidadProductoDlg, this.producto.getPrecioVenta(),\n (this.producto.getPrecioVenta().multiply(new BigDecimal(cantidadProductoDlg)))));\n \n //Seteamos el producto al item del detalle\n //Accedemos al ultimo Item agregado a la lista\n listDetalle.get(listDetalle.size()-1).setCodProducto(producto);\n \n //Seteamos la factura al item del detalle\n //Accedemos al ultimo Item agregado a la lista \n // listDetalle.get(listDetalle.size()-1).setCodFactura(factura);\n \n //Limpiamos la variable 'cantidadProducto'\n cantidadProductoDlg = null;\n //Invocamos al metodo que calcula el Total de la Venta para la factura\n totalFacturaVenta();\n\n FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, \"Correcto\", \"Producto agregado al detalle!\");\n FacesContext.getCurrentInstance().addMessage(null, message);\n }else{\n //Limpiamos la variable 'cantidadProducto'\n cantidadProductoDlg = null;\n FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR , \"Incorrecto\", \"La cantidad es incorrecta!\");\n FacesContext.getCurrentInstance().addMessage(null, message);\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }",
"public Controlador(Vista view, Modelo model){\r\n \r\n //Se igualan las propiedades\r\n this.view = view;\r\n this.model = model;\r\n this.view.btnGuardar.addActionListener(this);\r\n \r\n //se iguala el modelo de la tabla\r\n table = new DefaultTableModel();\r\n view.tablaResultado.setModel(table);\r\n \r\n //nombre para la columna de la tabla\r\n table.addColumn(\"Listado\"); \r\n \r\n }",
"public void validaCadastro(List<ProdutoModel> produto) {\n\n if (produto.size() == 0) {\n cadastraProduto();\n } else {\n JOptionPane.showMessageDialog(null, \"Produto existente\");\n jtf_nome.requestFocus();\n }\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n destinojTextField1 = new javax.swing.JTextField();\n origemjTextField2 = new javax.swing.JTextField();\n precojTextField3 = new javax.swing.JTextField();\n nrDiasjTextField4 = new javax.swing.JTextField();\n milhasjTextField5 = new javax.swing.JTextField();\n inserirjButton1 = new javax.swing.JButton();\n totalizarjButton2 = new javax.swing.JButton();\n jLabel6 = new javax.swing.JLabel();\n totalGastojLabel7 = new javax.swing.JLabel();\n jLabel8 = new javax.swing.JLabel();\n totalMilhasjLabel9 = new javax.swing.JLabel();\n jScrollPane2 = new javax.swing.JScrollPane();\n listaViagemjList2 = new javax.swing.JList<Viagem>();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jLabel1.setText(\"Destino:\");\n\n jLabel2.setText(\"Origem:\");\n\n jLabel3.setText(\"Preço:\");\n\n jLabel4.setText(\"Nr.Dias\");\n\n jLabel5.setText(\"Milhas\");\n\n destinojTextField1.setText(\"Disney\");\n\n origemjTextField2.setText(\"Rio de Janeiro\");\n\n precojTextField3.setText(\"1000\");\n\n nrDiasjTextField4.setText(\"7\");\n\n milhasjTextField5.setText(\"12000\");\n\n inserirjButton1.setText(\"INSERIR\");\n\n totalizarjButton2.setText(\"TOTAIS\");\n\n jLabel6.setText(\"Total Gasto R$ \");\n\n totalGastojLabel7.setText(\"___________\");\n\n jLabel8.setText(\"Total Milhas\");\n\n totalMilhasjLabel9.setText(\"___________\");\n\n listaViagemjList2.setModel(viagemDefaultListModel);\n jScrollPane2.setViewportView(listaViagemjList2);\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 .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel1)\n .addGap(18, 18, 18)\n .addComponent(destinojTextField1))\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel2)\n .addGap(18, 18, 18)\n .addComponent(origemjTextField2, javax.swing.GroupLayout.DEFAULT_SIZE, 183, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(inserirjButton1)\n .addGap(18, 18, 18)\n .addComponent(totalizarjButton2))\n .addGroup(layout.createSequentialGroup()\n .addGap(10, 10, 10)\n .addComponent(jLabel5)\n .addGap(14, 14, 14)\n .addComponent(milhasjTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel6)\n .addComponent(jLabel8))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(totalMilhasjLabel9)\n .addComponent(totalGastojLabel7))))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel3)\n .addGap(22, 22, 22))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(jLabel4)\n .addGap(14, 14, 14)))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(3, 3, 3)\n .addComponent(precojTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addComponent(nrDiasjTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)))))\n .addGroup(layout.createSequentialGroup()\n .addGap(23, 23, 23)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap(121, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1)\n .addComponent(destinojTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2)\n .addComponent(origemjTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel3)\n .addComponent(precojTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel4)\n .addComponent(nrDiasjTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel5)\n .addComponent(milhasjTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(totalizarjButton2)\n .addComponent(inserirjButton1))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel6)\n .addComponent(totalGastojLabel7))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel8)\n .addComponent(totalMilhasjLabel9))\n .addGap(18, 18, 18)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(80, Short.MAX_VALUE))\n );\n\n pack();\n }",
"public CrearQuedadaVista() {\n }",
"public Modello() {\r\n super();\r\n initComponents();\r\n setModalita(APPEND_QUERY);\r\n setFrameTable(tabModello);\r\n setNomeTabella(\"vmodello\");\r\n tMarcaDescrizione.setEnabled(false);\r\n }",
"@Override\r\npublic int create(Detalle_pedido d) {\n\treturn detalle_pedidoDao.create(d);\r\n}",
"private void btnBuscarMouseClicked(java.awt.event.MouseEvent evt) {\n if(!txtCadena.getText().isEmpty()){\n DefaultListModel mdlList = new DefaultListModel(); \n mdlList=this.BuscarProcesos(txtCadena.getText());\n this.lstBusqueda.setModel(mdlList);\n }\n \n //System.out.println(lst.get(0).toString());\n \n \n }",
"@Override\n\tpublic Oglas createNewOglas(NewOglasForm oglasForm) {\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\t\n\t\tOglas oglas = new Oglas();\n\t\tSystem.out.println(oglas.getId());\n\t\toglas.setNaziv(oglasForm.getNaziv());\n\t\toglas.setOpis(oglasForm.getOpis());\n\t\ttry {\n\t\t\toglas.setDatum(formatter.parse(oglasForm.getDatum()));\n\t\t\tSystem.out.println(oglas.getDatum());\n System.out.println(formatter.format(oglas.getDatum()));\n\t\t} catch (ParseException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn repository.save(oglas);\n\t}",
"public Vista() {\n initComponents();\n modelo = new DefaultTableModel();\n listamascota = new ArrayList<>();\n\n }",
"@RequestMapping(value = \"/pegawai/tambah\", method = RequestMethod.GET)\n\tprivate String add(Model model) {\n\t\tList<ProvinsiModel> provinsiList = provinsiService.getAllProvinsi();\n\t\tList<JabatanModel> jabatanList = jabatanService.getAllJabatan();\n\t\tList<InstansiModel> listInstansi = instansiService.getInstansiByProvinsi(provinsiList.get(0));\n\t\t\n\t\tPegawaiModel pegawai = new PegawaiModel();\n\t\tpegawai.setListJabatan(new ArrayList<JabatanModel>());\n\t\tpegawai.getListJabatan().add(new JabatanModel());\n\t\t\n\t\tmodel.addAttribute(\"pegawai\", pegawai);\n\t\tmodel.addAttribute(\"listInstansi\", listInstansi);\n\t\tmodel.addAttribute(\"listJabatan\", jabatanList);\n\t\tmodel.addAttribute(\"listProvinsi\", provinsiList);\n\t\treturn \"addPegawai\";\n\t}",
"public Controlador() {\n\t\t// m\n\t\tdatosPrueba1 = new ListaEnlazada();\n\t\t// m\n\t\tdatosPrueba2 = new ListaEnlazada();\n\t\t// add\n\t\tdatosPrueba3 = new ListaEnlazada();\n\t\tdatosPrueba4 = new ListaEnlazada();\n\t\tprueba1 = new Estadisticas(datosPrueba1);\n\t\tprueba2 = new Estadisticas(datosPrueba2);\n\t\tprueba3 = new Estadisticas(datosPrueba3);\n\t\tprueba4 = new Estadisticas(datosPrueba4);\n\t\t// finAdd\n\t}",
"public de_gestionar_contrato_añadir() {\n initComponents();\n lbl_error_nombre_cliente.setVisible(false);\n lbl_error_numero_contrato.setVisible(false);\n lbl_error_fecha_inicio.setVisible(false);\n lbl.setVisible(false);\n lbl_fecha_expira_contrato.setVisible(false);\n\n // detectar cambio en jdateChoser (fecha de inicio en agregar contrato)\n fecha_inicio_contrato.getDateEditor().addPropertyChangeListener(\n new PropertyChangeListener() {\n @Override\n public void propertyChange(PropertyChangeEvent e) {\n if (\"date\".equals(e.getPropertyName())) {\n System.out.println(e.getPropertyName()\n + \": \" + (Date) e.getNewValue());\n if(fecha_inicio_contrato.getDate()!=null){\n lbl_fecha_expira_contrato.setText(toma_fecha(fecha_inicio_contrato).substring(0,6)+String.valueOf(Integer.parseInt(toma_fecha(fecha_inicio_contrato).substring(6))+1));\n lbl.setVisible(true);\n lbl_fecha_expira_contrato.setVisible(true);\n }\n }else{\n lbl_fecha_expira_contrato.setText(\"\");\n lbl_error_fecha_inicio.setVisible(false);\n lbl.setVisible(false);\n lbl_fecha_expira_contrato.setVisible(false);\n }\n }\n });\n this.add(fecha_inicio_contrato);\n \n deshabilitarPegar();\n }",
"public Lista() {\r\n }",
"public CadastroProdutoNew() {\n initComponents();\n }",
"private void azzeraInsertForm() {\n\t\tviewInserimento.getCmbbxTipologia().setSelectedIndex(-1);\n\t\tviewInserimento.getTxtFieldDataI().setText(\"\");\n\t\tviewInserimento.getTxtFieldValore().setText(\"\");\n\t\tviewInserimento.getTxtFieldDataI().setBackground(Color.white);\n\t\tviewInserimento.getTxtFieldValore().setBackground(Color.white);\n\t}",
"public void add(Integer magazynId) {\r\n// FacesContext context = FacesContext.getCurrentInstance();\r\n// if (ilosc.equals(\"\") || ilosc.equals(null)) {\r\n// context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_FATAL, \"Błąd\", \"Pole ilość nie może być puste\"));\r\n//\r\n// } else if (marka.equals(\"\")) {\r\n// context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_FATAL, \"Błąd\", \"Pole marka nie może być puste\"));\r\n// } else if (model.equals(\"\") || model.equals(null)) {\r\n// context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_FATAL, \"Błąd\", \"Pole marka nie może być puste\"));\r\n// } else if (typ.equals(\"\") || typ.equals(null)) {\r\n// context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_FATAL, \"Błąd\", \"Pole typ nie może być puste\"));\r\n// } else {\r\n // produktTemp = new Produkt();\r\n \r\n// produktTemp.setTyp(typ);\r\n\r\n produktTemp.setStan(Boolean.TRUE);\r\n produktTemp.setAktualnailosc(produktTemp.getIlosc());\r\n Magazyn magazynTemp = magazynFacade.findMagazynByMid(magazynId);\r\n produktTemp.setMagazyn(magazynTemp);\r\n\r\n //produktTemp.setMagazyn(magazyn);\r\n// produktTemp.setModel(model);\r\n// produktTemp.setMarka(marka);\r\n// produktTemp.setIlosc(Integer.valueOf(ilosc));\r\n// produktTemp.setAktualnailosc(Integer.valueOf(ilosc));\r\n//\r\n// if (!imei.equals(null) || imei.equals(\"\")) {\r\n// produktTemp.setImei(imei);\r\n// }\r\n produktListTemp.add(produktTemp);\r\n// typ = \"\";\r\n// //magazyn = \"\";\r\n// model = \"\";\r\n// imei = \"\";\r\n// marka = \"\";\r\n// ilosc = \"\";\r\n\r\n produktTemp = new Produkt();\r\n// }\r\n\r\n }",
"public Aplicacion() {\n initComponents();\n\n Alumno alejandro = new Alumno(\"Alejandro\", 22);\n Alumno mathi = new Alumno(\"Mathi\", 21);\n Alumno jorge = new Alumno(\"Jorge\", 30);\n\n alejandro.PonAsignatura(\"mates\", 7.5f);\n alejandro.PonAsignatura(\"lengua\", 3.2f);\n alejandro.PonAsignatura(\"cono\", 9.9f);\n\n mathi.PonAsignatura(\"mates\", 6f);\n mathi.PonAsignatura(\"lengua\", 4);\n mathi.PonAsignatura(\"cono\", 9);\n\n jorge.PonAsignatura(\"mates\", 3.5f);\n jorge.PonAsignatura(\"lengua\", 5);\n jorge.PonAsignatura(\"cono\", 10);\n\n AlumnosT.add(alejandro);\n AlumnosT.add(mathi);\n AlumnosT.add(jorge);\n\n DefaultListModel ListAlumnos = new DefaultListModel();\n ListaAlumnos.setModel(ListAlumnos);\n ListAlumnos.addElement(alejandro.Datos());\n ListAlumnos.addElement(mathi.Datos());\n ListAlumnos.addElement(jorge.Datos());\n\n }",
"public void mostrarDados() {\n txtId.setText(\"\" + lista.get(indice).getId());\n txtNome.setText(lista.get(indice).getNome());\n txtEmail.setText(lista.get(indice).getEmail());\n txtSenha.setText(lista.get(indice).getSenha());\n preencheTabela();\n }",
"public void guardarCambios(View v){\n\n ArrayList<ENListaCompra> miL = DespenBD.getListasVisibles();\n ENListaCompra lCompra = miL.get(miL.size()-posicion-1);\n\n System.out.println(\"Posician: \"+posicion);\n System.out.println(\"Nombre: \"+lCompra.getNombre());\n\n DespenBD.editarLista(lCompra.getNombre(),lCompra.getFecha(),etNombre.getText().toString(), etFecha.getText().toString());\n //lCompra.setNombre();\n\n /* for (ENListaCompra lc: miL) {\n //misListas.add(0, new MisListas(\"\"+lc.getNombre(),\"\"+lc.getFecha()));\n System.out.println(\"imprime: \" + lc.getNombre());\n }*/\n\n Intent i = new Intent(this, ListasCompra.class );\n //i.putExtra(\"nombre\", \"\" + etNombre.getText());\n //i.putExtra(\"accion\", \"editar\");\n startActivity(i);\n\n finish();\n\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n titulojLabel = new javax.swing.JLabel();\n jSeparator1 = new javax.swing.JSeparator();\n jScrollPane1 = new javax.swing.JScrollPane();\n medicosjTable = new javax.swing.JTable();\n editajButton = new javax.swing.JButton();\n voltarjButton = new javax.swing.JButton();\n excluirjButton = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n titulojLabel.setFont(new java.awt.Font(\"Tahoma\", 1, 14)); // NOI18N\n titulojLabel.setText(\" LISTA DE MEDICOS CADASTRADOS\");\n\n medicosjTable.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null, null, null},\n {null, null, null, null, null, null},\n {null, null, null, null, null, null},\n {null, null, null, null, null, null},\n {null, null, null, null, null, null},\n {null, null, null, null, null, null},\n {null, null, null, null, null, null},\n {null, null, null, null, null, null},\n {null, null, null, null, null, null},\n {null, null, null, null, null, null}\n },\n new String [] {\n \"Codigo\", \"Crm\", \"Nome\", \"Endereco\", \"Especialidade\", \"Convenio\"\n }\n ) {\n boolean[] canEdit = new boolean [] {\n false, false, false, false, false, false\n };\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n medicosjTable.setColumnSelectionAllowed(true);\n medicosjTable.getTableHeader().setReorderingAllowed(false);\n jScrollPane1.setViewportView(medicosjTable);\n medicosjTable.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);\n\n editajButton.setText(\"Editar\");\n editajButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n editajButtonActionPerformed(evt);\n }\n });\n\n voltarjButton.setText(\"Voltar\");\n voltarjButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n voltarjButtonActionPerformed(evt);\n }\n });\n\n excluirjButton.setText(\"Excluir\");\n excluirjButton.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n excluirjButtonActionPerformed(evt);\n }\n });\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 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jSeparator1)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 486, Short.MAX_VALUE)\n .addComponent(titulojLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addContainerGap())\n .addGroup(layout.createSequentialGroup()\n .addGap(30, 30, 30)\n .addComponent(editajButton)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(voltarjButton)\n .addGap(135, 135, 135)\n .addComponent(excluirjButton)\n .addGap(27, 27, 27))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(titulojLabel)\n .addGap(14, 14, 14)\n .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 187, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 31, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(editajButton)\n .addComponent(voltarjButton)\n .addComponent(excluirjButton))\n .addGap(22, 22, 22))\n );\n\n pack();\n }",
"void listarDadosNaTelaColaborador(ArrayList<Colaborador> lista,DefaultTableModel model ) {\n model.setNumRows(0);\n //Correr o ArrayList\n for (int pos = 0; pos < lista.size(); pos++) {\n String[] linha = new String[9];\n Colaborador aux = lista.get(pos);\n linha[0] = \"\"+aux.getId();\n linha[1] = \"\"+aux.getMatricula();\n linha[2] = aux.getNome();\n linha[3] = \"\"+aux.getNumeroOAB();\n linha[4] = \"\"+aux.getCpf();\n linha[5] = aux.getEmail();\n linha[6] = \"\"+aux.getTelefone();\n linha[7] = aux.getTipo().toString();\n linha[8] = aux.getStatus().toString();\n model.addRow(linha);\n }\n }",
"@Override\r\n\tprotected void agregarObjeto() {\r\n\t\t// opcion 1 es agregar nuevo justificativo\r\n\t\tthis.setTitle(\"PROCESOS - PERMISOS INDIVIDUALES (AGREGANDO)\");\r\n\t\tthis.opcion = 1;\r\n\t\tactivarFormulario();\r\n\t\tlimpiarTabla();\r\n\t\tthis.panelBotones.habilitar();\r\n\t}",
"public FacturarPrincipal() {\n initComponents();\n\n dlgLogin.setSize(692, 345);\n dlgLogin.setLocationRelativeTo(this);\n dlgLogin.setVisible(true);\n dlgCrearProducto.setSize(300, 400);\n dlgCrearProducto.setLocationRelativeTo(this);\n\n //Se inicializan todos los modelos y los objetos.\n modeloClientes = new DefaultListModel<>();\n modeloProductos = new DefaultListModel<>();\n modeloHistorialVentas = new DefaultListModel<>();\n gestionarArchivos = new GestionA();\n //Se asignan a las listas los modelos que les corresponden, además,\n //se cargan los archivos .txt en cada lista.\n lstClientesVentas.setModel(modeloClientes);\n lstClientes.setModel(modeloClientes);\n lstClientes.setModel(gestionarArchivos.lista(\"Archivos/clientes.txt\"));\n lstProductos.setModel(gestionarArchivos.lista(\"Archivos/productos.txt\"));\n lstHistorialVentas.setModel(gestionarArchivos.lista(\"Archivos/facturas.txt\"));\n lstClientesVentas.setModel(gestionarArchivos.lista(\"Archivos/clientes.txt\"));\n lstProductosVentas.setModel(gestionarArchivos.lista(\"Archivos/productos.txt\"));\n modeloClientes = (DefaultListModel) lstClientes.getModel();\n modeloProductos = (DefaultListModel) lstProductos.getModel();\n modeloHistorialVentas = (DefaultListModel) lstHistorialVentas.getModel();\n\n }",
"public void mostrarTodo() {\n if (formListado != null) {\n formListado.dispose();\n }\n formListado = new FormListado();\n formListado.cargarTodo();\n formListado.setVisible(true);\n }",
"public void actionPerformed(ActionEvent e) {\n\t\t\t\t\tString nome = txtNome.getText();\n\t\t\t\t\tdouble nota1 = Integer.parseInt(txtNota1.getText());\n\t\t\t\t\tdouble nota2 = Integer.parseInt(txtNota2.getText());\n\t\t\t\t\tAluno a = new Aluno(nome, nota1, nota2);\n\t\t\t\t\t\t\t\t\n\t\t//INSERIR DADOS NO ARRAYLIST\n\t\t\t\t\talunos.add(a);\n\t\t\t\t\t\n\t\t//LIMPAR OS CAMPOS APOS CADASTRO / VOLTAR CURSOS PARA O CAMPO DO NOME\n\t\t\t\t\ttxtNome.setText(\"\");\n\t\t\t\t\ttxtNota1.setText(\"\");\n\t\t\t\t\ttxtNota2.setText(\"\");\n\t\t\t\t\ttxtNome.requestFocus();\n\t\t\t\t\t\n\t\t//ATUALIZAR DADOS DA TABELA DTM\n\t\t\t\t\tdtm.setRowCount(0);\n\t\t\t\t\tfor (int i=0; i<alunos.size(); i++) {\n\t\t\t\t\t\tdtm.addRow(new Object[] {\n\t\t\t\t\t\t\talunos.get(i).getNome(),\n\t\t\t\t\t\t\talunos.get(i).getNota1(),\n\t\t\t\t\t\t\talunos.get(i).getNota2(),\n\t\t\t\t\t\t\talunos.get(i).getMedia(),\n\t\t\t\t\t\t\talunos.get(i).getSituacao(),\n\t\t\t\t\t\t}); \n\t\t\t\t\t}\n\t\t//DEFINIR OS DADOS DA MINHA DTM\n\t\t\t\t\ttabela.setModel(dtm);\n\t\t\t\t\t\t\n\t\t\t\t\t}",
"public void crearNodos()\n\t{\n\t\tfor(List<String> renglon: listaDeDatos)\n\t\t{\n\t\t\tPersona persona = new Persona(Integer.parseInt(renglon.get(1)), Integer.parseInt(renglon.get(2))); //crea la persona\n\t\t\t\n\t\t\tNodo nodo = new Nodo(Integer.parseInt(renglon.get(0)), 0, 0, false); //crea el nodo con id en posicion 1\n\t\t\t\n\t\t\tnodo.agregarPersona(persona);\n\t\t\tlistaNodos.add(nodo);\n\t\t}\n\t\t\n\t}",
"public void recebeDados(\n\tList<NotasFaltasModel> lista, String nome, String curso) {\n\t\tDefaultTableModel modelo = (DefaultTableModel) tbBoletim.getModel();\n\t\tlblNome.setText(nome);\n\t\tlblCurso.setText(curso);\n\t\t\n\tfor(NotasFaltasModel boletimAluno : lista) {\n\t\t\tmodelo.addRow(new Object[] {\n\t\t\t\tboletimAluno.getDisciplina(),\n\t\t\t\tboletimAluno.getNota(),\n\t\t\t\tboletimAluno.getFaltas()\n\t\t\t});\n\t\t}\n\t}",
"public Component buidListForm() throws BeanDAOException {\n\t\treturn new ListForm<BEAN, KEY>(this);\n\t}",
"public FormInserir() {\n initComponents();\n }",
"public pfcGuiLlistaPacients() { \n \n this.llistaPacientsModel = new javax.swing.DefaultListModel();\n initComponents(); \n centraFormulari(); \n \n }",
"public ArticulosAdd() {\n initComponents();\n Sistema.lblNotificacion.setText(\"Ingreso Artítuclos\");\n this.setLocationRelativeTo(null);\n\n Date date = new Date();\n\n dtDesde.setDate(date);\n dtHasta.setDate(date);\n\n articulos.searchArticulo(cboArticulos, \"\", 0, 1000, 0);\n }",
"@GetMapping(\"/createRegistro\")\n\tpublic String crearValidacion(Model model) {\n\t\tList<Barrio> localidades = barrioService.obtenerBarrios();\n\t\tmodel.addAttribute(\"localidades\",localidades);\n\t\tmodel.addAttribute(\"persona\",persona);\n\t\tmodel.addAttribute(\"validacion\",validacion);\n\t\tmodel.addAttribute(\"registro\",registro);\n\t\tmodel.addAttribute(\"barrio\",barrio);\n\t\treturn \"RegistroForm\";\n\t}",
"public String insertarOficial() {\r\n\t\tlog.info(\"LISTA DE DESHABILITADO--> \"+ TelefonoDeshabilitado.size()); \r\n\t\tlog.info(\"insertarOficial() \" + \"Id-Cliente-->\"+\" \"+ objClienteSie.getIdcliente() + \" \"+\"Nombre de Cliente\"+\" \"+ objClienteSie.getNombrecliente());\r\n\t\tString paginaretorno=\"\";\r\n\t\ttry {\r\n\t\t\tif (log.isInfoEnabled()) {\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tlog.info(\"busca el Id-DNI\");\r\n\t\t\tobjClienteSie.setTbTipoDocumentoIdentidad(objTipoDocService.buscarTipoDocumento(TipoDocumento));\r\n\t\t\t\r\n\t\t\tlog.info(\"busca el Id-Ubigeo\");\r\n\t\t\tobjDomicilio.setTbUbigeo(objUbigeoService.findUbigeo(Integer.parseInt(idUbigeo1)));\r\n\t\t\t\r\n\t\t\tlog.info(\"*******AQUI ESTA SI HAY UN VALOR DENTRO DE LA LISTA TELEFONOS PARA ELIMINAR*******\");\r\n\t\t\tlog.info(\"Tel-FISICO--------->\"+ \" \"+ TelefonoDeshabilitado.size());\r\n\t\t\tlog.info(\"Tel-TEMPORAL------->\"+ \"\t\"+ TelefonoPersonaList.size());\r\n\t\t\t\r\n\t\t\tlog.info(\"*******AQUI ESTA SI HAY UN VALOR DENTRO DE LA LISTA DOMICILIO PARA ELIMINAR*******\");\r\n\t\t\tlog.info(\"Domicilio-FISICO--------->\"+ \" \"+ DomicilioPersonaDeshabilitado.size());\r\n\t\t\tlog.info(\"Domicilio-TEMPORAL------->\"+ \"\t\"+ DomicilioPersonaList.size());\r\n\t\t\tobjClienteService.updateCliente(objClienteSie,objDomicilio,idUbigeo1, idUbigeo, tipo, Tipocasanuevo,TelefonoPersona,TelefonoPersonaList, TelefonoDeshabilitado, DomicilioPersonaList, DomicilioPersonaDeshabilitado);\r\n\t\t\t\r\n\t\t\tmensaje = Constants.MESSAGE_ACTUALIZO_TITULO;\r\n\t\t\tmsg = new FacesMessage(FacesMessage.SEVERITY_INFO,\r\n\t\t\tConstants.MESSAGE_INFO_TITULO, mensaje);\r\n\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\tmensaje = e.getMessage();\r\n\t\t\tmsg = new FacesMessage(FacesMessage.SEVERITY_FATAL,\r\n\t\t\tConstants.MESSAGE_ERROR_FATAL_TITULO, mensaje);\r\n\t\t\tlog.error(e.getMessage());\r\n\t}\r\n\t\tFacesContext.getCurrentInstance().addMessage(null, msg);\r\n\t\treturn getViewList();\r\n\t}",
"public List listarCategoriasForm() throws Exception {\n PreparedStatement ps = null;\n Connection conn = null;\n ResultSet rs = null;\n\n try {\n conn = this.conn;\n ps = conn.prepareStatement(\"select idRemedio, categoria from Remedios group by categoria order by categoria ASC \");\n rs = ps.executeQuery();\n List<Produto> list = new ArrayList<Produto>();\n while (rs.next()) {\n int idRemedio = rs.getInt(1);\n String categoria = rs.getString(2);\n list.add(new Produto(idRemedio, null, null, null,null, null, null, null, null, null, null, null, null, null, categoria, null));\n\n }\n return list;\n\n } catch (SQLException sqle) {\n throw new Exception(sqle);\n } finally {\n Conexao.closeConnection(conn, ps, rs);\n }\n }",
"public List<Joueur> List_Joueur_HommesForComboBox() \r\n {\r\n List<Joueur> j = new ArrayList<>();\r\n String req= \"SELECT * FROM personne WHERE datedestruction is NULL and role = 'Joueur' and sexe='Homme' \";\r\n try {\r\n ResultSet res = ste.executeQuery(req);\r\n while (res.next()) {\r\n \r\n Joueur Jou = new Joueur(\r\n res.getInt(\"idpersonne\"),\r\n \r\n res.getString(\"nom\"),\r\n res.getString(\"prenom\")\r\n );\r\n j.add(Jou);\r\n \r\n System.out.println(\"------- joueurs selectionné avec succés----\");\r\n \r\n }\r\n \r\n } catch (SQLException ex) {\r\n System.out.println(\"----------Erreur lors methode : List_Joueur_Hommes()------\");\r\n }\r\n return j;\r\n \r\n}",
"private void apresentarListaNaTabela() {\n DefaultTableModel modelo = (DefaultTableModel) tblAlunos.getModel();\n modelo.setNumRows(0);\n for (Aluno item : bus.getLista()) {\n modelo.addRow(new Object[]{\n item.getIdAluno(),\n item.getNome(),\n item.getEmail(),\n item.getTelefone()\n });\n }\n }",
"private void listarDadosNaTelaEditora(ArrayList<Editora> lista) {\n DefaultTableModel modelEditoras = (DefaultTableModel) jTable_tabelaEditoras.getModel();\n jTable_tabelaEditoras.setRowSorter(new TableRowSorter(modelEditoras));\n //Limpando a tela\n modelEditoras.setNumRows(0);\n //Correr o ArrayList\n for (int pos = 0; pos < lista.size(); pos++) {\n String[] linha = new String[2];\n Editora aux = lista.get(pos);\n linha[0] = \"\"+aux.getId();\n linha[1] = aux.getNome();\n modelEditoras.addRow(linha);\n }\n }",
"public void crearManoObra(ActionEvent actionEvent) {\r\n manoobraDao manobraDao = new manoobraDaoImpl();\r\n String msg;\r\n this.manoobra.setNombreManob(this.manoobra.getNombreManob());\r\n this.manoobra.setCostojrhManob(this.manoobra.getCostojrhManob());\r\n \r\n if (manobraDao.crearManoObra(this.manoobra)) {\r\n msg = \"Mano de Obra creada correctamente\";\r\n FacesMessage message1 = new FacesMessage(FacesMessage.SEVERITY_INFO,msg , null);\r\n FacesContext.getCurrentInstance().addMessage(null, message1);\r\n } else {\r\n msg = \"No se creo la Mano de Obra\";\r\n FacesMessage message2 = new FacesMessage(FacesMessage.SEVERITY_ERROR, msg, null);\r\n FacesContext.getCurrentInstance().addMessage(null, message2);\r\n }\r\n \r\n }",
"@Override\n\tpublic MensajeBean inserta(Tramite_informesem nuevo) {\n\t\treturn tramite_informesemDao.inserta(nuevo);\n\t}",
"public FrmNuevoAlumno() {\n initComponents();\n obtenerCarreras();\n comboCarrera.setSelectedIndex(-1);\n obtenerDependencias();\n comboPlantel.setSelectedIndex(-1);\n mostrarAlumnos();\n deshabilitar();\n lblId.setVisible(false);\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPanel1 = new javax.swing.JPanel();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n img_foto = new Imagen();\n tf_nombre = new javax.swing.JTextField();\n tf_dir = new javax.swing.JTextField();\n tf_tel = new javax.swing.JTextField();\n btn_guardar = new javax.swing.JButton();\n jToolBar1 = new javax.swing.JToolBar();\n btn_nuevo = new javax.swing.JButton();\n btn_eliminar = new javax.swing.JButton();\n jScrollPane1 = new javax.swing.JScrollPane();\n ls_datos = new javax.swing.JList();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setTitle(\"Agenda\");\n setResizable(false);\n\n jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(-16777216,true)));\n\n jLabel1.setText(\"NOMBRE:\");\n\n jLabel2.setText(\"DIRECCION:\");\n\n jLabel3.setText(\"TELEFONO:\");\n\n img_foto.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/c1.png\"))); // NOI18N\n img_foto.setProporcion(1);\n\n javax.swing.GroupLayout img_fotoLayout = new javax.swing.GroupLayout(img_foto);\n img_foto.setLayout(img_fotoLayout);\n img_fotoLayout.setHorizontalGroup(\n img_fotoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 108, Short.MAX_VALUE)\n );\n img_fotoLayout.setVerticalGroup(\n img_fotoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 104, Short.MAX_VALUE)\n );\n\n btn_guardar.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/SAVE.png\"))); // NOI18N\n btn_guardar.setText(\"Guardar\");\n btn_guardar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btn_guardarActionPerformed(evt);\n }\n });\n\n jToolBar1.setFloatable(false);\n jToolBar1.setRollover(true);\n\n btn_nuevo.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/NEW.png\"))); // NOI18N\n btn_nuevo.setText(\"Nuevo\");\n btn_nuevo.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btn_nuevoActionPerformed(evt);\n }\n });\n jToolBar1.add(btn_nuevo);\n\n btn_eliminar.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/DELETE.png\"))); // NOI18N\n btn_eliminar.setText(\"Eliminar\");\n btn_eliminar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btn_eliminarActionPerformed(evt);\n }\n });\n jToolBar1.add(btn_eliminar);\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(img_foto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGap(8, 8, 8)\n .addComponent(tf_tel, javax.swing.GroupLayout.PREFERRED_SIZE, 279, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 69, Short.MAX_VALUE)\n .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(tf_dir)\n .addComponent(tf_nombre, javax.swing.GroupLayout.PREFERRED_SIZE, 279, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addGap(12, 12, 12))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(229, Short.MAX_VALUE))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addComponent(btn_guardar)\n .addContainerGap()))))\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(5, 5, 5)\n .addComponent(img_foto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel1)\n .addComponent(tf_nombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel2)\n .addComponent(tf_dir, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel3)\n .addComponent(tf_tel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addComponent(btn_guardar)\n .addContainerGap(28, Short.MAX_VALUE))\n );\n\n ls_datos.setFont(new java.awt.Font(\"Dialog\", 0, 14)); // NOI18N\n ls_datos.setModel(new javax.swing.AbstractListModel() {\n String[] strings = { \"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\", \"Item 5\" };\n public int getSize() { return strings.length; }\n public Object getElementAt(int i) { return strings[i]; }\n });\n ls_datos.addListSelectionListener(new javax.swing.event.ListSelectionListener() {\n public void valueChanged(javax.swing.event.ListSelectionEvent evt) {\n ls_datosValueChanged(evt);\n }\n });\n jScrollPane1.setViewportView(ls_datos);\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 .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 236, Short.MAX_VALUE)\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 313, Short.MAX_VALUE)\n .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addContainerGap())\n );\n\n pack();\n }",
"public Formulario() {\n initComponents();\n modelo = (DefaultTableModel) jTable2.getModel();\n }",
"public void listar_mais_pedidos(String tipo_pedido){\n \n \n OrdemCorteDAO dao = new OrdemCorteDAO();\n DefaultTableModel model = (DefaultTableModel) jTable_MaisPedidos.getModel(); \n \n model.setNumRows(0);\n \n for (OrdemCorteDTO mp : dao.getMaisPedidos(tipo_pedido)) {\n \n model.addRow(new Object[]{mp.getCodigo(), mp.getQtd_pedido()});\n }\n \n \n }",
"private void crearElementos() {\n\n\t\tRotonda rotonda1 = new Rotonda(new Posicion(400, 120), \"5 de octubre\");\n\t\tthis.getListaPuntos().add(rotonda1);\n\n\t\tCiudad esquel = new Ciudad(new Posicion(90, 180), \"Esquel\");\n\t\tthis.getListaPuntos().add(esquel);\n\n\t\tCiudad trelew = new Ciudad(new Posicion(450, 200), \"Trelew\");\n\t\tthis.getListaPuntos().add(trelew);\n\n\t\tCiudad comodoro = new Ciudad(new Posicion(550, 400), \"Comodoro\");\n\t\tthis.getListaPuntos().add(comodoro);\n\n\t\tCiudad rioMayo = new Ciudad(new Posicion(350, 430), \"Rio Mayo\");\n\t\tthis.getListaPuntos().add(rioMayo);\n\n\t\t// --------------------------------------------------------\n\n\t\tRutaDeRipio rutaRipio = new RutaDeRipio(230, 230, rotonda1, esquel);\n\t\tthis.getListaRuta().add(rutaRipio);\n\n\t\tRutaPavimentada rutaPavimentada1 = new RutaPavimentada(380, 100, trelew, comodoro);\n\t\tthis.getListaRuta().add(rutaPavimentada1);\n\n\t\tRutaPavimentada rutaPavimentada2 = new RutaPavimentada(800, 120, esquel, comodoro);\n\t\tthis.getListaRuta().add(rutaPavimentada2);\n\n\t\tRutaDeRipio rutaripio3 = new RutaDeRipio(380, 100, trelew, comodoro);\n\t\tthis.getListaRuta().add(rutaripio3);\n\n\t\tRutaEnConstruccion rutaConst1 = new RutaEnConstruccion(180, 70, rioMayo, comodoro);\n\t\tthis.getListaRuta().add(rutaConst1);\n\n\t\tRutaPavimentada rutaPavimentada3 = new RutaPavimentada(600, 110, rioMayo, esquel);\n\t\tthis.getListaRuta().add(rutaPavimentada3);\n\t}",
"public CrearProductos() {\n initComponents();\n }",
"private void btnAgregarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAgregarActionPerformed\n \n camino=null;\n \n int status = fileChooser.showOpenDialog (null);\n if (status == JFileChooser.APPROVE_OPTION){\n File selectedFile = fileChooser.getSelectedFile();\n camino = selectedFile.getAbsolutePath();\n }\n else{ \n if (status == JFileChooser.CANCEL_OPTION){\n System.out.println(\"CANCELAR\");\n }\n \n }\n try {\n cancion.agregarCancion(camino);\n } catch (IOException ex) {\n Logger.getLogger(biblioteca.class.getName()).log(Level.SEVERE, null, ex);\n } catch (UnsupportedTagException ex) {\n Logger.getLogger(biblioteca.class.getName()).log(Level.SEVERE, null, ex);\n } catch (InvalidDataException ex) {\n Logger.getLogger(biblioteca.class.getName()).log(Level.SEVERE, null, ex);\n }\n String[] test = cancion.mostrarCancion(i);\n lista.addElement(\" \"+test[0]);\n libCancion.setModel(lista);\n i++;\n }",
"public FrmCrearEmpleado() {\n initComponents();\n tFecha.setDate(new Date());\n }",
"private static void cadastroProduto() {\n\n\t\tString nome = Entrada(\"PRODUTO\");\n\t\tdouble PrecoComprado = Double.parseDouble(Entrada(\"VALOR COMPRA\"));\n\t\tdouble precoVenda = Double.parseDouble(Entrada(\"VALOR VENDA\"));\n String informacaoProduto = Entrada(\"INFORMAÇÃO DO PRODUTO\");\n String informacaoTecnicas = Entrada(\"INFORMAÇÕES TÉCNICAS\");\n\n\t\tProduto produto = new Produto(nome, PrecoComprado, precoVenda, informacaoProduto,informacaoTecnicas);\n\n\t\tListaDProduto.add(produto);\n\n\t}",
"void listarDadosNaTelaLivro(ArrayList<Livro> lista,DefaultTableModel model ) throws Exception {\n \n model.setNumRows(0);\n //Correr o ArrayList\n for (int pos = 0; pos < lista.size(); pos++) {\n String[] linha = new String[7];\n Livro aux = lista.get(pos);\n linha[0] = \"\"+aux.getId();\n linha[1] = \"\"+editora.recuperar(aux.getIdEditora());\n linha[2] = \"\"+autor.recuperar(aux.getIdAutor());\n linha[3] = \"\"+areaDeConhecimento.recuperar(aux.getIdAreaDeConhecimento());\n linha[4] = aux.getTituloDoLivro();\n linha[5] = \"\"+aux.getIsbn();\n model.addRow(linha);\n }\n }",
"public ListaAction() {\n initComponents();\n llenarTabla();\n }",
"public JsfVenda() {\r\n litem = new ArrayList();\r\n }",
"public jp_movimientos() {\n initComponents();\n this.jComboBox4.setVisible(false);\n this.jLabel9.setVisible(false);\n modelo = new DefaultComboBoxModel();\n modelo_libro = new ArrayList();\n this.jComboBox3.setModel(modelo);\n modelo_libro.add(new DefaultComboBoxModel<>(new String[]{\"5.1: \\tDIARIO\", \"5.3: \\tDETALLE DEL PLAN CONTABLE UTILIZADO\"}));\n modelo_libro.add(new DefaultComboBoxModel<>(new String[]{\"5.2: \\tDIARIO DE FORMATO SIMPLIFICADO\", \"5.4: \\tDETALLE DEL PLAN CONTABLE UTILIZADO\"}));\n modelo_libro.add(null);\n modelo_libro.add(new DefaultComboBoxModel<>(new String[]{\"8.1: \\tCOMPRAS\", \"8.2: \\tINFORMACION DE OPERACIONES CON SUJETOS NO DOMICILIADOS\", \"8.3: \\tCOMPRAS SIMPLIFICADO\"}));\n modelo_libro.add(new DefaultComboBoxModel<>(new String[]{\"14.1: \\tVENTAS E INGRESOS\", \"14.2: \\tVENTAS E INGRESOS SIMPLIFICADOS\"}));\n }",
"private void caricaLista() {\n /** variabili e costanti locali di lavoro */\n ArrayList unaLista = null;\n CampoDati unCampoDati = null;\n CDBLinkato unCampoDBLinkato = null;\n //@todo da cancellare\n try { // prova ad eseguire il codice\n /* recupera il campo DB specializzato */\n unCampoDBLinkato = (CDBLinkato)unCampoParente.getCampoDB();\n\n /* recupera la lista dal campo DB */\n unaLista = unCampoDBLinkato.caricaLista();\n\n /* recupera il campo dati */\n unCampoDati = unCampoParente.getCampoDati();\n\n /* registra i valori nel modello dei dati del campo */\n if (unaLista != null) {\n unCampoDati.setValoriInterni(unaLista);\n// unCampoDatiElenco.regolaElementiAggiuntivi();\n } /* fine del blocco if */\n\n } catch (Exception unErrore) { // intercetta l'errore\n /* mostra il messaggio di errore */\n Errore.crea(unErrore);\n } /* fine del blocco try-catch */\n\n }",
"public void abrirVentanaNuevaLista(ActionEvent event){\n Parent root;\n try {\n //Carga ventana\n FXMLLoader loader = new FXMLLoader(getClass().getResource(\"nuevaListaSample.fxml\"));\n root =loader.load();\n Stage stage = new Stage();\n stage.setTitle(\"Crear una nueva lista\");\n stage.setScene(new Scene(root,450,450));\n //Conexion con controller de nueva lista\n NuevaListaSample controllerNuevaLista = loader.getController();\n //Se actualiza los datos de listas\n controllerNuevaLista.definirData(this.data);\n\n stage.show();\n }catch (IOException e){\n e.printStackTrace();\n }\n }",
"@Override\n protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n if(requestCode==77){\n if(resultCode==RESULT_OK){\n if (data!=null){\n String nombre = data.getStringExtra(\"nombre\");\n String cantidad = data.getStringExtra(\"cantidad\");\n\n // int cantnum = Integer.parseInt(cantidad);\n\n Listado list = new Listado(nombre, Integer.parseInt(cantidad));\n\n listado.add(list);\n adapter.notifyItemInserted(listado.size());\n } else if (resultCode==MainActivity.RESULT_CANCELED){\n Toast.makeText(this, \"INTRODUCE DATOS\", Toast.LENGTH_SHORT).show();\n }\n }\n }\n\n }",
"protected void add(HttpServletRequest request) throws ClassNotFoundException, SQLException{\n if(!request.getParameter(\"nome\").equals(\"\")){\n //Adiciona pessoa\n PessoaDAO dao = new PessoaDAO(); \n //String acao = request.getParameter(\"add\");\n int id = 0;\n for(Pessoa t:dao.findAll()){\n id =t.getId();\n }\n id++; \n Pessoa p = new Pessoa(new Integer((String)request.getParameter(\"id\")),request.getParameter(\"nome\"),request.getParameter(\"telefone\"),request.getParameter(\"email\"));\n dao.create(p);\n }\n }",
"public VistaCrearPedidoAbonado() {\n initComponents();\n errorLabel.setVisible(false);\n controlador = new CtrlVistaCrearPedidoAbonado(this);\n }",
"private void cargaLista() {\n this.getTipoApelacionSelecionada().add(new SelectItem(\"Aclaracion\", \"Aclaracion\"));\n this.getTipoApelacionSelecionada().add(new SelectItem(\"Revision\", \"Revision\"));\n this.getTipoApelacionSelecionada().add(new SelectItem(\"Revocatoria\", \"Revocatoria\"));\n this.getTipoApelacionSelecionada().add(new SelectItem(\"Subsidiaria\", \"Subsidiaria\"));\n \n }",
"@Override\n\tpublic Boolean creaListaElettorale(String elezione, String nomeLista, String sindaco, String simbolo,\n\t\t\tArrayList<String> componenti) {\n\t\t\n\t\t//creo la lista\n\t\tLista nuovaLE = new Lista(elezione, sindaco, nomeLista, simbolo, componenti);\n\t\t\n\t\t//carico la lista delle liste elettorali\n\t\tArrayList<Lista> listaListeElettorali = listaListeElettorali();\n\n\t\t//aggiungo alla lista delle liste elettorali la nuova lista creata\n\t\tlistaListeElettorali.add(nuovaLE);\n\t\t\n\t\t//memorizzo la lista creata nel db\n\t\tmemorizzaListaElettorale(listaListeElettorali);\n\n\t\treturn true;\n\t\n\t}",
"public Funcionalidad() {\n Cajero cajero1 = new Cajero(\"Pepe\", 2);\n empleados.put(cajero1.getID(), cajero1);\n Reponedor reponedor1 = new Reponedor(\"Juan\", 3);\n empleados.put(reponedor1.getID(), reponedor1);\n Producto producto1 = new Producto(\"Platano\", 10, 8);\n productos.add(producto1);\n Perecedero perecedero1 = new Perecedero(LocalDateTime.now(), \"Yogurt\", 10, 8);\n }"
]
| [
"0.6703238",
"0.6526778",
"0.6412223",
"0.6191062",
"0.6168991",
"0.6094707",
"0.6065665",
"0.6057857",
"0.6002056",
"0.5991085",
"0.5968141",
"0.5960743",
"0.59424037",
"0.59419334",
"0.5920973",
"0.59024346",
"0.58876455",
"0.58824563",
"0.5880875",
"0.5880654",
"0.5875277",
"0.58734214",
"0.58611524",
"0.5851762",
"0.58458006",
"0.5830782",
"0.57981396",
"0.57678807",
"0.5765543",
"0.5759611",
"0.57587826",
"0.57557577",
"0.57339716",
"0.57220006",
"0.5714215",
"0.5700066",
"0.56995744",
"0.569909",
"0.5682098",
"0.5675982",
"0.56702703",
"0.566616",
"0.56527567",
"0.5645679",
"0.5639216",
"0.5636052",
"0.563424",
"0.56264925",
"0.56139576",
"0.5599674",
"0.5595876",
"0.5590192",
"0.55885154",
"0.55880284",
"0.55820894",
"0.55771506",
"0.55767876",
"0.55759823",
"0.5571443",
"0.5569303",
"0.5565287",
"0.5562097",
"0.5551619",
"0.55514073",
"0.55458397",
"0.5545577",
"0.5543865",
"0.55390817",
"0.5535889",
"0.5529118",
"0.5527516",
"0.55263007",
"0.55248576",
"0.55230117",
"0.5513896",
"0.5512451",
"0.5506645",
"0.5504386",
"0.55019623",
"0.55018115",
"0.5501734",
"0.55016387",
"0.55002517",
"0.5497711",
"0.549753",
"0.54972935",
"0.5495105",
"0.54947805",
"0.5487573",
"0.5485314",
"0.5484626",
"0.54838806",
"0.54789364",
"0.5476393",
"0.5475528",
"0.5473294",
"0.54727405",
"0.5470784",
"0.54659075",
"0.54655623"
]
| 0.58854884 | 17 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.