![]() |
|
SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here. |
![]() |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
Question About CreateArray
Is there a way to define the number of elements in CreateArray() without having to call them out say by the size of a file collection?
In other words instead of CreateArrary(0,1,2,3,4,5) use CreateArray(num) with number being the total number of elements I want in the array Also Is there a way to search an array once made for only elements with a matching string? I found FindElement but that only searches for the first match correct? cheers |
#2
|
|||
|
|||
You can create a variable using the Java Array class. I am pretty sure I have seen examples of it in SageMC and the default STV.
I believe for the search you can use the filterbymethod, etc.. calls to search an array for a certain value.. Thanks, Jeff |
#3
|
|||
|
|||
Quote:
come again ![]() |
#4
|
||||
|
||||
SageMC uses ArrayLists quite a bit. You call the constructor once and then append items to the ArrayList as necessary, usually in a loop. In Studio the code would like something like:
Code:
MyArrayList = new_java_util_ArrayList() java_util_ArrayList_add( MyArrayList , NewItem ) Aloha, Mike
__________________
"Everything doesn't exist. I'm thirsty." ...later... "No, it's real!!! I'm full." - Nikolaus (4yrs old) Last edited by MeInMaui; 06-08-2009 at 10:57 AM. |
#5
|
|||
|
|||
#6
|
|||
|
|||
Quote:
|
#7
|
|||
|
|||
Quote:
![]()
__________________
Server 2003 r2 32bit, SageTV9 (finally!) 2x Dual HDHR (OTA), 1x HD-PVR (Comcast), 1x HDHR-3CC via SageDCT (Comcast) 2x HD300, 1x SageClient (Win10 Test/Development) Check out TVExplorer |
#8
|
||||
|
||||
FYI... But Sun has some good resources and tutorials on Java. If you are not that familiar with java, then I'd look at the "Trails Covering the Basics" section, specifically the first 4 "Trails".
One of the Trails specifically deals with "Collections" which is term to refer to Lists, Sets, Queues, and Maps. Knowing what each of those are, and why you'd use them, can help you a lot. For example, if you are dynamically building a list of items, but you don't want to have duplicates, then you may be tempted to use a List (ArrayList), but then you'd have to track duplicates before you insert them. Using a Set (HashSet) will do that for you and save you a bunch of effort. Also, understanding the Java implementations for various Collections will be a bonus. For example, using a HashMap will not retain the insertion order of the items, but if that is important, then can use a LinkedHashMap.
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#9
|
|||
|
|||
Quote:
![]()
__________________
Server 2003 r2 32bit, SageTV9 (finally!) 2x Dual HDHR (OTA), 1x HD-PVR (Comcast), 1x HDHR-3CC via SageDCT (Comcast) 2x HD300, 1x SageClient (Win10 Test/Development) Check out TVExplorer |
#10
|
|||
|
|||
Yeah me too thanks I have bought a couple of books and started reading them as well. It is just easier for me to learn by doing but I know sometimes you have to read
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Picture quality question, also question on delays | andrew1810 | SageTV Software | 5 | 03-08-2006 04:51 PM |