Questions tagged [indexed-properties]

Properties of a Java Bean that could be accessed via index.

Properties of a Java Bean that could be accesses via index. Usually such property is a collection like a List, or Map, or array. Both collections have an index/key that could be used as a property accessor.

Here's how it's used in the Java Tutorial:

Indexed Properties

An indexed property is an array instead of a single value. In this case, the bean class provides a method for getting and setting the entire array. Here is an example for an int[] property called testGrades:

public int[] getTestGrades() {
    return mTestGrades;
}

public void setTestGrades(int[] tg) {
    mTestGrades = tg;
}

For indexed properties, the bean class also provides methods for getting and setting a specific element of the array.

public int getTestGrades(int index) {
    return mTestGrades[index];
}

public void setTestGrades(int index, int grade) {
    mTestGrades[index] = grade;
}
35 questions
2
votes
1 answer

How to use PropertyUtils to get an element from a list inside a map?

I've been trying to use the indexed notation used for getProperty of PropertyUtils to retrieve an element in a list contained as a map value. Here's an example (I'm using a general syntax here): map = {"aList": ["elem1", "elem2", "elem3"]} Let say,…
Psycho Punch
  • 6,418
  • 9
  • 53
  • 86
1
vote
1 answer

Delphi open array as property index in indexed property

Is it possible to use an open array as index type for indexed properties? unit OpenArrayAsPropertyIndex; interface type TFoo = class private function getBar(Index: array of Integer): String; public // [DCC Error]: E2008 Incompatible…
malom
  • 223
  • 2
  • 11
1
vote
2 answers

Using F# Indexed Properties in a Type

I'm trying to convert the following C# into F#: public class Matrix { double[,] matrix; public int Cols { get { return this.matrix.GetUpperBound(1) + 1; } } public…
Beaker
  • 2,804
  • 5
  • 33
  • 54
1
vote
1 answer

Why is this code throwing ReferenceError #1069?

The first line of this code is throwing ReferenceError #1069. "Property focusMask not found on ObjectButtonSkin and there is no default value." The "skin" variable is of type MovieClip, and the actual object instance is of type ObjectButtonSkin…
Triynko
  • 18,766
  • 21
  • 107
  • 173
1
vote
1 answer

Deleting an item from an indexed property - JavaBeans question

I'm working with indexed properties (using struts and java/jsp). We have a dynamic table that can add/delete rows/items in the table. The adding of rows works as intended - I see the new rows in the form in the action class. The deleted rows do not…
Marcus
  • 527
  • 1
  • 6
  • 23
1
vote
1 answer

How to iterate through collection in JSP and set values in an object in an action class

I have a JSP that receives a collection list from an action class. I am iterating through that list and I wish to set the values of that list to another object inside another action class through a form request. When I use the displayMovies.jsp…
Dankwansere
  • 71
  • 1
  • 11
1
vote
1 answer

C# WPF Binding to indexed property - what am I doing wrong?

I have recently discovered indexed properties. This looks like the perfect solution to the scenario in which the data I am working with would best be expressed in a collection, yet still needs to be implemented as a property that can be used in XAML…
Arian Goodwin
  • 13
  • 1
  • 6
1
vote
1 answer

Finding the largest value of an indexed property in AppEngine

Let's say I have several entities stored in the AppEngine DataStore that all have an indexed numerical property and I need to find the largest currently existing value. I could simply do a projection query sorted on this property with descending…
Markus A.
  • 12,349
  • 8
  • 52
  • 116
1
vote
3 answers

How can I get index-parameter values from indexed properties via reflection?

System.Reflection.PropertyInfo and System.Reflection.ParameterInfo don't seem to expose any way to get the values used at runtime to access indexed property values. If correct, this means that one must know the index values (i.e. keys) in advance -…
Iucounu
  • 1,630
  • 1
  • 20
  • 31
0
votes
1 answer

adding new item in indexed property of struts

here is what i want to do: I have an actionForm with an indexed property(a list of districts), I have managed to show and bind all items to form the list districts. I want to have a jsp page that allow user to add and delete item in that list. The…
user415726
  • 159
  • 1
  • 4
  • 14
0
votes
0 answers

Fake XAML designer errors when binding to dynamic objects and indexed properties

The following two classes are given (F#) type DynamicHelper() = inherit DynamicObject() ... override this.TryGetMember(binder: GetMemberBinder, result: obj byref) = ... type IndexedHelper() = ... member this.IndexedProperty with…
Franco Tiveron
  • 2,364
  • 18
  • 34
0
votes
1 answer

How can I define a custom object (table) in in indexed database?

I want to define a custom structure in my indexed database. How can I define a document structure in an indexed database? Let’s say: I have one people class export class People { id : number name: string lists: LookUp[] …
Harshad Pansuriya
  • 20,189
  • 8
  • 67
  • 95
0
votes
2 answers

What is the meaning of this code?

Here is the code sample provided in .Net Sdk: Private Sub ReadOrderData(ByVal connectionString As String) Dim queryString As String = _ "SELECT OrderID, CustomerID FROM dbo.Orders;" Using connection As New…
user774411
  • 1,749
  • 6
  • 28
  • 47
0
votes
1 answer

How to save dynamic data into my database with same name using Struts 2

I would like to know how to save multiple data at the same time with same names into my database using Struts2 I have multiple items,quantity,amount,description,unit price...and they are inside in dynamic table..Here's my code below public String…
Pablo Job
  • 485
  • 1
  • 5
  • 8
0
votes
3 answers

How to get property of arraylist using PropertyUtils

I am using Apache's PropertUtils to get values of bean by passing string parameter. In this particular case I have List of Object and I want to read specific property of an object inside the list, same code to explain List
Pratik
  • 952
  • 2
  • 16
  • 31