method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
968bb90a-40cc-4202-a267-dda0c55a5fe7 | 9 | public JSONObject toJSONObject() {
JSONObject json = new JSONObject(this);
json.put("_id", get_id());
Map<String, Method> methodMap = new HashMap<String, Method>();
for (Method method : this.getClass().getMethods()) {
methodMap.put(method.getName(), method);
}
for (Object key : json.keySet()) {
String... |
ee1e814b-1334-4558-8be1-67fe129f534a | 1 | public static void toggleEditableText(Node currentNode, JoeTree tree, OutlineLayoutManager layout) {
CompoundUndoablePropertyChange undoable = new CompoundUndoablePropertyChange(tree);
toggleEditableForSingleNode(currentNode, undoable);
if (!undoable.isEmpty()) {
undoable.setName("Toggle Editability for Node"... |
d9c21b43-a5d0-465f-8c75-e7c60f0ab5e1 | 9 | public void setFile(final File file, final JTree tree, final NBTFrame frame) {
this.file = file;
try {
final PrintWriter pw = new PrintWriter(LAST, "UTF-8");
pw.println(file);
pw.close();
} catch(final IOException e) {
e.printStackTrace();
}
NBTReader read = null;
NBTComp... |
a75cff81-5d71-4346-8cf5-f3cc41c131fc | 0 | public static void main(String[] args) throws FileNotFoundException, IOException, ParseException {
setFilePath();
SimpleDateFormat df = new SimpleDateFormat("yyyy_MM_dd");// 设置日期格式
today = "thunder_" + df.format(new Date());
read();
// write();
} |
4f21297a-e8f2-413a-b9cd-e582cbabcef1 | 2 | public static JMeterHTablePool getinstancePool(Configuration config,
int poolSize, byte[] tableName, final boolean autoFlush,
final long writeBufferSize) {
if (instancePool == null) {
synchronized (JMeterHTablePool.class) {
if(instancePool == null ){
System.out.println("Pool instance");
instance... |
e9e03965-b9fe-46a9-b4b9-f8cb5eb5d20c | 6 | public void bigify(int dc1, int dc2) {
if (moves.size()>0) {
if (((Move) moves.elementAt(0)).getNumAtomicMoves()==1) {
int big_die = 0;
for (int i=0; i<moves.size(); i++) {
AtomicMove am = ((Move) moves.elementAt(i)).getAtomicMove(0);
int this_die = Math.abs(am.source_column - am.dest_column);
... |
fba1c1db-f934-401e-8915-a6a105327209 | 5 | public void startReceiverThread()
{
new Thread()
{
public void run()
{
String tmp = null;
RadiogramConnection dgConnection = null;
Datagram dg = null;
try
{
dg... |
fa57a6a3-413e-44c3-be19-e61a938704e3 | 7 | private static ArrayList<MenuItem> create() {
ArrayList<MenuItem> items = new ArrayList<>();
items.add(new MenuItem("List All", "l", new Callable<Menu_1_2>() {
@Override
public Menu_1_2 call() throws Exception {
try {
PlaylistManager pm = new Play... |
fda15dee-06bf-45ed-81d6-af1c893f88f1 | 1 | public void close() throws BitstreamException
{
try
{
source.close();
}
catch (IOException ex)
{
throw newBitstreamException(STREAM_ERROR, ex);
}
} |
a02f656b-bf57-4100-a069-3432a6bd797e | 2 | public void union(int p, int q) {
int i = root(p);
int j = root(q);
if (i == j)
return;
if (siz[i] < siz[j]) {
id[i] = j;
siz[j] += siz[i];
} else {
id[j] = i;
siz[i] += siz[j];
}
count--;
} |
d92e1e88-47be-4b84-9e06-5c25b971b8a4 | 5 | private void checkIsPlaceFreeRet(ArrayList<String> teachersSymbols) {
this.proposalsInPlan.clear();
boolean placeFound;
for(String teacher : teachersSymbols) {// rozmieszczanie propozycji
placeFound = false;
for(MultiRoomerPlace place : proposalsInPlan) {
if(plac... |
74c80cb7-b091-4d7d-a509-9fa4bc5565d2 | 2 | private static void zmq_ctx_destroy(Ctx ctx_) {
if (ctx_ == null || !ctx_.check_tag ()) {
throw new IllegalStateException();
}
ctx_.terminate ();
} |
4794f11e-1014-4ffd-82df-3b76c06c2a03 | 6 | public void SRC(){
pcIncrease();
int number = Integer.parseInt(getCOUNT().get(), 2);
getALU().OP1.set(SelectRegister().get());
if (getI().get().equals("0")&&getT().get().equals("0")){
getALU().arithShiftRight(number);
SelectRegister().set(getALU().RES.get(... |
88fc724f-949f-45f2-90f3-e412c25eaa66 | 0 | public int getH() {
return h;
} |
09be0be8-d57b-4f7a-916c-f21f1076a868 | 4 | private void add(ActionEvent e)
{
System.out.println("Add employee button clicked.");
if (e.getSource() instanceof JButton)
{
JButton source = (JButton) e.getSource();
File f = new File("Employee.txt");
try
{
PrintWriter pw = new PrintWriter(new FileOutputStream(f, true));
user.getText()... |
ce6253bc-b152-4b31-9287-a61ffa7dffc7 | 1 | @Override
public void run() {
while(true){
//if steuerung =.... dann tue ....
}
} |
053b5185-d04e-412d-95f3-ddc377e27249 | 1 | @Override
public void execute() {
// NoteEditorFrame noteEditorFrame = NoteEditorFrame.getInstance();
File file = noteEditorFrame.showOpenFileDialog("Open file");
if (file != null){
editFile(file);
}
} |
3374a6f2-20ce-431c-88c8-b6dd5e122164 | 0 | public boolean isSink() {
return isSink;
} |
9cb2f9db-1862-43d5-ac77-4cea7f0b269b | 2 | @Override
public void update(GameContainer gc, StateBasedGame sb, float delta) {
if(this.position.y > SCREEN_HEIGHT - BOTTOM_GUI_HEIGHT - BIRD_HEIGHT || this.position.y < 0 + GUI_HEIGHT + BIRD_HEIGHT){
this.velocity.y*=-1;
}
this.updatePosition(delta);
} |
d51951c0-0053-4c8a-9b8f-8081e575f15f | 9 | public void scanToSubBlock(long subFP) {
assert !isLeafBlock;
//if (DEBUG) System.out.println(" scanToSubBlock fp=" + fp + " subFP=" + subFP + " entCount=" + entCount + " lastSubFP=" + lastSubFP);
//assert nextEnt == 0;
if (lastSubFP == subFP) {
//if (DEBUG) System.out.println(" already positi... |
4398f457-a73e-4ea2-9b04-1e9a14daa5a5 | 0 | public void initActionBox() {
actionBox = new HBox(24);
actionBox.setAlignment(Pos.CENTER);
actionBox.getStyleClass().add("popUpActionBox");
actionBox.setPadding(new Insets(5, 0, 8, 0));
Button okBtn = new Button("Submit");
okBtn.getStyleClass().add("submit-button");
okBtn.setPrefWidth(75);
okBtn.setOn... |
036f982f-c4a1-4c69-a953-5f3b834e2982 | 1 | public Transition modifyTransition(Transition transition, TableModel model)
{
String label = (String) model.getValueAt(0, 0);
MooreTransition t = (MooreTransition) transition;
try
{
return new MooreTransition(t.getFromState(), t.getToState(), label);
}
ca... |
3da53e2a-c71f-4e9f-8eec-456c86acd592 | 6 | public static void scheduleEvent( String method, Object target, long time, Object... parameters )
{
Event event = new Event();
try
{
Class< ? >[] paramClasses = new Class< ? >[ parameters.length ];
for ( int i = 0; i < paramClasses.length; i++ )
{
... |
498cdcd3-3d89-4802-b237-6984ac4679a3 | 8 | public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
if (commandLabel.equalsIgnoreCase("needcombined") || commandLabel.equalsIgnoreCase("nc")){
if (args.length == 1){
if (args[0].equalsIgnoreCase("info")){
msgHandler.info(sender);
return true;
}
if... |
41851f38-59ba-4870-842b-d03d73916bad | 0 | public String getApellidos() {
return apellidos;
} |
ad6e7b47-8e77-4394-99d7-fe433dbba014 | 3 | public void addScore(String playerName, int value) {
Score score = new Score(playerName, value);
// find the location to place the new score
int i = 0;
while (i < scores.size()) {
if (value > scores.get(i).value) {
break;
}
++i;
}
// add the new score
if (i < scores.size()) {
scores.add(... |
77f63995-a284-4305-bb9f-7018211c4b48 | 7 | private void makeSubscriptions(String argumentString) {
if (!isInVerify) {
String[] arguments = argumentString.split(" ");
ArgumentList argumentList = new ArgumentList(arguments);
String[] dataDescriptions = null;
ArrayList matchList = new ArrayList();;
ArgumentList.Argument arg;
while(argumentList.... |
80f69a9a-74c1-4dc5-a003-b5289a3cfe3f | 0 | @Override
public void startSetup(Attributes atts) {
super.startSetup(atts);
setEnabled(false);
addActionListener(this);
Outliner.documents.addDocumentRepositoryListener(this);
} |
c201f8b3-7d35-4436-8fc9-91fc920845f7 | 8 | public int getTowerInformation(TowerInformation towerInformation) {
double counter = 0;
for (GameAction currentGameAction : getGameActions()) {
if (currentGameAction.hasAnAttack()) {
switch (towerInformation) {
case DMG:
counter += ... |
085fd6b7-0265-4230-a847-984354e9dae0 | 9 | public int computeDependencies() {
// some of the dependencies in the "action" part and in the grouping and sort keys aren't relevant,
// because they don't depend on values set outside the for-each-group expression
int dependencies = 0;
dependencies |= select.getDependencies();
... |
2c254157-d289-4a1c-b033-eaac76a1e87b | 7 | private String buildIdName(String word){
try {
while(st.nextToken() == '_' || st.ttype == StreamTokenizer.TT_WORD || st.ttype == StreamTokenizer.TT_NUMBER) {
if(st.ttype == StreamTokenizer.TT_WORD)
word += st.sval;
else if(st.ttype == StreamTokenizer.TT_NUMBER)
word += String.valueOf((int)st.nval... |
24a2de14-b95c-481e-801d-ab027e267bb1 | 3 | private static void pNode(XMLNode node, int tabIndex) {
String tabs = "";
for (int i = 0; i < tabIndex; i++) {
tabs += " ";
}
String tabs2 = tabs + " ";
System.out.println(tabs + "[" + node.getName() + "] {");
for (XMLAttribute attr : node.getAttributes()) {
System.out.println(tabs2 + attr.g... |
4209f74a-8c1c-405e-a6c1-11d301a9ce57 | 2 | public static boolean isCataloguePath(String path) {
path = path.trim().toLowerCase();
return path.endsWith(DataConstants.CATALOGUE_FILE_EXTENSION)
|| path.endsWith(DataConstants.CATALOGUE_COMPRESSED_FILE_EXTENSION)
|| path.endsWith(DataConstants.CATALOGUE_COMPRESSED_FILE... |
b13e5e46-5c3b-442b-b49c-73b140b9b000 | 1 | public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
try {
Applicatie a = new Applicatie();
a.nieuwSpel();
} catch (Exception e) {
e.printStackTrace();
}
}
});
} |
d15d31b6-54bb-4c4e-95e9-97705672bc5d | 7 | public JsonElement serialize() {
JsonObject obj = new JsonObject();
if (this.timestamp != null) {
obj.addProperty("timestamp", this.timestamp);
}
if (this.actor != null) {
obj.add("actor", this.actor.serialize());
}
if (this.verb != null) {
... |
0e0d30fe-83d9-48d8-88a5-aee1a79ed3e5 | 6 | public Plateau(final int taille){
super(new GridLayout(taille, taille));
int position = 0;
for(int ligne=0; ligne<taille; ligne++){
for(int colonne=0; colonne<taille; colonne++){
if((colonne%2==0 && ligne%2==0) || (colonne%2!=0 && ligne%2!=0))
ajouterCase(Couleur.BLANC, 0);
else
ajouterCase(... |
d65bb6a4-d2bc-4ec8-8824-fdd5b54c4e09 | 8 | private void setPesoLlaveEntera(int llave, double valor){
switch (llave) {
case 0:
this.setPeso(EMBARAZOS, valor);
break;
case 1:
this.setPeso(CONCENTRACION_GLUCOSA, valor);
break;
case 2:
this.setPeso(PRESION_ARTERIAL, valor);
break;
case 3:
this.setPeso(GROSOR_TRICEPS, val... |
fad11940-2f76-4806-b381-267b23838e49 | 0 | public String getName() {
return name;
} |
03d7fab3-24d5-483d-b82b-d615c80555c1 | 7 | final void method617
(int i, int i_83_, Class348_Sub42_Sub17 class348_sub42_sub17,
int i_84_, Class348_Sub42_Sub17 class348_sub42_sub17_85_,
boolean bool, boolean bool_86_, int i_87_, int i_88_) {
try {
anInt1125++;
if (i != -1) {
method622();
if (!NA())
method621();
else {
Class4 clas... |
bf06785b-8ec8-4051-b273-c17710cf8f83 | 0 | public void add(Ball b)
{
balls.add(b);
} |
a5cc89f1-b934-4145-84d2-1d6c5a0e3c03 | 2 | public int compareTo(Coord c) {
if (c.y != y)
return (c.y - y);
if (c.x != x)
return (c.x - x);
return (0);
} |
9eb6c44d-8420-4775-8501-01e4c8c70bca | 3 | Writer createRawWriter() {
final SimpleArchive<Player> simpleArchive = new SimpleArchive<Player>();
Writer toFile = new Writer() {
public void writePlayers(String key, Iterable<? extends Player> players) throws KeyNotFoundException, KeyNotUpdatedException {
PrintStream out =... |
b07b23ea-7d1e-49d4-8744-4d5fe58fbfc3 | 5 | public void keyTyped(char c, int key) {
if (!theTextField.isMouseInside()){
return;
}
if (key == Keyboard.KEY_BACK) {
String txt = text;
if (txt.length() > 0) {
txt = txt.substring(0, txt.length() - 1);
text = txt;
}... |
6f863650-5893-4c59-aa6a-5e4709534c02 | 5 | public double getDataLevel(String name) {
try {
File f = new File(plugin.getDataFolder() + File.separator + "Players" + File.separator + name + ".data");
BufferedReader br = new BufferedReader(new FileReader(f));
StringBuilder readReason = new StringBuilder();
String line;
String[] line2;
while ((li... |
d3f55f65-a49b-40c7-853e-3e7761e5d172 | 2 | public void printTable() {
for (int i = 0; i < m; i++) {
if (table[i] == null) {
System.out.println("m = " + m + " i = [" + i + "] - null");
} else {
System.out.println("m = " + m + " i = [" + i + "] - " + table[i].getKey() + " | " + table[i].getI());
... |
c8be70fe-d17b-4549-8bd4-5fb4481a0cc4 | 1 | public void collisionCheck(ArrayList<Entity> a){
for(int i = 0; i < a.size(); i++){
Entity entity1 = a.get(i);
}//end for loop 1
}//end method |
eedfb434-18d0-47a8-97c9-9465adaa5308 | 6 | void scoreRandTest(int maxLen, int minLen, Random rand, DnaCoder dnaCoder, DnaSubsequenceComparator<DnaSequence> comparator) {
// First sequence
int len1 = rand.nextInt(maxLen) + minLen;
String seq1 = randSeq(len1, rand);
// Second sequence
int over = rand.nextInt(len1 - minLen + 1);
int start = over;
St... |
59fbdfdb-bb3a-45ba-9394-2b54ea27a608 | 4 | @SuppressWarnings("unchecked")
@Override
public int compareTo(ChannelRequest<T> o) {
if (request instanceof Comparable<?> && o.request instanceof Comparable<?>) {
return ((Comparable<T>) request).compareTo(o.request);
}
return 0;
} |
908c0380-b6c9-4009-bedb-298dfa0d0396 | 7 | @Override
public boolean invoke(MOB mob, List<String> commands, Physical givenTarget, boolean auto, int asLevel)
{
final MOB target=this.getTarget(mob,commands,givenTarget);
if(target==null)
return false;
if(!super.invoke(mob,commands,givenTarget,auto,asLevel))
return false;
final boolean success=prof... |
fc9c3049-2e2c-4215-bf7e-9843f6003b16 | 3 | public void fireActions()
{
//Execute cards
crdsToRemove = new ArrayList<card>();
for(int i = 0; i < sizeOfDeck(); i++)
{
card tmp = getCard(i);
tmp.mainAction();
//if the card has expired (been used or its mu... |
e680adbb-68e2-44d0-9ef8-122c38fbf3ce | 3 | @Override
public void configure(AbstractCommand command, String[] args) {
TimeBanUnbanCommand unbanCommand = (TimeBanUnbanCommand) command;
if (CommandLineParser.isOptionPresent(args[0], 'a')) {
unbanCommand.setUnbanAll(true);
} else if (args[0] != null && !args[0].isEmp... |
f888809f-a3cd-4459-a205-5af139f50986 | 9 | public void renderInventory(Graphics g) {
g.setColor(Color.black);
g.fillRect(inv_window_start, 0, 226, 600);
g.setColor(Color.red);
g.fillArc(inv_window_start, 0, 226, 140, 0, 360);
//create armor inventory
int next = 0;
for(int y = 0; y < arm_... |
30bf26f8-b5ac-4b2c-8fc0-7f19d05eb681 | 2 | public int Decode(SevenZip.Compression.RangeCoder.Decoder rangeDecoder, int posState) throws IOException
{
if (rangeDecoder.DecodeBit(m_Choice, 0) == 0)
return m_LowCoder[posState].Decode(rangeDecoder);
int symbol = 8;
if (rangeDecoder.DecodeBit(m_Choice, 1) == 0)
symbol += m_MidCo... |
1bd26885-4fd1-4991-afad-9bd09887f975 | 3 | private void printBoard() {
int count = 0;
System.out.println("CAMPO RESULTANTE: ");
for (int i = 0; i < board.length; i++) {
System.out.print("(");
for (int j = 0; j < board[i].length; j++) {
if (board[i][j].hasMine()) count++;
System.out.... |
168bb038-94d3-4085-9391-1b082c2c9753 | 3 | @Override
public Object getAsObject(FacesContext facesContext, UIComponent component, String value) {
if (value == null || value.length() == 0 || JsfUtil.isDummySelectItem(component, value)) {
return null;
}
return this.ejbFacade.find(getKey(value));
} |
554b0790-91db-4a6f-a72c-3507e04da34b | 2 | @Override
public void onStop() {
if (skillData != null) {
final int option = JOptionPane.showConfirmDialog(new JFrame(), "Would you like to leave feedback?", "Feedback", JOptionPane.YES_NO_OPTION);
if (option == 0)
Util.openURL("https://www.powerbot.org/community/topi... |
bbc814e4-167a-4461-931b-fa993ec5449c | 4 | private void lifeCycle() {
String s = "";
while (isInputActive) {
try {
s = readInput();
if (s.length()==0) {
break;
}
if (this.isValidInput(s)) {
this.isInputActive = false;
break;
} else {
System.out.println(MSG_WELCOME);
}
} catch (IOException e) {... |
3a19590a-44f4-4bc0-b172-e26f58e9be41 | 4 | public void basicSetParcours(Parcours myParcours) {
if (this.parcours != myParcours) {
if (myParcours != null){
if (this.parcours != myParcours) {
Parcours oldparcours = this.parcours;
this.parcours = myParcours;
if (oldparcours != null)
oldparcours.removeGPSPoint(this);
}
}
}
} |
f1883bf3-03b3-419f-ad06-4fb38f502f67 | 0 | public void setSaleId(int saleId) {
this.saleId = saleId;
} |
b21f9481-2201-4a12-a654-028e3ef15d51 | 5 | @Override
public void windowClosing(WindowEvent arg0) {
/*TODO
* Put this into a separate (static?) function to be
* called upon an exception that terminates the game
* so as to prevent database clogging up
*/
System.out.println("window closing");
//TODO find way to go around this pro... |
0eab05e5-c907-4605-8e5b-108c668d02b6 | 3 | public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String line = "";
StringBuilder out = new StringBuilder();
PriorityQueue<Register> pq = new PriorityQueue<Register>();
while ((line = in.readLine()) != null && !line.equals("#"... |
8fb709f9-b1dc-4525-8f60-44ecd1a60e31 | 5 | public boolean addAtIndex (T e, int index) {
if (index < 0 || index >= this.size) throw new IndexOutOfBoundsException();
// add at index 0
if (index == 0) return this.addFirst(e);
// add at the last index
else if (index == this.size - 1) return this.addLast(e);
// add at an index that is neither... |
28cb62e6-3981-462a-9280-b4efb9c18cbb | 0 | @Override
public Object getValue() {
return this.embeddedImageLink;
} |
4b427739-00a5-4163-b606-0b96dcff4e1b | 5 | private final void method1923(int i, int i_13_,
ByteBuffer class348_sub49) {
anInt3254++;
if (i_13_ == 4) {
if (i != 1) {
if (i != 2) {
if ((i ^ 0xffffffff) == -4)
((Class253) this).anInt3244
= class348_sub49.getShort();
else if (i == 4)
((Class253) this).anInt3251
= class... |
1c99c254-c02f-4373-80fd-6657c65bd627 | 2 | protected void handleCommand(String command) {
if (command.equalsIgnoreCase("stop") || command.equalsIgnoreCase("halt"))
this.stop();
else
LOGGER.info("Command: \"" + command + "\" does not exist!");
} |
dc1b4255-c7ae-46db-93b5-db9e1b503c0a | 3 | public void build(boolean classes, boolean jars) throws IOException {
HashSet<File> explored = new HashSet<File>();
for(File file : exploreDirs) {
HashMap<String, ClassInfo> db = new HashMap<String, ClassInfo>();
explore(file, explored, db, true, true, classes, jars);
looseDBs.add(db);
}
for(int i = 0;... |
9c567110-e157-4b5e-a958-86976154412d | 6 | public static void main(String[] args) {
// TODO Auto-generated method stub
int [] three = new int[10000];
int [] five = new int [10000];
int [] ff = new int [10000];
int sum3 = 0;
int sum5 = 0;
int sum15 = 0;
for(int i = 0 ; i <= 333 ; i++){
three[i] = 3*i;
}
for(int three1 : three){
... |
2f570239-4845-4ed4-912c-ba7f66c5eb8b | 7 | protected Size2D arrangeNN(BlockContainer container, Graphics2D g2) {
double y = 0.0;
double height = 0.0;
double maxWidth = 0.0;
List blocks = container.getBlocks();
int blockCount = blocks.size();
if (blockCount > 0) {
Size2D[] sizes = new Size2D[blocks.size... |
06547120-923b-47c9-84d7-46907244e072 | 2 | @Override
public void salvar(Cliente cliente, Funcionario funcionario, Secao secao, Evento evento) {
try{
conn = ConnectionFactory.getConnection();
String sql = "INSERT INTO compra (id, datacompra, idcliente, idfuncionario, idingresso) "
+ "VALUES ((SELECT NV... |
a9275f19-516a-423e-914d-b49fe94bb30a | 2 | public Board clone() {
Board cloned = new Board(width, height);
for(int x = 0; x < width; x++){
for(int y = 0; y < height; y++){
cloned.grid[x][y] = grid[x][y];
}
}
return cloned;
} |
5f9e6539-40cc-4bd7-aede-e131d9643466 | 8 | public final void advanceVertically() throws IOException {
do {
String line = lineSource.getNextLine();
if (line == null) {
reset(null);
eof = true;
dent = -indentationStack.size();
indentationSta... |
dd45963d-3182-45a3-b976-0682fe1d0443 | 3 | public Graph[] readGraphs(String path)
{
File f=new File(path);
File[] list=f.listFiles();
Graph[] g=new Graph[list.length];
int i=0;
for(i=0;i<list.length;i++)
{
g[i]=new Graph(list[i].getName().toUpperCase());
try
{
BufferedReader br=new BufferedReader(new FileReader(list[i]));
br.readLi... |
ffc1c937-0f9a-446d-ba0a-0ebaa62fed56 | 1 | private boolean indexOK(int index) {
return (index >= 0 && index < total);
} |
6c90bccf-483c-40b5-b990-fa954b4e2656 | 1 | @Override
public void removeItems(Collection<String> items) {
for (String item: items) {
removeItem(item);
}
} |
2285e92b-97a8-4920-859b-bddbf8436afb | 2 | public slideMediaObject(Integer branch,Integer duration,Integer startTime, Integer chapterBranch) {
super();
this.setOpaque(false);
this.setLayout(null);
this.branch = branch;
this.chapterBranch = chapterBranch;
if(duration == -1 || duration == 0)
{
this.finishTime = -1;
}
else
{
this.finishTi... |
ed43d2d2-03e4-4df7-a2b2-61f3c1534a83 | 9 | @Override
public boolean equals(Object obj)
{
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Road other = (Road) obj;
if (neighborhood1 == null) {
if (other.neighborhood1 != null)
return false;
} else if (!neighborhood1.equals(o... |
0c693085-75c9-4208-bedf-d0068a580dc9 | 8 | public void updateAchievementWindow()
{
if (this.theAchievement != null && this.achievementTime != 0L)
{
double var1 = (double)(System.currentTimeMillis() - this.achievementTime) / 3000.0D;
if (!this.haveAchiement && (var1 < 0.0D || var1 > 1.0D))
{
... |
ca3d973b-c997-4846-94f3-eea68fc09bbb | 3 | public boolean handleRightClick(Point clickPoint) {
Placeable placeable = null;
//start from the top and work our way down to "layer" the huds
try {
for (String key : placeables.keySet()) {
placeable = (Placeable) placeables.get(key);
if (placeable.ha... |
53a6afc7-9946-46e3-92f4-cf3a7408e8f0 | 7 | private void testLogout()
{
//Nodes moeten zichzelf herstellen na logout
//Beginsituatie = 3 nodes
tests++;
try
{
Node prevNode2 = null;
Node nextNode2 = null;
Node prevNode3 = null;
Node nextNode3 = null;
NodeLinkManagerInterface iFace2 = (NodeLinkManagerInterface)c2.getRMIInterface("//l... |
8a30246e-0602-4259-8d4e-d4c910d6fd0e | 4 | public void loadClip(String fileName, String name)
{
try
{
URL soundURL = Helpers.getResourceURL(this, fileName);
Clip clip = AudioSystem.getClip();
AudioInputStream inputStream = AudioSystem.getAudioInputStream(soundURL);
clip.open(inputStream);
clips.put(name, clip);
}
catch(Unsupporte... |
309e36c2-46bc-4a91-8819-cbe9cc943b46 | 3 | private boolean eiLiianLahellaLaitaa(Pelihahmo h){
double halkaisija = h.getMahdSuojakilvenHalkaisija();
boolean vx = h.getX() - halkaisija/2 >= 0;
boolean ox = h.getX() + halkaisija/2 <= kentanLeveys;
boolean yy = h.getY() - halkaisija/2 >= 0;
boolean ay = h.getY() + halkaisija/... |
8a33c6c1-1ac3-4090-a6e6-7594b723f9e9 | 9 | @Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof SessionID)) {
return false;
}
SessionID other = (SessionID) obj;
if (serverID == null) {
if (other.serverID != null) {
return false;
}
} else if (... |
776601ba-b3e1-4355-bf21-16abf0f866e8 | 6 | public int getValue() {
if (andOrTerm2.getOp().equals("and")) {
if (equalityTerm.getValue() != 0 && andOrTerm2.getValue() != 0)
return 1;
else
return 0;
}
else if (andOrTerm2.getOp().equals("or")) {
if (equalityTerm.getValue() != 0 || andOrTerm2.getValue() != 0)
ret... |
197b8014-f1ed-4a69-a170-825a00e6e862 | 9 | public int getCharIndex(char chr) {
switch((int)chr) {
case 20: // whitespace
return 1023;
}
if((int) chr >= (int)'A' && (int) chr <= (int) 'Z') {
return (sgaMode ? 96 : 0)+(int)chr-(int)'A';
}
if((int) chr >= (int)'a' && (int) chr <= (int) 'z') {
return (sgaMode ? 96 : 32)+(int)chr-(int)'a';
}
... |
3dff4342-7106-4452-a5a3-2b842bff5b59 | 4 | public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("[").append(bits()).append("]");
sb.append(" ").append(type());
if (checkHealth()) sb.append(" check health");
if (grown()) sb.append(" grown");
if (grown() && type() != FruitTreeType.FRUIT_TREE_PATCH) sb.append(" fruit: ").append(... |
84031c17-fbb5-46b4-bcfe-63540752a8c2 | 4 | public void spasiPromjene() {
Klase.Gost g = (Klase.Gost) listG.getSelectedValue();
if (validirajIzmjene() != "") {
JOptionPane.showMessageDialog(null, validirajIzmjene(), "Info",
JOptionPane.INFORMATION_MESSAGE);
return;
}
StraniGost sg = new StraniGost();
if (isStraniGost(g)) {
sg = DBManager... |
7d5cbf57-6768-4290-8cdf-2ae396215a2d | 5 | @Override
protected void paintTabBorder( Graphics g, int tabPlacement, int tabIndex, int x, int y, int w, int h, boolean isSelected){
Graphics2D g2D = (Graphics2D)g;
switch( tabPlacement ){
case LEFT:
case RIGHT:
case BOTTOM:
/* codigo pa... |
1503d69f-d5d1-43ed-92de-a5c4c9bd70e9 | 0 | @Override
public void recalculatePermissions(){ throw new UnsupportedOperationException("Not supported yet."); } |
0ce50e06-32fc-4535-b351-733fdd1c96e0 | 7 | public P_SingleMakeTab(){
this.setLayout(new BorderLayout());
topPane = new JPanel();
keyLabel = new JLabel("Key");
keyTxtFld = new JTextField(10);
keyLabel = new JLabel("Enter key and tick checkbox to print just one card");
singleCardCB = new JCheckBox();
addBt = new JButton("ADD")... |
e89c3b30-e4de-4916-86bf-7b0fb92ac4ef | 9 | public Object fromStringToOtherType(String s, String targetType) {
Object retVal = null;
ClassType type = wrapperClasses.get(targetType) ;
switch(type) {
case BYTE:
retVal = Byte.valueOf(s);
break;
case SHORT:
retVal = Short.valueOf(s);
break;
case STRING:
retVal = s;
break;
ca... |
83e5fa33-fad8-4c53-84f5-dc6f43762423 | 4 | @Override
public void deserialize(Buffer buf) {
entityId = buf.readInt();
if (entityId < 0)
throw new RuntimeException("Forbidden value on entityId = " + entityId + ", it doesn't respect the following condition : entityId < 0");
elemId = buf.readInt();
if (elemId < 0)
... |
760a0a8b-34a9-42e5-bc42-4ef2efe353bf | 6 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Proposta other = (Proposta) obj;
if (codigo == null) {
if (other.codigo != null)
return false;
} else if (!codigo.equals(other.codigo))
... |
4d188c5c-234e-4005-b2e7-43bef0900dd1 | 3 | public void addNewPastMeeting(Set<Contact> contacts, Calendar date,
String notes) throws IllegalArgumentException,
NullPointerException {
try {
if (date.getTime().after(theCalendar.getTime())) {
throw new IllegalArgumentException(
"The time entered was in the future!");
}
} catch (IllegalArgu... |
99f2eb4b-8b4b-4cdd-90b0-f535a2b41402 | 7 | private void kayitla_karsilastir(){
try {
Statement st = baglantiAc();
ResultSet res = st.executeQuery("select adi,sifre from kisi");
boolean bulundu=false;
if((jTextField1.getText())!="" && ( jPasswordField1.getText())!="")
{
while(... |
d5dfe686-a233-4b9b-b10c-8d3d2e791e32 | 7 | public static boolean LoadScen(Path p) {
try {
BufferedReader reader = Files.newBufferedReader(p, cSet);
String readL = "";
GlobalFuncs.loadMapCharacteristics(reader);
GlobalFuncs.scenMap.loadMap(reader);
GlobalFuncs.allCOAs = new Vector<COA>();
// Load units
while(readL != null) {
... |
4a2ae4ac-f5ac-44db-b672-75b66dee7931 | 8 | double getVoltage() {
double w = 2*pi*(sim.t-freqTimeZero)*frequency + phaseShift;
switch (waveform) {
case WF_DC: return maxVoltage+bias;
case WF_AC: return Math.sin(w)*maxVoltage+bias;
case WF_SQUARE:
return bias+((w % (2*pi) > (2*pi*dutyCycle)) ?
-maxVoltage : maxVoltage);
case WF_TRIANGLE:
retur... |
c439718b-17aa-489c-872a-718ee60376d7 | 5 | static public boolean isCorrectResult(Matrix coef, Matrix free,
Matrix result, double eps) {
int n = coef.getHeight();
for (int i = 0; i < n; i++) {
double res = 0.;
for (int j = 0; j < n; j++) {
res += (coef.get(i, j) * result.get(i, 0));
}
if (Double.isInfinite(res) || Double.isNaN(res)
||... |
e1a1e3a4-7036-4ce8-af2c-65c9e698dd50 | 9 | private static BatchUtils init() throws BatchException {
logger.setMethodName("init");
String os = System.getProperty("os.name").toLowerCase();
BatchUtils.logger.write("Operating System is: " + os,
ILogger.SEVERITY_INFO);
Properties prop = new Properties();
String fileName = BATCHS_PATH.concat(File.separ... |
e1160c83-d3ff-4df4-93b8-780b75ec24c6 | 7 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
FuelTank other = (FuelTank) obj;
if (fuelCapacity != other.fuelCapacity)
return false;
if (fuelLevel != other.fuelLevel)
return false;
... |
0a264840-673b-45b0-928f-9d415659e3e3 | 8 | public void actionPerformed(ActionEvent arg0)
{
String command = arg0.getActionCommand();
if (command.compareToIgnoreCase("Begin") == 0)
{
// disable the begin button and the configPanel (freeze the config)
controlPanel.begin.setEnabled(false);
configPanel.setEnabled(false);
fast = false;
// T... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.