text stringlengths 14 410k | label int32 0 9 |
|---|---|
private void setBalance(BigInteger balance) throws IllegalArgumentException {
if (! this.canHaveAsBalance(balance))
throw new IllegalArgumentException();
this.balance = balance;
} | 1 |
public void addVariableToLambdaSet(String variable, Set lambdaSet) {
if (!lambdaSet.contains(variable))
lambdaSet.add(variable);
} | 1 |
public void computePaths(Node source) {
this.source = source;
PriorityQueue<Pair> nodeQueue = new PriorityQueue<Pair>();
nodeQueue.add(new Pair(0,source));
// System.out.println(source);
for(int i = 0; i < distance.length; i++)
{
distance[i] = INFINITY;
pred[i] = -1;
}
distance[source.getId()] = 0;... | 4 |
private ByteBuffer convertImageData(BufferedImage bufferedImage, Texture tex) {
ByteBuffer imageBuffer = null;
WritableRaster raster;
BufferedImage texImage;
int texWidth = 2;
int texHeight = 2;
// find the closest power of 2 for the width and height
... | 3 |
public static void init()
{
try
{
Field[] ff = Images.class.getFields();
for(Field f : ff)
{
if(f.getType().isAssignableFrom(ImageIcon.class))
f.set(null, createIcon(f.getName() + ".png"));
}
} catch(Security... | 5 |
public void dumpExpression(TabbedPrintWriter writer)
throws java.io.IOException {
subExpressions[0].dumpExpression(writer, 201);
writer.breakOp();
writer.print(" ? ");
int subPriority = 0;
if (!subExpressions[1].getType().getHint()
.isOfType(subExpressions[2].getType())) {
writer.startOp(writer.IMPL... | 2 |
void setFTS(File f){
this.fTS = f;
} | 0 |
@Override
public void draw() {
System.out.println(" # ");
System.out.println(" ### ");
System.out.println(" ##### ");
System.out.println("#######");
} | 0 |
@Override
public void mouseClicked(MouseEvent e) {
if(e.getSource() == dataList)
{
try {
int index = dataList.locationToIndex(e.getPoint());
Dwarf dwarf = dwarfList.get(index);
showDwarfData(dwarf);
} catch (BadLocationException... | 4 |
public void setPlateWidth(double width){
if(width<=0.0D)throw new IllegalArgumentException("The plate width, " + width + ", must be greater than zero");
this.plateWidth = width;
if(this.plateSeparation!=-1.0)this.distancesSet = true;
if(this.distancesSet)this.calculateDistributedCapacita... | 3 |
public static String findUser(Map<String, Object> paramMap) throws SQLException{
String userName = paramMap.get("userName")==null ? "" : (String)paramMap.get("userName");
String password = paramMap.get("password")==null ? "" : (String)paramMap.get("password");
BEGIN();
SELECT(User.COLUMNS);
... | 6 |
@Override
public void run() {
ResultSet paperIDSet=getPaperIDSet();
String insert="insert into paperauthorList(paperid,authorlist) values(?,?);";
PreparedStatement statement=null;
int count=0;
try {
SQLconnection connection=new connection().conn();
statement=connection.conn.prepareStatement(insert);
... | 3 |
public int storeTicket(Ticket tick) {
int result = 0;
ResultSet rs = null;
PreparedStatement statement = null;
try {
statement = conn.prepareStatement("insert into Tickets (WorkerID_FK, Subject, Pending, Active, Closed) values (?,?,?,?,?)", Statement.RETURN_GENERATED_KEYS);
statement.setInt(1, tick... | 5 |
public void initializeMigration(Random random) {
Specification spec = getGame().getSpecification();
ServerPlayer player = (ServerPlayer) getOwner();
List<RandomChoice<UnitType>> recruits
= player.generateRecruitablesList();
if (spec.hasOption("model.option.immigrants")) {
... | 6 |
@Override
public String toString() {
String stracc = "Graph: \n";
// Edge: edgeId - VerticeName1(vId1) <=>//=> VerticeName2(vId2)
for (Edge e : edges.values()) {
Vertice source = vertices.get(e.getSrcVId());
Vertice target = vertices.get(e.getDestVId());
Set<String> attrs = e.getAttrE();
String acc... | 4 |
@SuppressWarnings("unchecked")
private byte[] writeEntry(QualifiedValue<?> value) {
ByteArrayOutputStream bout = new ByteArrayOutputStream();
CodedOutputStream output = CodedOutputStream.newInstance(bout);
try {
output.writeInt32(FIELD_ENTRY_ORDER, value.getOrderIndex());
... | 9 |
@Test
public void logTest(){
Logger log = Logger.getLogger(this.getClass().getName());
assertNotNull(log);
log.setLevel(Level.FINEST);
LogHandler.initLogFileHandler(log, "test");
File file = new File("logs/test+.log.0");
assertTrue(file.exists());
log.warning("test2");
log.info("Test");
log.finest("... | 1 |
public void initSerie() {
TableModel dataModel = new AbstractTableModel() {
@Override
public String getColumnName(int col) {
return titre;
}
public int getColumnCount() {
return 1;
}
public int getRowCount() {
return 8;
}
public Object getValueAt(int row, int col) {
return n... | 0 |
private static ArrayList<Integer> getIndependenetVirtualDiskKeys(VirtualMachine vm) throws Exception {
ArrayList<Integer> diskKeys = new ArrayList<Integer>();
VirtualDevice[] devices = (VirtualDevice[]) vm.getPropertyByPath("config.hardware.device");
for (int i = 0; i < devices.length; i++) {
if (devices[i] ... | 8 |
private void assignCornerElevations() {
LinkedList<Corner> queue = new LinkedList();
for (Corner c : corners) {
c.water = isWater(c.loc);
if (c.border) {
c.elevation = 0;
queue.add(c);
} else {
c.elevation = Double.MAX_V... | 7 |
private int getLargestProduct(int numOfAdjacent) {
int max = 0;
for (int i = numOfAdjacent - 1; i < GRID.length - numOfAdjacent + 1; i++) {
for (int j = numOfAdjacent - 1; j < GRID[i].length - numOfAdjacent + 1; j++) {
int productUp = 1;
int cursor = numOfAdjacent - 1;
while (cursor >= 0) {
prod... | 8 |
public void setPointDimensions(int count, int numBytes) {
if (count <= 0) {
throw new IllegalArgumentException("point dimension count must be >= 0; got " + count + " for field=\"" + name + "\"");
}
if (count > PointValues.MAX_DIMENSIONS) {
throw new IllegalArgumentException("point dimension coun... | 8 |
public IntegerResource(int value) {
this.value = value;
} | 0 |
public String getStr(char c1,char c2){
String tmp_str ="";
if(c2 == ' '){
tmp_str = "1"+c2;
}else{
if(c1==c2 && c1=='1'){
tmp_str = "21";
}else if(c1==c2 && c1=='2'){
tmp_str = "22";
}else if(c1!=c2 ){
tmp_str = "1"+c1+"1"+c2;
}
}
return tmp_str;
} | 6 |
@Override
public Ant run() {
Ant bestSoFar = null;
final int limit = maxIter / 2;
int stagnationCounter = 0;
int div = maxIter / 50;
final int stagnationLimit = div < 10 ? 10 : div;
for (int i = 0; i < maxIter; i++) {
List<Ant> ants = new ArrayList<>(l);
for (int j = 0; j < l; j++) {
Ant ant = ne... | 8 |
public static String getSignature(String secret, String... values) {
if (isBlank(secret)) {
throw new IllegalArgumentException("The value of 'secret' can't be blank.");
}
if (values == null || values.length < 1) {
throw new IllegalArgumentException("The 'values' can't be ... | 4 |
protected static String containedText(Node node) {
NodeList children = node.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
Node c = children.item(i);
if (c.getNodeType() != Node.TEXT_NODE)
continue;
return ((Text) c).getData();
}
return null;
} | 2 |
public void waitTillDone() {
while (true) {
Thread t = threadVar.get();
if (t == null) {
return;
}
try {
t.join();
} catch (InterruptedException e) {
Thread.currentThread().interrupt(); // propagate
return;
}
}
} | 3 |
void hideMe() {
for (int i=100; i>0; i--) {
label.setForeground(new Color(1, 1, 1, (float)i / 100f));
label.setBackground(new Color(0, 0, 0, (float)i / 100f));
label.setBorder(BorderFactory.createLineBorder(new Color(0, 0, 0, (float)i / 100f), 5, false));
try {
Thread.sleep(5);
} catch (Interrupted... | 2 |
@XmlElementWrapper(name = "data")
@XmlElement(name = "EmailKontakt")
public ArrayList<EmailKontakt> getContactList() {
return contactList;
} | 0 |
protected BeanAutoDetect(Class<?> clazz) throws DaoGenerateException {
this.clazz = clazz;
Map<String, PropertyDescriptor> descriptors;
try {
descriptors = IntrospectorUtils.getPropertyDescriptors(clazz);
} catch (Exception e) {
throw new DaoGenerateException("解析类[" + clazz + "]失败:", e);
}
for (Entr... | 7 |
public static String checkStatus(String dirName)
{
GetAbsolutePath pt = new GetAbsolutePath();
String absolutePath = pt.getPath();
File directory = new File(absolutePath + dirName);
File outFile = new File(absolutePath + dirName + "/outfile");
File outTree = new File... | 8 |
public void setContentType(String contentType) {
this.contentType = contentType;
} | 0 |
public Coord3d[] returnCommonCoordinates() {
Coord3d[] temp = new Coord3d[commonCoordinates.size()];
for (int i = 0; i < commonCoordinates.size(); i++) {
temp[i] = commonCoordinates.get(i);
}
return temp;
} | 1 |
public static void main(String[] args) {
List<Product> list = new ArrayList<Product>();
Product pro = null;
for(int i=0;i<2;i++){
pro = new Product();
pro.setSku("1"+i);
pro.setName("峻德"+i);
pro.setDescription("1"+i);
pro.setOnline("1"+i);
list.add(pro);
}
ComparatorProduct compare ... | 2 |
public static boolean unequipItem(Hero owner, Item item) {
if (owner != null && item != null && isItemEquipped(owner, item)) {
// item is equipped -> remove it
// set owner to null for item abilities
// so that a unit cannot use them anymore
owner.getEquipment().remove(item);
Set<Ability> abilities = i... | 7 |
static public BufferedImage[] loadImages(File f) throws IOException {
InputStream istream = new FileInputStream(f);
BufferedInputStream buffin = new BufferedInputStream(istream);
BinaryInputStream in = new BinaryInputStream(buffin);
try {
in.mark(32000);
IconDir... | 6 |
public static void main(String args[]) {
/*
* Set the Nimbus look and feel
*/
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/*
* If Nimbus (introduced in Java SE 6) is not available, stay with the
* default look and fe... | 6 |
public static int[] analyzeHistogram(ImageData imageData) {
int height = imageData.height;
int width = imageData.width;
int depth = imageData.depth;
int[] histogram = new int[256];
int c = 0;
for (int i = 0; i < height; i++) {// height
for (int j = 0; j < width; j++) {// width
// byte gray = imageDat... | 3 |
@Override
public String[] getPresentStatusLog() {
ArrayList<String> statusLog = new ArrayList<String>();
for (int i = 0; i < defaultStatusList.size(); i++) {
statusLog.add(defaultStatusList.getElementAt(i));
}
return statusLog.toArray(new String[statusLog.size()]);
} | 1 |
public void run(String[] args) throws Exception {
if (args.length == 1) {
int selectedIndex = 1;
String proto = null;
try {
PCSCManager.connect(selectedIndex, proto);
} catch (Exception e) {
selectedIndex = -1;
}
if (selectedIndex == -1 || proto == null)
Logger.log("Uso: " + getTe... | 4 |
public void setFechaRecogida(String fechaRecogida) {
this.fechaRecogida = fechaRecogida;
} | 0 |
private MidiDevice openMidiDevice( String containsString )
{
message( "Searching for MIDI device with name containing '" +
containsString + "'" );
MidiDevice device = null;
MidiDevice.Info[] midiDevices = MidiSystem.getMidiDeviceInfo();
for( int i = 0; i < midiDevice... | 7 |
public boolean mousedown(Coord c, int button) {
if(a || button != 1 || c.y < 16 || c.y > sz.y - 10)
return(false);
check(this);
return(true);
} | 4 |
public static Function getFunction(Library l, Object o) {
Dictionary d = null;
if (o instanceof Reference) {
o = l.getObject((Reference) o);
}
// create a dictionary out of the object if possible
if (o instanceof Dictionary) {
d = (Dictionary) o;
... | 8 |
private Method findFromStringMethod(Class<?> cls, String methodName) {
Method m;
try {
m = cls.getMethod(methodName, String.class);
} catch (NoSuchMethodException ex) {
try {
m = cls.getMethod(methodName, CharSequence.class);
} catch (NoSuchMet... | 4 |
private void checkAlive() {
ArrayList<ComponentEntry> removeList = new ArrayList<ComponentEntry>();
long now = System.currentTimeMillis();
for (ComponentEntry ap : this.accessPoints.values()) {
if (ap.timestamp+timeout < now) {
removeList.add(ap);
}
}
for (ComponentEntry ap : removeList) {
disass... | 6 |
public WordSearch(String filename, String name) {
this.name = name;
try {
scanner = new Scanner(new File(filename));
} catch (FileNotFoundException e) {
e.printStackTrace();
}
this.n = scanner.nextInt();
this.m = scanner.nextInt();
puzzle = new String[n];
for (int i = 0; i < n; i++) {
puzzle[i... | 5 |
public boolean getTeam()
{
return this.team;
} | 0 |
public MethodAnalyzer(ClassAnalyzer cla, MethodInfo minfo,
ImportHandler imports) {
this.classAnalyzer = cla;
this.imports = imports;
this.minfo = minfo;
this.methodName = minfo.getName();
this.methodType = Type.tMethod(minfo.getType());
this.isConstructor = methodName.equals("<init>")
|| methodName.... | 6 |
public static void injectValueInStaticField(Class<?> clazz, String fieldName, Object value)
throws JStrykerException, IllegalArgumentException {
if (clazz == null) {
throw new IllegalArgumentException("Clazz cannot be null.");
}
if (fieldName == null) {
throw new IllegalArgumentException("Field name can... | 5 |
public void showHideNavigator() {
if (!toolbar.getTreeSelected())
center.remove(navigator);
else
center.add(BorderLayout.WEST, navigator);
center.revalidate();
center.repaint();
} | 1 |
public static ArrayList<Object> getObjects(List<?> rows,
Class<?> decoratorClass) {
ArrayList<Object> resultList = new ArrayList<Object>();
Object firstRow = rows.get(0);
Class<? extends Object> rowClass = firstRow.getClass();
Integer lp = 1;
for (Object row : rows) {
try {
Constructor<?> construc... | 7 |
public boolean isBlackJack()
{
boolean hasAce = false;
boolean hasTen = false;
for ( int i = 0; i < hand.size(); i++ )
{
if ( hand.get(i).getFace() == Rank.ACE )
{
hasAce = true;
break;
}
}
for ( int i = 0; i < hand.size(); i++ )
{
if ( hand.get(i).getValues().get(0) == 10 )
... | 6 |
private final void draw0(byte[] is, int[] is_25_, int i, int i_26_,
int i_27_, int i_28_, int i_29_, int i_30_,
int i_31_, int i_32_, int i_33_, int i_34_,
aa var_aa, int i_35_, int i_36_) {
aa_Sub3 var_aa_Sub3 = (aa_Sub3) var_aa;
int[] is_37_ = ((aa_Sub3) var_aa_Sub3).anIntArray5201;
int[] is_38_ ... | 9 |
public void mousePressed(MouseEvent e)
{
// TODO Auto-generated method stub
} | 0 |
private TextAnchor textAlignPtForLabelAnchorV(RectangleAnchor anchor) {
TextAnchor result = TextAnchor.CENTER;
if (anchor.equals(RectangleAnchor.TOP_LEFT)) {
result = TextAnchor.TOP_RIGHT;
}
else if (anchor.equals(RectangleAnchor.TOP)) {
result = TextAnchor.TOP_CE... | 8 |
@Override
public void run() {
for (Player player : World.getWorld().getPlayers()) {
try {
if (player.getSession().getSocketChannel().isOpen()) {
for (Packet packet = player.getPacketQueue().poll(); packet != null; packet = player.getPacketQueue().poll()) {
PacketManager.handlePacket(player, packet)... | 4 |
@Override
public void setGUITreeComponentID(String id) {this.id = id;} | 0 |
public static void ledprocess(String filepath, String result, String sn){
String finalresult = "";
int errorcode=0;// print error code in the final output file;
int errornum = 7;
File outputfile = new File(filepath);
if ((result.equals("P"))||(result.equals("p"))||(result.equals("pass"))||(result.equals("... | 6 |
@Override
public Object getValueAt(int row, int col) {
String colName = getColumnName(col);
switch (colName) {
case "Select":
return selectList.get(row);
case "Status":
return entries.get(row).getStatus().toString()... | 9 |
public void drawObjects(BufferedImage canvas, boolean fill)
{
BufferedImage image = new BufferedImage(_width, _height, BufferedImage.TYPE_INT_RGB);
Graphics2D g = image.createGraphics();
g.drawImage(VisionUtils.convert2grey(canvas), 0, 0, null);
// draw groun... | 5 |
public void actionPerformed(ActionEvent e) {
while (true) {
String name = JOptionPane.showInputDialog("Enter name");
String number = JOptionPane.showInputDialog("Enter number");
if (name == null || number == null) {
gui.messageArea.setText("Canceled");
break;
} else if (name.equals("") || number.e... | 5 |
public static void main(String[] args) {
// TODO Auto-generated method stub
int[][] res = generateMatrix(0);
for (int i = 0; i < res.length; i++) {
for (int j = 0; j < res[i].length; j++) {
System.out.print(res[i][j] + " ");
}
System.out.println();
}
int[][] matrix = {{1},{2},{3},{4},{5},{6}};... | 3 |
public String toString(){
StringBuffer sb = new StringBuffer();
switch(type){
case TYPE_VALUE:
sb.append("VALUE(").append(value).append(")");
break;
case TYPE_LEFT_BRACE:
sb.append("LEFT BRACE({)");
break;
case TYPE_RIGHT_BRACE:
sb.append("RIGHT BRACE(})");
break;
case TYPE_LEFT_SQUARE:
... | 8 |
static void sendPBNotification(final Context context, String displayScore) {
if((flags & FLAG_NO_NOTIFICATION) > 0) return;
final String appName = Utils.getAppLabel(context);
if (appName == null) {
return;
}
if (Utils.packageIsInstalled(HEYZAP_PACKAGE, context) || !Utils.marketInstalled(context) || !Utils... | 7 |
@Override
protected void processElement(final XMLStreamReader reader, final Mop item)
throws XMLStreamException {
switch (reader.getNamespaceURI()) {
case NAMESPACE:
switch (reader.getLocalName()) {
case "Geometrie":
Utils.p... | 9 |
public void mousePressed(MouseEvent e) {
if (e.getButton() == MouseEvent.BUTTON1)
Main.isMouseLeft = true;
else if (e.getButton() == MouseEvent.BUTTON3)
Main.isMouseRight = true;
} | 2 |
@Override
public int matches( short[] sequenceA, int indexA, short[] sequenceB, int indexB, int count )
{
for (int i = 0; i < count; i++)
{
if (sequenceA[indexA + i] != sequenceB[indexB + i])
{
return i;
}
}
return count;
} | 2 |
private void dfs(Graph<?> g, Object v, boolean alt) {
this.marked.put(v, true);
//System.out.println(v);
//System.out.println(this);
for (Object temp : g.getAdjacentVertices(v)) {
if (!marked.get(temp)) {
this.color.put(temp, alt);
dfs(g, temp... | 5 |
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner in = new Scanner(System.in);
while (in.hasNextInt()) {
int a = in.nextInt();
if ( a == 0 ) break;
for ( int k = 1;;k++) {
// Try m
// Target : J(a,m,a) = 2
// Initial : J(1,m,1) = 0
int s = 0;
for ( in... | 5 |
protected void pageChange(int newPageIndex) {
switch (newPageIndex) {
case indexSRC:
if (isDirty())
updateTextEditorFromTable();
break;
case indexTBL:
if (isDirty())
updateTableFromTextEditor();
break;
}
isPageModified = false;
super.pageChange(newPageIndex);
} | 4 |
public void gaussianProbabilityPlot(){
this.lastMethod = 0;
// Check for suffient data points
this.gaussianNumberOfParameters = 2;
if(this.numberOfDataPoints<3)throw new IllegalArgumentException("There must be at least three data points - preferably considerably more");
... | 4 |
@Override
public void valueChanged(ListSelectionEvent e) {
JList lsm = (JList) e.getSource();
if (lsm == ticketList) {
int selectedIndex = lsm.getSelectedIndex();
if (selectedIndex >= 0) {
currentTicket = selectedIndex;
... | 4 |
public Topology2D(Base basis, int coarseness, Space space){
this.basis = basis;
this.coarseness = Math.abs(coarseness);
switch(space.getTau()){
case "Cylinder":
this.space = Topology2D.Cylinder.class;
break;
case "Torus":
this.space = Topology2D.Torus.class;
break;
case "Moebius":
this.... | 6 |
public void setProblemList(ProblemList problemList) {
this.problemList = problemList;
} | 0 |
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final Email other = (Email) obj;
if (!Objects.equals(this.endereco, other.endereco)) {
return false... | 3 |
public UpgradeManager() {
this.allUpgrades = new Upgrade[]{
new Upgrade(UpgradeType.Body, "Bodyup 1", null),
new Upgrade(UpgradeType.Head, "Headup 1", null),
new Upgrade(UpgradeType.Body, "Bodyup 2", null)
};
this.allHeads = new Head[]{
new Head(1, "Head 1"),
new Head(1, "Head 2")
};
this.a... | 0 |
public AST Q()
{
// Q -> R | R Q
AST r = R();
String next = toks.peek();
if(isAlphabetic(next) || "(".equals(next) || isNumber(next))
return new Product(r, Q());
else
return r; // I don't think I should *always* do this
// (e.g., if I peek and the R is fo... | 3 |
public boolean equals(Object other)
{
if(other == null || !(other instanceof Observation))
return false;
Observation o = (Observation) other;
if(this.itype != o.itype) return false;
if(this.obsID != o.obsID) return false;
if(!this.position.equals(o.position)) ret... | 6 |
public SettingsView() {
GridBagLayout gridBagLayout = new GridBagLayout();
gridBagLayout.columnWidths = new int[] { 0, 0 };
gridBagLayout.rowHeights = new int[] { 0, 235, 0, 0 };
gridBagLayout.columnWeights = new double[] { 1.0, Double.MIN_VALUE };
gridBagLayout.rowWeights = new double[] { 0.0, 1.0, 0.0,
... | 3 |
public boolean OnkoYhteys(Suunta suunta){
switch(suunta){
case Pohjoinen:
return OnkoYhteysPohjoiseen();
case Ita:
return OnkoYhteysitaan();
case Etela:
return OnkoYhteysEtelaan();
case Lansi:
return ... | 4 |
private final Node<K> buildTree(final Hashtable<K,Integer> distribution) {
final TreeSet<Node<K>> forest = new TreeSet<Node<K>>();
for (K key : distribution.keySet()) {
forest.add(new Node<K>(key,distribution.get(key)));
}
while (forest.size()>1) {
Node<K> tree0 = forest.first();
forest.remove(tree0);
... | 2 |
public static int numDistinct(String S, String T) {
int[][] f = new int[S.length() + 1][T.length() + 1];
for (int k = 0; k < S.length(); k++)
f[k][0] = 1;
for (int i = 1; i <= S.length(); i++) {
for (int j = 1; j <= T.length(); j++) {
if (S.charAt(i - 1) == T.charAt(j - 1)) {
... | 4 |
public boolean isColliding(GameObject obj){
//If the left side of this is to the left right side of obj and the right side of this is to the right of the left side of obj
if(position.getComponent(0) < obj.position.getComponent(0) + obj.width && this.position.getComponent(0) + this.width > obj.position.getComponen... | 5 |
public void dispatch() {
List<StoreLoader<?>> loaders = popLoaders();
for (StoreLoader<?> loader : loaders) {
loader.memoryDispatch(rows);
}
} | 3 |
protected void handleControlPropertyChanged(final String PROPERTY) {
if ("RESIZE".equals(PROPERTY)) {
resize();
} else if ("COLOR".equals(PROPERTY)) {
led.setStyle("-led-color: " + Util.colorToCss((Color) getSkinnable().getLedColor()) + ";");
changeStyle();
} ... | 7 |
@Override
public final void render(Graphics g)
{
if (hub.DEBUG)
{
g.setColor(Color.DARK_GRAY);
g.drawRect((int) Math.round(x), (int) Math.round(y), (int) Math.round(width), (int) Math.round(height));
}
Graphics2D g2d = (Graphics2D) image.get().getGraphics();
g2d.setComposite(Alp... | 6 |
static List<Vertex> bfs(Graph g, Vertex start) {
if (g == null) {
throw new IllegalArgumentException("Input graph must not be null.");
}
if (start == null) {
throw new IllegalArgumentException("Input vertex must not be null.");
}
final List<Vertex> retu... | 7 |
private Map<?, ?> createObjectContainer(ContainerFactory containerFactory){
if(containerFactory == null)
return new JSONObject();
Map<?, ?> m = containerFactory.createObjectContainer();
if(m == null)
return new JSONObject();
return m;
} | 6 |
public void checkGame() {
if (gameDAO == null) {
}
else if (!gameDAO.getIsRunning()) {
}
else if ((playerDAO.getAllWerewolves().size() == 0)
|| (playerDAO.getAllWerewolves().size() > playerDAO
.getAllTownspeople().size())) {
gameDAO.endGame();
List<Player> aliveList = playerDAO.getAllAlive()... | 8 |
@Override
public void componentShown(ComponentEvent e) {
if (resizeOnShow) {
e.getComponent().setSize(initialWidth, initialHeight);
}
} | 1 |
public YAML(Iterable<String> headers) {
this.headers = headers;
} | 0 |
public void startServer() throws IOException {
// Create a UUID for SPP
uuid = new UUID("1101", true);
// print uuid
logString.append("UUID : " + uuid.toString());
logString.append("\n");
// Create the service url
connectionString = "btspp://localhost:" + uuid +... | 9 |
public OutlineCommentIndicator(OutlinerCellRendererImpl renderer) {
super(renderer, GUITreeLoader.reg.getText("tooltip_toggle_comment"));
} | 0 |
public long getId() {
return Id;
} | 0 |
@Test(expected = RuntimeException.class)
public void twoInchesIsBetterEightOuncesShouldThrowException(){
ArithmeticQuantity two_in = new ArithmeticQuantity(2, Distance.INCHES);
ArithmeticQuantity eight_oz = new ArithmeticQuantity(8, Volume.OUNCE);
two_in.isBetter(eight_oz);
} | 0 |
public void visit_d2l(final Instruction inst) {
stackHeight -= 2;
if (stackHeight < minStackHeight) {
minStackHeight = stackHeight;
}
stackHeight += 2;
} | 1 |
protected void cacheReturn(String cacheKey, InterceptorChain chain, Method method, Cache cacheAn) throws Throwable {
// 获取缓存类型,根据缓存类型不同分别对缓存有不同的操作方式
CacheType cacheType = cacheAn.cacheType();
if (cacheType.equals(CacheType.String)) {
super.cacheReturn(cacheKey, chain, method, cacheAn);
} else if (cacheType.e... | 8 |
public MainFrame() throws HeadlessException {
// initializing main form
super(ZIP_ARCHIVER_V1_0);
setMinimumSize(new Dimension(WIDTH_MAIN_FRAME, HEIGHT_MAIN_FRAME));
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
setLocationRelativeTo(null);
pack();
//... | 4 |
Subsets and Splits
SQL Console for giganticode/java-cmpx-v1
The query retrieves a limited number of text entries within a specific length range, providing basic filtering but minimal analytical insight.