id stringlengths 7 14 | text stringlengths 1 106k |
|---|---|
1952675_3 | public static StandardServiceAgentClient newInstance(Settings settings)
{
UDPConnector.Factory udpFactory = Factories.newInstance(settings, UDP_CONNECTOR_FACTORY_KEY);
TCPConnector.Factory tcpFactory = Factories.newInstance(settings, TCP_CONNECTOR_FACTORY_KEY);
return new StandardServiceAgentClient(udpFacto... |
1952675_4 | public static StandardServiceAgentClient newInstance(Settings settings)
{
UDPConnector.Factory udpFactory = Factories.newInstance(settings, UDP_CONNECTOR_FACTORY_KEY);
TCPConnector.Factory tcpFactory = Factories.newInstance(settings, TCP_CONNECTOR_FACTORY_KEY);
return new StandardServiceAgentClient(udpFacto... |
1952675_5 | public static StandardServiceAgentServer newInstance(Settings settings)
{
UDPConnector udpConnector = Factories.<UDPConnector.Factory>newInstance(settings, UDP_CONNECTOR_FACTORY_KEY).newUDPConnector(settings);
TCPConnector tcpConnector = Factories.<TCPConnector.Factory>newInstance(settings, TCP_CONNECTOR_FACTOR... |
1952675_6 | public static StandardServiceAgentServer newInstance(Settings settings)
{
UDPConnector udpConnector = Factories.<UDPConnector.Factory>newInstance(settings, UDP_CONNECTOR_FACTORY_KEY).newUDPConnector(settings);
TCPConnector tcpConnector = Factories.<TCPConnector.Factory>newInstance(settings, TCP_CONNECTOR_FACTOR... |
1952675_7 | public static StandardServiceAgentServer newInstance(Settings settings)
{
UDPConnector udpConnector = Factories.<UDPConnector.Factory>newInstance(settings, UDP_CONNECTOR_FACTORY_KEY).newUDPConnector(settings);
TCPConnector tcpConnector = Factories.<TCPConnector.Factory>newInstance(settings, TCP_CONNECTOR_FACTOR... |
1952675_8 | public boolean equals(Object obj)
{
if (this == obj) return true;
if (obj == null || getClass() != obj.getClass()) return false;
final ServiceType that = (ServiceType)obj;
return type.equals(that.type);
} |
1952675_9 | public boolean matches(ServiceType serviceType)
{
if (serviceType == null) return false;
if (equals(serviceType)) return true;
if (isAbstractType())
{
if (serviceType.isAbstractType())
{
if (!getPrincipleTypeName().equals(serviceType.getPrincipleTypeName())) return false;
... |
1953808_0 | public Collection<T> getAllAt(WorldPosition position) {
Collection<T> objects = positions.get(position);
if (objects == null) {
return Collections.emptyList();
} else {
return Collections.unmodifiableCollection(objects);
}
} |
1956196_0 | public void transform(PlasticClass plasticClass, TransformationSupport support, MutableComponentModel model)
{
for(final PlasticField field : plasticClass.getFieldsWithAnnotation(InjectEntitySelectSupport.class))
{
addModelMethod(plasticClass, field);
addEncoderMethod(plasticClass, field);
}
} |
1956196_1 | String stripCriteriaIfPresent(String name)
{
if(name.endsWith("Criteria") && !name.startsWith("Criteria"))
{
name = name.replaceAll("Criteria$", "");
}
return name;
} |
1956196_2 | int getStyle(String style)
{
int formatType = -1;
if("long".equals(style))
{
formatType = DateFormat.LONG;
}
else if("medium".equals(style))
{
formatType = DateFormat.MEDIUM;
}
else if("full".equals(style))
{
formatType = DateFormat.FULL;
}
else if("short".equals(style... |
1956196_3 | DateFormat getDateFormat()
{
int style = getStyle(isSuffixPresent() ? formatWithoutSuffix() :format);
DateFormat dateFormat;
if(style < 0)
{
//Suffix has no significance
return new SimpleDateFormat(format, locale);
}
if(format.endsWith("_t"))
{
dateFormat = DateFormat.getTimeI... |
1956196_4 | DateFormat getDateFormat()
{
int style = getStyle(isSuffixPresent() ? formatWithoutSuffix() :format);
DateFormat dateFormat;
if(style < 0)
{
//Suffix has no significance
return new SimpleDateFormat(format, locale);
}
if(format.endsWith("_t"))
{
dateFormat = DateFormat.getTimeI... |
1956196_5 | DateFormat getDateFormat()
{
int style = getStyle(isSuffixPresent() ? formatWithoutSuffix() :format);
DateFormat dateFormat;
if(style < 0)
{
//Suffix has no significance
return new SimpleDateFormat(format, locale);
}
if(format.endsWith("_t"))
{
dateFormat = DateFormat.getTimeI... |
1956196_6 | DateFormat getDateFormat()
{
int style = getStyle(isSuffixPresent() ? formatWithoutSuffix() :format);
DateFormat dateFormat;
if(style < 0)
{
//Suffix has no significance
return new SimpleDateFormat(format, locale);
}
if(format.endsWith("_t"))
{
dateFormat = DateFormat.getTimeI... |
1956196_7 | DateFormat getDateFormat()
{
int style = getStyle(isSuffixPresent() ? formatWithoutSuffix() :format);
DateFormat dateFormat;
if(style < 0)
{
//Suffix has no significance
return new SimpleDateFormat(format, locale);
}
if(format.endsWith("_t"))
{
dateFormat = DateFormat.getTimeI... |
1956196_8 | void beginRender(MarkupWriter writer)
{
writer.element("a", "href", "#", "id", getClientId());
} |
1956196_9 | void afterRender(MarkupWriter writer)
{
writer.end();
} |
1961837_0 | public void initAndRunWorker(ServerChannelRegister serverChannelRegister) throws IOException {
boolean wasInit = alreadyInit.getAndSet(true);
if (wasInit) {
throw new IllegalStateException("connection manager was already initialized");
}
myServerSocketChannel = serverChannelRegister.channelFor(selector);
... |
1961837_1 | public static UDPAnnounceResponseMessage parse(ByteBuffer data)
throws MessageValidationException {
if (data.remaining() < UDP_ANNOUNCE_RESPONSE_MIN_MESSAGE_SIZE ||
(data.remaining() - UDP_ANNOUNCE_RESPONSE_MIN_MESSAGE_SIZE) % 6 != 0) {
throw new MessageValidationException(
"Invalid ... |
1961837_2 | public static HTTPAnnounceResponseMessage parse(BEValue decoded)
throws IOException, MessageValidationException {
if (decoded == null) {
throw new MessageValidationException(
"Could not decode tracker message (not B-encoded?)!");
}
Map<String, BEValue> params = decoded.getMap();
if (para... |
1961837_3 | public static String byteArrayToHexString(byte[] bytes) {
char[] hexChars = new char[bytes.length * 2];
for (int j = 0; j < bytes.length; j++) {
int v = bytes[j] & 0xFF;
hexChars[j * 2] = HEX_SYMBOLS[v >>> 4];
hexChars[j * 2 + 1] = HEX_SYMBOLS[v & 0x0F];
}
return new String(hexChars);
} |
1961837_4 | public static String byteArrayToHexString(byte[] bytes) {
char[] hexChars = new char[bytes.length * 2];
for (int j = 0; j < bytes.length; j++) {
int v = bytes[j] & 0xFF;
hexChars[j * 2] = HEX_SYMBOLS[v >>> 4];
hexChars[j * 2 + 1] = HEX_SYMBOLS[v & 0x0F];
}
return new String(hexChars);
} |
1961837_5 | public static String byteArrayToHexString(byte[] bytes) {
char[] hexChars = new char[bytes.length * 2];
for (int j = 0; j < bytes.length; j++) {
int v = bytes[j] & 0xFF;
hexChars[j * 2] = HEX_SYMBOLS[v >>> 4];
hexChars[j * 2 + 1] = HEX_SYMBOLS[v & 0x0F];
}
return new String(hexChars);
} |
1961837_6 | public static String byteArrayToHexString(byte[] bytes) {
char[] hexChars = new char[bytes.length * 2];
for (int j = 0; j < bytes.length; j++) {
int v = bytes[j] & 0xFF;
hexChars[j * 2] = HEX_SYMBOLS[v >>> 4];
hexChars[j * 2 + 1] = HEX_SYMBOLS[v & 0x0F];
}
return new String(hexChars);
} |
1961837_7 | public static String byteArrayToHexString(byte[] bytes) {
char[] hexChars = new char[bytes.length * 2];
for (int j = 0; j < bytes.length; j++) {
int v = bytes[j] & 0xFF;
hexChars[j * 2] = HEX_SYMBOLS[v >>> 4];
hexChars[j * 2 + 1] = HEX_SYMBOLS[v & 0x0F];
}
return new String(hexChars);
} |
1961837_8 | public static String byteArrayToHexString(byte[] bytes) {
char[] hexChars = new char[bytes.length * 2];
for (int j = 0; j < bytes.length; j++) {
int v = bytes[j] & 0xFF;
hexChars[j * 2] = HEX_SYMBOLS[v >>> 4];
hexChars[j * 2 + 1] = HEX_SYMBOLS[v & 0x0F];
}
return new String(hexChars);
} |
1961837_9 | public static String byteArrayToHexString(byte[] bytes) {
char[] hexChars = new char[bytes.length * 2];
for (int j = 0; j < bytes.length; j++) {
int v = bytes[j] & 0xFF;
hexChars[j * 2] = HEX_SYMBOLS[v >>> 4];
hexChars[j * 2 + 1] = HEX_SYMBOLS[v & 0x0F];
}
return new String(hexChars);
} |
1970932_3 | public void autoConfig() throws JoranException {
StatusListenerConfigHelper.installIfAsked(loggerContext);
new AndroidContextUtil().setupProperties(loggerContext);
boolean verbose = true;
boolean configured = false;
JoranConfigurator configurator = new JoranConfigurator();
configurator.setContext(loggerCont... |
1970932_4 | static public int convert(ILoggingEvent event) {
Level level = event.getLevel();
switch (level.levelInt) {
case Level.ERROR_INT:
return SyslogConstants.ERROR_SEVERITY;
case Level.WARN_INT:
return SyslogConstants.WARNING_SEVERITY;
case Level.INFO_INT:
return SyslogConstants.INFO_SEVERITY;
case Le... |
1970932_5 | int getMessageCountAndThenIncrement(String msg) {
// don't insert null elements
if (msg == null) {
return 0;
}
Integer i;
// LinkedHashMap is not LinkedHashMap. See also LBCLASSIC-255
synchronized (this) {
i = super.get(msg);
if (i == null) {
i = 0;
} else {
i = i + 1;
}
... |
1970932_6 | public String convert(ILoggingEvent le) {
long timestamp = le.getTimeStamp();
return cachingDateFormatter.format(timestamp);
} |
1970932_7 | public String convert(ILoggingEvent le) {
long timestamp = le.getTimeStamp();
return cachingDateFormatter.format(timestamp);
} |
1970932_8 | public String convert(ILoggingEvent le) {
long timestamp = le.getTimeStamp();
return cachingDateFormatter.format(timestamp);
} |
1970932_9 | public String convert(ILoggingEvent le) {
long timestamp = le.getTimeStamp();
return cachingDateFormatter.format(timestamp);
} |
1971346_0 | @Override
public JsonGenerator createGenerator(OutputStream out, JsonEncoding enc)
throws IOException
{
return new MessagePackGenerator(_generatorFeatures, _objectCodec, out, packerConfig, reuseResourceInGenerator);
} |
1971346_1 | @Override
public JsonParser createParser(byte[] data)
throws IOException, JsonParseException
{
IOContext ioContext = _createContext(data, false);
return _createParser(data, 0, data.length, ioContext);
} |
1971346_2 | @Override
public void close()
throws IOException
{
try {
flush();
}
finally {
if (isEnabled(Feature.AUTO_CLOSE_TARGET)) {
MessagePacker messagePacker = getMessagePacker();
messagePacker.close();
}
}
} |
1971346_3 | @Override
public void close()
throws IOException
{
try {
if (isEnabled(JsonParser.Feature.AUTO_CLOSE_SOURCE)) {
MessageUnpacker messageUnpacker = getMessageUnpacker();
messageUnpacker.close();
}
}
finally {
isClosed = true;
}
} |
1971346_4 | @Override
public void close()
throws IOException
{
try {
if (isEnabled(JsonParser.Feature.AUTO_CLOSE_SOURCE)) {
MessageUnpacker messageUnpacker = getMessageUnpacker();
messageUnpacker.close();
}
}
finally {
isClosed = true;
}
} |
1971346_5 | @Override
public void close()
throws IOException
{
try {
if (isEnabled(JsonParser.Feature.AUTO_CLOSE_SOURCE)) {
MessageUnpacker messageUnpacker = getMessageUnpacker();
messageUnpacker.close();
}
}
finally {
isClosed = true;
}
} |
1971346_6 | @Override
public void close()
throws IOException
{
try {
if (isEnabled(JsonParser.Feature.AUTO_CLOSE_SOURCE)) {
MessageUnpacker messageUnpacker = getMessageUnpacker();
messageUnpacker.close();
}
}
finally {
isClosed = true;
}
} |
1971346_7 | @Override
public void close()
throws IOException
{
try {
if (isEnabled(JsonParser.Feature.AUTO_CLOSE_SOURCE)) {
MessageUnpacker messageUnpacker = getMessageUnpacker();
messageUnpacker.close();
}
}
finally {
isClosed = true;
}
} |
1971346_8 | @Override
public void close()
throws IOException
{
try {
if (isEnabled(JsonParser.Feature.AUTO_CLOSE_SOURCE)) {
MessageUnpacker messageUnpacker = getMessageUnpacker();
messageUnpacker.close();
}
}
finally {
isClosed = true;
}
} |
1971346_9 | @Override
public void close()
throws IOException
{
try {
if (isEnabled(JsonParser.Feature.AUTO_CLOSE_SOURCE)) {
MessageUnpacker messageUnpacker = getMessageUnpacker();
messageUnpacker.close();
}
}
finally {
isClosed = true;
}
} |
1971919_1 | @GET
@Produces({MIMETYPE_TEXT, MIMETYPE_XML, MIMETYPE_JSON, MIMETYPE_PROTOBUF})
public Response get(final @Context ServletContext context,
final @Context UriInfo uriInfo) {
if (LOG.isDebugEnabled()) {
LOG.debug("GET " + uriInfo.getAbsolutePath());
}
servlet.getMetrics().incrementRequests(1);
ResponseBu... |
1971919_2 | @GET
@Produces({MIMETYPE_TEXT, MIMETYPE_XML, MIMETYPE_JSON, MIMETYPE_PROTOBUF})
public Response get(final @Context ServletContext context,
final @Context UriInfo uriInfo) {
if (LOG.isDebugEnabled()) {
LOG.debug("GET " + uriInfo.getAbsolutePath());
}
servlet.getMetrics().incrementRequests(1);
ResponseBu... |
1971919_3 | @GET
@Produces({MIMETYPE_TEXT, MIMETYPE_XML, MIMETYPE_JSON, MIMETYPE_PROTOBUF})
public Response get(final @Context ServletContext context,
final @Context UriInfo uriInfo) {
if (LOG.isDebugEnabled()) {
LOG.debug("GET " + uriInfo.getAbsolutePath());
}
servlet.getMetrics().incrementRequests(1);
ResponseBu... |
1971919_4 | @GET
@Produces({MIMETYPE_TEXT, MIMETYPE_XML, MIMETYPE_JSON, MIMETYPE_PROTOBUF})
public Response get(final @Context ServletContext context,
final @Context UriInfo uriInfo) {
if (LOG.isDebugEnabled()) {
LOG.debug("GET " + uriInfo.getAbsolutePath());
}
servlet.getMetrics().incrementRequests(1);
ResponseBu... |
1971919_5 | @GET
@Produces({MIMETYPE_TEXT, MIMETYPE_XML, MIMETYPE_JSON, MIMETYPE_PROTOBUF})
public Response get(final @Context ServletContext context,
final @Context UriInfo uriInfo) {
if (LOG.isDebugEnabled()) {
LOG.debug("GET " + uriInfo.getAbsolutePath());
}
servlet.getMetrics().incrementRequests(1);
ResponseBu... |
1971919_6 | @GET
@Produces({MIMETYPE_TEXT, MIMETYPE_XML, MIMETYPE_JSON, MIMETYPE_PROTOBUF})
public Response get(final @Context ServletContext context,
final @Context UriInfo uriInfo) {
if (LOG.isDebugEnabled()) {
LOG.debug("GET " + uriInfo.getAbsolutePath());
}
servlet.getMetrics().incrementRequests(1);
ResponseBu... |
1971919_7 | public void createTable(HTableDescriptor desc)
throws IOException {
TableSchemaModel model = new TableSchemaModel(desc);
StringBuilder sb = new StringBuilder();
sb.append('/');
if (accessToken != null) {
sb.append(accessToken);
sb.append('/');
}
sb.append(Bytes.toStringBinary(desc.getName()));
... |
1971919_8 | public void deleteTable(final String tableName) throws IOException {
deleteTable(Bytes.toBytes(tableName));
} |
1971919_9 | @PUT
@Consumes({MIMETYPE_XML, MIMETYPE_JSON, MIMETYPE_PROTOBUF})
public Response put(final ScannerModel model,
final @Context UriInfo uriInfo) {
if (LOG.isDebugEnabled()) {
LOG.debug("PUT " + uriInfo.getAbsolutePath());
}
return update(model, true, uriInfo);
} |
1980382_0 | public static int copy(InputStream in, OutputStream out, byte[] buffer)
throws IOException {
final long count = copyLarge(in, out, buffer);
return count > Integer.MAX_VALUE ? -1 : (int) count;
} |
1980382_1 | public static long copyLarge(InputStream in, OutputStream out, byte[] buffer)
throws IOException {
long count = 0;
int n = 0;
while ((n = in.read(buffer)) != -1) {
out.write(buffer, 0, n);
count += n;
}
return count;
} |
1980382_2 | public static int copy(InputStream in, OutputStream out, byte[] buffer)
throws IOException {
final long count = copyLarge(in, out, buffer);
return count > Integer.MAX_VALUE ? -1 : (int) count;
} |
1980382_3 | public static int copy(InputStream in, OutputStream out, byte[] buffer)
throws IOException {
final long count = copyLarge(in, out, buffer);
return count > Integer.MAX_VALUE ? -1 : (int) count;
} |
1980382_4 | public static int copy(InputStream in, OutputStream out, byte[] buffer)
throws IOException {
final long count = copyLarge(in, out, buffer);
return count > Integer.MAX_VALUE ? -1 : (int) count;
} |
1980382_5 | public static void closeQuietly(Closeable c) {
if (c == null) return;
try {
c.close();
}
catch (IOException e) {
// ignore
}
} |
1980382_6 | public static void closeQuietly(Closeable c) {
if (c == null) return;
try {
c.close();
}
catch (IOException e) {
// ignore
}
} |
1980382_7 | public static void closeQuietly(Closeable c) {
if (c == null) return;
try {
c.close();
}
catch (IOException e) {
// ignore
}
} |
1980382_8 | public static int read(InputStream in, byte[] buf) throws IOException {
int num;
int off = 0;
while (off < buf.length &&
(num = in.read(buf, off, buf.length-off)) != -1) {
off += num;
}
// This will read at least one byte if there are any to be read,
// so bytes read cannot be zero.
return o... |
1980382_9 | public static int read(InputStream in, byte[] buf) throws IOException {
int num;
int off = 0;
while (off < buf.length &&
(num = in.read(buf, off, buf.length-off)) != -1) {
off += num;
}
// This will read at least one byte if there are any to be read,
// so bytes read cannot be zero.
return o... |
1981819_0 | public static String getPostgresCategoryString(String searchString) {
if (searchString == null || !(searchString.trim().length() > 0)) {
return "{}";
}
List<String> categories = parse(searchString.trim().toLowerCase());
return PostgreSQLTextArray.stringArrayToPostgreSQLTextArray(categories.toArr... |
1981819_1 | public static String getPostgresCategoryString(String searchString) {
if (searchString == null || !(searchString.trim().length() > 0)) {
return "{}";
}
List<String> categories = parse(searchString.trim().toLowerCase());
return PostgreSQLTextArray.stringArrayToPostgreSQLTextArray(categories.toArr... |
1981819_2 | public static List<String> getPostgresCategoryString(String searchString, Map<String, String> mapPrefix, String prefixSplit ) {
List<String> finalList = new ArrayList<String>();
if (searchString == null || !(searchString.trim().length() > 0)) {
finalList.add( "{}" );
return finalList;
}
... |
1981819_3 | public static List<String> getPostgresCategoryString(String searchString, Map<String, String> mapPrefix, String prefixSplit ) {
List<String> finalList = new ArrayList<String>();
if (searchString == null || !(searchString.trim().length() > 0)) {
finalList.add( "{}" );
return finalList;
}
... |
1981819_4 | public static List<String> getPostgresCategoryString(String searchString, Map<String, String> mapPrefix, String prefixSplit ) {
List<String> finalList = new ArrayList<String>();
if (searchString == null || !(searchString.trim().length() > 0)) {
finalList.add( "{}" );
return finalList;
}
... |
1981819_5 | public static List<String> getPostgresCategoryString(String searchString, Map<String, String> mapPrefix, String prefixSplit ) {
List<String> finalList = new ArrayList<String>();
if (searchString == null || !(searchString.trim().length() > 0)) {
finalList.add( "{}" );
return finalList;
}
... |
1981819_6 | public static List<String> getPostgresCategoryString(String searchString, Map<String, String> mapPrefix, String prefixSplit ) {
List<String> finalList = new ArrayList<String>();
if (searchString == null || !(searchString.trim().length() > 0)) {
finalList.add( "{}" );
return finalList;
}
... |
1981819_7 | public static List<String> getPostgresCategoryString(String searchString, Map<String, String> mapPrefix, String prefixSplit ) {
List<String> finalList = new ArrayList<String>();
if (searchString == null || !(searchString.trim().length() > 0)) {
finalList.add( "{}" );
return finalList;
}
... |
1981819_8 | public static List<String> getPostgresCategoryString(String searchString, Map<String, String> mapPrefix, String prefixSplit ) {
List<String> finalList = new ArrayList<String>();
if (searchString == null || !(searchString.trim().length() > 0)) {
finalList.add( "{}" );
return finalList;
}
... |
1982584_0 | public static Game toGame(final BufferedReader pFlux) throws PGNException
{
assert pFlux != null;
final Game res = new Game();
try
{
String ligneLue = pFlux.readLine();
while (ligneLue != null)
{
String ligne = ligneLue.trim();
if (ligne.startsWith("["))
{
// Interprétation... |
1982584_1 | public static String toNormalizedSAN(final String pChaine)
{
assert pChaine != null;
final StringBuilder res = new StringBuilder(pChaine);
// Le marqueur 'P' pour les pions est possible avec PGN, pas avec SAN...
if (res.charAt(0) == 'P')
{
res.deleteCharAt(0);
}
// Les promotions sont indiquées avec u... |
1982584_2 | public static String toPGN(final Game pPartie)
{
if (pPartie == null)
{
throw new NullPointerException("Missing game description");
}
final StringBuilder sb = new StringBuilder();
sb.append("[Event \"" + APPLICATION_NAME + " v" + APPLICATION_VERSION + " chess game\"]\n");
String site = "?";
try
{
... |
1982584_3 | public static String toPGN(final Game pPartie)
{
if (pPartie == null)
{
throw new NullPointerException("Missing game description");
}
final StringBuilder sb = new StringBuilder();
sb.append("[Event \"" + APPLICATION_NAME + " v" + APPLICATION_VERSION + " chess game\"]\n");
String site = "?";
try
{
... |
1982584_4 | public static Move toMove(final MoveGenerator pEtat, final String pSAN) throws SANException
{
if (pEtat == null)
{
throw new NullPointerException("Missing game state");
}
if (pSAN == null)
{
throw new NullPointerException("Missing SAN string");
}
if (!SAN_VALIDATOR.matcher(pSAN).matches())
{
... |
1982584_5 | public static String toSAN(final MoveGenerator pEtat, final Move pMouvement)
{
if (pEtat == null)
{
throw new NullPointerException("Missing game state");
}
if (pMouvement == null)
{
throw new NullPointerException("Missing move");
}
final boolean trait = pEtat.isWhiteActive();
final Piece piece =... |
1982584_6 | public static Board toBoard(final String pFEN) throws FENException
{
if (pFEN == null)
{
throw new NullPointerException("Missing FEN string");
}
final String [] fields = pFEN.split(" ");
if (fields.length != 6)
{
throw new FENException("Invalid FEN string [" + pFEN + ']', null);
}
final MutableB... |
1982584_7 | public static String toFEN(final Board pEtat)
{
if (pEtat == null)
{
throw new NullPointerException("Missing game state");
}
final StringBuilder res = new StringBuilder(toFENKey(pEtat));
res.append(' ');
// Champ du compteur de demi-coups...
res.append(Integer.toString(pEtat.getHalfmoveCount()));
re... |
1982584_8 | public static String toFENKey(final Board pEtat)
{
if (pEtat == null)
{
throw new NullPointerException("Missing game state");
}
final StringBuilder res = new StringBuilder();
// Champ des positions...
for (int y = RANK_COUNT - 1; y >= 0; y--)
{
int vide = 0;
for (int x = 0; x < FILE_COUNT; x++... |
1982584_9 | public static String toFEN(final Board pEtat)
{
if (pEtat == null)
{
throw new NullPointerException("Missing game state");
}
final StringBuilder res = new StringBuilder(toFENKey(pEtat));
res.append(' ');
// Champ du compteur de demi-coups...
res.append(Integer.toString(pEtat.getHalfmoveCount()));
re... |
1984080_0 | public static double convertToSeconds(String time, String timeFormat) {
return convertToSeconds(time, timeFormat, 0L);
} |
1984080_1 | public static double convertToSeconds(String time, String timeFormat) {
return convertToSeconds(time, timeFormat, 0L);
} |
1984080_2 | public double value(double x0) {
if (splineFunction != null && splineFunction.isValidPoint(x0)) {
return splineFunction.value(x0);
}
if (x0 <= start.getX()) {
return start.getY();
}
if (x0 >= end.getX()) {
return end.getY();
}
throw new IllegalStateException("should n... |
1984080_3 | public double value(double x0) {
if (splineFunction != null && splineFunction.isValidPoint(x0)) {
return splineFunction.value(x0);
}
if (x0 <= start.getX()) {
return start.getY();
}
if (x0 >= end.getX()) {
return end.getY();
}
throw new IllegalStateException("should n... |
1984080_4 | public static void addLanePair(int fromLane, RoadSegment fromRoadsegment, int toLane, RoadSegment toRoadSegment) {
// check if lanes are already connected: ambiguous xodr!
if (toRoadSegment.sourceLaneSegment(toLane) != null
&& toRoadSegment.sourceLaneSegment(toLane).roadSegment() != fromRoadsegment)... |
1984080_5 | public static RoadSegment addJoin(RoadSegment sourceRoad, RoadSegment sinkRoad) {
final int limit = Math.min(sourceRoad.trafficLaneMax(), sinkRoad.trafficLaneMax());
for (int lane = 1; lane <= limit; ++lane) {
addLanePair(lane, sourceRoad, lane, sinkRoad);
}
// final int offset = sinkRoad.traffi... |
1984080_6 | public static RoadSegment addJoin(RoadSegment sourceRoad, RoadSegment sinkRoad) {
final int limit = Math.min(sourceRoad.trafficLaneMax(), sinkRoad.trafficLaneMax());
for (int lane = 1; lane <= limit; ++lane) {
addLanePair(lane, sourceRoad, lane, sinkRoad);
}
// final int offset = sinkRoad.traffi... |
1984080_7 | public static void addMerge(RoadSegment fromRoad1, RoadSegment fromRoad2, RoadSegment toRoad) {
assert fromRoad1.laneCount() + fromRoad2.laneCount() == toRoad.laneCount();
final int laneCount1 = fromRoad1.laneCount();
for (int i = 0; i < laneCount1; ++i) {
addLanePair(i, fromRoad1, i, toRoad);
}... |
1984080_8 | public static void addFork(RoadSegment fromRoad, RoadSegment toRoad1, RoadSegment toRoad2) {
assert fromRoad.laneCount() == toRoad1.laneCount() + toRoad2.laneCount();
final int laneCount1 = toRoad1.laneCount();
for (int i = 0; i < laneCount1; ++i) {
addLanePair(i, fromRoad, i, toRoad1);
}
fi... |
1984080_9 | public static void resetNextId() {
nextId = INITIAL_ID;
} |
200121_10 | public static PredefinedConfigurationContextResolver empty() {
return new PredefinedConfigurationContextResolver(Collections.<String>emptyList());
} |
200121_11 | public static PredefinedConfigurationContextResolver usingTags(final String... tags) {
if (tags == null) {
return empty();
} else {
return usingTagsList(Arrays.asList(tags));
}
} |
200121_12 | public static PredefinedConfigurationContextResolver usingTagsList(final List<String> tags) {
return new PredefinedConfigurationContextResolver(tags);
} |
200121_13 | public static String asCsv(String[] arr) {
StringBuffer tagcsv = new StringBuffer();
for (String tag : arr) {
if (tagcsv.length() > 0) {
tagcsv.append(",");
}
tagcsv.append(tag);
}
return tagcsv.toString();
} |
200121_14 | public static List<String> fromCSV(String csv) {
List<String> elements = new ArrayList<String>();
for (String element : csv.split(","))
elements.add(element);
return elements;
} |
200121_15 | public List<TaggedPropertySet> parseConfiguration() {
final Map<String, String> properties = new HashMap<String, String>();
Properties systemProperties = getProperties();
Set<Map.Entry<String, String>> systemEnv = System.getenv().entrySet();
for (Map.Entry<String, String> envEntry : systemEnv) {
... |
200121_16 | public YamlStore addResource(Resource resource, String key, String... tags) {
List<String> tagList = new ArrayList<String>();
addAll(tagList, tags);
return new YamlStore(this, key, new TaggedResource(resource, tagList));
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.